
422
|
Chapter 7, Names and Places
#84 Build a Free World Gazetteer
HACK
The Web Interface
You can try out this simple gazetteer at http://mappinghacks.com/cgi-bin/
gazetteer.cgi. Try typing a place name into the search box. Figure 7-6 shows
the results of a sample search. You can search for an exact match, or you can
match from the start or the end of the name. An option to filter results by
country is available. You should see any matches for your place name, along
with the country it’s in, the feature type of the place, and an approximate
GPS reference for it.
The gazetteer responds to simple GET requests. You can add
query=place to
look for a place name, and filter by asking for
country=ISO code. This will
only return exact matches for the name; optionally, you can try a fuzzy
match from the start or the end of your query by appending
match=start or
match=end to the URL. This gazetteer also has a simple machine-readable
output. The following URL, with
format=rdf appended to the end, will
return the same data in easy-to-parse XML:
http://mappinghacks.com/cgi-bin/index.cgi?query=London&country=UK&format=rdf
How does this gazetteer work? It is built from a source of free data known as
GEOnet, published by the U.S. government’s National Geospatial Intelli-
gence Agency, formerly the National Imagery and Mapping Agency. It pro-
vides coverage of interesting places—not just populated places, but hydro
features, ...