added query by spatial and type