I need to avoid points when routing. So far the only out of the box way in graphhopper i found are the Areas that can be added to a Custom model.
As there is no support for a simple Point, i put little bounding boxes around the points to avoid and fed them to the Custom model as a Multipolygon.
First question: I only saw docs and examples that used Polygons which where added separately with its own key. The multipolygon way seems to work so far, but is there something i should know about the implementation of graphhopper? Is there a reason why i should not do it?
MultiPolygon multiPolygon = new GeometryFactory().createMultiPolygon(polygons); areas.put("avoid", new JsonFeature("avoid", "Feature", null, multiPolygon, new HashMap<>())); customModel.setAreas(areas); customModel.addToPriority(If("in_avoid", MULTIPLY, request.avoidPrio)); // 0.001 -> nearly total avoidance
Second question: For first tests i only imported Austria/Small countries and about 20k points/surrounding polygons.
In the end about 18 million points and whole europe should be used for this. Will this be possible? Or should i already search for an other way i maybe did not see in the documentation and examples?
Third question: Are the areas in the custom model added to the “routing-graph-cache” in the initialization step or are they only used later at routing? (Or: Is the heavy lifting done at preparation of the cache, or later)
Thanks in advance for help,