Package com.massifmaps.geocoding
Class PeliasOnlineReverseGeocodingService
java.lang.Object
com.massifmaps.geocoding.ReverseGeocodingService
com.massifmaps.geocoding.PeliasOnlineReverseGeocodingService
An online reverse geocoding service that uses Mapzen Pelias geocoder.
As the class connects to an external (non-Massif) service, this class is provided "as-is",
future changes from the service provider may not be compatible with the implementation.
Geocoding and reverse geocoding perform network requests and must be executed in non-UI background thread.
Be sure to read the Terms and Conditions of your Pelias service provider to see if the
service is available for your application.
Note: this class is experimental and may change or even be removed in future SDK versions.
As the class connects to an external (non-Massif) service, this class is provided "as-is",
future changes from the service provider may not be compatible with the implementation.
Geocoding and reverse geocoding perform network requests and must be executed in non-UI background thread.
Be sure to read the Terms and Conditions of your Pelias service provider to see if the
service is available for your application.
Note: this class is experimental and may change or even be removed in future SDK versions.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance of the PeliasOnlineReverseGeocodingService given API key. -
Method Summary
Modifier and TypeMethodDescriptionCalculates matching addresses from the specified reverse geocoding request.Returns the custom backend service URL.Returns the language of the expected results.voidsetCustomServiceURL(String serviceURL) Sets the custom backend service URL.voidsetLanguage(String lang) Sets the language of the expected results.
-
Constructor Details
-
PeliasOnlineReverseGeocodingService
Constructs a new instance of the PeliasOnlineReverseGeocodingService given API key.- Parameters:
apiKey- The API key to use (registered with Mapzen).
-
-
Method Details
-
getCustomServiceURL
Returns the custom backend service URL.- Returns:
- The custom backend service URL. If this is not defined, an empty string is returned.
-
setCustomServiceURL
Sets the custom backend service URL.
The custom URL may contain tag "{api_key}" which will be substituted with the set API key.- Parameters:
serviceURL- The custom backend service URL to use. If this is empty, then the default service is used.
-
getLanguage
Description copied from class:ReverseGeocodingServiceReturns the language of the expected results.- Overrides:
getLanguagein classReverseGeocodingService- Returns:
- The language of the expected results. As ISO 639-1 code or empty string.
-
setLanguage
Description copied from class:ReverseGeocodingServiceSets the language of the expected results.- Overrides:
setLanguagein classReverseGeocodingService- Parameters:
lang- The language to use as ISO 639-1 code. Empty string can be used for default language.
-
calculateAddresses
Description copied from class:ReverseGeocodingServiceCalculates matching addresses from the specified reverse geocoding request.- Overrides:
calculateAddressesin classReverseGeocodingService- Parameters:
request- The reverse geocoding request to use.- Returns:
- The list of matching geocoding results, sorted by descending ranks.
- Throws:
IOException
-