use of net.osmand.router.RouteResultPreparation in project OsmAnd-tools by osmandapp.
the class OsmAndMapsService method approximate.
private List<RouteSegmentResult> approximate(RoutingContext ctx, RoutePlannerFrontEnd router, Map<String, Object> props, List<LatLon> polyline) throws IOException, InterruptedException {
GpxRouteApproximation gctx = new GpxRouteApproximation(ctx);
List<GpxPoint> gpxPoints = router.generateGpxPoints(gctx, new LocationsHolder(polyline));
GpxRouteApproximation r = router.searchGpxRoute(gctx, gpxPoints, null);
List<RouteSegmentResult> route = new ArrayList<RouteSegmentResult>();
for (GpxPoint pnt : r.finalPoints) {
route.addAll(pnt.routeToTarget);
}
if (router.useNativeApproximation) {
RouteResultPreparation preparation = new RouteResultPreparation();
// preparation.prepareTurnResults(gctx.ctx, route);
preparation.addTurnInfoDescriptions(route);
}
putResultProps(ctx, route, props);
return route;
}
Aggregations