|
31 | 31 | import com.graphhopper.routing.lm.LandmarkStorage; |
32 | 32 | import com.graphhopper.routing.querygraph.QueryGraph; |
33 | 33 | import com.graphhopper.routing.util.*; |
34 | | -import com.graphhopper.routing.weighting.BlockAreaWeighting; |
35 | 34 | import com.graphhopper.routing.weighting.Weighting; |
36 | 35 | import com.graphhopper.routing.weighting.custom.CustomProfile; |
37 | 36 | import com.graphhopper.routing.weighting.custom.FindMinMax; |
38 | 37 | import com.graphhopper.storage.BaseGraph; |
39 | 38 | import com.graphhopper.storage.Graph; |
40 | | -import com.graphhopper.storage.GraphEdgeIdFinder; |
41 | 39 | import com.graphhopper.storage.RoutingCHGraph; |
42 | 40 | import com.graphhopper.storage.index.LocationIndex; |
43 | 41 | import com.graphhopper.storage.index.Snap; |
@@ -104,7 +102,7 @@ public GHResponse route(GHRequest request) { |
104 | 102 | checkHeadings(request); |
105 | 103 | checkPointHints(request); |
106 | 104 | checkCurbsides(request); |
107 | | - checkNoBlockAreaWithCustomModel(request); |
| 105 | + checkNoBlockArea(request); |
108 | 106 |
|
109 | 107 | Solver solver = createSolver(request); |
110 | 108 | solver.checkRequest(); |
@@ -177,9 +175,9 @@ private void checkCurbsides(GHRequest request) { |
177 | 175 | throw new IllegalArgumentException("If you pass " + CURBSIDE + ", you need to pass exactly one curbside for every point, empty curbsides will be ignored"); |
178 | 176 | } |
179 | 177 |
|
180 | | - private void checkNoBlockAreaWithCustomModel(GHRequest request) { |
181 | | - if (request.getCustomModel() != null && request.getHints().has(BLOCK_AREA)) |
182 | | - throw new IllegalArgumentException("When using `custom_model` do not use `block_area`. Use `areas` in the custom model instead"); |
| 178 | + private void checkNoBlockArea(GHRequest request) { |
| 179 | + if (request.getHints().has("block_area")) |
| 180 | + throw new IllegalArgumentException("The `block_area` parameter is no longer supported. Use a custom model with `areas` instead."); |
183 | 181 | } |
184 | 182 |
|
185 | 183 | protected Solver createSolver(GHRequest request) { |
@@ -428,9 +426,6 @@ protected void checkRequest() { |
428 | 426 | if (getPassThrough(request.getHints())) |
429 | 427 | throw new IllegalArgumentException("The '" + Parameters.Routing.PASS_THROUGH + "' parameter is currently not supported for speed mode, you need to disable speed mode with `ch.disable=true`. See issue #1765"); |
430 | 428 |
|
431 | | - if (request.getHints().has(Parameters.Routing.BLOCK_AREA)) |
432 | | - throw new IllegalArgumentException("The '" + Parameters.Routing.BLOCK_AREA + "' parameter is currently not supported for speed mode, you need to disable speed mode with `ch.disable=true`."); |
433 | | - |
434 | 429 | if (request.getCustomModel() != null) |
435 | 430 | throw new IllegalArgumentException("The 'custom_model' parameter is currently not supported for speed mode, you need to disable speed mode with `ch.disable=true`."); |
436 | 431 |
|
@@ -492,13 +487,7 @@ protected void checkRequest() { |
492 | 487 | protected Weighting createWeighting() { |
493 | 488 | PMap requestHints = new PMap(request.getHints()); |
494 | 489 | requestHints.putObject(CustomModel.KEY, request.getCustomModel()); |
495 | | - Weighting weighting = weightingFactory.createWeighting(profile, requestHints, false); |
496 | | - if (requestHints.has(Parameters.Routing.BLOCK_AREA)) { |
497 | | - GraphEdgeIdFinder.BlockArea blockArea = GraphEdgeIdFinder.createBlockArea(baseGraph, locationIndex, |
498 | | - request.getPoints(), requestHints, new FiniteWeightFilter(weighting)); |
499 | | - weighting = new BlockAreaWeighting(weighting, blockArea); |
500 | | - } |
501 | | - return weighting; |
| 490 | + return weightingFactory.createWeighting(profile, requestHints, false); |
502 | 491 | } |
503 | 492 |
|
504 | 493 | @Override |
|
0 commit comments