
402
|
Chapter 7, Names and Places
#79 Geocode a U.S. Street Address
HACK
This street segment goes from (38.390313, –122.816102) to (38.389814,
–122.81515686); one side of the street includes addresses from 1001
through 1019, and the other covers addresses from 1000 to 1018. We can
interpolate that “1005” is about a fifth of the way from 1001 to 1019 and,
assuming the street is straight, that it will be about a fifth of the way
between the ends of the blocks.
There is a lot of other information in this line, and in the other files that
make up the data set for a county. TIGER/Line comprises some 24 gigabytes
of data for the whole country. Including information on curves in the road
that are not the ends of street segments, but in the interests of compressing
that 24 GB into something searchable, we will simplify away that extra
information.
Fortunately for us, Schuyler Erle has stripped away all of that complexity at
http://geocoder.us/, a free geocoding web site and web service for U.S.
addresses based on the U.S. Census TIGER/Line data.
You may use the web site to geocode individual addresses or use one of
three web-service interfaces to geocode via code, as illustrated in “Automati-
cally Geocode U.S. Addresses”
[Hack #80]. You can even download the source
code from CPAN, the Perl code repository at http://cpan.org, and the
TIGER/Line data from the census and create your own geocoding service.
The