Database Reference
In-Depth Information
Geocoder.us
The Geocoder.us website ofers a commercial API for converting US addresses into location co-
ordinates. It costs $50 for 20,000 lookups, but thankfully, Geocoder has also open-sourced the
code as a Perl CPAN module . It's straightforward to install, but the tricky part is populating it
with data, since it relies on Tiger/Line data from the US Census. You'll need to hunt around on
the Census website to locate the iles you need, and then they're a multigigabyte download.
Geodict
An open source library similar to Yahoo!'s Placemaker API, my project takes in a text string
and extracts country, city, and state names from it, along with their coordinates. It's designed to
run locally, and it only spots words that are highly likely to represent place names. For example,
Yahoo! will lag the “New York” in “New York Times” as a location, whereas Geodict requires
a state name to follow it or a location word like inor atto precede it:
./geodict.py -f json < testinput.txt
[{"found_tokens": [{
"code": "ES", "matched_string": "Spain",
"lon": -4.0, "end_index": 4, "lat": 40.0,
"type": "COUNTRY", "start_index": 0}]},
...
GeoNames
GeoNames has a large number of APIs available for all sorts of geographic queries, based on
its database of eight million place names. You can use a simple REST interface with no authen-
tication required, or you can download the entire database under a Creative Commons license
if you want to run your own analysis and processing on it. There's some unusual data available,
including weather , ocean names , and elevation :
curl "http://ws.geonames.org/findNearestAddressJSON?lat=37.451&lng=-122.18"
{"address":{"postalcode":"94025","adminCode2":"081","adminCode1":"CA",
"street":"Roble Ave","countryCode":"US","lng":"-122.18032",
"placename":"Menlo Park","adminName2":"San Mateo",
"distance":"0.04","streetNumber":"671",
"mtfcc":"S1400","lat":"37.45127","adminName1":"California"}}
US Census
If you're interested in American locations, the Census site is a mother lode of freely download-
able information. The only problem is that it can be very hard to ind what you're looking for on
Search WWH ::




Custom Search