Reputation: 2773
It is possible to search for location with in a bounding box in fusion table as:
SELECT * FROM <tableid> WHERE ST_INTERSECTS(<location_column>, RECTANGLE(LATLNG(B, Y), LATLNG(A, X))
Now my question is, is it possible to search the location within a polygon of irregular shape (other than rectangle or circle) and display it on the map?
More precisely, I have fusion table with few polygons of irregular shape (using kml) in it. Another fusion table with points data in it which are lying inside the polygons of first table. Now I want to filter a polygon in first table using fusion table api so that I can only view the points inside that polygon using intersection logic.
Upvotes: 4
Views: 1753
Reputation: 161334
Use a small CIRCLE around the point. If your <location_column>
contains Polygons, <latitude>
/<longitude>
are the coordinates of the point you are looking for:
SELECT * FROM <tableid> WHERE ST_INTERSECTS(`<location_column>`,
CIRCLE(LATLNG(`<latitude>`, `<longitude>`), 0.5))
Upvotes: 2