# CoordinateSystem

## Description

`[ShutdownSurvive]`
`sealed` `class` `Tinman.Terrain.Georef.CoordinateSystem`

Derived from

GeoObject abstract

Describes a coordinate system for geo-referencing.

A geographic coordinate system (IsGeographic is `true`) has the following `X` and `Y` axes:

• `X`: Geodetic latitude
Angle from the equatorial plane to the perpendicular to the ellipsoid through a given point, northwards treated as positive.

• `Y`: Geodetic longitude
Angle from the prime meridian plane to the meridian plane passing through the given point, eastwards treated as positive.

A projected coordinate system (IsProjection is `true`) has the following `X` and `Y` axes:

• `X`: Easting
East pointing axis used in 2D projected coordinate systems.

• `Y`: Northing
North pointing axis used in 2D projected coordinate systems.

A local coordinate system (IsLocal is `true`) has the following axes:

• `X`:
Horizontal coordinate without additional semantic.

• `Y`:
Vertical coordinate without additional semantic.

The standard `Z` axis for a coordinate system is (Vertical is `null`):

• `Z`: Ellipsoidal height
Distance of a point from the ellipsoid measured along the perpendicular from the ellipsoid to this point. Positive if upwards or outside of the ellipsoid.

Vertical coordinate systems (Vertical is not `null`) have a different `Z` axis, usually gravity-related height or depth.

## Public / Constants

### Local

`public` `static` `readonly` `attribute` `Local` → `(CoordinateSystem)`

Unspecific local coordinate system sing metric units.

### Moon

`public` `static` `readonly` `attribute` `Moon` → `(CoordinateSystem)`

A geographic coordinate system for the Moon ME frame with ephemeris DE421.

### Popular​Mercator

`public` `static` `readonly` `attribute` `PopularMercator` → `(CoordinateSystem)`

WGS 84 / Pseudo-Mercator

This coordinate system is used by popular web mapping applications.

### Popular​Mercator​Coordinate

`public` `constant` `PopularMercatorCoordinate` → `(20037508.342789244:float64)`

The maximum absolute map coordinate value of PopularMercator.

These are the bounds of a square PopularMercator map:

```180°W => -X
180°E => +X
Y°S => -Y
Y°N => +Y```

where `X` is PopularMercatorCoordinate and `Y` is PopularMercatorLatitudeDeg

### Popular​Mercator​Latitude​Deg

`public` `constant` `PopularMercatorLatitudeDeg` → `(85.0511287798066:float64)`

The absolute latitude (in degrees) that results in a map coordinate that is equal to PopularMercatorCoordinate.

`public` `constant` `PopularMercatorLatitudeRad` → `(1.4844222297453324:float64)`

The absolute latitude (in radians that results in a map coordinate that is equal to PopularMercatorCoordinate.

### WGS84

`public` `static` `readonly` `attribute` `WGS84` → `(CoordinateSystem)`

World Geodetic System 1984 (2D)

This coordinate system is supposed to be used when the Z-axis (height) is irrelevant.

### WGS84_3​D

`public` `static` `readonly` `attribute` `WGS84_3D` → `(CoordinateSystem)`

World Geodetic System 1984 (3D)

This is the same as WGS84, except that this coordinate system explicitly uses ellipsoid height as the Z-axis.

## Public / Constructors

### Coordinate​System

`public` `constructor` `CoordinateSystem` → `(9)`

geographic in : GeodeticDatum

The geodetic datum.

projection opt : ICoordinateOperation = null

The map projection that translates between geographic coordinates (latitude, longitude) and map coordinates (easting, northing) or `null` if the coordinate system does not define a projection.

vertical opt : VerticalDatum = null

The vertical datum or `null` if the coordinate system uses ellipsoid height. Defaults to `null`.

geographicUnit opt : UnitOfMeasure = null

The unit of geographic coordinates. If `null`, UnitOfMeasure.Degree will be used.

projectionUnit opt : UnitOfMeasure = null

The unit of map coordinates. If `null`, UnitOfMeasure.Metre will be used.

verticalUnit opt : UnitOfMeasure = null

The unit of vertical coordinates. If `null`, UnitOfMeasure.Metre will be used.

localUnit opt : UnitOfMeasure = null

The unit of local coordinates. If `null`, UnitOfMeasure.Metre will be used.

flags opt : CoordinateSystemFlags = CoordinateSystemFlags.None

The coordinate system flags.

name opt : string = null

Human-readable name of the coordinate system. If empty or null, GeoObject.UserDefined will be used instead.

Creates a new instance of CoordinateSystem.

### From​Wkt

`public` `static` `method` `FromWkt` → `(3)`

wkt in : string

`[not-null]`
The WKT representation to parse.

registry opt : IGeoRegistry = null

The GeoRegistry to use for looking up well-known entities. If a well-known entity has been found in the registry, it is used instead of the entity that is described in the WKT source. If `null`, lookup will be disabled and only the WKT entity descriptions will be used.

coordinateOperation opt : ICoordinateOperation = null

The coordinate operation to use instead of the one defined in wkt in.

returns → CoordinateSystemWkt

The coordinate system description.

Creates a new instance of CoordinateSystem based on the given well-known text representation (WKT) of a coordinate reference system.

The given string must match the following Grammar:

```wkt    := value ;

obj    := id !> open null* values close ;
!value := obj | str | num ;
values := value (',' null* value)* null* ;

num    := float ;

!id    := letter (letter | digit)* ;

!close := ']' | ')' ;
letter := 'a'..'z' | 'A'..'Z' | '_' ;
null   := ',' ;
!open  := '[' | '(' ;
str    := '"' (]"[ | '""')* '"' ;```
ValidatingException

If the given wkt in source code is malformed or invalid.

### Topocentric

`public` `static` `method` `Topocentric` → `(4)`

center in : LatLon

Geographic coordinates of the map origin. The longitude angle is interpreted absolute, i.e. it is not relative to the prime meridian of datum opt.

datum opt : GeodeticDatum = null

The geodetic datum to use. If `null`, GeodeticDatum.WGS84 is used.

unit opt : UnitOfMeasure = null

Unit of projected coordinates. If `null`, UnitOfMeasure.Metre will be used.

method opt : int32 = 0

Depicts the CoordinateOperationMethod to use:
`0` : CoordinateOperationMethod.ObliqueStereographic
`1` : CoordinateOperationMethod.TransverseMercator
`2` : CoordinateOperationMethod.PolarStereographic
`3` : CoordinateOperationMethod.TransverseMercatorSouth
`4` : CoordinateOperationMethod.LambertAzimuthal
`5` : CoordinateOperationMethod.LambertConic
`6` : CoordinateOperationMethod.Mercator
`7` : CoordinateOperationMethod.PopularMercator
`8` : CoordinateOperationMethod.Cassini
`9` : CoordinateOperationMethod.Sinusoidal
The given method index will be clamped to the allowed range.

returns → CoordinateSystem

The projected coordinate system.

Creates a topocentric coordinate system.

This method delegates to CoordinateOperationMethod.Topocentric using the CoordinateOperationMethod depicted by method opt.

## Public / Methods

### Create​Coordinate​Transform

`public` `method` `CreateCoordinateTransform` → `()`

returns → ICoordinateTransform

The coordinate transform.

Creates a ICoordinateTransform for this projected or geographic coordinate system.

GeorefException

If the geo-reference parameters are incomplete or invalid.

### Create​Coordinate​Transform​Null

`public` `method` `CreateCoordinateTransformNull` → `()`

returns → ICoordinateTransform

The coordinate transform or `null` iff the geo-reference parameters are incomplete or invalid.

Creates a ICoordinateTransform for this projected or geographic coordinate system.

### To​Cubemap​Face

`[Pure]`
`public` `method` `ToCubemapFace` → `(1)`

face in : CubemapFace

The cubemap face.

returns → CoordinateSystem

The resulting coordinate system.

Creates a cubemap face geographic coordinate system based on this coordinate system.

First, the projection is removed (if present). Then, a cubemap face projection (see CoordinateOperationMethod.Face) is constructed based on the ellipsoid.

### To​Geographic

`[Pure]`
`public` `method` `ToGeographic` → `()`

returns → CoordinateSystem

The resulting coordinate system.

Returns the base geographic coordinate system by removing the projection.

If this coordinate system if already geographic (see IsGeographic) or local (see IsLocal), this method returns `this`.

### To​Projection

`[Pure]`
`public` `method` `ToProjection` → `(2)`

projection in : ICoordinateOperation

`[not-null]`
The map projection that translates between geographic coordinates (latitude, longitude) and map coordinates (easting, northing).

projectionUnit opt : UnitOfMeasure = null

The unit of map coordinates. If `null`, UnitOfMeasure.Metre will be used.

returns → CoordinateSystem

The resulting coordinate system.

Returns a projected coordinate system by setting or replacing the projection.

### To​Unnamed

`[Pure]`
`public` `method` `ToUnnamed` → `()`

returns → CoordinateSystem

The resulting CoordinateSystem, which may be `this`.

Sets IGeoObject.Name to `null`.

### To​Vertical

`[Pure]`
`public` `method` `ToVertical` → `(2)`

unit opt : UnitOfMeasure = null

The vertical unit. If `null`, UnitOfMeasure.Metre will be used.

datum opt : VerticalDatum = null

The vertical datum (see Vertical).

returns → CoordinateSystem

The resulting coordinate system.

Updates the vertical components of this coordinate system.

## Public / Attributes

### Face​Bounds

`public` `attribute` `FaceBounds` → `(get)`

value : Box2D

The map bounds.

Returns the map bounds of CoordinateOperationMethod.Face for this coordinate system.

### Flags

`public` `attribute` `Flags` → `(get)`

value : CoordinateSystemFlags

The flags.

The coordinate system flags.

### Geographic

`public` `attribute` `Geographic` → `(get)`

value : GeodeticDatum

The geodetic datum or `null`.

The geodetic datum this coordinate system is based upon.

### Geographic​Scale

`public` `attribute` `GeographicScale` → `(get)`

value : float64

The approximate scale factor to use for converting coordinates in the geographic unit to coordinates in the horizontal unit. If this is not a geographic coordinate system, the returned scale factor will be 1.

Returns the approximate scale factor from the geographic unit to the horizontal unit.

The returned scale factor has the highest precision at the equator.

### Geographic​Unit

`public` `attribute` `GeographicUnit` → `(get)`

value : UnitOfMeasure

The unit of measure or `null` if Geographic is `null`.

The unit of measure used for geographic coordinates.

### Horizontal​Unit

`public` `attribute` `HorizontalUnit` → `(get)`

value : UnitOfMeasure

`[not-null]`
The horizontal unit of measure.

Returns the horizontal unit of measure.

Depending on the coordinate system type, the horizontal unit of measure is either the local unit, projected unit or the unit of the ellipsoid of the geodetic datum.

### Is​Geographic

`public` `attribute` `IsGeographic` → `(get)`

value : bool

`true` if this coordinate system is geographic, `false` if not.

Is this a geographic coordinate system?

Geographic coordinate system use geographic coordinates (latitude, longitude), which are specified in angular units. A coordinate system can either be geographic, projected or local.

### Is​Local

`public` `attribute` `IsLocal` → `(get)`

value : bool

`true` if this coordinate system is local, `false` if not.

Is this a local coordinate system?

Local coordinate systems use custom map coordinates, which are specified in length units. A coordinate system can either be geographic, projected or local.

### Is​Projection

`public` `attribute` `IsProjection` → `(get)`

value : bool

`true` if this coordinate system is projected, `false` if not.

Is this a projected coordinate system?

Projected coordinate systems use map coordinates (easting, northing), which are specified in length units. A coordinate system can either be geographic, projected or local.

### Is​Vertical

`public` `attribute` `IsVertical` → `(get)`

value : bool

`true` if this coordinate system is non-ellipsoidal vertical, `false` if not.

Does this coordinate system include vertical coordinates that are different from ellipsoid height?

### Local​Unit

`public` `attribute` `LocalUnit` → `(get)`

value : UnitOfMeasure

The unit or measure or `null` if IsLocal is `false`.

The unit of measure used for local coordinates.

### Projection

`public` `attribute` `Projection` → `(get)`

value : ICoordinateOperation

The coordinate operation or `null`.

The map projection that translates between geographic coordinates (latitude, longitude) and map coordinates (easting, northing).

### Projection​Unit

`public` `attribute` `ProjectionUnit` → `(get)`

value : UnitOfMeasure

The unit of measure or `null` if Projection is `null`.

The unit of measure used for projected coordinates.

### Vertical

`public` `attribute` `Vertical` → `(get)`

value : VerticalDatum

The vertical datum or `null` if ellipsoid height is used.

The vertical datum this coordinate system is based upon.

### Vertical​Unit

`public` `attribute` `VerticalUnit` → `(get)`

value : UnitOfMeasure

`[not-null]`
The unit of measure of vertical coordinates.

The unit of measure used for vertical coordinates.

## Configuration

### Config

`public` `static` `attribute` `Config` → `(get)`

value : IConfigurator<CoordinateSystem>

`[not-null]`
The configurator object.

The configurator object for this type.

### Config​Flags

`public` `static` `attribute` `ConfigFlags` → `(get)`

value : IConfigurator<CoordinateSystemFlags>

`[not-null]`
The configurator object.

The configuration type for CoordinateSystemFlags values.

## Serialization

### Serial​Id

`public` `static` `readonly` `attribute` `SerialId` → `(ISerialTypeInfo)`