Geographic class
A geographic position with longitude, latitude and optional elevation and m.
Longitude is available at lon, latitude at lat and elevation at elev. m represents a measurement.
Longitude (range [-180.0, 180.0]) and latitude (range [-90.0, 90.0]) are
represented as deegrees. The unit for elev is meters.
Geographic coordinates are based on a spherical or ellipsoidal coordinate system representing positions on the Earth as longitude (lon) and latitude (lat).
m represents a measurement or a value on a linear referencing system (like time). It could be associated with a 2D position (lon, lat, m) or a 3D position (lon, lat, elev, m).
For 2D coordinates the coordinate axis indexes are:
| Index | Geographic |
|---|---|
| 0 | lon |
| 1 | lat |
| 2 | m |
For 3D coordinates the coordinate axis indexes are:
| Index | Geographic |
|---|---|
| 0 | lon |
| 1 | lat |
| 2 | elev |
| 3 | m |
- Inheritance
-
- Object
- Positionable
- ValuePositionable
- Position
- Geographic
- Available extensions
- Annotations
-
- @immutable
Constructors
- Geographic({required double lon, required double lat, double? elev, double? m})
-
A geographic position with
lonandlat, and optionalelevandm.const -
Geographic.build(Iterable<
num> coords, {int offset = 0, Coords? type}) -
Builds a geographic position from
coordsstarting fromoffset.factory - Geographic.create({required double x, required double y, double? z, double? m})
-
A position from parameters compatible with
CreatePositionfunction type.const - Geographic.parse(String text, {Pattern delimiter = ',', Coords? type, bool swapXY = false})
-
Parses a geographic position from
text.factory - Geographic.parseDms({DmsFormat format = const Dms(), required String lon, required String lat, String? elev, String? m})
-
Parses a geographic position from
lonandlattext values that are formatted as specified (and parsed) byformat.factory
Properties
- conforming → PositionScheme
-
Returns a position scheme this position is conforming to.
no setteroverride
- coordinateDimension → int
-
The number of coordinate values (2, 3 or 4) on a position.
no setterinherited
- coordType → Coords
-
A value of Coords representing the coordinate type of position data
contained directly or within child objects.
no setterinherited
- elev → double
-
The elevation (or altitude) coordinate in meters.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- is3D → bool
-
True for 3D positions (with z or elevation coordinate).
no setteroverride
- isMeasured → bool
-
True if a measure value is available (or the m coordinate for a position).
no setteroverride
- lat → double
-
The latitude coordinate.
no setter
- lon → double
-
The longitude coordinate.
no setter
- m → double
-
The m ("measure") coordinate value. Returns zero if not available.
no setteroverride
- optElev → double?
-
The elevation (or altitude) coordinate optionally in meters.
no setter
- optM → double?
-
The m ("measure") coordinate optionally. Returns null if not available.
no setteroverride
- optZ → double?
-
The z coordinate value optionally. Returns null if not available.
no setteroverride
- positionCount → int
-
A Position object represents a single position, returns always
1.no setterinherited - rhumb → SphericalRhumbLine
-
Available on Geographic, provided by the SphericalRhumbLineExtension extension
Create an object calculating distances, bearings, destinations, etc on (loxodromic) rhumb line paths with this position as the current position.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spatialDimension → int
-
The number of spatial coordinate values (2 for 2D or 3 for 3D) on a
position.
no setterinherited
- spherical → SphericalGreatCircle
-
Available on Geographic, provided by the SphericalGreatCircleExtension extension
Create an object calculating distances, bearings, destinations, etc on (orthodromic) great-circle paths with this position as the current position.no setter - type → Coords
-
The coordinate type.
no setterinherited
- valueCount → int
-
The number of coordinate values contained.
no setterinherited
-
values
→ Iterable<
double> -
Coordinate values of this position as an iterable of 2, 3 or 4 items.
no setterinherited
- x → double
-
The x coordinate value.
no setteroverride
- y → double
-
The y coordinate value.
no setteroverride
- z → double
-
The z coordinate value. Returns zero if not available.
no setteroverride
Methods
-
bearingTo2D(
Position destination) → double -
Returns a bearing from this to
destinationcalculated in a cartesian 2D plane.inherited -
copyByType(
Coords type) → Geographic -
Copies
thisas another object according to the giventype.override -
copyTo<
R extends Position> (CreatePosition< R> factory) → R -
Copies this position to a new position created by the
factory.inherited -
copyWith(
{double? x, double? y, double? z, double? m}) → Geographic -
Copies the position with optional
x,y,zandmoverriding values.override -
destinationPoint2D(
{required double distance, required double bearing}) → Geographic -
Returns a destination point located at the given
distancefrom this to the direction ofbearingcalculated in a cartesian 2D plane.override -
distanceTo2D(
Position destination) → double -
Returns a distance from this to
destinationcalculated in a cartesian 2D plane.inherited -
distanceTo3D(
Position destination) → double -
Returns a distance from this to
destinationcalculated in a cartesian 3D space.inherited -
distanceToLineSegment2D(
Position start, Position end) → double -
Returns a distance from this to a line segment formed by
startandendpositions calculated in a cartesian 2D plane.inherited -
equals2D(
covariant Position other, {double toleranceHoriz = defaultEpsilon}) → bool -
True if this position equals with
otherby testing 2D coordinates only.inherited -
equals3D(
covariant Position other, {double toleranceHoriz = defaultEpsilon, double toleranceVert = defaultEpsilon}) → bool -
True if this position equals with
otherby testing 3D coordinates only.inherited -
equalsCoords(
covariant Position other) → bool -
True if this and the
otherposition equals.inherited -
expand(
ExpandPosition expand) → Iterable< Geographic> -
Expands this position to an iterable of zero or more positions of using
expand.
override
-
intermediatePointTo(
Position destination, {required double fraction}) → Geographic -
Returns an intermediate point at the given
fractionbetween this anddestinationpositions calculated in the cartesian coordinate reference system.override -
latDms(
[DmsFormat format = const Dms()]) → String -
Formats lat according to
format. -
latLonDms(
{DmsFormat format = const Dms(), String separator = ', ', bool omitElev = false, String elevUnits = 'm', int elevDecimals = 2, bool omitM = false, String mUnits = '', int mDecimals = 2}) → String -
Formats lat and lon according to
format, with lat formatted first and separated from lon byseparator. -
lonDms(
[DmsFormat format = const Dms()]) → String -
Formats lon according to
format. -
midPointTo(
Position destination) → Geographic -
Returns a midpoint between this and
destinationpositions calculated in the cartesian coordinate reference system.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
packed(
) → Geographic -
Returns a position instance whose coordinate storage contains only
coordinate values represented by this position.
override
-
project(
Projection projection) → Projected -
Projects this geographic position to a projected position using
the forward
projection.override -
toGeocentricCartesian(
{Datum? datum, Ellipsoid? ellipsoid}) → Position -
Available on Geographic, provided by the EllipsoidalExtension extension
Converts this geographic position (latitude and longitude as geodetic coordinates) to geocentric cartesian coordinates (X, Y, Z) based on the givendatumorellipsoid. -
toMgrs(
{Datum datum = Datum.WGS84}) → Mgrs -
Available on Geographic, provided by the EllipsoidalExtension extension
Converts this geographic position (latitude and longitude as geodetic coordinates) first to projected UTM coordinates and then from UTM coordinates to the MGRS grid reference. -
toString(
) → String -
A string representation of this object.
override
-
toText(
{String delimiter = ',', int? decimals, bool compactNums = true, bool swapXY = false}) → String -
A string representation of coordinate values separated by
delimiter.inherited -
toUtm(
{UtmZone? zone, Datum datum = Datum.WGS84, bool roundResults = true, bool verifyEN = true}) → Utm -
Available on Geographic, provided by the EllipsoidalExtension extension
Converts this geographic position (latitude and longitude as geodetic coordinates) to projected UTM coordinates with conversions based on thedatum. -
toUtmMeta(
{UtmZone? zone, Datum datum = Datum.WGS84, bool roundResults = true, bool verifyEN = true}) → UtmMeta< Utm> -
Available on Geographic, provided by the EllipsoidalExtension extension
Converts this geographic position (latitude and longitude as geodetic coordinates) to projected UTM coordinates wrapped inside metadata object with conversions based on thedatum. -
transform(
TransformPosition transform) → Geographic -
Returns a position transformed from this using transform.
override
-
valuesByType(
Coords type) → Iterable< double> -
Coordinate values as a double iterable according to the given
type.inherited -
vincenty(
{Ellipsoid ellipsoid = Ellipsoid.WGS84}) → EllipsoidalVincenty -
Available on Geographic, provided by the EllipsoidalVincentyExtension extension
Create an object calculating distances, bearings, destinations, etc on the ellipsoidal earth model devised by Thaddeus Vincenty.
Operators
-
operator %(
Position divisor) → Geographic -
Returns a position with coordinate values of this applied with modulo
operator
%by values ofdivisor.override -
operator *(
double factor) → Geographic -
Returns a position with coordinate values of this scaled by
factor.override -
operator +(
Position other) → Geographic -
Returns a position with coordinate values summed from this and
other.override -
operator -(
Position other) → Geographic -
Returns a position with coordinate values of this subtracted with values
of
other.override -
operator /(
Position divisor) → Geographic -
Returns a position with coordinate values of this divided by values of
divisor.override -
operator ==(
Object other) → bool -
The equality operator.
override
-
operator [](
int index) → double -
A coordinate value by the coordinate axis
index.inherited -
operator unary-(
) → Geographic -
Returns a position with coordinate values of this subtracted with values
of
other.override
Static Methods
-
from(
Position source) → Geographic -
Creates a geographic position by copying coordinates from
source. -
writeLatLonDms(
StringSink buf, Geographic position, {DmsFormat format = const Dms(), String separator = ' ', bool omitElev = false, String elevUnits = 'm', int elevDecimals = 2, bool omitM = false, String mUnits = '', int mDecimals = 2}) → void -
Formats geographic
positionaccording toformatand writes it tobuf.
Constants
- scheme → const PositionScheme
- A position scheme that creates Geographic and GeoBox instances for positions and bounding boxes.