Interface GeoCoder

All Known Implementing Classes:
GazetteerGeoCoder

public interface GeoCoder
  • Method Summary

    Modifier and Type
    Method
    Description
    getCountryCode(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.NearbyLocation
    getNearbyCity(String locationWKT)
     
  • Method Details

    • getLocation

      GeoResult getLocation(String location)
      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 GeoResult most 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

      Optional<String> getCountryCode(String locationWKT, int radius)
      Retrieves the country code for a given location. The center point is used if locationWKT is a polygon.
      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)