graphhopper / graphhopper/graphhopper

Prevent snapping to disconnected edges when we use custom models with /route

Open
#2,274 1 comment 0 reactions 0 assignees View on GitHub
improvement
Dominant language
Java
Stars
6.7k
Forks
2k
Avg merge
15h 58m
Merged PRs (30d)
3

Description

This issue addresses a similar problem as #2273, but here we need to prevent connection not found errors when we specify the custom model per request. In this case the subnetwork removal we run during the import obviously does not solve the problem. To prevent snapping to disconnected edges when we change the custom model for a single request we need to run a dynamic connection check. A possible solution could be this:

1) find all edges around the query point using `locationIndex.query(bbox, visitor)`. these will be our snapping candidates
2) for every snapping candidate determine the number of reachable nodes for the given custom weighting, but stop as soon as a configurable maximum number of nodes has been found
3) exclude all candidates for which the number of reachable nodes is below some threshold
4) snap to the closest remaining candidate. if no candidate is left there will still be a connection not found error, but maybe we need to handle the special case where the target node was already found during the candidate search (both query points are within the same 'island').

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.