Skip to main content

multiLineString

Creates a MultiLineString geometry from an array of line strings coordinates or an array of LineStrings.

Each line string must contain at least 2 positions. Empty line strings with 0 positions are allowed.

Type Parameters

  • P

Parameters

NameTypeDefaultDescription
dataPosition[][] | LineString[]MultiLineString coordinates or an array of LineStrings
options?objectOptional geometry options
options.id?number | stringOptional identifier to be assigned to the geometry instance.
options.properties?POptional data to be assigned to the geometry instance.
options.layout?'XY' | 'XYZ' | 'XYZM' | 'XYM''XYZM'Coordinate layout for interpreting GeoJSON coordinates.
Defines how to interpret the coordinates of input geometries. This does not force the dimension of the resulting geometries - the actual geometry dimension will be determined from the parsed data.
Use this to:
  • Trim unwanted Z or M ordinates from the input.
  • Treat the third ordinate as M instead of Z.
options.consume?booleanfalseWhether to consume the input geometries - consumed geometries become detached, are no longer valid and should not be used.
When true the ownership of input geometries is passed to created collection geometry, no extra copies are made, but the input geometries can no longer be used on their own.
When false the clones of input geometries are used to create a collection geometry.

Returns

MultiLineString<P>

A new MultiLineString geometry

Throws

Examples