Test spatial query