Hello all, Peter and the other devs.
I’ve been playing around with map-matching (https://github.com/graphhopper/map-matching) to see if I can get GPS points matched to a path. Some quick tests seemed to show that this worked pretty well for what was needed.
Issue is that with the new GraphHopper 1.0-SNAPSHOT there seems to be a few breaking changes in how edges are processed.
matching-core : com.graphhopper.matching.MapMatching -> MapMatchedPath uses processEdge(edge.getEdge(), edge.getAdjNode(), prevEdge) that is no longer present in core / com.graphhopper.routing.Path
Similarly in matching-web : com.graphhopper.matching.cli.MatchCommand also fails as it expects PathMerger to supply a Graph and Weighting instead of a blank constructor.
I’m assuming I can pass in hopper and pull out the weighting value from AlgorithmOptions to pass into PathMerger.
So just wondering what the right steps would be to get map-matching working with the latest version of GraphHopper, given that it doesn’t look like the old methods are now applicable? - at least since commit - https://github.com/graphhopper/graphhopper/commit/9a5efe6e2b7332495709cfc42674017d7d047cfc
It might be that you are already planning to update the map-matching repo to work with the new GraphHopper modifications, in which case if you have an estimate on when that might be worked on would be appreciated.
Thanks v much,
Thanks @easbar for this pointer. I see in the pull request there is an open issue of which graph and weighting to use for PathMerger. Using PathMerger(graphHopper.getGraphHopperStorage().getBaseGraph(), opts.getWeighting()) , the module builds and it all seems to run. Can get the graph imported and then the matching running. Thanks!
Curiously when comparing the old output with the new output for the GPX trace I get one more entry just after the first entry that also has a
<time> attribute behind it. Given that
<time> is a useful hint to see what the mapped inputs are, having this additional output means there are N+1 outputs. Every other entry is the same with the same results. This is for a trivial two point input file. Not yet tested with 2+ points.
Just a quick snippet to show the difference in case it is useful.
Input (shortened to just the entries)
<trkpt lat="52.1687576371473" lon="5.59498872776257"> <time>2019-10-15T10:00:00Z</time> </trkpt> <trkpt lat="52.1730671558686" lon="5.63681339427334"> <time>2019-10-15T10:02:00Z</time> </trkpt>
<trkpt lat="52.168631" lon="5.595003"><time>2019-10-15T10:00:00Z</time></trkpt> <trkpt lat="52.168842" lon="5.599731"></trkpt> ...
<trkpt lat="52.168631" lon="5.595003"><time>2019-10-15T10:00:00Z</time></trkpt> <trkpt lat="52.168746" lon="5.597739"><time>2019-10-15T10:00:05Z</time></trkpt> <trkpt lat="52.168842" lon="5.599731"></trkpt> ...