Another complexity that surprises folks is you can't guarantee a one-to-many state-to-ZIP Code relationship. There are several (I forgot offhand how many, I used to have them memorized) that span across state boundaries.
I lived in a house; the other location was a nail spa. Strangers sometimes visited thinking they were at the right address (they weren't) to get their nails'did (they didn't).
Stop Using Zip Codes for Geospatial Analysis (2019) - 184 points, 131 comments - https://news.ycombinator.com/item?id=42974728
https://www.census.gov/programs-surveys/geography/guidance/g...
Still cool!
I have a pet peeve for having to enter my zip code after I've already had to type in the city and state. There wasn't any easily downloadable file that had every ZIP code though. I keep hoping more sites will ask for ZIP first and then just auto fill it using data like this. /wishfulthinking
I like the experience of autocomplete while I'm typing out my street address.
>I have a pet peeve for having to enter my zip code AFTER I've already had to type in the city and state.
The city and state can be derived from the zipcode - so why not simply ask for the zipcode to be typed and then auto-populate the associated city and state.
A few comments here suggest this isn't true.
If you want to reduce input to one field, the autocomplete based on the street address that I brought up is the best experience I've come across.
I was frustrated that this seemingly open data wasn't openly available. Anything that asks for city+state+zipcode can ask for zip code first, auto populate the rest. For the edge cases where the city is wrong, the person can still type in the city like they would have needed to anyway.
It is worth noting that a package would never get delivered to the wrong place because the city wasn't correct but the ZIP code was. The USPS routes based on ZIP codes, not city/state.
https://www.printmag.com/designer-interviews/paula-scher-map...
Point here is to type 0, 1, 2, etc. in the search box to see how zip codes with that prefix are geographically distributed.
I read an interesting story where this distribution comes from the manual mail sorting days... before computer sorting, postal workers could read the first digit and drop it into one of 10 boxes based on what part of the country it was going to, and so on for each additional digit.
Other countries have said "ah f it, it's all computers these days anyways, lets just make all addresses arbitrary random codes with no correlation between code distance and geographic distance. A database lookup at computer speed is a database lookup no matter what."
They remind me of Social Security numbers in a way, where an identifier created for one narrow use (internal Social Security use only) ended up becoming a de facto standard (national identification number) due to the absense of a suitable alternative.
If you'd like to go further down the ZIP code rabbit hole, a few interesting codes to research are `00501`, `48222`, and `12345`. :)
serbuvlad•1h ago
joecool1029•1h ago
llimllib•42m ago
Even when I worked for Medicare I couldn't get the damned post office to give us accurate zip code data! It's terrible geodata but also almost everybody remembers it and most zip codes map to one county, so it was the best UI we found for getting a general area for where a person lived.