@turf/boolean-point-on-line

esm cjs
turf boolean-point-on-line module
Version 7.2.0 License MIT
Keywords
turfbooleanPointOnLine
INSTALL
Type:
Version:
- Static
- Latest Patch
- Latest Minor
- Latest Major
- 7.2.0
- 7.1.0
- 7.0.0
- 6.5.0
- 6.4.0
- 6.3.0
- 6.2.0
- 6.0.1
- 6.0.0
- 5.1.5
- 5.1.0
- 5.0.4
- 5.0.0
- 4.7.3
- 4.7.1
- 4.7.0
- 4.6.1
- 4.6.0
- 4.0.0
- 7.1.0-alpha.70
- 7.1.0-alpha.7
- 7.0.0-alpha.116
- 7.0.0-alpha.115
- 7.0.0-alpha.114
- 7.0.0-alpha.113
- 7.0.0-alpha.111
- 7.0.0-alpha.110
- 7.0.0-alpha.2
- 7.0.0-alpha.1
- 7.0.0-alpha.0
- 6.2.0-alpha.3
- 6.2.0-alpha.2
- 6.2.0-alpha.1
- 6.2.0-alpha.0
<script type="module"> import turfbooleanPointOnLine from 'https://cdn.jsdelivr.net/npm/@turf/boolean-point-on-line@7.2.0/+esm' </script>
@turf/boolean-point-on-line
booleanPointOnLine
Returns true if a point is on a line. Accepts a optional parameter to ignore the start and end vertices of the linestring.
Parameters
pt
Coord GeoJSON Pointline
Feature<LineString> GeoJSON LineStringoptions
Object Optional parameters (optional, default{}
)
Examples
var pt = turf.point([0, 0]);
var line = turf.lineString([[-1, -1],[1, 1],[1.5, 2.2]]);
var isPointOnLine = turf.booleanPointOnLine(pt, line);
//=true
Returns boolean true/false
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Installation
Install this single module individually:
$ npm install @turf/boolean-point-on-line
Or install the all-encompassing @turf/turf module that includes all modules as functions:
$ npm install @turf/turf