Domanda

The geocoding (or reverse geocoding) results typically have bounding boxes for each address_component, but these are very gross boxes.

Yet, google seems to have good complex polygons for lots of regions. See this google maps query for "WC1N" :

"new" Google Maps query for WC1N

Notice there is a very nice red dotted line that outlines the post code. This exists for other areas as well. For example a query for "Berkeley, CA, USA" has a very complex red dotted line.

So, how do you get these polygons programmatically? a geocode query itself doesn't seem to do it. The response to this query for WC1N just has the boxes:

http://maps.googleapis.com/maps/api/geocode/json?&address=WC1N&sensor=true

As does a query giving a lat/lng that inside either the bounding box or polygon.

Is this data available someplace else? Or are there plans to make it available via the google API?

È stato utile?

Soluzione

Turns out almost everyone treats this data as propritary. There isn't a way to get it from google or the like.

However, there are shapefiles you can download that have a lot of the data. post codes, zip codes, counties, etc. But then you have to deal with the complexity of shapefiles.

mapbox & OpenStreetMap have some polygon lookup facilities as well.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top