Top
Best
New

Posted by munro 20 hours ago

USPS now offers official ZIP Code boundary polygons(postalpro.usps.com)
693 points | 358 commentspage 2
ortusdux 19 hours ago|
I'm sure their system has its faults, but I find shipping to the UK via postal code quite easy.

"A full postcode identifies a group of addresses (typically around ten) or a major delivery point."

https://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdo...

reticulates 19 hours ago||
Fun fact, a postcode can represent up to 100 addresses, apartment buildings with more than 100 units have multiple postcodes. Sometimes third-party systems will only recognize a subset of those postcodes (e.g: a system might assume a building only has 1 postcode) which can lead to some residents being in the geographic region for a service while others are not despite being in the same building.

Also postcode data is licensed by the Royal Mail, not free.

cjs_ac 19 hours ago|||
Interestingly, there are no polygons for UK postcodes, because UK postcodes don’t represent a geographical area; instead, they represent one or more discrete points.
xp84 18 hours ago|||
ZIPs don't represent areas either. They represent routes, so a collection of paths on a road map is bundled together and named with a ZIP. If you built a new house in between towns, whichever post office decides to serve it would extend one of their lines to go past your house, and then you are assigned that ZIP code. Since it's all based on their convenience, they don't pay any mind to things like city limits or even in some cases state lines.
EwanToo 19 hours ago||||
I know what you're saying, but Ordnance Survey sells the polygons anyway.

https://docs.os.uk/osngd/data-structure/administrative-and-s...

cjs_ac 18 hours ago||
That’s naughty of them. I wonder how SW1A 1AA (Buckingham Palace) and SW1A 0AA (the House of Commons) are represented.
russdill 18 hours ago|||
Given how postcodes are supposed to work, this is what I would expect. Curious if many of the polygons in the data set contain more than one polygon and or if there is any overlap
kube-system 18 hours ago||
> how postcodes are supposed to work

Not sure under what basis you think they are "supposed" to be a certain way but postal codes originated as a signifiers of areas, even in the UK.

US postal codes absolutely have overlap in area, because they do not divide land, they direct delivery routing.

russdill 17 hours ago||
Different places have things like postal codes that mean different things, but in the US postal codes are tied to mail delivery routes.

https://web.archive.org/web/20030119031055/http://users.rcn....

kube-system 16 hours ago||
Yes, I know that is the current way they work (...and I said it in my comment?)

My point is that postal codes aren't "supposed" to work any particular way. They work in what ever way they are specified to work at any particular point in time in any particular place.

Zip codes in the US are related to delivery routes. Prior postal codes in the US were not. UK post codes are currently hyperspecific to a single location. Previously they were not.

russdill 16 hours ago||
In the US they were always tied to routes. The first number gives a set of distribution centers, and the second two numbers where specifically to go. If you look at a map of the first number, you'll see sharp lines separating the states. It'd be hard to verify historically, but if you look at zip codes near the border for, say, 89439, several addresses on the California side use the 89439 zip code.

It'd find it difficult to believe that when the system was originally created, mail delivered by a Nevada post office to a physical location in California had a zip code starting with a 9 rather than an 8.

kube-system 16 hours ago||
Zip codes aren't even quite specific enough to get to the route level. But postal codes in the US pre 1962 were not even zip codes.

My grandfather's postal code growing up in the US was simply "6". He did not have a zip code, because they had not been invented yet.

We didn't quite get enough info to determine the particular route until Zip+4 in 1983.

> It'd find it difficult to believe that when the system was originally created, mail delivered by a Nevada post office to a physical location in California had a zip code starting with a 9 rather than an 8.

When the US first implemented postal codes, 100+ cities had a duplicate postal code of "1", which was the first postal zone within that particular city. We've increased the specificity of our postal codes twice since then. (well, three times if you count IMb)

But more to your modern zip code example -- addresses and their 5 digit ZIP codes historically followed the post office together in lock step. (This is why many system have separate "mailing addresses" from "physical addresses", they weren't always the same thing) -- e.g. if you lived in rural town and your mail was delivered from a different town you'd have something like a rural route address and both the municipality and the zip code you'd put on the letter would be for town the post office was in, not the town you lived in.

For example, when I was young and wrote a letter to my grandmother, I wouldn't put her street address on it... because she didn't have one. I'd address it to her rural route number and box number, and I would address it not to the town she lived in, but to the town the post office was in, and the zip code of that post office.

In the case where this was across state lines, your mailing address would be a different state than where you lived.

This is part of the reason why USPS has been converting from RR addresses to the Locatable Address Conversion System. Because it was difficult for first-responders to find homes when people calling didn't have addresses that matched where they actually were.

cornedor 18 hours ago|||
As someone from the Netherlands I’ve been very surprised at how far “ahead” we seem to be here. Just a postcode can point you to a street, even the side of the street (right or left hand), a house number than gives you the exact building. That is how people are used to enter their address here.

When I had to work with addresses in other countries, I found out that is not that normal.

ortusdux 16 hours ago||
In the US, outside of grid systems, it's common for house addresses to be distances, with even numbers to be on the right hand side. For example, 567 Oak Street would be 0.56 miles down Oak, on the left. Very helpful for first responders and delivery people. Not that helpful if you do not know where Oak street is.
reaperducer 19 hours ago||
"A full postcode identifies a group of addresses (typically around ten) or a major delivery point."

The United States can be more granular, as a "full postcode" equivalent in the United States is ZIP+4, which can resolve down to an individual building, mailbox, or person, depending on the characteristics of the location.

https://en.wikipedia.org/wiki/ZIP_Code#ZIP+4

twodave 19 hours ago||
And even for those where it isn’t one exact person/box there is a 2 digit delivery point code that often is included on the end.
konfusinomicon 19 hours ago||
bottom line is that this should be open source and available on the US governments dataset website.
at1as 11 hours ago||
interesting - I worked on Twilio's geographic gating of phone numbers.

Very complex problem globally, but the consequences can be high if you sell the wrong number type to a customer in the wrong location (and sometimes the EU and its member states can have precisely opposite legal requirements).

The US is relatively simple, with rate centers, but in some countries you actually have to draw geojson boundaries and find out exactly which location the company's headquarters resides within, down to the meter. If your boundaries aren't precise enough, you can get into trouble.

It's been about a decade since I was involved in that, so I'm curious if it's easier these days. There's not, however, a lot of incentive to fix it, as in many countries a few telco providers control everything.

mzagaja 19 hours ago||
As someone who has done tons of geospatial work I hate this. A ZIP code was never technically a geospatial boundary. Being "inside" a boundary does not guarantee you have that ZIP code, just that the space is surrounded by a bunch of postal delivery addresses bearing the ZIP code.
FarmerPotato 15 hours ago||
I made ZIP boundaries from the TIGER database in 1993. (Giant Delaunay triangulation/ Voronoi diagram. Fun algorithms for dealing with millions of points! Then merge polygons.)

I believe the demand for this was to visualize attributes on a map by coloring polygons, and the dataset was addresses that already had zip codes.

(Please stop coloring polygons by attribute: it gives false impressions because areas are unequal. Instead, use a scale of dot density. Or marker size, which has its own perceptual issues.)

However misguided, coloring zip code polygons gives you things like maps of customer data. But you could just as well geocode each address and assign it to a county or other boundary. (news flash: the geocoding database is derived from the same line data as the ZIP code project.)

konfusinomicon 19 hours ago|||
most people dont know that zip codes are specific to the postal service and dont have anything to do with actual municipal government boundaries. the hierarchy of geo boundaries and the ways to locate and communicate within them is way more interesting than one would believe!
Tangurena2 18 hours ago|||
Some 5-digit zip codes represent the PO Boxes at a post office building.

Some zip codes represent a single building. Example 20500 is the White House. The Pentagon is so big it has several zip codes.

https://convene.com/catalyst/office/buildings-new-york-city-...

It used to be that the first 3 digits of a zip code sent that mail to the "main" post office building (the one that has loading docks for like 10-30 tractor trailers on one side of the building). Even if you were mailing a letter to the same zip, it went to that building to be sorted and returned to the local office before delivery. Nowadays, everything goes to central facilities where stuff is scanned and sorted. In Kentucky, almost all mail goes through Louisville.

aidenn0 16 hours ago|||
A lot of people also don't know that your written address is also disconnected from municipal government boundaries.

The "city" on my address growing up was a CDP[1], and it is now a city that I live 2 miles from rather than the one that I live less than a mile from.

1: https://en.wikipedia.org/wiki/Census-designated_place

biker142541 19 hours ago|||
Polygons do have value in some workflows, if used with the appropriate caveats.

And in no instances have I ever run across use cases where these are worth paying any substantial money for. If USPS is going to jump into the fray here, really bad look (and probably net negative revenue for them) to offer as a paid product.

toast0 19 hours ago||
I know that many people do use ZIP codes for grouping locations, and polygons may be useful for tieing a lat/long to a zipcode if it doesn't have a delivery location. But it's all kind of silly unless you're sorting mail. Also, I'd hate/love to see some of the polygons where delivery boundaries get weird.

Whatever you're grouping is likely better served by some grouping based on geography, not based on delivery routes. You probably wouldn't group by telephone company central office either, unless you're telco related.

We want to group by geography, zip codes are easy and vaguely geographic, lets use that is kind of a valid decision, but it's deeply frustrating :p

xp84 18 hours ago||
Completely agree on this. Something I have used for a few applications is the DMA (designated market area) boundaries. It's not ideal for everything, but it's very human-focused: If you live just a few miles across a state boundary from a major city, grouping you with the city makes more sense than with anything in your state.

In fact, these were invented by Nielsen, and they determined them just by measuring which city's TV stations are predominantly watched in each county, and assigning each county to one DMA based on that.

TimK65 19 hours ago|||
This. The USPS has always said that a ZIP Code was not a geographical area, but a collection of deliverable addresses. So what is this nonsense?
mac3n 18 hours ago|||
As someone who did a little geospatial work, I concur. We had banks complain that we didn't have ZIP codes for some ATM locations.

The ATMs never got mail.

lianbuilds 13 hours ago||
[flagged]
acaloiar 11 hours ago||
I understand it costs money to collect, clean, and serve data. But this is the wrong price for this data. At this price, what I think we're most likely to see is a cottage industry of cheaper zip code boundary polygon services that have introduced just enough jitter in their boundary points to defeat the USPS's assertions that they're reselling USPS data. I doubt buyers will care that the cheap service boundaries have a few meters of error at the edges when it costs 100x less.
jackconsidine 19 hours ago||
Seeing enterprise

We use https://github.com/OpenDataDE/State-zip-code-GeoJSON - it's from 2010, but open it in Claude and use the free-to-download data source to regen from the most recent census.

toolslive 17 hours ago||
in the EU, this is considered FAIR (Findable, Accessible, Interoperable, Reusable) data. You can just find this on govt portals.
ButlerianJihad 17 hours ago|
https://en.wikipedia.org/wiki/Postal_addresses_in_the_Republ...

  Ireland was the last country in the OECD to create a postcode system. In July 2015 all 2.2 million residential and business addresses in Ireland received a letter notifying them of the new Eircode for their address.[4] Unlike other countries, where postcodes define clusters or groups of addresses, an Eircode identifies an individual address and shows exactly where it is located. The system was criticised...[5]

   ...for using an unsequenced code limited to postal addresses...[67][68]
nxobject 18 hours ago||
I'm not sure how many fields will find this useful -- other core geo/spatial datasets use the related-but-not-identical ZCTAs, especially Census demographic data. Perhaps transportation operations?
azhenley 18 hours ago||
I wrote a JS library and blog post about mapping latitude and longitude to country, state, and city with a small, in-memory lookup. It was fun to build! My startup was paying a lot of money to Google's reverse geocoding API.

Blog post: https://austinhenley.com/blog/coord2state.html

HN discussion: https://news.ycombinator.com/item?id=44175356

mc007 17 hours ago|
did something similar if anyone needs it, boundaries for GADM zones, fast with cache, population center, was quite a mess to get good results : https://github.com/polymech-info/gadm - easy to render in maplibre
More comments...