geocoder icon indicating copy to clipboard operation
geocoder copied to clipboard

Support for Nominatim lookup endpoint

Open kalsan opened this issue 1 year ago • 4 comments

Thank you very much for providing this aweseome gem!

If I saw correctly, all Nominatim lookups go to the /search endpoint. While this covers most use cases, some are missing, such as looking up an osm_id, which is done through the /lookup endpoint. For example:

curl 'http://localhost:8080/lookup?osm_ids=R1702265&format=jsonv2&addressdetails=1'
[{"place_id":104828,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright","osm_type":"relation","osm_id":1702265,"boundingbox":["47.3991502","47.4171175","8.5260623","8.5587967"],"lat":"47.4104211","lon":"8.5445851","display_name":"Oerlikon, Kreis 11, Zürich, Bezirk Zürich, Zürich, Schweiz/Suisse/Svizzera/Svizra","place_rank":20,"category":"boundary","type":"administrative","importance":0.14667666666666662,"address":{"suburb":"Oerlikon","city":"Zürich","county":"Bezirk Zürich","state":"Zürich","ISO3166-2-lvl4":"CH-ZH","country":"Schweiz/Suisse/Svizzera/Svizra","country_code":"ch"}}]

Would you be interested in supporting the lookup endpoint as well?

Best, Kalsan

kalsan avatar Nov 12 '24 12:11 kalsan

Yes you are correct, and yes I'm interested in adding support for OSM ID lookups. Thanks for noting this. It could be implemented similar to how some lookups detect a forward or reverse geocoding query and adjust the URL, using a base_query_url method. See the Here lookup, for example.

alexreisner avatar Nov 12 '24 14:11 alexreisner

Thank you for your quick answer! Do you require assistance with this? I might be able to help next year, given that I'll have more time then than I do have now.

kalsan avatar Nov 12 '24 14:11 kalsan

Yes, definitely open to a pull request. No rush.

alexreisner avatar Nov 12 '24 14:11 alexreisner

Thank you :-) will contact you somewhere in winter/spring 2025 hopefully!

Have a nice day!

kalsan avatar Nov 12 '24 14:11 kalsan