@Test public void processIsochronesRequestOptionsTest() throws Exception { IsochronesRequestHandler isochronesRequestHandler = new IsochronesRequestHandler(); RouteSearchParameters routeSearchParameters = isochronesRequestHandler.constructRouteSearchParameters(request); Assert.assertEquals(RoutingProfileType.DRIVING_CAR, routeSearchParameters.getProfileType()); Assert.assertEquals(WeightingMethod.FASTEST, routeSearchParameters.getWeightingMethod()); Assert.assertFalse(routeSearchParameters.getConsiderTurnRestrictions()); checkPolygon(routeSearchParameters.getAvoidAreas(), geoJsonPolygon); Assert.assertEquals(16, routeSearchParameters.getAvoidFeatureTypes()); Assert.assertEquals(0, routeSearchParameters.getVehicleType()); Assert.assertFalse(routeSearchParameters.getFlexibleMode()); Assert.assertEquals(BordersExtractor.Avoid.CONTROLLED, routeSearchParameters.getAvoidBorders()); Assert.assertNull(routeSearchParameters.getBearings()); Assert.assertNull(routeSearchParameters.getMaximumRadiuses()); Assert.assertNull(routeSearchParameters.getOptions()); Assert.assertEquals(115, routeSearchParameters.getAvoidCountries()[0]); ProfileWeightingCollection weightings = routeSearchParameters.getProfileParameters().getWeightings(); ProfileWeighting weighting; Iterator<ProfileWeighting> iter = weightings.getIterator(); while (iter.hasNext() && (weighting = iter.next()) != null) { if (weighting.getName().equals("green")) { Assert.assertEquals(0.5, weighting.getParameters().getDouble("factor", -1), 0); } if (weighting.getName().equals("quiet")) { Assert.assertEquals(0.2, weighting.getParameters().getDouble("factor", -1), 0); } if (weighting.getName().equals("steepness_difficulty")) { Assert.assertEquals(3, weighting.getParameters().getInt("level", -1), 0); } } }
RouteSearchParameters processIsochronesRequestOptions(IsochronesRequest request, RouteSearchParameters parameters) throws StatusCodeException { RouteRequestOptions options = request.getIsochronesOptions(); parameters = new RouteRequestHandler().processRequestOptions(options, parameters); if (options.hasProfileParams()) parameters.setProfileParams(convertParameters(options, parameters.getProfileType())); return parameters; }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters processIsochronesRequestOptions(IsochronesRequest request, RouteSearchParameters parameters) throws StatusCodeException { RouteRequestOptions options = request.getIsochronesOptions(); parameters = new RouteRequestHandler().processRequestOptions(options, parameters); if (options.hasProfileParams()) parameters.setProfileParams(convertParameters(options, parameters.getProfileType())); return parameters; } }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters processIsochronesRequestOptions(IsochronesRequest request, RouteSearchParameters parameters) throws StatusCodeException { RouteRequestOptions options = request.getIsochronesOptions(); parameters = new RouteRequestHandler().processRequestOptions(options, parameters); if (options.hasProfileParams()) parameters.setProfileParams(convertParameters(options, parameters.getProfileType())); return parameters; } IsochronesRequestHandler(); }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters processIsochronesRequestOptions(IsochronesRequest request, RouteSearchParameters parameters) throws StatusCodeException { RouteRequestOptions options = request.getIsochronesOptions(); parameters = new RouteRequestHandler().processRequestOptions(options, parameters); if (options.hasProfileParams()) parameters.setProfileParams(convertParameters(options, parameters.getProfileType())); return parameters; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest(); }
IsochronesRequestHandler extends GenericHandler { RouteSearchParameters processIsochronesRequestOptions(IsochronesRequest request, RouteSearchParameters parameters) throws StatusCodeException { RouteRequestOptions options = request.getIsochronesOptions(); parameters = new RouteRequestHandler().processRequestOptions(options, parameters); if (options.hasProfileParams()) parameters.setProfileParams(convertParameters(options, parameters.getProfileType())); return parameters; } IsochronesRequestHandler(); void generateIsochronesFromRequest(IsochronesRequest request); IsochroneMapCollection getIsoMaps(); IsochroneRequest getIsochroneRequest();  }