0

Hithere, i have got a list of incident in Italian motorway and the kilometer where they happened. I should find lat and long of the event. I extracted all nodes from the motorway using this script:

. [out:json][timeout:25]; //fetch area “Italy” to search in {{geocodeArea:Italy}}->.searchArea; //gather results ( // query part for: “highway=motorway and ref=A14” node["highway"="motorway"]["ref"="A14"](area.searchArea); way["highway"="motorway"]["ref"="A14"](area.searchArea); relation["highway"="motorway"]["ref"="A14"](area.searchArea); out body; >; out skel qt;

The problem is that while nodes are ordered (so i can calculate relative distance in km of a way), ways aren't. This means i can't create a path of way from the start of the street till the end.

Is there any way to order ways and calculate absolute distance in km?

Thanks for help

Francesco
  • 41
  • 7

1 Answers1

0

IIRC, in the geoJSON, youll first see the list of nodes, unordered. Then in the way object there should be a list of the ID's of every node inside the way. Those ID's are in order, so the nodes corresponding to the first and last ID's should be your start and end.