double lengthIn = e1.getDistance() * lengthRatioIn;
double lengthOut = e1.getDistance() * (1 - lengthRatioIn);
// Split each edge independently. If a only one splitter vertex is used, routing may take
// shortcuts thought the splitter vertex to avoid turn penalties.
IntersectionVertex e1midpoint = new IntersectionVertex(linker.graph, "split 1 at " + label, midCoord.x, midCoord.y, name);
// We are replacing two edges with four edges
// Note: Always enable elevation. This should not be a big waste of memory.
StreetWithElevationEdge forward1 = new StreetWithElevationEdge(e1v1, e1midpoint, forward1Geom, name, lengthIn,
e1.getPermission(), e1.isBack());
StreetWithElevationEdge forward2 = new StreetWithElevationEdge(e1midpoint, e1v2, forward2Geom, name, lengthOut,
e1.getPermission(), e1.isBack());
if (e1 instanceof AreaEdge) {
((AreaEdge) e1).getArea().addVertex(e1midpoint, linker.graph);
}
addEdges(forward1, forward2);
StreetWithElevationEdge backward1 = null;
StreetWithElevationEdge backward2 = null;
IntersectionVertex e2midpoint = null;
if (e2 != null) {
e2midpoint = new IntersectionVertex(linker.graph, "split 2 at " + label, midCoord.x, midCoord.y, name);
backward1 = new StreetWithElevationEdge(e2v1, e2midpoint, backGeometryPair.first,
name, lengthOut, e2.getPermission(), e2.isBack());
backward2 = new StreetWithElevationEdge(e2midpoint, e2v2, backGeometryPair.second,
name, lengthIn, e2.getPermission(), e2.isBack());
if (e2 instanceof AreaEdge) {