LineString
A LineString geometry is a collection of two or more positions, each position connected to the next position linearly.
-
The positions at which the line string is located.
-
-
Initializes a line string defined by given positions.
This initializer is equivalent to the
lineString
function in the turf-helpers package of Turf.js (source code). -
-
-
Returns the line string transformed into an approximation of a curve by applying a Bézier spline algorithm.
This method is equivalent to the turf-bezier-spline package of Turf.js (source code).
-
Returns the portion of the line string that begins at the given start distance and extends the given stop distance along the line string.
This method is equivalent to the turf-line-slice-along package of Turf.js (source code).
-
Returns the portion of the line string that begins at the given coordinate and extends the given distance along the line string.
-
See moreIndexedCoordinate
is a coordinate with additional information such as the index from its position in the polyline and distance from the start of the polyline. -
Returns a coordinate along a line string at a certain distance from the start of the polyline.
This method is equivalent to the turf-along package of Turf.js (source code).
-
Returns an indexed coordinate along a line string at a certain distance from the start of the polyline.
-
Returns the distance along a slice of the line string with the given endpoints.
If the
start
andend
arguments are unspecified, this method is equivalent to the turf-length package of Turf.js (source code). -
Returns a subset of the line string between two given coordinates.
This method is equivalent to the turf-line-slice package of Turf.js (source code).
-
Returns the geographic coordinate along the line string that is closest to the given coordinate as the crow flies.
The returned coordinate may not correspond to one of the polyline’s vertices, but it always lies along the polyline.
This method is equivalent to the turf-nearest-point-on-line package of Turf.js (source code).
-
Returns a copy of the line string simplified using the Ramer–Douglas–Peucker algorithm.
This method is equivalent to the turf-simplify package of Turf.js (source code).
-
Simplifies the line string in place using the Ramer–Douglas–Peucker algorithm.
This method is nearly equivalent to the turf-simplify package of Turf.js (source code), except that it mutates the line string it is called on.
-
Returns all intersections with another
LineString
.This function is roughly equivalent to the turf-line-intersect package of Turf.js (source code). Order of found intersections is not determined.
You can also use
Turf.intersection(_:, _:)
if you need to find intersection of individualLineSegment
s.Seealso
Turf.intersection(_:, _:)
-