Package org.codice.ddf.spatial.geocoder
Interface GeoCoder
- All Known Implementing Classes:
GazetteerGeoCoder
public interface GeoCoder
-
Method Summary
Modifier and TypeMethodDescriptiongetCountryCode(String locationWKT, int radius) Retrieves the country code for a given location.getLocation(String location) Takes a query for a place and returns the most relevant result.org.codice.ddf.spatial.geocoding.context.NearbyLocationgetNearbyCity(String locationWKT)
-
Method Details
-
getLocation
Takes a query for a place and returns the most relevant result.- Parameters:
location- a string representing a simple placename query, such as "Washington, D.C." or "France" (i.e. the string just contains search terms, not query logic)- Returns:
- the
GeoResultmost relevant to the query, null if no results were found
-
getNearbyCity
org.codice.ddf.spatial.geocoding.context.NearbyLocation getNearbyCity(String locationWKT) throws org.codice.ddf.spatial.geocoding.GeoEntryQueryException - Parameters:
locationWKT- - a WKT string describing the area to search- Returns:
- a description of the "nearest city"
- Throws:
org.codice.ddf.spatial.geocoding.GeoEntryQueryException- if an exception occurs while querying the GeoNames resource
-
getCountryCode
Retrieves the country code for a given location. The center point is used iflocationWKTis a polygon.- Parameters:
locationWKT- WKT location for which to get the country code ofradius- Radius in kilometers to search from the center oflocationWKT- Returns:
- a country code in ISO 3166-1 alpha-3 format or null if not found (for example, a location in the ocean)
-