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

How to limit query to parts of highways strictly inside an area or use boundary as polygon

1

I want to perform some analyses on the cycleways in my town. To do this I exported the cycleways using the following overpass query:

[out:json];
area[name="Segrate"];
way["highway"="cycleway"](area);
(._;>;);
out;

I noticed that some of the returned cycleways are outside of the town, which is very clear if you run this query, in which I also draw the town boundaries.

It appears that if the cycleway has a part inside the area and one outside, also the outer part is included in the query response.

  • Is there a way to limit the response of the query regarding a area, to the parts of the highways strictly inside that area?
  • Alternatively, how can I use the boundaries as a polygon to limit the returned highways at the nodes that are inside?

asked 22 Jan '20, 21:29

livmilan's gravatar image

livmilan
26223
accept rate: 0%

edited 22 Jan '20, 21:30

Source code available on GitHub .