<div dir="ltr"><div>Hmm... not quite. Result of findNetworkEntries() still returns 0 entries.<br><br></div>Do you get a result when loading the test-osm3.xml and call findNetworkEntries()?<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2014-02-14 23:49 GMT+01:00 Peter K <span dir="ltr"><<a href="mailto:peathal@yahoo.de" target="_blank">peathal@yahoo.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Try setInMemory(true, true) instead of setInMemory(true, false)<br>
<br>
Regards,<br>
Peter.<br>
<br>
BTW: This was recently changed and now just reads setInMemory(true)<br>
<div><div class="h5"><br>
> Hi There,<br>
><br>
> I want to test an algorithm which i wrote on a very simple graph (like<br>
> the test.osm in the storage test cases).<br>
> My algorithm uses location indexes. My algo first gets all nodes<br>
> nearby by calling findNetworkEntries(lat, lon).<br>
> This usually works on my external built graph (e.g. on my smart phone)<br>
> but it does not work if i just load an OSM file with GraphHopper via<br>
> setInMemory(true, false)<br>
><br>
> My code is equivalent to the GraphHopper test case:<br>
><br>
> private static final String testOsm3 =<br>
> "./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>
> @Test<br>
> public void myAlgoTest(){<br>
> gh = new GraphHopper().setInMemory(true,<br>
> false).setEncodingManager(new EncodingManager("CAR"))<br>
><br>
> .setGraphHopperLocation(ghLoc).setOSMFile(testOsm3);<br>
> gh.importOrLoad();<br>
><br>
> myAlgoDoesFancyStuff();<br>
> }<br>
><br>
> The problem is, that it seems that it didn't create any location<br>
> indexes and findNetworkEntries() returns 0 entries.<br>
> What is the easiest way to create the location indexes that i get<br>
> findNetworkEntries() working?<br>
<br>
<br>
</div></div>_______________________________________________<br>
GraphHopper mailing list<br>
<a href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/graphhopper" target="_blank">https://lists.openstreetmap.org/listinfo/graphhopper</a><br>
</blockquote></div><br></div>