Live data from Hacker News

Stop using zip codes for geospatial analysis (2019)

carto.com

11–20 of 134 posts

Re: Stop using zip codes for geospatial analysis (2019)

#12
If you want to learn a bit more, there was a recent, really good Planet Money episode[1] about this exact same topic. They focus on the problems that you might face when using zip code for demographic analysis.

[1]: https://www.npr.org/2025/01/08/1223466587/zip-code-history

Re: Stop using zip codes for geospatial analysis (2019)

#14
ZIP codes are an emergent property of the mail delivery system. While the author might consider this a bad thing, this makes them "good enough" on multiple axes in practice. They tend to be:

- Well-known (everybody knows their zip code)

- Easily extracted (they're part of every address, no geocoding required)

- Uniform-enough (not perfect, but in most cases close)

- Granular-enough

- Contiguous-enough by travel time

Notably, the alternatives the author proposes all fail on one or more of these:

- Census units: almost nobody knows what census tract they live in, and it can be non-trivial to map from address to tract

- Spatial cells: uneven distribution of population, and arbitrary division of space (boundaries pass right through buildings), and definitely nobody knows what S2 or H3 cell they live in.

- Address: this option doesn't even make sense. Yes, you can geocode addresses, but you still need to aggregate by something.

Re: Stop using zip codes for geospatial analysis (2019)

#15

To put it in plain mathematical language, ZIP codes are not defined as polygons [0]. The consequence is that performing any analysis with an assumption that ZIP codes are polygons is bound to be error-prone. 0: https://manifold.net/doc/mfd8/zip_codes_are_not_areas.htm

Yeah. ZIP codes are sets in the abstract-dimensional space of carrier delivery points. I suppose you could think of them as lines, but definitely not polygons.

Re: Stop using zip codes for geospatial analysis (2019)

#16
post #14

ZIP codes are an emergent property of the mail delivery system. While the author might consider this a bad thing, this makes them "good enough" on multiple axes in practice. They tend to be: - Well-known (everybody knows their zip code) - Easily extracted (they're part of every address, no geocoding required) - Uniform-enough (not perfect, but in most cases close) - Granular-enough - Contiguous-enough by travel time…

Well you hit on all the points that discuss the compromises that zip codes offer. Just because you have them in your data doesn't mean that they can produce anything useful. You are correct that no one knows their census unit is (if you are thinking from someone entering this on a website) but collecting location or address will be a lot better.

Fact is a lot of web data contains a zip but if you can collect something better it will usually render better results. Unless you are analyzing shipments then that is fine.

Re: Stop using zip codes for geospatial analysis (2019)

#17
post #14

ZIP codes are an emergent property of the mail delivery system. While the author might consider this a bad thing, this makes them "good enough" on multiple axes in practice. They tend to be: - Well-known (everybody knows their zip code) - Easily extracted (they're part of every address, no geocoding required) - Uniform-enough (not perfect, but in most cases close) - Granular-enough - Contiguous-enough by travel time…

There are point process models, but, yes, its much more common to want to aggregate to a spatial area.

Another consideration is what kind of reference information is available at different spatial units. There are plenty of Census Bureau data available by ZCTA but some data may only be available at other aggregate units. Zip Codes are often used as political boundaries.

I'd also mention the "best" areal unit depends on the data. There is a well known phenomenon called the modifiable areal unit problem in which spatial effects appear and vanish at different spatial resolutions. It can sort of be thought of as a spatial variation of the ecological fallacy.

Re: Stop using zip codes for geospatial analysis (2019)

#18
post #7

...and use H3 instead! https://h3geo.org/

Very different use case -- ZIPs/ZCTAs have some semblance of population normalization

Not necessarily true. The population isn't balanced at all between many. Census units are.

Re: Stop using zip codes for geospatial analysis (2019)

#20
post #15

To put it in plain mathematical language, ZIP codes are not defined as polygons [0]. The consequence is that performing any analysis with an assumption that ZIP codes are polygons is bound to be error-prone. 0: https://manifold.net/doc/mfd8/zip_codes_are_not_areas.htm

Yeah. ZIP codes are sets in the abstract-dimensional space of carrier delivery points. I suppose you could think of them as lines, but definitely not polygons.

Zip codes (in the US) are machine readable numbers a mail sorter can use to send a parcel to the right delivery truck for final delivery. In the US, they represent the hierarchy of postal centers with the most significant digit representing the primary hub for a region and the smallest number the actual post office that will be in charge of delivering the letter (or truck if you do the extended post code).

They don't represent geography at all, they represent the organizational structure of USPS.

They work by making the address on a letter almost meaningless. For some smaller population zip codes you can practically just put the name and zip code down and achieve delivery.

Post reply on HN