Package org.geonames
GeoNames Java API main classes.
Webservice Code Examples
geonames full text search
Code Example :ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria(); searchCriteria.setQ("zurich"); ToponymSearchResult searchResult = WebService.search(searchCriteria); for (Toponym toponym : searchResult.toponyms) { System.out.println(toponym.getName()+" "+ toponym.getCountryName()); }
Reverse Geocoding - find next postal codes for given latitude and longitude
Code Example :PostalCodeSearchCriteria postalCodeSearchCriteria = new PostalCodeSearchCriteria(); postalCodeSearchCriteria.setLatitude(37.373636); postalCodeSearchCriteria.setLongitude(-121.972146); ListpostalCodes = WebService.findNearbyPostalCodes(postalCodeSearchCriteria);
-
Class Summary Class Description Address a street addressBoundingBox Intersection an intersection between two streetsPostalCode a postal codePostalCodeSearchCriteria search criteria for web services returning postal codesStreetSegment a street line segment.Timezone gmtOffset and dstOffset are computed on the server with theTimeZone
and included in the web service as not all geonames users are using java.Toponym a GeoNames toponymToponymSearchCriteria search criteria for web services returning toponyms.ToponymSearchResult a toponym search result as returned by the geonames webservice.WeatherObservation WebService provides static methods to access the GeoNames web services.WikipediaArticle a wikipedia article -
Enum Summary Enum Description FeatureClass Enumeration for the GeoNames feature classes A,H,L,P,R,S,T,U,VStyle Enumeration for style parameter specifying the verbosity of geonames web services -
Exception Summary Exception Description GeoNamesException InsufficientStyleException Is thrown when trying to access a field that has not been set as the style for the request was not sufficiently verbose to return this information.InvalidParameterException is thrown when the search criteria is initialized with obviously invalid parameters, such as an invalid country code.