use of com.graphhopper.storage.GraphHopperStorage in project graphhopper by graphhopper.
the class PrepareRoutingSubnetworksTest method createSubnetworkTestStorage.
GraphHopperStorage createSubnetworkTestStorage() {
GraphHopperStorage g = createStorage(em);
// big network
g.edge(1, 2, 1, true);
g.edge(1, 4, 1, false);
g.edge(1, 8, 1, true);
g.edge(2, 4, 1, true);
g.edge(8, 4, 1, false);
g.edge(8, 11, 1, true);
g.edge(12, 11, 1, true);
g.edge(9, 12, 1, false);
g.edge(9, 15, 1, true);
// large network
g.edge(0, 13, 1, true);
g.edge(0, 3, 1, true);
g.edge(0, 7, 1, true);
g.edge(3, 7, 1, true);
g.edge(3, 5, 1, true);
g.edge(13, 5, 1, true);
// small network
g.edge(6, 14, 1, true);
g.edge(10, 14, 1, true);
return g;
}
use of com.graphhopper.storage.GraphHopperStorage in project graphhopper by graphhopper.
the class PrepareRoutingSubnetworksTest method createSubnetworkTestStorage2.
GraphHopperStorage createSubnetworkTestStorage2(EncodingManager em) {
GraphHopperStorage g = createStorage(em);
// large network
g.edge(0, 1, 1, true);
g.edge(1, 3, 1, true);
g.edge(0, 2, 1, true);
g.edge(2, 3, 1, true);
g.edge(3, 7, 1, true);
g.edge(7, 8, 1, true);
// connecting both but do not allow CAR!
g.edge(3, 4).setDistance(1);
// small network
g.edge(4, 5, 1, true);
g.edge(5, 6, 1, true);
g.edge(4, 6, 1, true);
return g;
}
use of com.graphhopper.storage.GraphHopperStorage in project graphhopper by graphhopper.
the class PrepareRoutingSubnetworksTest method testRemoveDeadEndUnvisitedNetworks.
@Test
public void testRemoveDeadEndUnvisitedNetworks() {
GraphHopperStorage g = createDeadEndUnvisitedNetworkStorage(em);
assertEquals(11, g.getNodes());
PrepareRoutingSubnetworks instance = new PrepareRoutingSubnetworks(g, Collections.singletonList(carFlagEncoder)).setMinOneWayNetworkSize(3);
int removed = instance.removeDeadEndUnvisitedNetworks(new PrepEdgeFilter(carFlagEncoder));
assertEquals(3, removed);
instance.markNodesRemovedIfUnreachable();
g.optimize();
assertEquals(8, g.getNodes());
}
use of com.graphhopper.storage.GraphHopperStorage in project graphhopper by graphhopper.
the class PrepareRoutingSubnetworksTest method createTarjanTestStorage.
GraphHopperStorage createTarjanTestStorage() {
GraphHopperStorage g = createStorage(em);
g.edge(1, 2, 1, false);
g.edge(2, 3, 1, false);
g.edge(3, 1, 1, false);
g.edge(4, 2, 1, false);
g.edge(4, 3, 1, false);
g.edge(4, 5, 1, true);
g.edge(5, 6, 1, false);
g.edge(6, 3, 1, false);
g.edge(6, 7, 1, true);
g.edge(8, 5, 1, false);
g.edge(8, 7, 1, false);
g.edge(8, 8, 1, false);
return g;
}
use of com.graphhopper.storage.GraphHopperStorage in project graphhopper by graphhopper.
the class AbstractEdgeElevationInterpolatorTest method setUp.
@SuppressWarnings("resource")
@Before
public void setUp() {
dataFlagEncoder = new DataFlagEncoder();
graph = new GraphHopperStorage(new RAMDirectory(), new EncodingManager(Arrays.asList(dataFlagEncoder, new FootFlagEncoder()), 8), true, new GraphExtension.NoOpExtension()).create(100);
edgeElevationInterpolator = createEdgeElevationInterpolator();
interpolatableWay = createInterpolatableWay();
normalWay = new ReaderWay(0);
normalWay.setTag("highway", "primary");
}
Aggregations