MapTrip Interface Android Reference Manual 9.10.1
Loading...
Searching...
No Matches
de.infoware.android.mti.Geocoder Class Reference

Static Public Member Functions

static native int geocodeAddress (String country, String city, String district, String zipCode, String street, String houseNr)
 
static native int getGeocodedAddress (int index)
 
static void addListener (GeocoderListener listener)
 
static void removeListener (GeocoderListener listener)
 
static void removeAllListeners ()
 

Detailed Description

The geocoder allow to retrieve coordinates to a given address. To geocode an address the method Geocoder.geocodeAddress() has to be called. It will return a number of found matches which can be individually retrieved via Geocoder.getGeocodedAddress().

Attention
Even if the geocoder returns a single address this is not necessarily the requested address. E.g. If an invalid housenumber is geocoded, it finds a single "best match" which is not exactly the requested address. Please compare the address information passed to the Geocoder and compare them with the result. If partial addresses are passed ( e.g. city without postcode ) the results will contain the missing information (post code) as far as they can be resolved.

Member Function Documentation

◆ addListener()

static void de.infoware.android.mti.Geocoder.addListener ( GeocoderListener  listener)
static

◆ geocodeAddress()

static native int de.infoware.android.mti.Geocoder.geocodeAddress ( String  country,
String  city,
String  district,
String  zipCode,
String  street,
String  houseNr 
)
static

Requests to geocode an address based on the passed address information. The result callbacks returns the number of found addresses. Individual addresses can then be retrieved via Geocoder.getGeocodedAddress(). The Geocoder performs a "starts withs" search. F.e. if the city fields contains the string "Frank" it will retrieve all cities and districts that contain the substring Frank like "Frankfurt" or "Frankenbach". If multiple results are received, the lowest index is the best match and the highest index the worst one. e.g. with 3 matches, index 0 is the best match and index 2 the worst one. The addresses are ordered by the following logic (best to worst): 1. perfect hit city name, 2. perfect hit district 3. city name starting with search string, 4. district starting with search string. The maximum number of addresses that are calculated is limited to 100.

The behavior of the Geocoder depends on how many / which parameters are passed:

  • country: The country parameter limits the search space. It is not possible to search only for a country. If left blank, the whole installed mapdata is searched for the given address.
  • only city (Geocode City centers and districts ) The geocoder will retrieve the city center coordinates of the matching cities or coordinates of districts with the given name. eg. search "Frankfurt" will result contain "Frankfurt am Main" but also "Markt Taschendorf" which has a district "Frankfurt".
  • only zip code The zip code can not be used as a stand alone parameter, Geocoding only a zip code will yield no results.
  • city and zip code If a city and zip code are passed to the geocoder, only the city will be geocoded and zip code is ignored.
  • city and street The Geocoder will retrieve the street center in the given city. Multiple results if there are cities with identical name that contain similar streetnames.
  • zip code and street All matching street centers in the given zip code area.
  • city, zip code and street All matching street centers for the given zip code area.
  • city, (zip code), street and housenumber searches the exact address and coordinate for the housenumber. If the housenumber is invalid it searches the geographic closest match (search for 10 with only up to 5 returns the 5).

What abbreviation are resolved by the geocoder
The Geocoder does not handle Spelling mistakes like switched characters but it replaces some common character combinations.

  • Umlaute: search strings containing a, u, o are also searched with their corresponding "umlaut" \u00E4, \u00F6, \u00FC while ae, oe and ue are treated as synonyms.
  • Searchingstring containing double s (ss) do also contain results with sharp s (\u00DF) but not the other way around.
  • Shortened common names like str or str. for Strasse are synonyms.
Parameters
country- country of the address that shall be geocoded 3-letter ISO format on MapTrip 4.0, previous versions use the vehicle registration codes. Optional to reduce the search space: if left blank all countries of the installed mapdata will be searched.
city- city / district of the address that shall be geocoded.
district- district - not yet used for geocoding
zipCode- zipcode of the address that shall be geocoded; It is not possible to search only for a zip code ( without street or city )
street- street of the address that shall be geocoded
houseNr- housenumber of the address that shall be geocoded, if no street is given this parameter is ignored. If the passed housenumber does not exist the result for the closest nearest number is returned (e.g. if number 12 or 13 is geocoded but the highest number in the map data is 11 the address AND coordinate of 11 are returned). If the map data does not have any housenumber at thist street, you will get the coordinates of the street center point. The housenumber field of the returned address will then be empty and the return value of this function call will be MTI_ERROR_NO_HOUSENUMBER_FOUND.
Returns
Invokes callback GeocoderListener.geocodeAddressResult().

◆ getGeocodedAddress()

static native int de.infoware.android.mti.Geocoder.getGeocodedAddress ( int  index)
static

Get the address information from the last geocoding process at a given index.

Parameters
index- 0 based index of the geocoded address to be retrieved
Returns
Invokes callback GeocoderListener.getGeocodedAddressResult().

◆ removeAllListeners()

static void de.infoware.android.mti.Geocoder.removeAllListeners ( )
static

◆ removeListener()

static void de.infoware.android.mti.Geocoder.removeListener ( GeocoderListener  listener)
static