Hi,
Total newbie to using GeoNames. I have some Java code that looks OK to me, but continually returns a 0 length List< Toponym >, though the same input work via the web site:
Code:
// Address changed to protect the innocent - because I use MY address
String address = "100 Fake St Denver, CO";
ToponymSearchResult result;
try
{
ToponymSearchCriteria criteria = new ToponymSearchCriteria();
String UrlUtf8Address = URLEncoder.encode( address, "UTF8" );
criteria.setQ( UrlUtf8Address );
WebService.setGeoNamesServer( "ws.geonames.org" );
result = WebService.search( criteria );
}
catch (Exception e)
{
e.printStackTrace();
return null;
}
List< Toponym > ts = result.getToponyms();
By the rime I get to the result, the size of the List is 0.
I must be doing something obviously wrong. Or did I miss a registration requirement for using the free service?
Thanks for any clues.
P.S. Are there any simple Java cookbooks around for GeoNames?