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

发布于 2024-10-15 12:29:40 字数 1539 浏览 2 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

↘紸啶 2024-10-22 12:29:40

只是一个小注释。大多数第三方城市/州/邮政编码到纬度/经度数据库均基于美国人口普查老虎数据。从 2000 年人口普查开始,邮政编码数据被 ZCTA 取代 - 这是邮政编码的近似值。以下是人口普查网站的解释(自 2011 年起):

邮政编码制表区域 (ZCTA™) 是美国人口普查局开发的一个新统计实体,用于对 2000 年人口普查的汇总统计数据进行制表。这个新实体的开发是为了克服精确统计数据中的困难。定义每个 ZIP Code® 所覆盖的土地面积。为了准确地制表该区域的人口普查数据,有必要定义一个区域的范围。

ZCTA 是美国邮政服务 (USPS) 邮政编码服务区域的广义区域表示。简而言之,每个区块都是通过将地址使用给定邮政编码的 Census 2000 区块聚合到 ZCTA 中而构建的,ZCTA 将该邮政编码分配为其 ZCTA 代码。它们代表了给定区域中发现的大多数 USPS 五位数邮政编码。对于难以确定现行五位邮政编码的地区,则采用较高级别的三位数邮政编码作为 ZCTA 代码。如需了解更多信息,请参阅 ZCTA (FAQ) 常见问题解答网页。

下面的链接是更新的解释(2013):

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

OpenGeoCode.Org 团队

于 2013 年 12 月 17 日添加:我们的(免费)州/城市/邮政数据集 (CSV) 可以在下面的链接中找到。它源自公共领域“政府”数据集:

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

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):

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 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.

The link below is an updated explanation (2013):

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

The OpenGeoCode.Org team

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:

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

瞄了个咪的 2024-10-22 12:29:40

谷歌提供这个作为查找。您可以从您的应用程序进行 ajax 调用吗?

这就是所谓的网络服务。
http://code.google.com/apis/maps/documentation/webservices /index.html

您需要使用 Google 地理编码 api。
使用起来很简单,调用这个url:
http://maps.googleapis.com/maps/api /geocode/json?address=sydney&sensor=false

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

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

示例结果

{
  "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
        }
      }
    }
  } ]
}

然后您需要做的就是打开 results[0].geometry.location.latresults[0].geometry.location .lng

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

It's called 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

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

It can also reply in xml. just change json to 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

傲世九天 2024-10-22 12:29:40

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

只是一个小注释。大多数第三方城市/州/邮政编码到纬度/经度数据库均基于美国人口普查老虎数据。 [安德鲁]

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

有关其中缺少什么(更重要的是,基于人口普查 ZCTA 数据的大多数低端邮政编码数据中缺少什么)与商业级的真正好的解释,请参阅 此处

ps - 关于使用 Google API 的建议,我看到了很多建议,但除非您在谷歌地图中显示它,否则这违反了 Google 服务条款。具体来说:“地理编码 API 只能与 Google 地图结合使用;禁止在地图上显示地理编码结果。”您会发现 StackOverFlow 在那些网站被阻止的网站上有多个线程。

希望这是有益的

[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.

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]

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).

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.

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 StackOverFlow has several threads on those who's sites have been blocked.

Hope this is beneficial

几度春秋 2024-10-22 12:29:40

这是一个旧线程,但我最近在寻找相同的信息,并且还发现了这个免费数据库:

http://federalgovernmentzipcodes.us< /a>

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

http://federalgovernmentzipcodes.us

沐歌 2024-10-22 12:29:40

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

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

誰ツ都不明白 2024-10-22 12:29:40

如果您有少量的美国城市,您可以轻松地从 Google 建立您自己的数据库,该数据库直接在搜索页面上为您提供坐标,而无需遵循任何链接,例如输入:

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

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:

chicago illinois longitude latitude

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文