Search in sources :

Example 1 with DefaultWayPropertySetSource

use of org.opentripplanner.graph_builder.module.osm.DefaultWayPropertySetSource in project OpenTripPlanner by opentripplanner.

the class FakeGraph method buildGraphNoTransit.

/**
 * Build a graph in Columbus, OH with no transit
 */
public static Graph buildGraphNoTransit() throws UnsupportedEncodingException {
    Graph gg = new Graph();
    OpenStreetMapModule loader = new OpenStreetMapModule();
    loader.setDefaultWayPropertySetSource(new DefaultWayPropertySetSource());
    AnyFileBasedOpenStreetMapProviderImpl provider = new AnyFileBasedOpenStreetMapProviderImpl();
    File file = new File(URLDecoder.decode(FakeGraph.class.getResource("columbus.osm.pbf").getFile(), "UTF-8"));
    provider.setPath(file);
    loader.setProvider(provider);
    loader.buildGraph(gg, new HashMap<Class<?>, Object>());
    return gg;
}
Also used : Graph(org.opentripplanner.routing.graph.Graph) OpenStreetMapModule(org.opentripplanner.graph_builder.module.osm.OpenStreetMapModule) DefaultWayPropertySetSource(org.opentripplanner.graph_builder.module.osm.DefaultWayPropertySetSource) AnyFileBasedOpenStreetMapProviderImpl(org.opentripplanner.openstreetmap.impl.AnyFileBasedOpenStreetMapProviderImpl) File(java.io.File)

Aggregations

File (java.io.File)1 DefaultWayPropertySetSource (org.opentripplanner.graph_builder.module.osm.DefaultWayPropertySetSource)1 OpenStreetMapModule (org.opentripplanner.graph_builder.module.osm.OpenStreetMapModule)1 AnyFileBasedOpenStreetMapProviderImpl (org.opentripplanner.openstreetmap.impl.AnyFileBasedOpenStreetMapProviderImpl)1 Graph (org.opentripplanner.routing.graph.Graph)1