This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Getting closest street/road given latitude longitude coordinate

0

I've set up my own instance of Nominatim. Trying to to create a reverse geocoding query for the closest road/street to a coordinate but not sure how to. I've used the "around" query when using the OSM API but unable to do so on my own instance of Nominatim.

asked 22 Feb '19, 08:15

hellu's gravatar image

hellu
31226
accept rate: 0%


One Answer:

2

Use /reverse which on our machine might be /nominatim/reverse or /nominatim/reverse.php and set the lat and lon parameters. Setting zoom to 16 will skip building and return streets. http://nominatim.org/release-docs/latest/api/Reverse/

answered 22 Feb '19, 11:39

mtmail's gravatar image

mtmail
4.8k1574
accept rate: 27%

will try that thank you!

(27 Feb '19, 03:02) hellu

a follow up, im only looking for highway of type 'roads' and 'link roads' but this returns me 'pedestrian'. can I specify highway type?

(27 Feb '19, 04:08) hellu
1

highway=roads "If you do know the road type, do not use this value, instead use one of the more specific highway=* values." https://wiki.openstreetmap.org/wiki/Key:highway Nominatim doesn't have tag filters in the reverse search. In the forwards search it would also only be able to filter one road type, not many.

(27 Feb '19, 10:51) mtmail

If you only care about specific highway tags, just filter out everything else before loading the data in to nominatim.

(27 Feb '19, 16:46) alester

Source code available on GitHub .