Reloading OSM-Data at runtime?

Hi all.

I am running GraphHopper embedded in my web-application.
I would really like to update the graph once every month and i wonder if this is possible without stopping my whole application.

I tried to put a routingdata.gzh file next to the graphhopper location dir and tried to do a
graphHopper.close(); graphHopper.importOrLoad();

But unfortunately I got an java.lang.IllegalStateException: graph is already successfully loaded.

Is there any way to do this or something similar? Or do I need to reinstantiate the graphhopper object?

Thx in advance.

Björn Mehner

BTW.: GraphHoppers performance is really amazing. Thanks for this cool piece of software.

Hi Björn,

can you try:

graphHopper.close();

// This will remove the graphhopper data:
graphHopper.clean();

// new object, to let garbage collector collect the old one
graphHopper = new GraphHopper()
// here do your initial config here
// ...
graphHopper.importOrLoad();