org.opentripplanner.graph_builder.module.stopsAlerts.UnconnectedStop Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.graph_builder.module.stopsAlerts;
import org.opentripplanner.routing.edgetype.PathwayEdge;
import org.opentripplanner.routing.edgetype.StreetTransitLink;
import org.opentripplanner.routing.graph.Edge;
import org.opentripplanner.routing.graph.Graph;
import org.opentripplanner.routing.vertextype.TransitStopVertex;
import java.util.List;
public class UnconnectedStop extends AbstractStopTester {
/**
* @return true if the stop is not connected to any street
*/
@Override
public boolean fulfillDemands(TransitStopVertex ts, Graph graph) {
List outgoingStreets = ts.getOutgoingStreetEdges();
boolean hasStreetLink = false;
for(Edge e:ts.getIncoming()){
if(e instanceof StreetTransitLink || e instanceof PathwayEdge){
hasStreetLink = true;
break;
}
}
if(!hasStreetLink){
//TODO: see what if there is incoming and not outgoing
for(Edge e:ts.getOutgoing()){
if(e instanceof StreetTransitLink){
hasStreetLink = true;
break;
}
}
}
return !(hasStreetLink || (outgoingStreets.size() > 0));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy