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

Get node ids with coordinates

1

Hi,

I have coordinates where there should be some nodes. Is there a way to get a node id with (lat,long). If that is not possible how to get nodes around some coordinate? I need nodes related to traffic (traffic lights etc.)

This question is marked "community wiki".

asked 03 Oct '20, 19:13

Mico95's gravatar image

Mico95
11223
accept rate: 0%

edited 03 Oct '20, 19:14


One Answer:

0

You could try using the overpass-turbo service. In this example

[out:csv(::lat, ::lon)][timeout:25];
// fetch area “Bergamo” to search in
area[name="Bergamo"][admin_level="8"]->.searchArea;
// gather results
(
  // query part for: “highway=traffic_light”
  node["highway"="traffic_signals"](area.searchArea);
);
// print results
out;

Finds all the traffic lights in Bergamo and gives an CSV like output containing lat,lon coordinates of the nodes. You could add some more info to the out:csv part (for example ::id, name, see Wiki for more examples). You have to just edit the area info. You could also use a bounding box with coordinates

answered 04 Oct '20, 10:09

Mannivu's gravatar image

Mannivu
1.1k31027
accept rate: 6%

edited 04 Oct '20, 10:10