如何获取美国邮政编码的边界坐标? [英] How to get the bounding coordinates for a US postal(zip) code?

查看:137
本文介绍了如何获取美国邮政编码的边界坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有将采用邮政编码的服务/API并返回边界(边界)坐标,以便我可以在MS SQL数据库中构建Geometry对象?

通过边界坐标,我的意思是我想检索一个GPS坐标列表,这些列表构成了一个定义美国邮政编码的多边形.

解决方案

我的评论的详细说明是,邮政编码不是多边形....

我们经常将邮政编码视为区域(多边形),因为我们说:哦,我住在这个邮政编码中……".这会给人以包含区域的印象,也许是ZIP代表" Zone 改善计划"的事实.有助于与多边形的虚假关联.

实际上,邮政编码是从某种意义上代表邮递员路线的线.在几何上,线没有面积. 就像线是沿着坐标平面的点的字符串一样,邮政编码线是在USPS指定的地址的抽象空间中的传递点的字符串.

它们与地理坐标不相关.不过,您会发现它们似乎面向地理位置,因为对于承运人而言,拥有完全与距离和位置无关的路线效率不高.

"USPS指定地址的抽象空间"是什么?这就是我描述美国邮政局维护的庞大而神秘的可交付地点数据库的方式.地址不是根据地理位置来分配的,而是根据承运人的行进路线分配的,通​​常与街道和通行性有关.

一些5位数的邮政编码只是一栋建筑物,一栋建筑物或一栋建筑物,甚至是一栋建筑物的地板(是的,由于邮政编码的传递点是垂直分层的,所以多个邮政编码可以在一个坐标上).这些中的一些(除其他外)是独特的".邮编.公司和大学经常出于营销或组织目的而获得自己的邮政编码.例如,. (在以前的Google Maps版本中,当您点击该链接时,您会注意到位置标记处于悬停状态,因为它指向的是邮政编码,而不是坐标.大多数美国邮政编码用于显示在Google地图上的某个区域中,这些类型不能,因为可以说,美国邮政局没有拥有"它们,并且它们没有区域.)

只是为了好玩,让我们尝试验证唯一邮政编码中的地址.前往 SmartyStreets 并在12345中输入虚假地址,例如:

街道:999 Sdf sdf

邮政编码: 12345

当您尝试验证时,请注意...它是有效的!为什么? USPS将为该唯一的邮递区号向接收器发送一个邮件,但此时,要由GE分发.邮政编码内部几乎没有任何内容与USPS相关,包括街道地址(技术上为送货路线1").许多大学以类似的方式运作. 此处有更多信息.

现在,尝试使用相同的伪造地址,但没有邮政编码,而要输入城市/州:

街道:999 Sdf sdf

城市:斯克内克塔迪

州:纽约

它没有验证.这是因为即使Schenectady包含12345,该地址也是有效"的,它在几何上与真实"相交.斯克内克塔迪的邮政编码.

再举一个例子:军事.某些海军舰船有自己的邮政编码.军用地址是使用同一名称空间的完全不同的地址类.船舶移动.地理坐标没有.

ZIP精度是另一个有趣的特性. 5位数的邮递区号是精确度"最低的(尽管术语特定的"在这里可能更有意义,因为邮政编码没有明确指出任何东西). 7位数和9位数的邮政编码是最具体的,通常在市区内达到街区或街区的水平.但是由于每个邮递区号的大小都不同,因此很难说出您在说什么实际距离.

9位数的邮递区号可能会分配到建筑物的地板上,因此您可能有数百个地址的邮递区号重叠.

底线:与普遍的看法相反,邮政编码不提供地理或边界数据.它们之间的差异很大,除非您要传递邮件或包裹,否则它们实际上是无济于事的. ,但是USPS的工作是设计有效的运输路线,而不是将人口划分为多个协调区域.

更多的是人口普查局的工作.他们已经编了地图边界列表,因为邮政编码是";便捷"跟...共事.为此,他们将一堆地址分成了多个人口普查区.然后,他们汇总了USPS邮政编码数据,以查找其人口普查区块(其中包含一些粗略的坐标数据)与邮政编码之间的关系.因此,我们可以近似将线绘制为多边形. (显然,他们通过根据其内容将2D多边形转换为适合线性数据的方式将1D线转换为2D多边形,以适应每个非唯一的常规邮政编码.)

从他们的网站(上面的链接):

邮政编码制表区(ZCTA)是一个统计地理实体 近似于美国邮政服务的交付区域 五位数或三位数的邮政编码. ZCTA是人口普查的汇总 与相同的主要邮递区号相关的区块 美国人口普查局主地址文件(MAF)中的地址. 三位数的ZCTA代码适用于大型连续区域,对于这些区域, 美国人口普查局没有五位数的邮政编码信息 在其MAF中. ZCTA未能准确描述邮政编码交付区域,并且 不包括用于邮件传递的所有邮政编码.美国人口普查 主席团已将ZCTAs建立为新的地理实体,类似于, 但要替换的是,在 与1990年或更早的人口普查结合起来.

USCB的数据集不完整,有时不准确. Google的数据仍然存在漏洞(12345是一个很好的例子),但是Google最终会通过手动检查每个地址和邮政编码来修补它.他们已经这样做了,但是还没有使他们的所有地图数据都完美无缺.自然地,对这些数据的访问仅限于API术语,并且提出这些要求非常昂贵.

Ph.我被打了我希望这有助于澄清问题.免责声明:我曾经是SmartyStreets的开发人员. 有关使用地址数据进行地理编码的详细信息.

有关邮政编码的更多信息.

Is there a service/API that will take a postal/zip code and return the bounding(perimeter) coordinates so I can build a Geometry object in a MS SQL database?

By bounding coordinates, I mean I would like to retrieve a list of GPS coordinates that construct a polygon that defines the US zip code.

解决方案

An elaboration of my comment, that ZIP codes are not polygons....

We often think of ZIP codes as areas (polygons) because we say, "Oh, I live in this ZIP code..." which gives the impression of a containing region, and maybe the fact that ZIP stands for "Zone Improvement Plan" helps the false association with polygons.

In actuality, ZIP codes are lines which represent, in a sense, mail carrier routes. Geometrically, lines do not have area. Just as lines are strings of points along a coordinate plane, ZIP code lines are strings of delivery points in the abstract space of USPS-designated addresses.

They are not correlated to geographical coordinates. What you will find, though, is that they appear to be geographically oriented because it would be inefficient for carriers to have a route completely irrelevant of distance and location.

What is this "abstract space of USPS-designated addresses"? That's how I am describing the large and mysterious database of deliverable locations maintained by the US Postal Service. Addresses are not allotted based on geography, but on the routes that carriers travel which usually relates to streets and travelability.

Some 5-digit ZIP codes are only a single building, or a complex of buildings, or even a single floor of a building (yes, multiple zip codes can be at a single coordinate because their delivery points are layered vertically). Some of these -- among others -- are "unique" ZIPs. Companies and universities frequently get their own ZIP codes for marketing or organizational purposes. For instance, the ZIP code "12345" belongs to General Electric up in Schenectady, NY. (Edit: In a previous version of Google Maps, when you follow that link, you'd notice that the placement marker was hovering, because it points to a ZIP code, which is not a coordinate. While most US ZIP codes used to show a region on Google Maps, these types cannot because the USPS does not "own" them, so to speak, and they have no area.)

Just for fun, let's try verifying an address in a unique ZIP code. Head over to SmartyStreets and punch in a bogus address in 12345, like:

Street: 999 Sdf sdf

ZIP Code: 12345

When you try to verify that, notice that... it's VALID! Why? The USPS will deliver a piece to the receptacle for that unique ZIP code, but at that point, it's up to GE to distribute it. Pretty much anything internal to the ZIP code is irrelevant to the USPS, including the street address (technically "delivery line 1"). Many universities function in a similar manner. Here's more information regarding that.

Now, try the same bogus address, but without a ZIP code, and instead do the city/state:

Street: 999 Sdf sdf

City: Schenectady

State: NY

It doesn't validate. This is because even though Schenectady contains 12345, where the address is "valid," it geometrically intersects with the "real" ZIP codes for Schenectady.

Take another instance: military. Certain naval ships have their own ZIP codes. Military addresses are an entirely different class of addresses using the same namespace. Ships move. Geographical coordinates don't.

ZIP precision is another fun one. 5-digit ZIP codes are the least "precise" (though the term "specific" might be more meaningful here, since ZIP codes don't pinpoint anything). 7- and 9-digit ZIP codes are the most specific, often down to block or neighborhood-level in urban areas. But since each ZIP code is a different size, it's really hard to tell what actual distances you're talking.

A 9-digit ZIP code might be portioned to a floor of a building, so there you have overlapping ZIP codes for potentially hundreds of addresses.

Bottom line: ZIP codes don't, contrary to popular belief, provide geographical or boundary data. They vary widely and are actually quite un-helpful unless you're delivering mail or packages... but the USPS' job was to design efficient carrier routes, not partition the population into coordinate regions so much.

That's more the job of the census bureau. They've compiled a list of cartographic boundaries since ZIP codes are "convenient" to work with. To do this, they sectioned bunches of addresses into census blocks. Then, they aggregated USPS ZIP code data to find the relation between their census blocks (which has some rough coordinate data) and the ZIP codes. Thus, we have approximations of what it would look like to plot a line as a polygon. (Apparently, they converted a 1D line into a 2D polygon by transforming a 2D polygon based on its contents to fit linear data -- for each non-unique, regular ZIP code.)

From their website (link above):

A ZIP Code tabulation area (ZCTA) is a statistical geographic entity that approximates the delivery area for a U.S. Postal Service five-digit or three-digit ZIP Code. ZCTAs are aggregations of census blocks that have the same predominant ZIP Code associated with the addresses in the U.S. Census Bureau's Master Address File (MAF). Three-digit ZCTA codes are applied to large contiguous areas for which the U.S. Census Bureau does not have five-digit ZIP Code information in its MAF. ZCTAs do not precisely depict ZIP Code delivery areas, and do not include all ZIP Codes used for mail delivery. The U.S. Census Bureau has established ZCTAs as a new geographic entity similar to, but replacing, data tabulations for ZIP Codes undertaken in conjunction with the 1990 and earlier censuses.

The USCB's dataset is incomplete, and at times inaccurate. Google still has holes in their data, too (the 12345 is a somewhat good example) -- but Google will patch it eventually by going over each address and ZIP code by hand. They do this already, but haven't made all their map data perfect quite yet. Naturally, access to this data is limited to API terms, and it's very expensive to raise these.

Phew. I'm beat. I hope that helps clarify things. Disclaimer: I used to be a developer at SmartyStreets. More information on geocoding with address data.

Even more information about ZIP codes.

这篇关于如何获取美国邮政编码的边界坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆