Package org.codice.ddf.spatial.geocoder
Class GazetteerGeoCoder
java.lang.Object
org.codice.ddf.spatial.geocoder.GazetteerGeoCoder
- All Implemented Interfaces:
GeoCoder
-
Constructor Summary
Constructors -
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 location) voidsetGeoEntryQueryable(org.codice.ddf.spatial.geocoding.GeoEntryQueryable geoEntryQueryable)
-
Constructor Details
-
GazetteerGeoCoder
public GazetteerGeoCoder()
-
-
Method Details
-
setGeoEntryQueryable
public void setGeoEntryQueryable(org.codice.ddf.spatial.geocoding.GeoEntryQueryable geoEntryQueryable) -
getLocation
Description copied from interface:GeoCoderTakes a query for a place and returns the most relevant result.- Specified by:
getLocationin interfaceGeoCoder- 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
@Nullable public org.codice.ddf.spatial.geocoding.context.NearbyLocation getNearbyCity(String location) throws org.codice.ddf.spatial.geocoding.GeoEntryQueryException - Specified by:
getNearbyCityin interfaceGeoCoder- Parameters:
location- - 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
Description copied from interface:GeoCoderRetrieves the country code for a given location. The center point is used iflocationWKTis a polygon.- Specified by:
getCountryCodein interfaceGeoCoder- 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)
-