Support addressdetails param in /reverse search #3886
Replies: 2 comments 2 replies
-
|
For your own Nominatim installation you can customize the output, see https://nominatim.org/release-docs/latest/customize/Result-Formatting/ I'd say that's similar to the "Enclosing Features" section on Maybe on the OSM website (https://github.com/openstreetmap/openstreetmap-website/) that logic could be reused? If it required two API calls I'd add a button for the user to explicitly press, e.g. "show all enclosing features". |
Beta Was this translation helpful? Give feedback.
-
|
Interesting proposal. As @mtmail says, a custom formatter would be the way to go here. You could define a completely new format, for example called "osm-core-info", which would be for the specific use of the osm.org website. With that you could return the result information needed specifically to lay out the results on osm.org as required. Would also be cool if it includes the necessary information to solve openstreetmap/openstreetmap-website#6079 If you want to go down this road, you can make a PR that adds such a format. Once it looks reasonable, we can deploy this for test purposes on the production servers, so that you can make a PR against openstreetmap-website. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, when using the /reverse endpoint to perform a reverse geocoding query, we can only get a simple formatted address, e.g., "Tunnel Avenue, Greenwich Peninsula, Royal Borough of Greenwich, Greater London, England, SE10 0QH, United Kingdom".
However, if we want to obtain detailed information for each administrative level (country, state, city, neighborhood, etc.), we have to first call /reverse to get the OSM ID and then call /details separately.
I believe there is a valid use case for obtaining detailed administrative-level information directly from coordinates. Therefore, I propose adding support for the addressdetails parameter to the /reverse endpoint, so that it can return detailed address components just like the /details endpoint.
This would streamline workflows and reduce the need for multiple API calls.
A possible application:
I want to create a feature (either on the OSM website or as a browser extension) where users can click on any part of an address and open the corresponding administrative object in OSM.
Below is what I want to show in /reverse API when addressdetails=1

Beta Was this translation helpful? Give feedback.
All reactions