Live data from Hacker News

Stop using zip codes for geospatial analysis (2019)

carto.com

31–40 of 134 posts

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

#31
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…

Also, "use a different grid" is only masking the problem, not actually fixing it.

The real problem is ever using an average without also specifying some sort of bounds. For median-based data, this probably means the upper and lower quartiles (or possibly other percentiles); for mean-based data, this probably means standard deviation.

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

#32
post #6

Instead of zip use the following? Use Addresses Use Census Units Use your own Spatial Index Why not lat, long?

Lat/lon is in a spherical coordinate. It’s more complicated to do calculation.

Btw. I have a need recently to compute the shortest distance from a point to a line defined by two points, all in lat/lon. Anyone has any lead on how to do it?

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

#33
post #8

Zip codes are just weird to use for anything other than mail in general because they’re set up based off infrastructure. CGP Grey has a great video on this: https://m.youtube.com/watch?v=1K5oDtVAYzk

I've noticed more and more super/hypermarkets started asking for your zip/postal code sometime during self-checkout. I'm guessing they use these as approximations about where people travel from, so they can evaluate if to open more stores closer to popular areas, or something like that. Pretty sure there is more use cases for postal codes too.

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

#35
post #15

Earlier quoted context omitted.

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…

Right but this ends up being a good approximation for geography because the reality of logistics is that you end up doing a cute n-ary search of the geography. When you know the regional hub you can say for certain a huge chunk of the US the zip code doesn't represent. And then you keep n-secting. Sometimes the land-mass you get at the end is specific enough for your uses.

You're not going to wind up with a situation where zip codes with the same regional marker end up on different coasts.

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

#36
This is interesting since zip codes came up in consideration for how we built out our pay choropleth map in the US: https://levels.fyi/heatmap

Though ultimately it was far too granular (for example the Bay Area would be so many different zip codes). Instead we went with Nielsen's DMA (Designated Market Area) mappings within the US to abstract aggregated data a bit better. And of course this DMA dataset also had a different original use case. It was used for TV / media market surveys so it has some weird vestiges. Some regions are grouped very far and wide (you'll notice there's a bit of Denver within Nevada and its just a remnant of how it used to be categorized), but it still provides a bit of a broader level grouping than something acute like zip code.

I do like this map from the article though and the granularity you can get with zip code when zooming: https://clausa.app.carto.com/map/29fd0873-64cb-42a6-a90d-c83...

We've also been considering using Combined Statistical Areas using population instead. This is something that is under way, and in the interim we've considered charting styles that don't necessarily need borders (for example this bubble map: https://www.levels.fyi/bubble-plot/europe/). The benefit with DMAs is that it offers full border coverage of the entire US whereas some hubs can still be missing from CSAs if relying on a population threshold. But the plan is to create some of our own regional definitions and borders using our own submissions combined with population. Will be an interesting project.

GeoJSON data for the map borders: https://github.com/PublicaMundi/MappingAPI/blob/master/data/...

Nielsen DMA regions: https://blocks.roadtolarissa.com/simzou/6459889

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

#38
post #15

Earlier quoted context omitted.

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…

I agree that they weren't explicitly meant to represent geography, but implicitly they do, right? Are there cases where this is violated?

In other words, is it safe to assume that for entity in a zip code is less than x distance away from the closest entity in the same zip code?

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

#39
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…

This is a tangent, but addresses are also way more complicated than most people realize - especially if you’re relying on a user to input a correct address or if you need to support multiple countries, somewhere with unique addresses like Queens[0], or you need to differentiate between units of a specific street address that uses something other than unit numbers for a unit designation. At that point you need somethi…

Yes, unfortunately, their assertion that everyone knows their zip code is wrong. People often write a neighboring code, and the post office just delivers it.

Similar issues for city name, of course.

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

#40
post #8

Zip codes are just weird to use for anything other than mail in general because they’re set up based off infrastructure. CGP Grey has a great video on this: https://m.youtube.com/watch?v=1K5oDtVAYzk

Wait until you find out that this is the same way phones used to work. The number was the row/colum for the operator needed to plug your line into.
Post reply on HN