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

How to get coordinates along a specific road?

0

I am trying to get a list of coordinates for a specified road by inputting the road name/number. Is there a way to do that? Thanks!

asked 30 Jan '21, 09:43

edenmaylie's gravatar image

edenmaylie
11112
accept rate: 0%


One Answer:

0

As an example with overpass-turbo:

[out:json][timeout:25];
// gather results
(
  // query with id
  way(id:200820110)({{bbox}});
);
// print results
out body;
>;
out skel qt;

or

[out:json][timeout:25];
// gather results
(
  // query with name
  way[name='Schmidtsdrift Road']({{bbox}});
);
// print results
out body;
>;
out skel qt;

should give you what you want. Alternately after //print results you could have out geom; but as far as I am aware the output will not be 100% compatible with the normal OSM XML format.

answered 27 Feb '21, 10:49

arkriger's gravatar image

arkriger
155131421
accept rate: 0%

Source code available on GitHub .