pointOnLine.location does not return correct distance
See original GitHub issueI currently wonder if the @turf/pointOnLine package does return a wrong location value. Here is a short fiddle of the problem:
http://jsfiddle.net/andi_lo/95q4Lgqc/
I would like to set a point (which is a train station in my project) onto the polyline (representing the routes shape) via turf.pointOnLine
and use the returning location property as of how far the train traveled. However if I use turf.along with the distance provided by turf.pointOnLine(...).properties.location
I will get a point that does not match my expectations. I would expect to get a point that lays onto the station but I get a point that is positioned falsely.
The used geojson is inside the fiddle. Feel free to ask for clarification if needed.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Check is a point (x,y) is between two points drawn on a ...
if (distance(A, C) + distance(B, C) == distance(A, B)) return true; // C is on the line. return false; // C is not...
Read more >how to use st_distance for closest location? - Microsoft Q&A
My query returns a list of the locations within the given radius from the given point. How would I return the closest location...
Read more >CadQuery Class Summary
Returns true if this shape is null. In other words, it references no underlying shape with the potential to be given a location...
Read more >Inform and engage your community - PulsePoint
PulsePoint helps create an informed and engaged community that drives a “Culture of Action,” a key strategy in strengthening the Chain of Survival...
Read more >Reference Manual - Rose Point Navigation Systems
The Instrument Panels are normally closed when not underway and open when underway. When they are closed, only the names of the panels...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Related To-Do on
@turf/along
: https://github.com/Turfjs/turf/issues/691👍 Glad it works, definitely nice work from @dpmcmlxxvi