从邮政编码获取街道名称 - 加拿大

发布于 2024-10-19 23:32:45 字数 1436 浏览 5 评论 0原文

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

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

发布评论

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

评论(3

梦纸 2024-10-26 23:32:45

只是一个想法...尝试相反的方法

而不是查找邮政编码的街道名称...因为同一邮政编码内有很多街道名称。

查找每个街道名称的邮政编码

在加拿大,至少前 3 个应该相同...然后排序

在任何城市中查找街道名称列表应该很容易

http://cartgraphic.info/ca_street/show.php ?p=ont&t=City%20of%20Ottawa

我希望这会有所帮助,

我目前正在尝试为安大略省渥太华创建相同的内容,

感谢任何帮助

Just a thought... try the reverse

Instead of finding the street name for a postal code... because there are many within the same postal code.

find the postal codes for each street name

In Canada, at least the first 3 should be the same... then sort

It should be easy to find a list of street names within any city

ex. http://cartographic.info/ca_street/show.php?p=ont&t=City%20of%20Ottawa

I hope this helps

I am currently trying to create the same for Ottawa Ontario

Any help is appreciated

街角卖回忆 2024-10-26 23:32:45

最低要求是街道号码和邮政编码。即使这样,也可能需要将多个街道比赛呈现给最终用户以供选择。

格雷格(Greg)提到了一个很好的观点,但如果您只知道邮政编码,则可能无法实现。另一方面,一条街道也可以有许多邮政编码,但不一定所有邮政编码的前半部分都相同(想想很长的街道)。

您可以使用 Curl 发布邮政编码来“查找地址”并获取要解析的结果列表。确保将适当的字段传递到页面(即表单提交页面中的隐藏字段)。

Minimum requirements are street number and postal code. Even then there could be multiple street matches that would need to be presented to the end user for selection.

Greg, mentions a good point, but may not be possible if you only know the postal code. On the flip side, a street can have many postal codes as well and not necessary have the same first half for all of them (think of really long streets).

You can use Curl to post a postal code to 'find an address' and get a listing of results to parse through. Make sure you pass appropriate fields to the page though (ie. hidden fields from form submission page).

虚拟世界 2024-10-26 23:32:45

马塞尔的评论是正确的。就其本质而言,邮政编码(至少在我所知道的大多数国家/地区)是有界的区域,其中通常有许多街道,有时还有其他政治边界。

我很好奇加拿大邮政网站如何神奇地从一个邮政编码知道街道名称。接口位于哪里(URL)?您传递了哪些数据?它还发送了哪些其他变量?发布这些内容将使您更容易更直接地回答您的问题。

我在 SmartyStreets 工作,我们负责美国和国际地址验证。据我所知,仅通过邮政编码所能得到的最窄范围可能是一个城市街区、建筑物的楼层或公司(如果它是唯一/自定义邮政编码) - 也就是说您拥有完全扩展的邮政编码(在美国,称为 ZIP+4)。不过,加拿大邮政可能有所不同。

Marcel is correct in his comments. By their very nature, postal codes (in most countries that I know of, at least) are bounded regions in which are usually many streets, sometimes other political boundaries, too.

I'm curious how the Canada Post website is able to magically know the street name from a single postal code. Where is the interface located (URL)? What data are you passing in, and what other variables is it sending? Posting these things will make it easier to answer your question more directly.

I work at SmartyStreets where we perform US and international address validation. From what I know, as narrow as you can get with only a postal code is maybe a city block, floor of a building, or corporation (if it's a unique/custom postal code) -- that's if you have the fully-expanded postal code (in the US, it's called ZIP+4). Canadian post might be different, though.

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