Skip to content

Instantly share code, notes, and snippets.

@Nate-Wessel
Created September 10, 2019 18:52
Show Gist options
  • Save Nate-Wessel/e7d72da7c7c12e00a472b41537334f8d to your computer and use it in GitHub Desktop.
Save Nate-Wessel/e7d72da7c7c12e00a472b41537334f8d to your computer and use it in GitHub Desktop.
overpass query finding parts of split/divided highways - very slow query at present
// identify 3-way intersections of identically named ways
// thus to identify/located divided/split roadways
// get nodes of all named ways
way[highway][name]({{bbox}})->.namedways;
// foreach way
foreach .namedways -> .thisway(
node(w.thisway)->.childnodes;
foreach.childnodes -> .thisnode(
// select named parent ways of this node with the same name
way.namedways(bn.thisnode)(if: t["name"] == thisway.u(t["name"]));
// count how many there are
if( count(ways) >= 3){
( node.thisnode; .result; ) -> .result;
};
); // foreach child node
); // foreach named way
.result out skel qt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment