Repository navigation
Skip shapes which don't block any edges - #2305
Conversation
|
If a shape does not cover edges - maybe we should even throw an exception? (it might be too ugly?) Did you had a chance to measure the query difference? Because this API is kind of legacy and if the difference is huge it will be critical to implement this for the new option via custom model too. |
|
Noticed this while benchmarking requests with a few blocked points. And e.g a point might not always cover an edge in the graph if the road is not present in OSM. |
|
We could also drop these kind of shapes. There's no point to do the checks if we know that we won't find any intersections? |
|
Yes, either this or throwing an exception. |
|
Apart from |
|
Shouldn't have skipped my ☕ Readded the |
|
@karussell the id lookup currently only works for non-virtual edges. Could we use the same mechanism as in int edge;
if (edgeState instanceof VirtualEdgeIteratorState)
edge = GHUtility.getEdgeFromEdgeKey(((VirtualEdgeIteratorState) edgeState).originalEdgeKey());
else
edge = edgeState.getEdge();I'm working on a solution for #2313 and i'd like to avoid passing around a |

BlockArea currently treats an empty GHIntHashSet the same way as a non-existing cache for blocked edges. But a small shape which doesn't cover edges in the graph would also yield an empty GHIntHashSet. For those cases BlockArea would resort to the more expensive bbox/shape intersection logic:
graphhopper/core/src/main/java/com/graphhopper/storage/GraphEdgeIdFinder.java
Lines 198 to 223 in 0522c49
I changed the logic to explicitly store
nullas the cache for blocked edges if the shape is to large so we can properly determine if we have no cache or if it's just empty.