I'm using OverpassQL to find a "way" that passes through two consecutive nodes. Here's my query:
[out:json];
(
way(around:1,x1, y1);
-
(
way(around:1, x1, y1);
-
way(around:1, x2, y2);
);
);
out geom;
I thought of making the intersection between the ways around two points. Since the intersection operation does not exist in OverpassQL I used the subtraction. I'm trying to determine if this query will always return a unique "way" that intersects both of these points. If not, can anyone provide a counterexample where more than one "way" would be returned?
To get the intersection, you can simply combine multiple filters in one query statement:
If you need more control which ways to use for an intersection, you can also have different queries, and intersect the results in a separate step:
No, this will not get you a unique way. Think about a roundabout which has been split into two ways. If you query with both lat/lon values, where the two ways connect, the query will return both ways.
Example returning two ways: