ZIP / Postal Code + Country to Geo Coordinates

后端 未结 4 1824
生来不讨喜
生来不讨喜 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:09

    That's actually a really tough problem since a ZIP code is not actually a polygonal region, but a set of lines aggregated together (see the best anser to How to get the bounding coordinates for a US postal(zip) code? for a very detailed explanation of this.)

    Within the United States, the Census Bureau maintains a list of approximate Zip Code boundaries called the "Five digit Zip Code Tabulation Areas" (ZCTA5). You can download these directly and process them however you like. There are several geocoding tools which can get you started with this; I use PostGIS (http://postgis.net/) but there are others, most importantly the Open Street Maps data (http://www.openstreetmap.org), which covers the world.

提交回复
热议问题