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).
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.
发布评论
评论(3)
只是一个想法...尝试相反的方法
而不是查找邮政编码的街道名称...因为同一邮政编码内有很多街道名称。
查找每个街道名称的邮政编码
在加拿大,至少前 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
最低要求是街道号码和邮政编码。即使这样,也可能需要将多个街道比赛呈现给最终用户以供选择。
格雷格(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).
马塞尔的评论是正确的。就其本质而言,邮政编码(至少在我所知道的大多数国家/地区)是有界的区域,其中通常有许多街道,有时还有其他政治边界。
我很好奇加拿大邮政网站如何神奇地从一个邮政编码知道街道名称。接口位于哪里(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.