1

I'd like to

  • export just the route from an Overpass Turbo query as GeoJson, and
  • ideally just within a specified radius of a set of coordinates.

I have the query below, but this exports tags / waypoints along the way as shown. I want to use the route within leaflet (for which I know I need to Export to GeoJson).

[out:json][timeout:25];
// gather results
(
  area[name="West Midlands"];
  way[name ~"^(Bristol Road|Binley Road)"]({{bbox}});
);
// print results
out body;
>;
out geom qt;

This outputs the following map, where you can see the route and also the circles (its those I want to exclude) that may well be the nodes, but I'm not sure. They may also indicate parts of the route as I can see there are many Features defined as LineStrings. Basically, all I want is the LineStrings.

If anyone knows how to limit to a radius of a specified point for each road, that would be great, but if needs be I can use bbox.

enter image description here

0

1 Answer 1

2
+50

It seems all you have to do is to leave out recourse down >; part of your query (see https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Recurse_down_.28.3E.29). Your query would then look like this:

[out:json][timeout:25];
// gather results
(
  area[name="West Midlands"];
  way[name ~"^(Bristol Road|Binley Road)"]({{bbox}});
);
// print results
out body;
out geom qt;

On the Overpass Turbo map you will still see some markers: enter image description here

But if you drill down (zoom in) enough, they'll disappear:

enter image description here

And if you export result into GeoJSON and then drop it down into https://geojson.io/, you'll see only ways, no points/markers/nodes:

enter image description here

1
  • Perfect, thank you @TomazicM
    – Chris
    Sep 30, 2023 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.