Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate correctness of map-matching algorithm #1435

Closed
aoles opened this issue May 10, 2023 · 1 comment
Closed

Evaluate correctness of map-matching algorithm #1435

aoles opened this issue May 10, 2023 · 1 comment
Assignees

Comments

@aoles
Copy link
Member

aoles commented May 10, 2023

Changes to the code of map matching algorithm over the past few years might have introduced some subtle bugs to the original implementation. For example, consider the following two places.

  1. //TODO: the commented out code doesn't seem to be equivalent to the current implementation. Bug?
    //Point zt = z[xi.measuredPointIndex]
    //Point zt1 = z[xj.measuredPointIndex]
    double dz = distances[xi.measuredPointIndex]; // distCalcEarth.calcDist(zt.lat, zt.lon, zt1.lat, zt1.lon)
    distances array contains precomputed distances between consecutive points which xi and xj not necessarily are.

  2. //TODO: all the bookkeeping around road segments seems obsolete to me as the matching appears to happen
    // based on matched points rather than segments. In fact, the size of `roadSegments` array is used in loops
    // iterating over `matchPoints` which looks like a potential bug to me.
    int edgeId = EdgeIteratorStateHelper.getOriginalEdge(qr.getClosestEdge());
    if (!roadSegments.contains(edgeId))
    roadSegments.add(edgeId);
    mp.segmentId = roadSegments.indexOf(edgeId);

ORS map matching is based on the idea presented in the paper Hidden Markov Map Matching Through Noise and Sparseness by Paul Newson and John Krumm. The description of the algorithm can be found here, see presentation slides.

@aoles
Copy link
Member Author

aoles commented Jun 12, 2023

There have been identified some serious issues with the implementation of the ORS map matcher. Therefore, rather than fixing it it the decision was to switch to using the more reliable GraphHopper map matching endpoint.

@aoles aoles closed this as completed Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant