I need to execute a BigQuery database query whereby I'm trying to ascertain if a given lat, lon coordinate is within one of a few US counties.
One of those counties is Collin County in Texas, shown here in Google Maps:
BigQuery supports GIS functions I'd need like ST_CONTAINS
, but I can't figure out how to get, say, a GeoJSON representation of that polygon Google Maps is showing from either that service or OpenStreetMap.
The closest I've gotten with OpenStreetMap + Overpass is the following query:
[out:json][timeout:180];
relation(1837688);
out geom;
But the polygon I try to create from that response using members
doesn't line up with what OpenStreetView has https://www.openstreetmap.org/relation/1837688.
Is there a more general solution I can use to create these bounding polygons for a region?