Class MultiOSMOfflineGeocodingService

java.lang.Object
com.massifmaps.geocoding.GeocodingService
com.massifmaps.geocoding.MultiOSMOfflineGeocodingService

public class MultiOSMOfflineGeocodingService extends GeocodingService
A geocoding service that uses custom geocoding database files.
Note: this class is experimental and may change or even be removed in future SDK versions.
  • Constructor Details

    • MultiOSMOfflineGeocodingService

      public MultiOSMOfflineGeocodingService() throws IOException
      Constructs a new instance of the MultiOSMOfflineGeocodingService.
      Throws:
      IOException
  • Method Details

    • isAutocomplete

      public boolean isAutocomplete()
      Description copied from class: GeocodingService
      Returns the autocomplete flag of the service.
      Overrides:
      isAutocomplete in class GeocodingService
      Returns:
      The autocomplete flag of the service.
    • setAutocomplete

      public void setAutocomplete(boolean autocomplete)
      Description copied from class: GeocodingService
      Sets the autocomplete flag of the service.
      By default this flag is off.
      Overrides:
      setAutocomplete in class GeocodingService
      Parameters:
      autocomplete - The new value for autocomplete flag.
    • getLanguage

      public String getLanguage()
      Description copied from class: GeocodingService
      Returns the language of the expected results.
      Overrides:
      getLanguage in class GeocodingService
      Returns:
      The language of the expected results. As ISO 639-1 code or empty string.
    • setLanguage

      public void setLanguage(String lang)
      Description copied from class: GeocodingService
      Sets the language of the expected results.
      Overrides:
      setLanguage in class GeocodingService
      Parameters:
      lang - The language to use as ISO 639-1 code. Empty string can be used for default language.
    • getMaxResults

      public int getMaxResults()
      Description copied from class: GeocodingService
      Returns the maximum number of results the geocoding service returns.
      Overrides:
      getMaxResults in class GeocodingService
      Returns:
      The maximum number of results the geocoding service returns.
    • setMaxResults

      public void setMaxResults(int maxResults)
      Description copied from class: GeocodingService
      Sets the maximum number of results the geocoding service returns.
      The default number of results is service dependant (normally 10).
      Overrides:
      setMaxResults in class GeocodingService
      Parameters:
      maxResults - The new maximum number of results the geocoding service returns.
    • calculateAddresses

      public GeocodingResultVector calculateAddresses(GeocodingRequest request) throws IOException
      Description copied from class: GeocodingService
      Calculates matching addresses from the specified geocoding request.
      Overrides:
      calculateAddresses in class GeocodingService
      Parameters:
      request - The geocoding request to use.
      Returns:
      The list of matching geocoding results, sorted by descending ranks.
      Throws:
      IOException
    • add

      public void add(String database)
      Adds a new database.
      Parameters:
      database - The database file patht to be added.
    • remove

      public boolean remove(String database)
      Removes a database.
      Parameters:
      database - The database file patht to be removed.
      Returns:
      True if the database was removed. False otherwise ( database was not found).