Coordinate class Null safety
The base coordinate class, used by all feature types.
Constructors
- Coordinate(double latitude, double longitude)
-
Coordinate.fromJson(List<
double> json) -
Creates a Coordinate from a JSON List.
factory
- Coordinate.fromWKT(String wkt)
-
Creates a Coordinate from a WKT String.
factory
Properties
Methods
-
bearingTo(
Coordinate other) → double - Returns the bearing to a different Coordinate in degrees. Uses the Haversine formula to calculate the bearing between two points.
-
destination(
double distance, double bearing) → Coordinate - Returns the Coordinate at a certain distance and bearing from the Coordinate. Uses the Haversine formula to calculate the new coordinate.
-
distanceTo(
Coordinate other) → double - Returns the distance to a different Coordinate in meters. Uses the Haversine formula to calculate the distance between two points.
-
interpolate(
Coordinate to, double fraction) → Coordinate -
Returns the Coordinate at a certain fraction of the distance between the Coordinate and different Coordinate,
to
. Uses the Haversine formula to calculate the new coordinate. Thefraction
is a number between 0 and 1. If thefraction
is 0, the Coordinate will be the same as the Coordinate. If thefraction
is 1, the Coordinate will be the same as theto
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toJson(
) → List< double> - Converts the Coordinate to a JSON coordinate List.
-
toString(
) → String -
A string representation of this object.
override
-
toWKT(
) → String - Converts the Coordinate to a WKT String. Useless on its own, but useful for other classes.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override