I would like to write a geocoding web service for genealogy in Java. Because it is for genealogy, I don't need to go down to the street level. I only need to go down to the county.

Looking at genealogy data, misspelled names are very common. People also use a lot of non standard abbreviations. For instance for Baltimore County might look like:

  1. Baltimore
  2. Baltimore County
  3. Baltimore Co
  4. Baltimore Cty

4 Answers 4


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


Google has a nice API for geocoding, if you can follow their terms of service. Basic demo can be found here.

Using their service is subject to some limitations, but the result is intuitive, fast, accurate and familiar to most users. It will allow you to focus on developing the genealogy part of your service.


Not the answer you're looking for? Browse other questions tagged or ask your own question.