osmbonuspack icon indicating copy to clipboard operation
osmbonuspack copied to clipboard

Handle house numbers in GeocoderNominatim

Open selphiron opened this issue 3 years ago • 2 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.

selphiron avatar Jun 23 '22 15:06 selphiron

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.

MKergall avatar Jun 25 '22 12:06 MKergall

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.

selphiron avatar Jul 08 '22 07:07 selphiron