I want to implement a solution to the following issue:
I have started a discussion there but I don't seem to be getting answers so I'm positing it here, hoping this is the right place.
As described there I want to create a
/rebuild servlet that accepts a file.
As I side effect I would like GH to be able to load the graph lazily if needed using this rebuild command.
I think a config variable should be added called
graph.lazy_load that will be
false by default.
I started changing the code to be able to facilitate for this but have ran into some issue.
1. I need to be able to get the multi-part request with a file, this requires some 3rd party dependencies, I want to get right one and with the right license, please advise.
2. GraphHopperAPI interface is too small and doesn't really help which requires the developer to cast in order to use it - not sure what to do here.
3. In order to rebuild the graph I also need to rebuild the
LocationIndex which is injected to
NearestServlet, I think a better approach will be to add the getLocationIndex method to the
GraphHopperAPI interface and remove this injection so that if I change the location index I won't need to re-inject it to
I know that the concept of a lazy loaded graph is something that might prove hard to implement or customize but I think it's a step in the right direction to make the GH server a true server (no need to shut it down, ever)