GlobalPosition edgeEndGlobal = edge.getToNode().getPosition();
Point2D edgeStartLocal = edgeStartGlobal.projected();
Point2D edgeEndLocal = edgeEndGlobal.projected();
double globalLenght = edgeEndGlobal.distanceTo(edgeStartGlobal);
double localLength = Point2DUtils.distance(edgeEndLocal, edgeStartLocal);
double distanceToStart = Point2DUtils.distance(position, edgeStartLocal);
double realtiveEdgePosition = distanceToStart / localLength;
if (realtiveEdgePosition < 0.0d || realtiveEdgePosition > 1.0d) {