8 ms·
USPS doesn't care; each ZIP code has a single preferred city name and a list of acceptable alternate city names to account for cases in which a ZIP code spans m
by jcrawfordor 6mo ago
USPS doesn't care; each ZIP code has a single preferred city name and a list of acceptable alternate city names to account for cases in which a ZIP code spans multiple cities. However, USPS's address validation will prefer to use the preferred city name for the ZIP regardless of whether the recipient actually lives within the boundaries of that city. That's because USPS has opted to organize addressing entirely around the ZIP codes, and other political boundaries are irrelevant except in cases of problems interpreting the address.
This does mean that you might autofill a city name that is "wrong" in the view of the person completing the address form, but much of the bulk mail they receive probably uses that city name anyway.
Technically speaking ZIP codes are not "supposed" to span states but, in exceptional cases, some do. In this case USPS handles it the same way: the state of the preferred city is the preferred state for the ZIP code.
The preferred city is almost always the location of the post office serving the ZIP, which makes this situation fairly intuitive. You can find some interesting edge cases where a post office in located in a suburb city, resulting in a ZIP that includes part of a major city having the suburb as its preferred city name.
You can look up the city name and alternates for a ZIP here: https://tools.usps.com/zip-code-lookup.htm?citybyzipcode https://tools.usps.com/zip-code-lookup.htm?citybyzipcode
and the Domestic Mailing Manual covers this, although it's scattered across several sections and mostly part of how the City State database (the database used for validating city and state names in addresses) works.
- thfuran 6mo agoBut addresses aren’t just for sending mail. Location also determines which municipal and state laws apply, so there are contexts where the distinction matters.
- jagged-chisel 6mo agoThese things shouldn’t be based on the zip code.
- twodave 6mo agoIt’s more that the municipal “geofence” encompasses a certain area, and all addresses that fall within that space belong to that municipality. I.e. the address doesn’t determine the location, it just happens to be located somewhere.
- Jimmc414 6mo agoThis is accurate. For a scenario with a possibility of litigation you must ultimately geocode the address with google maps API or census geocoder, point in polygon against district boundaries (geopandas or shapely), then pass the result through a rules table keyed on jurisdiction + case type.
- daft_pink 6mo agoI would just like to point out that the city field doesn’t necessarily prove anything because many unincorporated areas have a listed a city but may not be subject to the laws or taxes of a municipality. So having the correct city isn’t as useful as one thinks it is.
- cvoss 6mo agoI used to live in just such a place. Went to the city center to apply for a library card, thinking "of course I can get a card here, I live in Foo City and this is the Foo City Public Library." I was asked for my street address, and she pulled out a binder of street names to check (yes it was analog, in the year 2016 A.D.). I was not within the city limits and was denied a card.
- lacunary 6mo agosame thing happened to me last year, except at a brush drop-off rather than a library; analog binder and all!
- aidenn0 6mo agoI live in a zip code that spans two cities and I live in the unincorporated area between them, but with one of the cities in my preferred address. So at least two of the exceptions listed in this thread apply.
- collinmanderson 6mo agoI agree using the preferred city name works just fine for USPS, though maybe not for UPS/Fedex. What I want to know is: Why isn't this preferred city+state mapping dataset for zip codes publicly available from USPS? It would be like 40kb of data for the entire thing. Why is this not public domain from the US Government? Edit: or is this what I'm looking for (the "Physical City", "Physical State" columns? https://postalpro.usps.com/ZIP_Locale_Detail https://postalpro.usps.com/ZIP_Locale_Detail It's missing 00501 at least (which zippopotam has), and military zip codes (which zippopotam doesn't have). Military zip codes are included in this file: https://postalpro.usps.com/areadist_ZIP5 https://postalpro.usps.com/areadist_ZIP5 Also fun fact 88888 is for "Operation Santa" uspsoperationsanta.com, which zippopotam is missing, but appears in the areadist_ZIP5 file.
- 8n4vidtmkvmk 6mo agoThat's not nearly as good as Canada's H0H 0H0.
- mxdvl 6mo agoWhich thankfully Zippopotamus supports: https://api.zippopotam.us/CA/H0H https://api.zippopotam.us/CA/H0H
- jcrawfordor 6mo agoUnfortunately these USPS datasets are not public because USPS sells them. Or in some cases, the pattern tends to be that USPS has a contract with a provider (part of what I call the Postal Industrial Complex) that maintains the database and then sells it to both USPS and everyone else. Since these databases are used primarily by bulk mail services, they're fairly expensive and represent an important revenue source to USPS. Remember that USPS is semi-privatized, so they're looking for fees they can charge like everyone else... especially fees that can be changed more easily than postage rates. That said, the ZIP DB is indeed not very large, so you can find copies of it. You won't generally find complete copies of the City State file but I wouldn't be surprised if there is one out there.
- dataflow 6mo ago> Technically speaking ZIP codes are not "supposed" to span states but, in exceptional cases, some do. In this case USPS handles it the same way: the state of the preferred city is the preferred state for the ZIP code. I've heard this before but it raises a million questions for me and I don't understand how this doesn't cause massive systematic problems and headaches in practice. Are residents even usually well-aware what city they live in, versus what's on their postal address? I sure as heck have always assumed whatever my mailing address says is the city I live in; I can't imagine a ton of people questioning it. Doesn't this mean a ton of citizens would be registering for the wrong state's elections? Do the election officials always catch these? What about businesses - don't they constantly pay taxes incorrectly if the address is written incorrectly? What about laws (say privacy, wiretapping/call recording, etc.) where people make assumptions based on the city and state - what if they're wrong because the written city isn't the actual city? Who's criminally liable then?? Does every business have to perform a jurisdiction lookup to make sure an address isn't misleading?
- jasomill 6mo agoMy dad had an address in Morgantown, Indiana, and the fact that he lived several miles south, over the county line and past antother small town, always made it pretty clear to me that he didn't live in Morgantown. Likewise, if you live in another state, there's little confusion because state lines appear on maps and are well marked on all major roads. Businesses and individuals are responsible for knowing which state they reside in and paying the appropriate taxes, regardless of where their mail is sorted. As for elections, electoral districts don't generally align with city limits in the first place, so this has to be sorted out by the election registration system based on the full address in most cases anyway. As for what city name appears in legal documents, the answer is that "preferred" doesn't mean "mandatory". A warrant to search the Indianapolis Motor Speedway, 4790 W 16th St, Speedway IN, 46222, would be perfectly valid, despite the fact that the USPS prefers mail to be addressed to "Indianapolis" rather than "Speedway". For there to be any possibility of confusion, you'd need to have two distinct locations, whose identical addresses share a ZIP code, and differ only by city name, which for obvious reasons the postal service will not allow.