@Override
public void buildGraph(Graph graph, HashMap<Class<?>, Object> extra) {
final Parser parser[] = new Parser[] {new Parser()};
GeometryFactory geometryFactory = GeometryUtils.getGeometryFactory();
EarliestArrivalSPTService earliestArrivalSPTService = new EarliestArrivalSPTService();
earliestArrivalSPTService.maxDuration = (maxDuration);
for (TransitStop ts : Iterables.filter(graph.getVertices(), TransitStop.class)) {
// Only link street linkable stops
if (!ts.isStreetLinkable())
continue;
LOG.trace("linking stop '{}' {}", ts.getStop(), ts);
// Determine the set of pathway/transfer destinations
Set<TransitStop> pathwayDestinations = new HashSet<TransitStop>();
for (Edge e : ts.getOutgoing()) {
if (e instanceof PathwayEdge || e instanceof SimpleTransfer) {
if (e.getToVertex() instanceof TransitStop) {
TransitStop to = (TransitStop) e.getToVertex();
pathwayDestinations.add(to);
}
}
}
int n = 0;
RoutingRequest routingRequest = new RoutingRequest(TraverseMode.WALK);
routingRequest.clampInitialWait = (0L);
routingRequest.setRoutingContext(graph, ts, null);
routingRequest.rctx.pathParsers = parser;
ShortestPathTree spt = earliestArrivalSPTService.getShortestPathTree(routingRequest);
if (spt != null) {
for (State state : spt.getAllStates()) {
Vertex vertex = state.getVertex();
if (ts == vertex) continue;