file formatting
This commit is contained in:
parent
6605e1d8d2
commit
a74c1a2549
1 changed files with 80 additions and 109 deletions
|
@ -82,10 +82,13 @@ public class RouteProvider {
|
|||
// ORS("OpenRouteService"), // disable ors due to no public rest service (testing2015 doesn't seem stable)
|
||||
OSRM("OSRM (only car)"),
|
||||
BROUTER("BRouter (offline)"), STRAIGHT("Straight line");
|
||||
|
||||
private final String name;
|
||||
|
||||
private RouteService(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
@ -175,7 +178,6 @@ public class RouteProvider {
|
|||
return res;
|
||||
}
|
||||
|
||||
|
||||
public void setReverse(boolean reverse) {
|
||||
this.reverse = reverse;
|
||||
}
|
||||
|
@ -189,7 +191,6 @@ public class RouteProvider {
|
|||
copy.prepareGPXFile(this);
|
||||
return copy.getPoints();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class GPXRouteParams {
|
||||
|
@ -269,7 +270,6 @@ public class RouteProvider {
|
|||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static Location createLocation(WptPt pt){
|
||||
|
@ -287,9 +287,6 @@ public class RouteProvider {
|
|||
return loc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public RouteCalculationResult calculateRouteImpl(RouteCalculationParams params){
|
||||
long time = System.currentTimeMillis();
|
||||
if (params.start != null && params.end != null) {
|
||||
|
@ -382,9 +379,6 @@ public class RouteProvider {
|
|||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private RouteCalculationResult calculateOsmAndRouteWithIntermediatePoints(RouteCalculationParams routeParams,
|
||||
final List<Location> intermediates) throws IOException {
|
||||
RouteCalculationParams rp = new RouteCalculationParams();
|
||||
|
@ -417,9 +411,6 @@ public class RouteProvider {
|
|||
return findVectorMapsRoute(rp, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private List<RouteDirectionInfo> calcDirections(int[] startI, int[] endI,
|
||||
final List<RouteDirectionInfo> inputDirections) {
|
||||
List<RouteDirectionInfo> directions = new ArrayList<RouteDirectionInfo>();
|
||||
|
@ -451,9 +442,6 @@ public class RouteProvider {
|
|||
return directions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void insertFinalSegment(RouteCalculationParams routeParams, List<Location> points,
|
||||
List<RouteDirectionInfo> directions, boolean calculateOsmAndRouteParts) {
|
||||
if(points.size() > 0) {
|
||||
|
@ -578,9 +566,6 @@ public class RouteProvider {
|
|||
return ctx.getString(resId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected RouteCalculationResult findYOURSRoute(RouteCalculationParams params) throws MalformedURLException, IOException,
|
||||
ParserConfigurationException, FactoryConfigurationError, SAXException {
|
||||
List<Location> res = new ArrayList<Location>();
|
||||
|
@ -728,9 +713,6 @@ public class RouteProvider {
|
|||
return calcOfflineRouteImpl(params, router, ctx, complexCtx, st, en, inters, precalculated);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private RoutingConfiguration initOsmAndRoutingConfig(Builder config, final RouteCalculationParams params, OsmandSettings settings,
|
||||
GeneralRouter generalRouter) throws IOException, FileNotFoundException {
|
||||
GeneralRouterProfile p ;
|
||||
|
@ -775,9 +757,6 @@ public class RouteProvider {
|
|||
return cf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private RouteCalculationResult calcOfflineRouteImpl(final RouteCalculationParams params,
|
||||
RoutePlannerFrontEnd router, RoutingContext ctx, RoutingContext complexCtx, LatLon st, LatLon en,
|
||||
List<LatLon> inters, PrecalculatedRouteDirection precalculated) throws IOException {
|
||||
|
@ -840,9 +819,6 @@ public class RouteProvider {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private RouteCalculationResult applicationModeNotSupported(RouteCalculationParams params) {
|
||||
return new RouteCalculationResult("Application mode '"+ params.mode.toHumanStringCtx(params.ctx)+ "'is not supported.");
|
||||
}
|
||||
|
@ -855,8 +831,6 @@ public class RouteProvider {
|
|||
return new RouteCalculationResult("Empty result");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static List<RouteDirectionInfo> parseOsmAndGPXRoute(List<Location> res, GPXFile gpxFile, boolean osmandRouter,
|
||||
boolean leftSide, float defSpeed) {
|
||||
List<RouteDirectionInfo> directions = null;
|
||||
|
@ -1156,11 +1130,11 @@ public class RouteProvider {
|
|||
return gpx;
|
||||
}
|
||||
|
||||
|
||||
private void appendOSRMLoc(StringBuilder uri, LatLon il) {
|
||||
uri.append("&loc=").append(String.valueOf(il.getLatitude()));
|
||||
uri.append(",").append(String.valueOf(il.getLongitude()));
|
||||
}
|
||||
|
||||
protected RouteCalculationResult findOSRMRoute(RouteCalculationParams params)
|
||||
throws MalformedURLException, IOException, JSONException {
|
||||
// https://router.project-osrm.org/viaroute?loc=52.28,4.83&loc=52.35,4.95&alt=false&output=gpx
|
||||
|
@ -1214,7 +1188,6 @@ public class RouteProvider {
|
|||
return new RouteCalculationResult(res, null, params, null);
|
||||
}
|
||||
|
||||
|
||||
protected RouteCalculationResult findBROUTERRoute(RouteCalculationParams params) throws MalformedURLException,
|
||||
IOException, ParserConfigurationException, FactoryConfigurationError, SAXException {
|
||||
int numpoints = 2 + (params.intermediates != null ? params.intermediates.size() : 0);
|
||||
|
@ -1251,7 +1224,6 @@ public class RouteProvider {
|
|||
OsmandApplication ctx = (OsmandApplication) params.ctx;
|
||||
List<Location> res = new ArrayList<Location>();
|
||||
|
||||
|
||||
IBRouterService brouterService = ctx.getBRouterService();
|
||||
if (brouterService == null) {
|
||||
return new RouteCalculationResult("BRouter service is not available");
|
||||
|
@ -1329,5 +1301,4 @@ public class RouteProvider {
|
|||
dots.add(location);
|
||||
return new RouteCalculationResult(dots, null, params, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue