CINXE.COM
GeoNames Source Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>GeoNames Source Code</title> <link href="https://www.geonames.org/geonames.ico" rel="shortcut icon"> <link rel="StyleSheet" href="/geonames.css" type="text/css"></head> <body> <table id="topmenutable"><tbody><tr> <td class="topmenu"> <a href="https://www.geonames.org/" title="GeoName Home"> GeoNames Home</a> | <a href="http://www.geonames.org/postal-codes/" title="Postal Codes">Postal Codes</a> | <a href="http://www.geonames.org/export/" title="Database Dump and Webservice API">Download / Webservice</a> | <a href="http://www.geonames.org/about.html" title="About GeoNames">About</a> </td> <td class="topsearch"> <form class="topsearch" name="searchForm" method="post" action="/servlet/geonames" onsubmit="javascript:fulltextsearch();return false;"> search <input class="topmenu" name="q" size="20" value="" type="text"> <input name="srv" value="1" type="hidden"> </form> </td></tr> </tbody></table> <div style="margin: auto; width: 600px; text-align: left;"> <h3>GeoNames Source Code </h3> <h4>Java Client for GeoNames Webservices </h4> The geonames java library helps you to easily access the geonames web services with java. <br/><br/> Code sample : <pre> WebService.setUserName("demo"); // add your username here ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria(); searchCriteria.setQ("zurich"); ToponymSearchResult searchResult = WebService.search(searchCriteria); for (Toponym toponym : searchResult.getToponyms()) { System.out.println(toponym.getName()+" "+ toponym.getCountryName()); } </pre> <b>Download : </b> <br/> <a href="geonames-1.1.15.jar">geonames-1.1.15.jar</a> or <a href="geonames-source-1.1.15.jar">jar with source code</a> (compiled with java8). <br/><br/> <b>Requirements : </b> <br/> <a href="jdom-1.0.jar">jdom</a>, used to parse the xml web service result. <br/><br/> <b>License : </b> <br/> This software is released under the <a href="http://www.apache.org/licenses/">Apache License, Version 2.0 (current)</a>. <br/><br/> <b>Javadoc : </b> <br/> <a href="javadoc">online javadoc</a> <br/><br/> <b>Doap: </b> <br/> <a href="geonames-doap.rdf">geonames doap</a> <br/><br/><br/><br/> The Java source code for geonames is available on <a href="https://github.com/geonames/webservice-client">github</a>. All contributions are welcome. <br/><br/> <h4>Release History</h4> 8. July 2020, Release 1.1.15: add new service for srtm1 and countrySubdivision <p/> 26. March 2018, Release 1.1.14: add new services for address and geoCodeAddress <p/> 1. October 2015, Release 1.1.13: add fuzzy parameter to toponym search <p/> 13. June 2014, Release 1.1.12: check for GeoNamesException in txt services (timezone,gtopo30,srtm3,astergdem) <p/> 15. December 2013, Release 1.1.11: children service now supports maxRows <p/> 15. July 2013, Release 1.1.10: multiple country codes supported in toponymsearch, support for proxy, adm5 name and code in search <p/> 9. September 2012, Release 1.1.9: implement adm3 name and code for postal code, adm3name and adm4 name for toponym <p/> 15. August 2012, Release 1.1.8: add boundingbox parameter to toponym search <p/> 18. June 2012, Release 1.1.7: fix issues with https when setting failover server <p/> 17. February 2012, Release 1.1.6: switch to failover server after database timeout <p/> 8. February 2012, Release 1.1.5: implement "get" service <p/> 9. January 2012, Release 1.1.4: examine http status code for failover switch <p/> 13. September 2011, Release 1.1.3: improved failover server handling <p/> 23. July 2011, Release 1.1.2: fix bug with observationTime for weather services, implemented new service findNearbyStreetsOSM, implement countryBias parameter for search service <p/> 25. Feburary 2011, Release 1.1.1: Wikipedia: fix elevation, new rank attribute, new Comparators, new class DistanceOrder; continentCode for Toponym; Bearing returns double <p/> 24. January 2011, Release 1.1.0: fix npe for exception handling, Android user agent <p/> 20. January 2011, Release 1.0.6: change default server to api.geonames.org, improve exception handling, fix npe with timezone service. <p/> 26. November 2010, Release 1.0.5: implement weatherIcao and findNearByWeather, add mtfcc attribute to tiger services, add isReduced to postal code search. <p/> 3. April 2010, Release 1.0.4: add continentCode to ToponymSearchCriteria, fix issue with countryCode service <p/> 21. January 2010, Release 1.0.3: hierarchy service implemented <p/> 10. December 2009, Release 1.0.2: srtm3 multiple coordinates, astergdem new, findNearby, radius for countrycode service <p/> 1. June 2009, Release 1.0.1: changed population from 'int' to 'long'. <p/> 31. March 2008, Release 1.0 : <a href="http://geonames.wordpress.com/2008/03/31/geonames-web-service-client-r10/">details</a> <p/> 31. August 2007, Release 0.5 : added timezone to Toponym, added style to ToponymSearchResult, add findNearbyStreets fix streetname in findNearestAddress, add adminCode2,3,4, use Enum for featureClass <p/> 10. April 2007, Release 0.4 : adminCodes2/3, radius for reverse postal code geocoding <p/> 1. Feb 2007, Release 0.3 : Timezone, adminCode1 search <p/> 7. Nov 2006, Release 0.2 : Streetlevel reverse geocoding, Bearing <p/> 23. Sept 2006, Release 0.1 : initial version (geonames webservice client) <br/><br/><br/><br/> <h4>More GeoNames Source Code</h4> <a href="http://georss.geonames.org/">GeoRSS module for ROME</a>, a java RSS library. </div> <br/><br/><br/><br/> <div id="pageFooter"> info@geonames.org <img src="/img/smallant.gif" alt="ant" align="middle" border="0" hspace="40"> <p> <a href="http://www.geonames.org/">GeoNames Home</a> <span class="separator">•</span> <a href="http://www.geonames.org/postal-codes/">Postal Codes</a> <span class="separator">•</span> <a href="http://www.geonames.org/export/">Download / Webservice</a> <span class="separator">•</span> <a href="http://forum.geonames.org/">Forum</a> <span class="separator">•</span> <a href="http://www.geonames.org/sitemap.html">Sitemap</a> </p></div> </body></html>