Projected class

A projected position with x, y, and optional z and m coordinates.

All implementations must contain at least x and y coordinate values, but z and m coordinates are optional (getters should return zero value when such a coordinate axis is not available).

When a position contains geographic coordinates, then by default x represents longitude, y represents latitude, and z represents elevation (or height or altitude).

A projected map position might be defined as easting (E) and northing (N) coordinates. It's suggested that then E == x and N == y, but a coordinate reference system might specify something else too.

m represents a measurement or a value on a linear referencing system (like time). It could be associated with a 2D position (x, y, m) or a 3D position (x, y, z, m).

For 2D coordinates the coordinate axis indexes are:

Index Projected
0 x
1 y
2 m

For 3D coordinates the coordinate axis indexes are:

Index Projected
0 x
1 y
2 z
3 m
Inheritance
Annotations
  • @immutable

Constructors

Projected({required double x, required double y, double? z, double? m})
A projected position with x, y, and optional z and m coordinates.
const
Projected.build(Iterable<num> coords, {int offset = 0, Coords? type})
Builds a projected position from coords starting from offset.
factory
Projected.create({required double x, required double y, double? z, double? m})
A position from parameters compatible with CreatePosition function type.
const
Projected.parse(String text, {Pattern delimiter = ',', bool swapXY = false, Coords? type})
Parses a projected position from text.
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
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
m double
The m ("measure") coordinate value. Returns zero if not available.
no setteroverride
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
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
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 destination calculated in a cartesian 2D plane.
inherited
copyByType(Coords type) Projected
Copies this as another object according to the given type.
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}) Projected
Copies the position with optional x, y, z and m overriding values.
override
destinationPoint2D({required double distance, required double bearing}) Projected
Returns a destination point located at the given distance from this to the direction of bearing calculated in a cartesian 2D plane.
override
distanceTo2D(Position destination) double
Returns a distance from this to destination calculated in a cartesian 2D plane.
inherited
distanceTo3D(Position destination) double
Returns a distance from this to destination calculated in a cartesian 3D space.
inherited
equals2D(covariant Position other, {double toleranceHoriz = defaultEpsilon}) bool
True if this position equals with other by testing 2D coordinates only.
inherited
equals3D(covariant Position other, {double toleranceHoriz = defaultEpsilon, double toleranceVert = defaultEpsilon}) bool
True if this position equals with other by testing 3D coordinates only.
inherited
equalsCoords(covariant Position other) bool
True if this and the other position equals.
inherited
expand(ExpandPosition expand) Iterable<Projected>
Expands this position to an iterable of zero or more positions of using expand.
override
intermediatePointTo(Position destination, {required double fraction}) Projected
Returns an intermediate point at the given fraction between this and destination positions calculated in the cartesian coordinate reference system.
override
midPointTo(Position destination) Projected
Returns a midpoint between this and destination positions calculated in the cartesian coordinate reference system.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
packed() Projected
Returns a position instance whose coordinate storage contains only coordinate values represented by this position.
override
project(Projection projection) Geographic
Unprojects this projected position to a geographic position using the inverse projection.
override
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
transform(TransformPosition transform) Projected
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

Operators

operator %(Position divisor) Projected
Returns a position with coordinate values of this applied with modulo operator % by values of divisor.
override
operator *(double factor) Projected
Returns a position with coordinate values of this scaled by factor.
override
operator +(Position other) Projected
Returns a position with coordinate values summed from this and other.
override
operator -(Position other) Projected
Returns a position with coordinate values of this subtracted with values of other.
override
operator /(Position divisor) Projected
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-() Projected
Returns a position with coordinate values of this negated.
override

Static Methods

from(Position source) Projected
Creates a projected position by copying coordinates from source.

Constants

scheme → const PositionScheme
A position scheme that creates Projected and ProjBox instances for positions and bounding boxes.