Is the layer parameter implemented in Nominatim lib-php

-1

When I go to my updated nominatum that I just installed I get the closest POI. Not the closest address.

MyIp/api/reverse?lat=40.643528333333336&lon=-73.97747333333334&zoom=18&format=jsonv2&layer=address

This is the reponse I get. And it ignores the layer=address. I use the php frontend.

{“place_id”:58379216,“licence”:“Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright",“osm_type”:“node”,“osm_id”:8641974064,“lat”:“40.6438398”,“lon”:“-73.9774496”,“place_rank”:30,“category”:“amenity”,“type”:“bicycle_rental”,“importance”:9.99999999995449e-6,“addresstype”:“amenity”,“name”:"Citi Bike - East 3rd Street & Church Avenue”,“display_name”:“Citi Bike - East 3rd Street & Church Avenue, East 3rd Street, Parkville, Windsor Terrace, Kings County, New York, 11218, United States”,“address”:{“amenity”:“Citi Bike - East 3rd Street & Church Avenue”,“road”:“East 3rd Street”,“neighbourhood”:“Windsor Terrace”,“suburb”:“Kings County”,“city”:“New York”,“state”:“New York”,“ISO3166-2-lvl4”:“US-NY”,“postcode”:“11218”,“country”:“United States”,“country_code”:“us”},“boundingbox”:[“40.6437898”,“40.6438898”,“-73.9774996”,“-73.9773996”]}

But when going on the public server it does return an address.

https://nominatim.openstreetmap.org/reverse.php?lat=40.643528333333336&lon=-73.97747333333334&zoom=18&format=jsonv2&layer=address

{“place_id”:15137129,“licence”:“Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",“osm_type”:“node”,“osm_id”:8855385577,“lat”:“40.6438293”,“lon”:“-73.9776146”,“category”:“place”,“type”:“house”,“place_rank”:30,“importance”:9.99999999995449e-06,“addresstype”:“place”,“name”:“”,“display_name”:"334, East 3rd Street, Parkville, Windsor Terrace, Kings County, New York, 11218, United States”,“address”:{“house_number”:“334”,“road”:“East 3rd Street”,“neighbourhood”:“Parkville”,“suburb”:“Kings County”,“city”:“New York”,“state”:“New York”,“ISO3166-2-lvl4”:“US-NY”,“postcode”:“11218”,“country”:“United States”,“country_code”:“us”},“boundingbox”:[“40.6437793”,“40.6438793”,“-73.9776646”,“-73.9775646”]}

I tried to add the layer=address but it did not help.

The layer parameter is only available in the Python frontend. Looks like the documentation doesn’t mark this properly. I will fix that.

1 Like

Why not just add it to the php? Or guide me in the right direction to add it.

Isn’t it only to add to the sql?

The PHP frontend is about to be deprecated and therefore in bugfixes-only mode. The layer parameter requires relatively complex changes to the SQL and will not be backported.

For more information on the deprecation plan and the roadmap for Nominatim 5, please see The Roadmap to Nominatim 5

Thanks. Is there somewhere instructions to change from the php to the python? Can you still continue to use apache?

It’s in the manual: Deploy (Python frontend) - Nominatim 4.3.2 Manual

Please be aware that the Python frontend is considered experimental until the 4.4 release. A lot of bug fixes and improvements have happened in the last two months. They are currently available in the development version only and will be released with 4.4.