map city/zipcode polygons using google maps

岁酱吖の 提交于 2019-11-30 07:32:57

Google Maps API doesn't support that kind of solution. There are a couple other places from which you can get the coordinates, though:

Flickr API

There is a Flickr API based on photos that people tag, but it's only as accurate as the people who tag photos: so it's good enough for bootstrapping but probably not for production: http://karya-blog.blogspot.com/2012/12/fetching-city-polygons-with-flickr-api.html

Natural Earth Data

An accurate alternative is www.naturalearthdata.com. To get that data from there you just need to make two requests: one with the city name and one with their ID to get the parameters:

unlock.edina.ac.uk/ws/search?name=berlin&gazetteer=naturalearth&format=json

and then

unlock.edina.ac.uk/ws/footprintLookup?format=json&identifier=14126951

and you're set :)

Mapzen

If it's possible for you to pre-fetch the data, go for Mapzen, they have a full and pretty accurate database: https://mapzen.com/data/borders/

Short answer: I do not think there is any magical getZipCodeBoundaries method in the Google Maps API. However, what you want to do can and has been done. Please see the implementation, and this thread on Google groups concerning the process. Is the first link similar to what you're hoping to accomplish? Also, there is a neighborhood API offered from Zillow under the CC license. You might want to look into that and see if it breaks neighborhoods down by zipcode.

german_martin

You can get polygon coordenates in json for using with googlemaps using openstreetmap. Go to http://nominatim.openstreetmap.org/ search a place like "Partido de Ituzaingó"

Steps:

Look on this site Twitter geo api You have few modes of search, and it gives You boundary box for cities. I am using it now on My site. Try f.e. this link and U will see the results.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!