Closed nickw1 closed 3 years ago
Hi and thanks a lot for taking the time to dig into this and also for submitting a PR. Really sorry about taking so long before looking at it, but just so little time (or energy) for open source maintenance these days.
I have published version 1.5.3 which includes this fix.
@perliedman many thanks! Let me know if you are anyone else encounter any problems.
(Please note this is a new version of now-closed PR #64, now based on the
issue-27-fix
branch of my fork, as I wish to make other unrelated changes to master.)This is a likely fix of issue #27, which works in my test case, OpenTrailView (https://opentrailview.org) which uses GeoJSON Path Finder to connect together panoramas using GeoJSON OpenStreetMap data.
The issue appears to be when a phantom node is created for the end point of a route. The compactedCoordinates from the previous 'real' node (the neighbor) to the phantom node should contain the previous 'real' node, and not the phantom node - but in fact contain the reverse.
This happens because the incomingCoordinates of the phantom from the neighbor contain the phantom, but not the neighbor.
So the fix creates the compactedCoordinates by obtaining the neighbor coordinates (the exact unrounded coordinates of the neighbor are obtained) and concatenating the incomingCoordinates with the last member (the phantom coordinates) removed.