TransitStationStop fromVertex = stopNodes.get(transfer.fromStopId);
TransitStationStop toVertex = stopNodes.get(transfer.toStopId);
double distance = distanceLibrary.distance(fromVertex.getCoordinate(),
toVertex.getCoordinate());
TransferEdge edge = null;
switch (transfer.seconds) {
case StopTransfer.FORBIDDEN_TRANSFER:
case StopTransfer.UNKNOWN_TRANSFER:
break;
case StopTransfer.PREFERRED_TRANSFER:
case StopTransfer.TIMED_TRANSFER:
edge = new TransferEdge(fromVertex,
toVertex, distance);
break;
default:
edge = new TransferEdge(fromVertex,
toVertex, distance, transfer.seconds);
}
if (edge != null) {
LineString geometry = GeometryUtils.getGeometryFactory().createLineString(new Coordinate[] {
fromVertex.getCoordinate(),
toVertex.getCoordinate() });
edge.setGeometry(geometry);
}
}
}