免费城市/州/邮编到纬度/经度数据库?

时间:2022-04-25 19:14:37

Is there a standard database of records mapping city/state/zip to lat/lng? I found this database, and the USPS has a simple (no lat/lng) API, but is there another recommended alternative?

是否有一个标准的记录数据库,将city / state / zip映射到lat / lng?我找到了这个数据库,USPS有一个简单的(没有lat / lng)API,但还有另一个推荐的替代方案吗?

Update: Found this too: http://www.geopostcodes.com/

更新:发现这个:http://www.geopostcodes.com/

6 个解决方案

#1


12  

Just a small note. Most of these 3rd party city/state/zip to lat/lng databases are based on the US Census Tiger data. Start with the Census 2000, the zip code data was replaced with ZCTA - which is an approximation of zipcodes. Here's an explanation from the Census site (from 2011):

只是一个小小的音符。这些第三方城市/州/邮政到lat / lng数据库中的大多数是基于美国人口普查Tiger数据。从Census 2000开始,邮政编码数据被ZCTA取代 - 这是一个拉码的近似值。以下是人口普查网站(2011年)的解释:

ZIP Code Tabulation Areas (ZCTAs™) are a new statistical entity developed by the U.S. Census Bureau for tabulating summary statistics from Census 2000. This new entity was developed to overcome the difficulties in precisely defining the land area covered by each ZIP Code®. Defining the extent of an area is necessary in order to accurately tabulate census data for that area.

邮政编码列表区域(ZCTAs™)是由美国人口普查局开发的一个新的统计实体,用于列出2000年人口普查的汇总统计数据。这个新实体的开发是为了克服精确定义每个邮政编码所涵盖的土地面积的困难。为了准确地将该地区的人口普查数据制成表格,必须确定一个地区的范围。

ZCTAs are generalized area representations of U.S. Postal Service (USPS) ZIP Code service areas. Simply put, each one is built by aggregating the Census 2000 blocks, whose addresses use a given ZIP Code, into a ZCTA which gets that ZIP Code assigned as its ZCTA code. They represent the majority USPS five-digit ZIP Code found in a given area. For those areas where it is difficult to determine the prevailing five-digit ZIP Code, the higher-level three-digit ZIP Code is used for the ZCTA code. For more information, please refer to the ZCTA (FAQ) Frequently Asked Questions Web page.

ZCTA是美国邮政服务(USPS)邮政编码服务区域的通用区域表示。简单地说,每个人都是通过将人口普查2000块(其地址使用给定的邮政编码)聚合到ZCTA中来构建的,该ZCTA将该邮政编码指定为其ZCTA代码。它们代表在给定区域中发现的USPS五位数邮政编码的大多数。对于难以确定主要五位邮政编码的区域,ZCTA代码使用更高级别的三位邮政编码。有关详细信息,请参阅ZCTA(FAQ)常见问题网页。

The link below is an updated explanation (2013):

以下链接是更新的说明(2013年):

http://www.census.gov/geo/reference/zctas.html

The OpenGeoCode.Org team

OpenGeoCode.Org团队

ADDED 12/17/13: Our (FREE) state/city/zip dataset (CSV) can be found at the link below. It is derived from public domain "government" datasets:

ADDED 12/17/13:我们的(免费)州/城市/邮政数据集(CSV)可在以下链接中找到。它源自公共领域“*”数据集:

http://www.opengeocode.org/download.php#cityzip

#2


5  

Google offers this as a lookup. Can you do ajax calls from your app?

Google将其作为查找提供。你可以从你的应用程序进行ajax调用吗?

It's called webservices. http://code.google.com/apis/maps/documentation/webservices/index.html

它被称为webservices。 http://code.google.com/apis/maps/documentation/webservices/index.html

You'd want to use the Google Geocoding api. It's simple to use, make a call to this url: http://maps.googleapis.com/maps/api/geocode/json?address=sydney&sensor=false

您想使用Google地理编码API。它使用起来很简单,可以调用这个URL:http://maps.googleapis.com/maps/api/geocode/json?address = sydney&_sensor = false

Change "address=" to whatever you need (ie the city state and zip code)

将“address =”更改为您需要的任何内容(即城市州和邮政编码)

It can also reply in xml. just change json to xml http://code.google.com/apis/maps/documentation/geocoding/

它也可以用xml回复。只需将json更改为xml http://code.google.com/apis/maps/documentation/geocoding/

Example Result

{
  "status": "OK",
  "results": [ {
    "types": [ "locality", "political" ],
    "formatted_address": "Sydney New South Wales, Australia",
    "address_components": [ {
      "long_name": "Sydney",
      "short_name": "Sydney",
      "types": [ "locality", "political" ]
    }, {
      "long_name": "New South Wales",
      "short_name": "New South Wales",
      "types": [ "administrative_area_level_1", "political" ]
    }, {
      "long_name": "Australia",
      "short_name": "AU",
      "types": [ "country", "political" ]
    } ],
    "geometry": {
      "location": {
        "lat": -33.8689009,
        "lng": 151.2070914
      },
      "location_type": "APPROXIMATE",
      "viewport": {
        "southwest": {
          "lat": -34.1648540,
          "lng": 150.6948538
        },
        "northeast": {
          "lat": -33.5719182,
          "lng": 151.7193290
        }
      },
      "bounds": {
        "southwest": {
          "lat": -34.1692489,
          "lng": 150.5022290
        },
        "northeast": {
          "lat": -33.4245980,
          "lng": 151.3426361
        }
      }
    }
  } ]
}

Then all you need to do is open up results[0].geometry.location.lat, and results[0].geometry.location.lng

然后你需要做的就是打开结果[0] .geometry.location.lat和结果[0] .geometry.location.lng

#3


3  

[EDIT 8/3/2015] The free non-commercial ZIP Code database I mentioned below has moved to softwaretools.com. Note: greatdata.com still has the premium ZIP Code data for enterprises.

[编辑8/3/2015]我在下面提到的免费非商业邮政编码数据库已移至softwaretools.com。注意:greatdata.com仍然拥有企业的优质邮政编码数据。

Just a small note. Most of these 3rd party city/state/zip to lat/lng databases are based on the US Census Tiger data. [Andrew]

只是一个小小的音符。这些第三方城市/州/邮政到lat / lng数据库中的大多数是基于美国人口普查Tiger数据。 [安德鲁]

I'm a developer for a commercial ZIP Code Database company (GreatData). For low-end data, Andrew's recommendation is correct and if you know your way around census data, it's pretty easy to get it. Just know it may initially take some hours to get it right. If you prefer not to do the work yourself, you can get our free/non-commercial version here (it's pretty much what Andrew is suggesting with minor enhancements. It's updated every couple months).

我是商业邮政编码数据库公司(GreatData)的开发人员。对于低端数据,安德鲁的建议是正确的,如果您了解人口普查数据,那么很容易得到它。只要知道它最初可能需要几个小时才能正确完成。如果你不想自己做这项工作,你可以在这里获得我们的免费/非商业版本(这几乎是安德鲁建议的一些小改进。它每隔几个月更新一次)。

For a really good explanation on what is missing in it (and more importantly, what's missing in most all low-end ZIP Code data that is based on census ZCTA data) versus a commercial grade, see here.

有关其中缺少的内容(更重要的是,大多数基于人口普查ZCTA数据的低端邮政编码数据中缺少的内容)与商业级别相比,请参阅此处。

ps - regarding suggestions to use Google's API, I see this suggested a lot but unless you're displaying it in a google map, this violates Googles TOS. Specifically: "The Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited." You'll find * has several threads on those who's sites have been blocked.

ps - 关于使用谷歌API的建议,我看到这个建议很多,但除非你在谷歌地图中显示它,这违反了谷歌的TOS。具体来说:“地理编码API只能与Google地图结合使用;禁止在地图上显示地理编码结果,而不会在地图上显示地理编码结果。”你会发现*在那些被阻止的网站上有几个主题。

Hope this is beneficial

希望这是有益的

#4


2  

This is an old thread, but I was looking for the same information recently and also came across this free database:

这是一个旧线程,但我最近在寻找相同的信息,也遇到了这个免费的数据库:

http://federalgovernmentzipcodes.us

#5


0  

Check out zcta. You can draw the geographic boundaries of a zip code using their data.

看看zcta。您可以使用其数据绘制邮政编码的地理边界。

#6


0  

If you have a small number of US cities you can easily build up your own database from Google which gives you the co-ordinates straight on the search page without the need to follow any links, e.g. type:

如果您拥有少数美国城市,则可以轻松地从Google建立自己的数据库,直接在搜索页面上为您提供坐标,而无需关注任何链接,例如:类型:

chicago illinois longitude latitude

芝加哥伊利诺伊州经度纬度

#1


12  

Just a small note. Most of these 3rd party city/state/zip to lat/lng databases are based on the US Census Tiger data. Start with the Census 2000, the zip code data was replaced with ZCTA - which is an approximation of zipcodes. Here's an explanation from the Census site (from 2011):

只是一个小小的音符。这些第三方城市/州/邮政到lat / lng数据库中的大多数是基于美国人口普查Tiger数据。从Census 2000开始,邮政编码数据被ZCTA取代 - 这是一个拉码的近似值。以下是人口普查网站(2011年)的解释:

ZIP Code Tabulation Areas (ZCTAs™) are a new statistical entity developed by the U.S. Census Bureau for tabulating summary statistics from Census 2000. This new entity was developed to overcome the difficulties in precisely defining the land area covered by each ZIP Code®. Defining the extent of an area is necessary in order to accurately tabulate census data for that area.

邮政编码列表区域(ZCTAs™)是由美国人口普查局开发的一个新的统计实体,用于列出2000年人口普查的汇总统计数据。这个新实体的开发是为了克服精确定义每个邮政编码所涵盖的土地面积的困难。为了准确地将该地区的人口普查数据制成表格,必须确定一个地区的范围。

ZCTAs are generalized area representations of U.S. Postal Service (USPS) ZIP Code service areas. Simply put, each one is built by aggregating the Census 2000 blocks, whose addresses use a given ZIP Code, into a ZCTA which gets that ZIP Code assigned as its ZCTA code. They represent the majority USPS five-digit ZIP Code found in a given area. For those areas where it is difficult to determine the prevailing five-digit ZIP Code, the higher-level three-digit ZIP Code is used for the ZCTA code. For more information, please refer to the ZCTA (FAQ) Frequently Asked Questions Web page.

ZCTA是美国邮政服务(USPS)邮政编码服务区域的通用区域表示。简单地说,每个人都是通过将人口普查2000块(其地址使用给定的邮政编码)聚合到ZCTA中来构建的,该ZCTA将该邮政编码指定为其ZCTA代码。它们代表在给定区域中发现的USPS五位数邮政编码的大多数。对于难以确定主要五位邮政编码的区域,ZCTA代码使用更高级别的三位邮政编码。有关详细信息,请参阅ZCTA(FAQ)常见问题网页。

The link below is an updated explanation (2013):

以下链接是更新的说明(2013年):

http://www.census.gov/geo/reference/zctas.html

The OpenGeoCode.Org team

OpenGeoCode.Org团队

ADDED 12/17/13: Our (FREE) state/city/zip dataset (CSV) can be found at the link below. It is derived from public domain "government" datasets:

ADDED 12/17/13:我们的(免费)州/城市/邮政数据集(CSV)可在以下链接中找到。它源自公共领域“*”数据集:

http://www.opengeocode.org/download.php#cityzip

#2


5  

Google offers this as a lookup. Can you do ajax calls from your app?

Google将其作为查找提供。你可以从你的应用程序进行ajax调用吗?

It's called webservices. http://code.google.com/apis/maps/documentation/webservices/index.html

它被称为webservices。 http://code.google.com/apis/maps/documentation/webservices/index.html

You'd want to use the Google Geocoding api. It's simple to use, make a call to this url: http://maps.googleapis.com/maps/api/geocode/json?address=sydney&sensor=false

您想使用Google地理编码API。它使用起来很简单,可以调用这个URL:http://maps.googleapis.com/maps/api/geocode/json?address = sydney&_sensor = false

Change "address=" to whatever you need (ie the city state and zip code)

将“address =”更改为您需要的任何内容(即城市州和邮政编码)

It can also reply in xml. just change json to xml http://code.google.com/apis/maps/documentation/geocoding/

它也可以用xml回复。只需将json更改为xml http://code.google.com/apis/maps/documentation/geocoding/

Example Result

{
  "status": "OK",
  "results": [ {
    "types": [ "locality", "political" ],
    "formatted_address": "Sydney New South Wales, Australia",
    "address_components": [ {
      "long_name": "Sydney",
      "short_name": "Sydney",
      "types": [ "locality", "political" ]
    }, {
      "long_name": "New South Wales",
      "short_name": "New South Wales",
      "types": [ "administrative_area_level_1", "political" ]
    }, {
      "long_name": "Australia",
      "short_name": "AU",
      "types": [ "country", "political" ]
    } ],
    "geometry": {
      "location": {
        "lat": -33.8689009,
        "lng": 151.2070914
      },
      "location_type": "APPROXIMATE",
      "viewport": {
        "southwest": {
          "lat": -34.1648540,
          "lng": 150.6948538
        },
        "northeast": {
          "lat": -33.5719182,
          "lng": 151.7193290
        }
      },
      "bounds": {
        "southwest": {
          "lat": -34.1692489,
          "lng": 150.5022290
        },
        "northeast": {
          "lat": -33.4245980,
          "lng": 151.3426361
        }
      }
    }
  } ]
}

Then all you need to do is open up results[0].geometry.location.lat, and results[0].geometry.location.lng

然后你需要做的就是打开结果[0] .geometry.location.lat和结果[0] .geometry.location.lng

#3


3  

[EDIT 8/3/2015] The free non-commercial ZIP Code database I mentioned below has moved to softwaretools.com. Note: greatdata.com still has the premium ZIP Code data for enterprises.

[编辑8/3/2015]我在下面提到的免费非商业邮政编码数据库已移至softwaretools.com。注意:greatdata.com仍然拥有企业的优质邮政编码数据。

Just a small note. Most of these 3rd party city/state/zip to lat/lng databases are based on the US Census Tiger data. [Andrew]

只是一个小小的音符。这些第三方城市/州/邮政到lat / lng数据库中的大多数是基于美国人口普查Tiger数据。 [安德鲁]

I'm a developer for a commercial ZIP Code Database company (GreatData). For low-end data, Andrew's recommendation is correct and if you know your way around census data, it's pretty easy to get it. Just know it may initially take some hours to get it right. If you prefer not to do the work yourself, you can get our free/non-commercial version here (it's pretty much what Andrew is suggesting with minor enhancements. It's updated every couple months).

我是商业邮政编码数据库公司(GreatData)的开发人员。对于低端数据,安德鲁的建议是正确的,如果您了解人口普查数据,那么很容易得到它。只要知道它最初可能需要几个小时才能正确完成。如果你不想自己做这项工作,你可以在这里获得我们的免费/非商业版本(这几乎是安德鲁建议的一些小改进。它每隔几个月更新一次)。

For a really good explanation on what is missing in it (and more importantly, what's missing in most all low-end ZIP Code data that is based on census ZCTA data) versus a commercial grade, see here.

有关其中缺少的内容(更重要的是,大多数基于人口普查ZCTA数据的低端邮政编码数据中缺少的内容)与商业级别相比,请参阅此处。

ps - regarding suggestions to use Google's API, I see this suggested a lot but unless you're displaying it in a google map, this violates Googles TOS. Specifically: "The Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited." You'll find * has several threads on those who's sites have been blocked.

ps - 关于使用谷歌API的建议,我看到这个建议很多,但除非你在谷歌地图中显示它,这违反了谷歌的TOS。具体来说:“地理编码API只能与Google地图结合使用;禁止在地图上显示地理编码结果,而不会在地图上显示地理编码结果。”你会发现*在那些被阻止的网站上有几个主题。

Hope this is beneficial

希望这是有益的

#4


2  

This is an old thread, but I was looking for the same information recently and also came across this free database:

这是一个旧线程,但我最近在寻找相同的信息,也遇到了这个免费的数据库:

http://federalgovernmentzipcodes.us

#5


0  

Check out zcta. You can draw the geographic boundaries of a zip code using their data.

看看zcta。您可以使用其数据绘制邮政编码的地理边界。

#6


0  

If you have a small number of US cities you can easily build up your own database from Google which gives you the co-ordinates straight on the search page without the need to follow any links, e.g. type:

如果您拥有少数美国城市,则可以轻松地从Google建立自己的数据库,直接在搜索页面上为您提供坐标,而无需关注任何链接,例如:类型:

chicago illinois longitude latitude

芝加哥伊利诺伊州经度纬度