MKergall / osmbonuspack

A third-party library of (very) useful additional objects for osmdroid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle house numbers in GeocoderNominatim

selphiron opened this issue · comments

I can search for streetname + house number but the return value of GeocoderNominatim.getFromLocationName does not contain information about the house number, although the latitude and longitude shows at a building with the house number I searched for.
For example, when I search for "Einsteinufer 17", it suggests "Einsteinufer, 10587, Germany", which is street name, postal code, country name. But the marker is positioned at exactly Einsteinufer 17.

commented

Searching "Einsteinufer 17", the house number is store in Address.mSubThoroughfare = 17
Tell me if you think this is not appropriate (I'm not a specialist about postal address normalization...)

And the mExtras bundle contains a display_name field, whose value is "Caféteria EN, 17, Einsteinufer, Charlottenburg, Charlottenburg-Wilmersdorf, Berlin, 10587, Allemagne"

I usually use this "display_name" extra, as building a readable address from Address object is really a nightmare.

Indeed, that works. I was looking in addressLines, assuming it contained all relevant information. Thanks!
"display_name" works a little bit weird though. When you search for "Tempelhofer Damm 148", there are three entries. Pizza, Humana and Friseur by Apo. However, no normal address for Tempelhofer Damm 148. This happens only with some addresses.