有人知道免费的邻里数据库吗?

发布于 2024-11-15 07:18:01 字数 1539 浏览 4 评论 0原文

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

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

发布评论

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

评论(4

御守 2024-11-22 07:18:01

刚刚找到了一种从 2 个数据源创建我自己的邻里数据库的方法。其中一个是带有纬度/经度质心的美国邮政编码的完整文件。另一个是来自 USGS 的免费文件,位于 http://geonames.usgs.gov/domestic/download_data.htm

好消息是,USGS 文件有一个名为“Populated Places”的要素类型,其中在城市地区包含社区名称。我针对 Urbanmapping 进行了测试,对于旧金山和亚特兰大,除了 1 个社区名称之外,它还包含所有社区名称(通过 Neighborhood API 演示)。

由于邮政编码文件和 USGS 文件都有纬度/经度,因此唯一要做的就是将社区名称与邮政编码关联起来。为此,您可以使用以下公式并计算所有邮政编码纬度/经度与所有人口密集地点纬度/经度之间的距离,然后根据要包含的距离进行选择。我使用 5 英里半径作为拉链质心。等式如下:

((ACOS(SIN('.$latitude.' * PI() / 180) * SIN(latitude * PI() / 180) + COS('.$latitude.' * PI() / 180) * COS(纬度 * PI() / 180) * COS(('.$经度.' – 经度) * PI() / 180))* 180 / PI()) * 60 * 1.1515) AS 距离

希望这可以帮助其他人解决同样的问题,并且很难证明许可这些数据的成本是合理的(这对于初创公司来说是巨大的)。

Just found a way to create my own Neighborhood database from 2 data sources. One is a complete file of US Zip codes with Lat/Long Centroids. The other is a free file from the USGS found at http://geonames.usgs.gov/domestic/download_data.htm

The good news is that the USGS file has a Feature Type called "Populated Places", which in urban areas contain neighborhood names. I tested against Urbanmapping and for San Francisco and Atlanta it had all but 1 of their neighborhood names (via Neighborhood API demo).

Since both the zip code file and the USGS file have lat/longs, the only thing left to do is to associate the neighborhood names with the zip codes. To do this you can use the following equation and compute the distance between all zip code lat/long and all Populated Place lat/long, then do a select based on the distance you want to include. I am using a 5 mile radius for the zip centroid. Here's the equation:

((ACOS(SIN(‘.$latitude.’ * PI() / 180) * SIN(latitude * PI() / 180) + COS(‘.$latitude.’ * PI() / 180) * COS(latitude * PI() / 180) * COS((‘.$longitude.’ – longitude) * PI() / 180))* 180 / PI()) * 60 * 1.1515) AS distance

Hope this helps other people struggling with the same issue and having a hard time justifying the cost of licensing this data (which is huge for a start up).

七分※倦醒 2024-11-22 07:18:01

我认为这涵盖了您的问题: https://stackoverflow.com/questions/6095392/resolve -city-code-from-user-input/6354044#6354044

或者,这可能提供值:根据用户输入解析城市。特别是@Michael Borgwardt 的回答。

I think this covers your question: https://stackoverflow.com/questions/6095392/resolve-city-code-from-user-input/6354044#6354044

Alternatively this might offer value: resolve city from user input. In particular @Michael Borgwardt's answer.

旧梦荧光笔 2024-11-22 07:18:01

不确定数据有多好,但 Zillow 有一些知识共享数据: http:// /www.zillow.com/howto/api/neighborhood-boundaries.htm

not sure how good the data is, but Zillow has some creative commons data: http://www.zillow.com/howto/api/neighborhood-boundaries.htm

梦回梦里 2024-11-22 07:18:01

我构建了这个工具,至少可以在邮政编码的半径范围内实现这一点:

http://www.woodstitch.com/resources/zip-code-catcher.php

如果您需要知道如何实用地获取某个区域内的邮政编码,它会变得有点棘手,但仍然非常可行 - 我写博客解释如何在这里执行此操作: http://taylor.woodstitch.com/php/php-mysql-best-solutions-for-finding-points-in-a-polygon-from-a-database/

I built this tool that would do the trick at least for the radius of the zip code:

http://www.woodstitch.com/resources/zip-code-catcher.php

If you need to know how to do get zip codes within an area pragmatically it get a bit more tricky but still very doable - I wrote blog explaining how to do it here: http://taylor.woodstitch.com/php/php-mysql-best-solutions-for-finding-points-in-a-polygon-from-a-database/

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