Creating geocoding/gazetteer web service?

I don't think this question is explicitly geographic, because you're only interested in names, so you may want to ask it on Stack Overflow. You could answer your question with two pieces of information: the state and the corrected county name. To perform the corrections, you'd likely want to use the Levenshtein distance (example & java implementation) to match the fuzzy data to corrected values.


A geocoding service needs geographic geometry data, an associated gazetteer (to handle naming and name alternatives), and a user interface (to mediate the search). For a reverse geocoder, you'll need to add a topology validator. For Java, the open source JTS Topology Suite would be the natural choice: http://www.vividsolutions.com/jts/jtshome.htm

County geometries for the United States can be found at the Census: http://www.census.gov/geo/www/cob/co2000.html

To get started on the gazetteer, the U.S. Board on Geographic Names has a database: http://geonames.usgs.gov/

Creating a solid gazetteer database and weaving algorithms that tolerate approximate search matches are the difficult part.


for Java Geocoder try http://jgeocoder.sourceforge.net/

a little dated (2008) but still might be useful has a wiki http://docs.codehaus.org/display/JGEOCODER/JGeocoder+-+Free+Java+Geocoder