I looked at many SO questions referring to a similar topic:
Google Maps API V3: How to get region border coordinates (polyline) data?
Add "Search Area" outline onto google maps result
Where do Google and Twitter source political boundaries of cities, regions and states?
And searched for online tools and tools within my country and too:
https://market.mashape.com/vanitysoft/boundaries-io/overview https://market.mashape.com/vanitysoft/boundaries-io http://mapit.openpolis.it/postcode/00188.html
But no one of them fits with the task I need to complete (and I tell you why right after explaining the task I have to do):
Basically all I want is, for each Italian post code (called CAP in Italy) (as of 2015, they are 8709 and I have them all stored in a database's table), find its area coordinates (therefore something like an array with the following structure (it can be a JSON, KML, XML, it doesn't matter as long as the coords are truthful and I can somehow parse them):
[
[ [lat, lng], [lat, lng], [lat, lng], ... ], // Polygon 1
/*
* This additional arrays may be here in the case
* where a CAP (Italian postal code) is made up of many areas,
* therefore each area is a polygon.
*
* For example here -> https://www.google.it/maps/place/84020+SA/@40.605482,15.1783416,10.32z/data=!4m2!3m1!1s0x13396999456508e7:0x1c09e123127ecbc0
*
*/
[ [lat, lng], [lat, lng], ... ], // Optional Polygon 2
...
[ [lat, lng], [lat, lng], ... ] // Optional Polygon n
];
So that I can draw them with a google.maps.Polygon
or a custom overlay extending the google.maps.OverlayView
class on a map. The coordinates of the areas I need are shown by Google here:
Or here:
But I can't find a way to get them in my application and I didn't find such a guide on their site at https://developers.google.com/maps/documentation/
. Also, in the SO questions I linked the answers say that Google doesn't provide this data, but, as of 2015, maybe they have changed something?
Now, why no one of the features I have found suits my needs:
- They all address to United States' zip codes only;
- The local Italian site I have found (
mapit.openpolis.it
) doesn't return the coords for the polygon area but just the a single pair oflat
andlng
which points to the center of the postal code and also doesn't return anything for some postal codes (CAPs).
What could I do? Is there a way to contact a responsible of the Google Maps API team and ask him what should I do in such a case? (And I am pretty serious so don't laugh at me...).
Thanks for the attention.