Closed xivk closed 6 years ago
Following the suggestion, is there anyway to get an edge (start, end and coordinate) using its (long)directedEdgeid? I could find the one for undirected one but need to retrive the directed one. cheers
Yes, you can just do
if directededgeid < 0: edgeid = -directededgeid -1 else edgeid = directededgeid - 1
A directededgeid of '0' makes no sense.
This is exactly what this issue is trying to fix, it's not very clear at the moment what's what. But it's a pretty big breaking change so it will have to wait for 2.0.
This struct has been added, closing this issue until work is started on 2.0. Added this to the roadmap:
http://docs.itinero.tech/docs/itinero/development/index.html
Introduce a struct that represents a directed edge id.
Motivation:
Now there are two types:
The first one is used to refer to an edge internally, the second one is use in path descriptions and to provide direction whenever referring to an edge.
The relation between an _edgeid_and directededgeid:
Currently it's possible to use an edgeid as a directededgeid without any issue because of the implicit conversion between uint and long. This can cause strange errors and routes that make no sense without Itinero being able to catch these mistakes.
Proposed changes:
Introduce a struct that represents a directededgeid with helper methods to convert from/to edgeid using a direction flag.