Skip to content

@turf/boolean-point-on-line incorrectly returns true in some cases when line is of zero length #2750

@smallsaucepan

Description

@smallsaucepan

turf 7.1.0

In cases where the line is of zero length (start and end points the same) booleanPointOnLine incorrectly returns true for any other point on the same longitude.

const line = turf.lineString([[1, 1], [1, 1]]);
let pt;

pt = turf.point([2, 13]);
turf.booleanPointOnLine(pt, line);
//false, cool

pt = turf.point([1, 13]);
turf.booleanPointOnLine(pt, line);
// true, oh no

Technically (I guess?) this function should only return true if the three points - start, end, and point - are the same.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions