use of org.opentripplanner.graph_builder.DataImportIssueStore in project OpenTripPlanner by opentripplanner.
the class TestUnconnectedAreas method testUnconnectedParkAndRide.
/**
* The P+R.osm.gz file contains 2 park and ride, one a single way area and the other a
* multipolygon with a hole. Both are not linked to any street, apart from three roads that
* crosses the P+R with w/o common nodes.
*
* This test just make sure we correctly link those P+R with the street network by creating
* virtual nodes at the place where the street intersects the P+R areas. See ticket #1562.
*/
@Test
public void testUnconnectedParkAndRide() throws Exception {
Graph gg = new Graph();
DataImportIssueStore issueStore = new DataImportIssueStore(true);
OpenStreetMapModule loader = new OpenStreetMapModule();
loader.setDefaultWayPropertySetSource(new DefaultWayPropertySetSource());
File file = new File(getClass().getResource("P+R.osm.pbf").getFile());
BinaryOpenStreetMapProvider provider = new BinaryOpenStreetMapProvider(file, false);
loader.setProvider(provider);
loader.buildGraph(gg, new HashMap<Class<?>, Object>(), issueStore);
assertEquals(1, issueStore.getIssues().size());
int nParkAndRide = 0;
int nParkAndRideLink = 0;
for (Vertex v : gg.getVertices()) {
if (v instanceof ParkAndRideVertex) {
nParkAndRide++;
}
}
for (Edge e : gg.getEdges()) {
if (e instanceof ParkAndRideLinkEdge) {
nParkAndRideLink++;
}
}
assertEquals(2, nParkAndRide);
assertEquals(10, nParkAndRideLink);
}
use of org.opentripplanner.graph_builder.DataImportIssueStore in project OpenTripPlanner by opentripplanner.
the class BikeRentalUpdater method setup.
@Override
public void setup(Graph graph) {
// Creation of network linker library will not modify the graph
linker = new SimpleStreetSplitter(graph, new DataImportIssueStore(false));
// Adding a bike rental station service needs a graph writer runnable
service = graph.getService(BikeRentalStationService.class, true);
}
Aggregations