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

Ordering of nodes for routing algorithm

0

Hi guys,

I've been writing a little Overpass QL script that grabs the way data base on a route of nodes. I'm doing this by comparing the ways a node is part of with those of the previous node. This means it's vital that my foreach loop iterates over the nodes in the way that I'm providing them. At the moment it's automatically reordering all nodes by if before starting the loop. Any way you guys can see around this? Any help would be greatly appreciated!

/ run to see input nodes node(id:360043069,2864527555,360043065); out; /

node(id:2864527555,360043065) -> .nodes; node(id:360043069); wayhighway -> .lastnodeways;

foreach .nodes -> .thisnode ( wayhighway -> .thisnodeways; ( way.thisnodeways.lastnodeways; .confirmedways; ) -> .confirmedways; .thisnodeways -> .lastnodeways; );

.confirmedways out geom;

This question is marked "community wiki".

asked 22 Aug '18, 18:05

gillesgerlo's gravatar image

gillesgerlo
11112
accept rate: 0%

Source code available on GitHub .