Getting Latitude and Longitude from a Street Address
The Simple Statement
A method is described for determining a latitude and longitude when given
a US street address. The technique uses the Census Bureau data files. Not
all addresses can be successfully geocoded, but the results are promising.
An abbreviated view
- Determine proper county based on zip or city name to county mapping
(this becomes unnecesary if all data is in one table).
- Locate possible street match candidates. Record Type (RT) 1 includes zip codes
as a crutch.
- Walk the list of candidaets. Verify suffix (dr/blvd/ave). Validate zip code on
that record. (The issue is that we have street segments. We need to assemble
a full line for a street (maybe not...see next steps).
- Extract address ranges
- Determine odd/even for side of street
- Select proper street record based on address ranges
- Extroplate lat/long based on start/end of street segment, and the % of the
way that this house number is between the start/stop.
example: assume start/end range is 200-295 (house numbers). Then '250'
is halfway between the start and end lat/long. We will be off by
a maximum of 1 block (but 'block' might be a long ways!).
- Consider using more shape records (RT 6?) for more precision.
10/17/2000-an attempt to automate a geo coding application
10:45pm Start work
12:08am A rudimentary app exists. It does find the correct block, often, but does not
try to extroplate the lat/long based on %'s of address within the range, and it is
not very smart or user friendly. It also doesn't yet use zip codes-which will help.
Thoughts for Enhancements
- I don't need non-road features in my data! This is a thought for dealing with
a truly massive amount of data (as I try to move to have full coverage).
- Linking to my map would be cool...but what scale? What features? This brings up
the key question: how do you automate what is, at heart, an aesthetic and artistic
choice?
Tentacles of despair.
file created 10/17/2000 original as: //icarus/geo/geocoding.html