I would like to use GraphHopper to create my own API for routing. I have taken a look into the GraphHopper.java to create my own class. I put a OSM file into the API I get a directory with edges, nodes etc. This seems to work well.
My question is, how can I load this data, so that I can call the route-Method? I try to understand the GraphHopper.java class, but my example does not work. I try to load the graph with
GHDirectory l_dir = new GHDirectory( m_graphlocation.getAbsolutePath(), DAType.RAM);
m_graph = new LevelGraphStorage( l_dir, m_EncodingManager );
Do I need the OSM file again for routing or can I use the directory with edges and nodes only? IMHO I need a call
OSMReader l_reader = new OSMReader( l_graph, CConfiguration.getInstance().get().ExpectedCapacity).setWorkerThreads(-1).setEncodingManager(m_EncodingManager).setWayPointMaxDistance(CConfiguration.getInstance().get().WaypointMaxDistance).setEnableInstructions(false);
l_reader.doOSM2Graph(p_osm);
l_graph.optimize();
to create my graph, so is it correct to create my GraphHopperAPI class, overload the methods and on load the data with the code above and can call route?
Thanks a lot Phil