需要查找邮政编码的纬度和经度并将其存储到我的数据库中

发布于 2024-08-28 23:28:34 字数 1539 浏览 6 评论 0原文

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

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

发布评论

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

评论(7

懵少女 2024-09-04 23:28:34

邮政编码位置数据现在免费提供。请参阅此答案:

https://www.ordnancesurvey.co.uk/opendatadownload/products.html

您想要的是“代码-点开”。

Postcode location data is available free now. See this answer:

https://www.ordnancesurvey.co.uk/opendatadownload/products.html

The one you want is "Code-Point open".

意犹 2024-09-04 23:28:34

这里是。转储 SQL 表,其中包含邮政编码、LAT/LON、X/Y 坐标:)

下载 zip (英国邮政编码.zip) 和
有关更多信息,请阅读 [same-website]/guides/article.php?article=64 :)

我还没有测试过它,但它应该可以工作,小伙子 :)

快乐编码 ^^

Here it is. Dumped SQL table full of Postcodes, LAT/LON, X/Y coordinates :)

Download zip (UK-Postcodes.zip) and
for more info read [same-website]/guides/article.php?article=64 :)

I haven't tested it, but it should be working, lad :)

Happy coding ^^

孤单情人 2024-09-04 23:28:34

也许 Nominatim 应该可以解决问题。唯一的问题是它可能不是最新的。

Maybe Nominatim should do the trick. The only problem is that it might not be up to date.

独木成林 2024-09-04 23:28:34

Geonames.org 提供免费的可下载数据库。您可以尝试 Bing API 或其他商业产品,但它们对在一段时间内可以进行多少次查询以及如何使用它有相当严格的条款和条件(需要律师来解释它们的细微差别)。

我发现 Geonames.org 足以满足我的需求。

Geonames.org offers a free downloadable database. You could try Bing API or other commercial offerings but they have rather restrictive T&C in how many queries you can make within a time period, how you can use it (needs a lawyer to interpret their nuances).

I found Geonames.org to be more than sufficient for my needs.

丿*梦醉红颜 2024-09-04 23:28:34

对于邮政编码数据库,不幸的是我无法帮助你。

但对于 Google...您知道,您不必每次都对每个邮政编码执行此操作。您可以将这些值缓存在数据库中,并且只需为每个新邮政编码执行一次。尽管这需要一些时间,但这是可能的。

是啊,还是很烂。但总比没有好。

For postcode database, unfortunately I cannot help you.

But for Google... You know, you don't have to do this for EVERY postcode EACH time. You can cache the values in your database and do it only once for each new postcode. Although this will take some time, it's possible.

Yeah, it still sucks. But better than nothing.

久伴你 2024-09-04 23:28:34

http://www.freethepostcode.org/ 提供您可能会觉得有用的信息。

http://www.freethepostcode.org/ provides information you may find useful.

巷子口的你 2024-09-04 23:28:34

我只在商业软件的本地数据库中看到过这种情况,可能是因为皇家邮政对其邮政编码数据施加了许可限制。

不过,有些具有相当高速率限制的 API 可以对英国邮政编码进行地理编码。雅虎的地理编码 API 每天的点击次数被限制为 5,000 次,但这意味着您可以在四天内完成整个数据库,将纬度/经度存储在数据库中,然后使用它来添加新地址。

另外——您需要的信息有多准确?如果您只需要一个大概的位置,您可以对出站进行地理编码(例如“BS1”);我在网上看到过一些用户来源的数据库,其合法性至少是有争议的。

I've only seen this done from a local database with commercial software, possibly because of the licensing restrictions the Royal Mail put on their postcode data.

There are APIs with reasonably high rate limits that can geocode UK postcodes, though. Yahoo's geocoding API is restricted to 5,000 hits a day, but that means you could have your entire database done in four days, store the lat/lon in the database, and just use it to add new addresses as they come in, say.

Also -- how accurate do you need the information? If you just need a rough location, you could geocode to the Outbound (e.g. "BS1"); I've seen user-sourced databases of at least arguable legality around the net for that.

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