[GraphHopper] long loading graph

Peter K peathal at yahoo.de
Wed Jul 3 13:59:31 UTC 2013


Hi Dimitry,

if you import the graph once it should be fast the next time.... ah I
see you should use:
setInMemory(true, true)
instead of
setInMemory(true, false)

E.g. to load the whole planet it takes 30sec on my server (needs a bit
more RAM though ;))

If you want instant loading (~0.1s) you can use setMemoryMapped() but
then requests could be slower and you'll have to make sure routing
happens from the same thread (or make MMapDataAccess thread safe).

Regards,
Peter.

> Hello! 
> I ran into another problem!
> Initialization of the graph is very long, about 10 minutes on my
> machine (2gb RAM, 4core).
>
>
> private static final String ghLoc =
> "/home/dmitriy/graphhopper/core/target";
> private static final String testOsm =
> "/home/dmitriy/graphhopper/russia-european-part-latest.osm.pbf";
>
> GraphHopper gh = new GraphHopper().setInMemory(true,
> false).setEncodingManager(
>                 new EncodingManager("CAR")).setCHShortcuts(true,
> true).setGraphHopperLocation(
>                 ghLoc).setOSMFile(testOsm);
>         gh.importOrLoad();
>
>
> Please, tell me.
> Сan I download a graph of RAM? Or maybe there are other ways to fast
> downloads.
> I thinkperhaps need to download maps in a different format then the .pbf?
>
>
>
> Dmitriy Puchkov




More information about the GraphHopper mailing list