ZIP / Postal Code + Country to Geo Coordinates

后端 未结 4 1828
生来不讨喜
生来不讨喜 2021-02-05 23:03

What is the most complete, precise and reliable way to get the coordinates (latitude / longitude) of a given ZIP / Postal Code of a given country? I need to make a lot of reques

4条回答
  •  天命终不由人
    2021-02-05 23:18

    I think that your choice will probably depend on how many API call you intend to make per day. The daily limit of the free Google Maps API is 15,000 request per IP address. (Source: Google Maps API FAQ.)

    You can do geocoding with Google Maps API using the following HTTP request:

    Simple CSV:

    http://maps.google.com/maps/geo?q=W1A+1AA,+London&output=csv&sensor=false
    

    More Complex XML:

    http://maps.google.com/maps/geo?q=W1A+1AA,+London&output=xml&sensor=false
    

    Simply change the "q" parameter with the postcode and country to geocode.

    However, I think that storing the geocoding results permanently in your database may be a violation of the Google Maps API terms and conditions. You may want to check for more information about these restrictions.

提交回复
热议问题