Skip to content

Commit

Permalink
Revert "Remove disconnected subnetworks _after_ adding transit." sinc…
Browse files Browse the repository at this point in the history
…e the root problem is now fixed. #1311 #1313

This reverts commit 24bf137

Signed-off-by: Michael Zilske <michael.zilske@tu-berlin.de>
  • Loading branch information
michaz committed Mar 25, 2018
1 parent f2be2b6 commit f32db38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Expand Up @@ -323,6 +323,8 @@ public static GraphHopperStorage createOrLoad(GHDirectory directory, EncodingMan
throw new RuntimeException(e);
}
}
new PrepareRoutingSubnetworks(graphHopperStorage, Collections.singletonList(ptFlagEncoder)).doWork();

int id = 0;
for (String gtfsFile : gtfsFiles) {
try {
Expand All @@ -343,10 +345,6 @@ public static GraphHopperStorage createOrLoad(GHDirectory directory, EncodingMan
for (int i = 0; i < id; i++) {
new GtfsReader("gtfs_" + i, graphHopperStorage, gtfsStorage, ptFlagEncoder, walkNetworkIndex).readGraph();
}
// This currently needs to happen as the last step, since we cannot add new nodes after this step.
// This means that disconnected parts of the transit network are removed as well.
// If we don't want that, we need to think of something.
new PrepareRoutingSubnetworks(graphHopperStorage, Collections.singletonList(ptFlagEncoder)).doWork();
graphHopperStorage.flush();
return graphHopperStorage;
}
Expand Down
10 changes: 2 additions & 8 deletions reader-gtfs/src/test/java/com/graphhopper/GraphHopperGtfsIT.java
Expand Up @@ -28,7 +28,6 @@
import com.graphhopper.util.Helper;
import com.graphhopper.util.Instruction;
import com.graphhopper.util.Parameters;
import com.graphhopper.util.exceptions.PointNotFoundException;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
Expand Down Expand Up @@ -447,13 +446,8 @@ private void assertNoRoute(GraphHopperGtfs graphHopper, double from_lat, double
ghRequest.getHints().put(Parameters.PT.EARLIEST_DEPARTURE_TIME, LocalDateTime.of(2007,1,1,0,0).atZone(zoneId).toInstant());
ghRequest.getHints().put(Parameters.PT.MAX_WALK_DISTANCE_PER_LEG, 30);

try {
GHResponse route = graphHopper.route(ghRequest);
Assert.assertTrue(route.getAll().isEmpty());
} catch (PointNotFoundException e) {
// This is also acceptable. Whether disconnected stops are required to be indexed or not
// may change.
}
GHResponse route = graphHopper.route(ghRequest);
Assert.assertTrue(route.getAll().isEmpty());
}

@Test
Expand Down

0 comments on commit f32db38

Please sign in to comment.