MKergall / osmbonuspack

A third-party library of (very) useful additional objects for osmdroid
GNU Lesser General Public License v3.0
606 stars 205 forks source link

Handle house numbers in GeocoderNominatim #424

Open selphiron opened 2 years ago

selphiron commented 2 years ago

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.

MKergall commented 2 years ago

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.

selphiron commented 2 years ago

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.