<div dir="ltr"><div><div><div><div><div><div>Hi There,<br><br></div>I want to test an algorithm which i wrote on a very simple graph (like the test.osm in the storage test cases).<br></div>My algorithm uses location indexes. My algo first gets all nodes nearby by calling findNetworkEntries(lat, lon).<br>
</div>This usually works on my external built graph (e.g. on my smart phone) but it does not work if i just load an OSM file with GraphHopper via setInMemory(true, false)<br><br></div>My code is equivalent to the GraphHopper test case:<br>
<br>private static final String testOsm3 = "./src/test/resources/com/graphhopper/reader/test-osm3.xml";<br>private static final String ghLoc = "./target/tmp/ghosm";<br>private GraphHopper gh;<br><br>@Before<br>
public void setUp(){<br> Helper.removeDir(new File(ghLoc));<br>}<br><br>@After<br>public void tearDown(){<br> gh.close();<br> Helper.removeDir(new File(ghLoc));<br>}<br><br></div>@Test<br></div>public void myAlgoTest(){<br>
<div><div> gh = new GraphHopper().setInMemory(true, false).setEncodingManager(new EncodingManager("CAR"))<br> .setGraphHopperLocation(ghLoc).setOSMFile(testOsm3);<br> gh.importOrLoad();<br>
<br></div><div> myAlgoDoesFancyStuff();<br></div><div>}<br><br></div><div>The problem is, that it seems that it didn't create any location indexes and findNetworkEntries() returns 0 entries.<br></div><div>What is the easiest way to create the location indexes that i get findNetworkEntries() working?<br>
<br></div><div>Thanks in advance,<br></div><div>Andreas<br></div><div><br></div></div></div>