<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Hi,<div><br></div><div>I am using your library in my master thesis. In my usage scenario I have already a String with OSM content and I would like to apply a routing algorithm on it.</div>
<div><br></div><div>
What is the easiest way to do it?</div><div><br></div><div>Now I doing this:<br><br><div>OSMInputFile file = new OSMInputFile(xmlcontent);</div><div>OSMReader k;</div><div>GraphHopper instance = new GraphHopper() {</div>
<div><span style="white-space:pre-wrap"> </span>@Override</div><div><span style="white-space:pre-wrap"> </span>protected DataReader createReader(GraphStorage tmpGraph) {</div><div><span style="white-space:pre-wrap"> </span>return initOSMReader(new StringOSMReader(tmpGraph, xmlcontent));</div>
<div><span style="white-space:pre-wrap"> </span>}</div><div>};</div><div>instance.setInMemory(true);</div><div>EncodingManager manager = new EncodingManager("foot");</div><div>instance.setEncodingManager(manager);</div>
<div>instance.setCHShortcuts("shortest");</div><div>instance.setOSMFile(somevalidpathtoFile);</div><div>instance.setGraphHopperLocation(somevalidpathtoFile2);</div><div>instance.importOrLoad();</div><div><br></div>
<div>int allnodes = instance.getGraph().getNodes();</div><div>GHRequest request = new GHRequest(placesList);<br></div><div>request.setVehicle("foot");</div><div>GHResponse ph = instance.route(request);</div><div>
assertTrue(ph.isFound());</div></div><div><br></div><div><br></div><div>May be there is a more elegant solution, then overiding the method?</div><div><br></div><div>Best Regards</div><span class="HOEnZb"><font color="#888888"><div>
Konstantin</div></font></span></div>
</div><br></div>