LineString

A GeoJSON line string.

The simplest line string is just a line: joining two points together.

Geo.LineString(
Geo.Point(Geo.Longitude(0.0), Geo.Latitude(0.0)),
Geo.Point(Geo.Longitude(5.0), Geo.Latitude(0.2)),
)

A more complex line string represents a path between multiple points, drawing a straight line between each two points.

Geo.LineString(
Geo.Point(Geo.Longitude(0.0), Geo.Latitude(0.0)),
Geo.Point(Geo.Longitude(5.0), Geo.Latitude(0.2)),
Geo.Point(Geo.Longitude(6.0), Geo.Latitude(0.3)),
Geo.Point(Geo.Longitude(6.1), Geo.Latitude(0.9)),
)

A line string can represent the outline of a polygon with any number of points.

External resources

Constructors

Link copied to clipboard
constructor(points: List<Geo.Point>)
constructor(vararg points: Geo.Point)

Constructs a LineString instance from multiple Point instances.

Types

Link copied to clipboard

Properties

Link copied to clipboard

Returns true if this line string is closed, i.e. the first and last points are the same.

Link copied to clipboard

The points that make up the line string.

Functions

Link copied to clipboard
open override fun toString(): String

JSON representation of this object as a BSON document.

Link copied to clipboard
open override fun writeTo(writer: BsonFieldWriter)

Writes this object to the provided writer.