Class GazetteerGeoCoder

java.lang.Object
org.codice.ddf.spatial.geocoder.GazetteerGeoCoder
All Implemented Interfaces:
GeoCoder

public class GazetteerGeoCoder extends Object implements GeoCoder
  • Constructor Details

    • GazetteerGeoCoder

      public GazetteerGeoCoder()
  • Method Details

    • setGeoEntryQueryable

      public void setGeoEntryQueryable(org.codice.ddf.spatial.geocoding.GeoEntryQueryable geoEntryQueryable)
    • getLocation

      @Nullable public GeoResult getLocation(String location)
      Description copied from interface: GeoCoder
      Takes a query for a place and returns the most relevant result.
      Specified by:
      getLocation in interface GeoCoder
      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 GeoResult most 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:
      getNearbyCity in interface GeoCoder
      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

      public Optional<String> getCountryCode(String locationWKT, int radius)
      Description copied from interface: GeoCoder
      Retrieves the country code for a given location. The center point is used if locationWKT is a polygon.
      Specified by:
      getCountryCode in interface GeoCoder
      Parameters:
      locationWKT - WKT location for which to get the country code of
      radius - Radius in kilometers to search from the center of locationWKT
      Returns:
      a country code in ISO 3166-1 alpha-3 format or null if not found (for example, a location in the ocean)