Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you perform address validation? [closed]

Is it even possible to perform address (physical, not e-mail) validation? It seems like the sheer number of address formats, even in the US alone, would make this a fairly difficult task. On the other hand it seems like a task that would be necessary for several business requirements.

like image 557
Kevin Pang Avatar asked Sep 25 '08 18:09

Kevin Pang


People also ask

How address validation is done?

An address can be verified in one of two ways: upfront, when a user searches for an address that is not correct or complete, or by cleansing, parsing, matching and formatting data in a database against reference postal data. Bulk address validation serves businesses that want to verify addresses.

How does USPS address validation work?

The US postal service compares the provided address against their address database to identify possible matches. If the postal service finds an exact match in their database, they will return a response that the address is valid and properly formatted. And just like that, your address is validated.

What does address validation failed mean?

The address verification system encountered an error when attempting to validate the address, usually due to a missing or invalid value, or combination of values, in the City, State, and Postal Code fields. For example, the City field may be blank, or the postal code is in an incorrect format for the ship-to country.

What to do if your address Cannot be verified?

If you receive the error "The address you entered could not be verified against the USPS database", please check the following: In most cases there is an entry problem with the address. Check for correct spelling, numbers, ordinals (NE, SW, etc), and titles like Avenue or Street.


1 Answers

Here's a free and sort of "outside the box" way to do it. Not 100% perfect, but it should reject blatantly non-existent addresses.

Submit the entire address to Google's geocoding web service. This service attempts to return the exact coordinates of the location you feed it, i.e. latitude and longitude.

In my experience if the address is invalid you will get a result of 602 from the service. There's definitely a possibility of false positives or false negatives, but used in conjunction with other consistency checks it could be useful.

(Yahoo's geocoding web service, on the other hand, will return the coordinates of the center of the town if the town exists but the rest of the address is bogus. Potentially useful as long as you pay close attention to the "precision" field in the result).

like image 154
Tim Farley Avatar answered Oct 20 '22 01:10

Tim Farley