基于邮政编码的纬度和经度

时间:2021-10-31 16:01:23

My requirement is to get the Latitude and Longitude value for a particular zip code. Is there any API that I can use to get these information. As I am working in a company so the requirement is coming for our team is to find the latitude and longitude value for a particular zip code. So we were thinking to build a new service for this. So what reliable data source we can use to get these information back if we are passing zip code to our service. Or what can be the best approach that I can propose to my PM about this requirement. Any pointers will be appreciated.

我的要求是获取特定邮政编码的纬度和经度值。我可以用什么API来获取这些信息吗?因为我在一家公司工作,所以我们团队的需求是找到特定邮政编码的纬度和经度值。所以我们想为这个建立一个新的服务。那么,如果我们将邮政编码传递给我们的服务,我们可以使用什么可靠的数据源来获取这些信息呢?或者我可以向我的PM提出关于这个要求的最好方法是什么。任何建议都将受到欢迎。

Just to add, that data source should have all the zip codes, latitudes and longitude in a world. Not that much accurate but mostly it should cover around more than 95% coverage.

补充一下,这个数据源应该包含世界上所有的邮政编码、纬度和经度。虽然不那么准确,但大部分应该覆盖超过95%的覆盖率。

Update

更新

I did some research and I found that I can use Maxmind data for this but Maxmind data doesn't cover all the zip code list.

我做了一些研究,我发现我可以使用Maxmind数据来做这个,但是Maxmind数据并不能涵盖所有的邮政编码列表。

6 个解决方案

#1


13  

Please have a look at Google Geocoding API and at Yahoo! PlaceFinder.

请查看谷歌地理编码API和Yahoo!PlaceFinder。

Both of them have Geocoding features, which is exactly what you want (obtaining map (latitude, longitude) coordinates from partial or full addresses).

它们都具有地理编码特性,这正是您想要的(从部分地址或完整地址获取地图(纬度、经度)坐标)。

#2


30  

You can download zip code and corresponding lat and long values for different countries from here: (this is open source data and free of charge)

您可以从这里下载不同国家的邮政编码和相应的lat和long值(这是开放源码数据,免费)

http://download.geonames.org/export/dump/

http://download.geonames.org/export/dump/

You can then import the data into your database and query it.

然后,您可以将数据导入数据库并查询它。

Hope this helps.

希望这个有帮助。

#3


3  

If you need commercial grade, consider this: http://greatdata.com. If you do not need this level of quality, here is a list of some other sources w/ pros & cons (it's worth reading just to understand the differences between zip, zcta, usps, census, etc. versions of the data).

如果您需要商业级别,请考虑以下内容:http://greatdata.com。如果您不需要这个级别的质量,这里有一些其他来源的w/ pro & cons列表(仅为了理解zip、zcta、usps、census等数据版本之间的差异,就值得一读)。

ps - you said 'entire world' but your other responses and the term 'zip code' itself seem to imply primarily US. The above link goes beyond US but not the entire world.

你说的是“整个世界”,但你的其他回答和“邮政编码”本身似乎主要是指我们。以上的联系超越了我们,但不是整个世界。

Regarding the Google API mentioned already, please be aware of Google's TOS. Specifically: "Note: the Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited."

关于已经提到的谷歌API,请注意谷歌的TOS。具体:“注意:地理编码API只能与谷歌映射结合使用;不显示在地图上的地理编码结果是被禁止的。

I am an employee for greatdata.

我是greatdata的雇员。

#4


1  

GeoNames has a nice straightforward API with pretty good coverage. (Docs)

GeoNames有一个很简单的API,覆盖面很广。(文档)

example usage: http://api.geonames.org/postalCodeSearch?postalcode=98122&maxRows=10&username=demo

示例使用:http://api.geonames.org/postalCodeSearch?postalcode=98122&maxRows=10&username=demo

#5


0  

What about this: http://www.boutell.com/zipcodes/ ?

这个怎么样:http://www.boutell.com/zipcodes/ ?

#6


0  

I have a situation where there are 12 warehouses nationwide and I needed to find the nearest one that has inventory for an item. My simple solution was to take the absolute value of the difference between the target zip code and the 12 warehouses. And then, simply ordering them by the lowest to highest difference in zip code numbers and querying the inventory in that order. It seems that just getting the ABS(zip1 - zip2), yields the closet distance between two zipcodes.

我有一种情况,全国有12个仓库,我需要找到最近的一个,有一个项目的库存。我的简单解决方案是取目标邮政编码和12个仓库之间的差值的绝对值。然后,简单地按最低到最高的不同邮编编码,并按该顺序查询库存。似乎只是得到了ABS(zip1 - zip2),就能产生两个zipcode之间的距离。

#1


13  

Please have a look at Google Geocoding API and at Yahoo! PlaceFinder.

请查看谷歌地理编码API和Yahoo!PlaceFinder。

Both of them have Geocoding features, which is exactly what you want (obtaining map (latitude, longitude) coordinates from partial or full addresses).

它们都具有地理编码特性,这正是您想要的(从部分地址或完整地址获取地图(纬度、经度)坐标)。

#2


30  

You can download zip code and corresponding lat and long values for different countries from here: (this is open source data and free of charge)

您可以从这里下载不同国家的邮政编码和相应的lat和long值(这是开放源码数据,免费)

http://download.geonames.org/export/dump/

http://download.geonames.org/export/dump/

You can then import the data into your database and query it.

然后,您可以将数据导入数据库并查询它。

Hope this helps.

希望这个有帮助。

#3


3  

If you need commercial grade, consider this: http://greatdata.com. If you do not need this level of quality, here is a list of some other sources w/ pros & cons (it's worth reading just to understand the differences between zip, zcta, usps, census, etc. versions of the data).

如果您需要商业级别,请考虑以下内容:http://greatdata.com。如果您不需要这个级别的质量,这里有一些其他来源的w/ pro & cons列表(仅为了理解zip、zcta、usps、census等数据版本之间的差异,就值得一读)。

ps - you said 'entire world' but your other responses and the term 'zip code' itself seem to imply primarily US. The above link goes beyond US but not the entire world.

你说的是“整个世界”,但你的其他回答和“邮政编码”本身似乎主要是指我们。以上的联系超越了我们,但不是整个世界。

Regarding the Google API mentioned already, please be aware of Google's TOS. Specifically: "Note: the Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited."

关于已经提到的谷歌API,请注意谷歌的TOS。具体:“注意:地理编码API只能与谷歌映射结合使用;不显示在地图上的地理编码结果是被禁止的。

I am an employee for greatdata.

我是greatdata的雇员。

#4


1  

GeoNames has a nice straightforward API with pretty good coverage. (Docs)

GeoNames有一个很简单的API,覆盖面很广。(文档)

example usage: http://api.geonames.org/postalCodeSearch?postalcode=98122&maxRows=10&username=demo

示例使用:http://api.geonames.org/postalCodeSearch?postalcode=98122&maxRows=10&username=demo

#5


0  

What about this: http://www.boutell.com/zipcodes/ ?

这个怎么样:http://www.boutell.com/zipcodes/ ?

#6


0  

I have a situation where there are 12 warehouses nationwide and I needed to find the nearest one that has inventory for an item. My simple solution was to take the absolute value of the difference between the target zip code and the 12 warehouses. And then, simply ordering them by the lowest to highest difference in zip code numbers and querying the inventory in that order. It seems that just getting the ABS(zip1 - zip2), yields the closet distance between two zipcodes.

我有一种情况,全国有12个仓库,我需要找到最近的一个,有一个项目的库存。我的简单解决方案是取目标邮政编码和12个仓库之间的差值的绝对值。然后,简单地按最低到最高的不同邮编编码,并按该顺序查询库存。似乎只是得到了ABS(zip1 - zip2),就能产生两个zipcode之间的距离。