Geocoder icon indicating copy to clipboard operation
Geocoder copied to clipboard

[Nominatim] Municipality not in list of 'localityFields'

Open uwbas opened this issue 3 years ago • 2 comments

I came across some reverse geocoding results where Nominatim.php didn't return a 'locality'. In my opinion, this latlng query should have 'Purmerend' as its locality, as it's the municipal boundary:

https://nominatim.openstreetmap.org/ui/reverse.html?lat=52.50741&lon=4.93279&zoom=18 https://nominatim.openstreetmap.org/ui/details.html?osmtype=W&osmid=6593763&class=highway

Upon debugging, I noticed that inside jsonResultToLocation(), on line 209, 'municipality' was not considered a 'locality'.

$localityFields = ['city', 'town', 'village', 'hamlet'];

Is this a matter of definition?

Adding 'municipality' fixes my issue:

$localityFields = ['city', 'town', 'village', 'hamlet', 'municipality'];

uwbas avatar May 14 '22 20:05 uwbas

Hello @uwbas , That seems indeed to be a valid point! Could you submit a PR with that change ? Thanks.

jbelien avatar May 27 '22 08:05 jbelien

Done: https://github.com/geocoder-php/Geocoder/pull/1156

uwbas avatar May 28 '22 11:05 uwbas