This commit is contained in:
MadWasp79 2020-03-12 11:05:02 +02:00
parent 2ef2c741c6
commit 48af2bdd88
2 changed files with 14 additions and 0 deletions

View file

@ -29,6 +29,7 @@ import net.osmand.router.PrecalculatedRouteDirection;
import net.osmand.router.RouteCalculationProgress;
import net.osmand.router.RouteSegmentResult;
import net.osmand.router.RoutingConfiguration;
import net.osmand.router.TransportRoutePlanner;
import net.osmand.util.Algorithms;
import org.apache.commons.logging.Log;
@ -128,6 +129,9 @@ public class NativeLibrary {
return closeBinaryMapFile(filePath);
}
//todo
// public TransportRoutePlanner.TransportRouteResult[] runNativePTRouting() {}
public RouteSegmentResult[] runNativeRouting(int sx31, int sy31, int ex31, int ey31, RoutingConfiguration config,
RouteRegion[] regions, RouteCalculationProgress progress, PrecalculatedRouteDirection precalculatedRouteDirection,
boolean basemap, boolean publicTransport, boolean startTransportStop, boolean targetTransportStop) {

View file

@ -452,6 +452,14 @@ public class TransportRoutingHelper {
params.calculationProgress.isCancelled = true;
}
/**
* TODO Check if native lib available and calculate route there.
* @param params
* @return
* @throws IOException
* @throws InterruptedException
*/
private List<TransportRouteResult> calculateRouteImpl(TransportRouteCalculationParams params) throws IOException, InterruptedException {
RoutingConfiguration.Builder config = params.ctx.getRoutingConfigForMode(params.mode);
BinaryMapIndexReader[] files = params.ctx.getResourceManager().getTransportRoutingMapFiles();
@ -472,6 +480,8 @@ public class TransportRoutingHelper {
params.params.put(key, vl);
}
}
GeneralRouter prouter = config.getRouter(params.mode.getRoutingProfile());
TransportRoutingConfiguration cfg = new TransportRoutingConfiguration(prouter, params.params);
TransportRoutePlanner planner = new TransportRoutePlanner();