Add support for spatial view queries.

Change-Id: I05f2ad7ae14219a9491ee0ca434e14f38715f013
Added additional bad input error handling.

Change-Id: I1959bbdd7735efbc7110cd6ef22e29deadd4ea41