News for hackers. Stuff that matters.
Re:USPS now offers official ZIP Code boundary polygons by xp84 on Monday November 09, 2026 @04:06PM (#50432135)
This is interesting. For a long time it was pointed out that ZIP codes, unlike say, city or state boundaries, were not properly representable as polygons, since they don't divide up acreage into zones, but rather label postal delivery routes. Suppose I build a new neighborhood way out in the middle of nowhere. The "polygon" concept suggests that we could look and see what polygon I'm in, and that will determine what post office delivers my mail. But in reality, if there was no route to that area already, they could decide to make it part of any one of the surrounding routes.

I suppose though, as long as you let the polygons map has uncontained areas, where no routes currently exist, it's a doable task to draw polygons around the limits of every route network, as long as you don't mind that they may have lots of weird ragged edges.

Re:USPS now offers official ZIP Code boundary polygons by mikepurvis on Monday November 09, 2026 @04:35PM (#50432549)
Making each able to be a union of multiple enclosed areas would probably also help add an axis of flexibility.
Re:USPS now offers official ZIP Code boundary polygons by bordercontrol on Monday November 09, 2026 @04:48PM (#50432726)
As someone who has worked with geodata quite a lot, that wouldn't be a good idea in terms of resource usage. You are blowing up the size of the dataset by one or two orders of magnitude. Maybe even more. Processing these polygons would be extremely annoying.

I once built an interactive map for some areas in Switzerland with postcodes rendered on it. I had to use a lot of tricks to keep it down to a few hundred KB for just about 5% of Switzerland's area. If I tried to add more areas, I'd have to abandon the approach of rendering polygons directly with Leaflet and move to static, pre-rendered images. Now, if you add 10 or 100 times more points, you would barely be able to render it fast enough on the CPU anymore.

So, nice idea, but the polygons become hard to work with then.

Re:USPS now offers official ZIP Code boundary polygons by dmtry on Monday November 09, 2026 @05:17PM (#50433065)
It's become much easier to do this with the advent of tiled vector data and libraries like https://github.com/maplibre/geojson-vt

Here is an example using Mapbox GL - https://demos.mapbox.com/boundaries-explorer/?country=US&lay...

Re:USPS now offers official ZIP Code boundary polygons by bordercontrol on Tuesday November 10, 2026 @04:44AM (#50438035)
Thank you for the links. The postcode project I mentioned was 5 years ago. So this definitely didn't exist back then. Great to see such progress with these libraries.

Quite something to see this in a browser on my phone, rendered that easily. I can clearly remember how hard this was back then.

Re:USPS now offers official ZIP Code boundary polygons by jaggederest on Monday November 09, 2026 @05:33PM (#50433248)
I'm confused, we did this on US Tiger line file data in 2006, rendering it on a early equivalent of Google Maps. You have to decimate the polygons to get them to render but doing bounding boxes around postcodes is fairly reasonable.

I think the one I enjoyed the most was a zipcode with 38 separate geographical areas, and the other example was a street where one half was one zip code, and the other was a different one, but half way down the street they swapped sides. Representing that with non-overlapping polygons was impossible. So we just let them overlap and shrugged.

Re:USPS now offers official ZIP Code boundary polygons by labcomputer on Monday November 09, 2026 @07:25PM (#50434439)
> Representing that with non-overlapping polygons was impossible. So we just let them overlap and shrugged.

Yup, lots of weird edge cases. For that one, you could also represent it with a multipoly.

Re:USPS now offers official ZIP Code boundary polygons by bordercontrol on Tuesday November 10, 2026 @04:38AM (#50437993)
I was talking about runtime rendering. It's a bit of a hard topic to talk about, as there are a multitude of use cases and approaches.

But in general, having more points really doesn't help with processing geo data. As you said yourself, you had to decimate the polygons. It's always compute vs. precision.

Re:USPS now offers official ZIP Code boundary polygons by jaggederest on Tuesday November 10, 2026 @03:52PM (#50446174)
Well, we did it real time using VML in IE6 of all things, and we used adaptive decimation based on the zoom level, so from a practical perspective there's no point in rendering subpixel detail levels
Re:USPS now offers official ZIP Code boundary polygons by montroser on Monday November 09, 2026 @04:48PM (#50432729)
Yeah, I always thought that was a bit of an aCkTcHUuaLly type of point. Okay, okay, it's about routes. But, when you can draw perfectly mutually exclusive convex hulls around the unions of the lots receiving mail for a given zip code, then you can draw zip code polygons.
Re:USPS now offers official ZIP Code boundary polygons by fwip on Monday November 09, 2026 @05:54PM (#50433485)
[delayed]
Re:USPS now offers official ZIP Code boundary polygons by eichin on Monday November 09, 2026 @08:14PM (#50434803)
The Pentagon has six zipcodes and they're divided up by floor.

(My standard example used to be the World Trade Center, which had two - not one for each tower, but one for the state government offices and one for everything else.)

Re:USPS now offers official ZIP Code boundary polygons by xp84 on Wednesday November 11, 2026 @07:32PM (#50461194)
This is a much better point that I didn't even think of!
Re:USPS now offers official ZIP Code boundary polygons by clickety_clack on Monday November 09, 2026 @04:49PM (#50432738)
Doesn’t that imply that a ZIP code could change if the route is changed?
Re:USPS now offers official ZIP Code boundary polygons by NegativeLatency on Monday November 09, 2026 @04:51PM (#50432760)
Only if it’s 1:1 instead of many to many
Re:USPS now offers official ZIP Code boundary polygons by aidenn0 on Monday November 09, 2026 @06:36PM (#50433930)
Yes. I had my ZIP code change when I was a teenager.
Re:USPS now offers official ZIP Code boundary polygons by skrtskrt on Monday November 09, 2026 @06:54PM (#50434129)
Did it just change with no net new zones?

I had mine changed from a new zip getting added as the area's population grew (after it had been removed decades earlier).

Re:USPS now offers official ZIP Code boundary polygons by s1artibartfast on Monday November 09, 2026 @05:39PM (#50433291)
Thats interesting, how does that work with addresses that dont have mail delivery?
Re:USPS now offers official ZIP Code boundary polygons by dd8601fn on Monday November 09, 2026 @07:25PM (#50434438)
I thought you used to be able to get it from tiger/line data