This should be possible somehow, see AlternativeRoutingTemplate.isReady. You’ll need to add multiple altResponses to ghResponse ghResponse.add(altResponse); and before that fill every altResponse via the pathMerger pathMerger.doWork(altResponse, pathList, tr);
Sorry, but I can not make alternative roundtrip tracks to generate. I know to the Hopper Framwerk too little.
My goal is to generate as 5 roundtrip Gpx Tracks. But only the first track is ok, the other instruction lists are null.
Can anybody help me?
Thanks
Achim
My CodeSnipped:
PathWrapper altResponse = new PathWrapper();
altResponse.setWaypoints(wpList);
for (int i = 0; i < 5; i++) {
rsp.add(altResponse);
iL = rsp.getAll().get(i).getInstructions();
gpx = iL.createGPX("RoundTrip Graphhopper_GPX", 0l, true, false, true, true);
try {
writeUTF8TextFileContent("e:/gh/RoundTrip/GH_RoundTrip_" + i + ".gpx", gpx);
} catch (IOException e) {
e.printStackTrace();
}
}
This is not implemented as creating a round trip on its own is rather resource expensive. I made the proposal to implement this on your own using the snippets in the alternative template. But have not tried it myself. Maybe @boldtrn can help or has tried this already?
Yes this is possible and shouldn’t be much overhead. I tried if for Kurviger and it’s possible. I think it was pretty straight forward. I think I started in the round trip template and extend from there. Unfortunately, I do not have a sample ready right now.