1

I have a fusion table populated with addresses, not lat/lng coordinates. Google has done the geocoding for me so I don't have access to the geocoded data. This fusion table is one layer on my map, and it shows markers for each address.

I'm using the DrawingManager to allow the user to draw a polygon. Once the polygon is completed (i.e. in the polygoncomplete callback) I would like to be able to determine which of the markers from the fusion table are located within the polygon.

If I had access to the coordinates then I could do this with ST_INTERSECTS, but I don't have access to it. And since it is already geocoded by Google I don't see a reason to make additional queries using the geocoding API to get the coordinates.

So is there a way to determine which markers from the fusion table are within a polygon?

John Sampson
  • 544
  • 4
  • 11

1 Answers1

1

When you mean with ST_INTERSECTS the function of the FusionTablesAPI:

you don't need the coordinates, when the specific column is marked as location-column and has already been geocoded you may use this column in your query(even when you had the coordinates they wouldn't help you more when you use the API, because ST_INTERSECTS expects the column-name, not the geometry).

The problem is another: the FusionTablesAPI supports as geometry for ST_INTERSECTS only CIRCLE and RECTANGLE

So the answer is: No

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
  • Thanks for the clarification on `ST_INTERSECTS`. According to [this answer](http://stackoverflow.com/questions/6522484/google-maps-v3-check-if-point-exists-in-polygon) there is a way to find a point within a polygon using ray casting. So I guess there's no way short of using the geocoding API directly for me to do what I want, correct? – John Sampson Feb 09 '14 at 19:42
  • 1
    The geocoding API only geocodes adresses, nothing more. When you want to achieve it by using the Javascript-API use [google.maps.geometry.poly.containsLocation()](https://developers.google.com/maps/documentation/javascript/reference?hl=en&csw=1#poly) – Dr.Molle Feb 09 '14 at 21:01
  • 1
    If you don't expect a lot of point results, you could create a rectangle that encompasses the bounding box of the polygon, use that with st_intersects, and then filter out false positives using a point in polygon test on the client (like the one noted in the comment above) – jlivni Feb 13 '14 at 00:29