LineString class Null safety
A LineString is a Feature made up of connected Coordinates to form a line.
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
- LineString.random()
-
Creates a LineString with random Coordinates
Currently only supports a 2 Coordinate LineString
factory
Properties
- bbox → BoundingBox
-
Returns the BoundingBox of the LineString
read-only, override
- bearing → double
-
read-only
- center → Point
-
Returns the center Point of the LineString
read-only, override
-
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
-
segments
→ List<
LineString> -
Returns each segment (a 2-coordinate
LineString
) of theLineString
in a FeatureCollectionread-only
Methods
-
along(
double distance) → Point -
Returns the Point at the
distance
(in meters) along the LineString. If thedistance
is greater than the length of the LineString, the last Point in the LineString will be returned. If thedistance
is less than 0, the first Point in the LineString will be returned. -
explode(
) → List< Point> -
Explodes the LineString into a List of
Point
soverride -
isParallelTo(
LineString other) → bool -
Returns whether or not the LineString is parallel to the LineString
other
. If the LineStrings have different lengths, they are not considered parallel. -
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 thepercentage
is greater than 1, the last Point in the LineString will be returned. If thepercentage
is less than 0, the first Point in the LineString will be returned. If thepercentage
is 0, the first Point in the LineString will be returned. If thepercentage
is 1, the last Point in the LineString will be returned. -
reverse(
) → LineString - Returns a LineString that is a copy of the LineString with the coordinates reversed. The first coordinate will become the last, and the last coordinate will become the first. If the LineString is a closed ring, the first and last coordinate will be the same.
-
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