Skip to content

nearestPointOnLine broken on vertical line segments #1514

@msbarry

Description

@msbarry

nearestPointOnLine exhibits strange behavior when the line is near-vertical.

For example in this jsfiddle the line goes from [-40,50] to [-40,60], the point is [-40.01,56] and turf returns the nearest point as [-40,~55.3]: https://jsfiddle.net/hdumty60/

I tried playing with the code a bit and the issue went away if I changed nearest-point-on-line to use rhumb destination, not sure if that is an ideal solution though.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions