LineString class Null safety

A LineString is a Feature made up of connected Coordinates to form a line.

Inheritance

Constructors

LineString(List<Coordinate> coordinates, {dynamic properties = const <String, dynamic>{}})
LineString.fromJson(Map<String, dynamic> json)
Creates a LineString from a valid GeoJSON object
factory
LineString.fromWKT(String wkt)
Creates a LineString from a WKT string
factory

Properties

coordinates List<Coordinate>
final
hashCode int
The hash code for this object.
read-only, inherited
isClosedRing bool
Returns true if the LineString is a closed ring, meaning that the first and last coordinate are the same.
read-only
length double
Returns the LineString's length in meters. The length is calculated using the Haversine formula.
read-only
properties Map<String, dynamic>
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

along(double distance) Point
Returns the Point at the distance (in meters) along the LineString. If the distance is greater than the length of the LineString, the last Point in the LineString will be returned. If the distance is less than 0, the first Point in the LineString will be returned.
explode() List<Point>
Explodes the LineString into a List of Points
override
midpoint() Point
Returns the midPoint of the LineString.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
pointAt(double percentage) Point
Returns the Point at the percentage along the LineString. If the percentage is greater than 1, the last Point in the LineString will be returned. If the percentage is less than 0, the first Point in the LineString will be returned. If the percentage is 0, the first Point in the LineString will be returned. If the percentage is 1, the last Point in the LineString will be returned.
toJson() Map<String, dynamic>
Returns a GeoJSON representation of the LineString
override
toPolygon() Polygon
If the LineString is a closed ring, it will be converted to a Polygon. Any properties will be applied to the Polygon.
toString() String
A string representation of this object.
override
toWKT() String
Converts the LineString to a String in WKT format.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

type String
final