Skip to content
Browse files

Merge pull request #954 from benmoovit/master

fix #947
  • Loading branch information...
2 parents e9663f8 + a5e3066 commit 0695d46e36e81c96ffc13f56dcee75bca67b4596 @novalis novalis committed
View
14 ...ph-builder/src/main/java/org/opentripplanner/graph_builder/impl/PruneFloatingIslands.java
@@ -50,17 +50,21 @@
}
public List<String> getPrerequisites() {
+// return Arrays.asList("streets","linking");
return Arrays.asList("streets");
}
@Override
public void buildGraph(Graph graph, HashMap<Class<?>, Object> extra) {
- if(graph.getService(StreetVertexIndexService.class) == null) {
- //TODO:log and throw error
- }
+ _log.warn("Pruning isolated islands ...");
StreetUtils.pruneFloatingIslands(graph, maxIslandSize, islandWithStopMaxSize, createLogger());
- //reconnect stops on small islands (that removed)
- transitToStreetNetwork.buildGraph(graph,extra);
+ if(transitToStreetNetwork == null){
+ _log.warn("Could not reconnect stop, TransitToStreetNetworkGraphBuilder was not provided");
+ }else{
+ //reconnect stops on small islands (that removed)
+ transitToStreetNetwork.buildGraph(graph,extra);
+ }
+ _log.warn("Done pruning isolated islands");
}
@Override
View
8 opentripplanner-routing/src/main/java/org/opentripplanner/common/StreetUtils.java
@@ -15,10 +15,7 @@
import java.util.*;
-import com.vividsolutions.jts.algorithm.ConvexHull;
-import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
-import com.vividsolutions.jts.geom.GeometryFactory;
import org.opentripplanner.common.geometry.Subgraph;
import org.opentripplanner.gbannotation.GraphConnectivity;
import org.opentripplanner.routing.core.RoutingRequest;
@@ -32,11 +29,8 @@
import org.opentripplanner.routing.graph.Edge;
import org.opentripplanner.routing.graph.Graph;
import org.opentripplanner.routing.graph.Vertex;
-import org.opentripplanner.routing.services.StreetVertexIndexService;
-import org.opentripplanner.routing.services.TransitIndexService;
import org.opentripplanner.routing.vertextype.StreetVertex;
-import org.opentripplanner.routing.vertextype.TransitStop;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,8 +42,6 @@
public static void pruneFloatingIslands(Graph graph, int maxIslandSize, int islandWithStopMaxSize, String islandLogName) {
_log.debug("pruning");
- StreetVertexIndexService streetVertexIndex = graph.getService(StreetVertexIndexService.class);
-
Logger islandLog = null;
if(islandLogName != null){
islandLog = LoggerFactory.getLogger(islandLogName);

0 comments on commit 0695d46

Please sign in to comment.
Something went wrong with that request. Please try again.