I am trying to convert a zip code to an address that is approximately in the center of this zip code

I have a database of addresses provided by users. In some cases, the user entered only a zip code, which for some time was considered adequate for our purposes. Now we know that the zip code does not abbreviate it, and we need the actual address.

So, we strive to convert zip codes to an address that is close enough to this location, and then letting users know what we did so that they can log in and change these addresses if necessary.

Does anyone know anything that can provide the data I'm looking for?

+1
source share
1 answer

I was the developer of SmartyStreets (I have a lot of experience with street addresses).

Unfortunately, zip codes cannot be converted to an address.

U.S. addresses are identified (almost uniquely) by an 11-digit number (12 with a check digit) called the bar code of the delivery point. The postal code is usually the first 5 digits of this code. The remaining 6 digits provide even more granularity to pinpoint the address. Please note that this does not indicate the address geographically, but only logically, in accordance with the USPS address assignment system. (They assign zip codes and addresses based on what makes the most sense for administration and delivery.) Without these other numbers, accurate interpolation is high, highly unlikely.

Trying to resolve an address from a zip code is like trying to scale a bitmap of 100 pixels to 100,000 pixels, depending on the zip code.

Technical impracticability aside, I would advise you not to look for the address, and then ask users to fix it. From a UX and DBA perspective, why not just ask your users to provide the correct address? If you try to guess the address instead, users will be confused, and database administrators are likely to lose information about which addresses are fictitious and which ones have been fixed. In other words, your data will lie to you.

You probably have incomplete data and know this without having the wrong data and don’t know.

Even if users do not fill out their address, you can, with some reasonable certainty, accept the city and state from the zip code. For this, SmartyStreets has an API. At least in this way you will have an approximate coordinate and city / state, and not completely incorrect address data. The probability of correct guessing is from tens of thousands to one.

+2
source

All Articles