Struct UtmCoordinate

Projected UTM coordinate carrying zone and north/south false-northing convention for unambiguous reverse projection.

struct UtmCoordinate(T)
  
if (isGeodesyScalar!T);

Easting and northing are always metres. The value carries no datum, CRS identifier, EPSG code, MGRS latitude band, height, or axis metadata. .init is invalid because its zone is invalid.

Properties

NameTypeDescription
easting[get] TEasting in metres.
hemisphere[get] UtmHemisphereNorth/south false-northing convention.
isValid[get] boolTrue when the coordinate is structurally valid.
northing[get] TNorthing in metres.
projected[get] ProjectedCoordinate!TUntagged projected coordinate in metres.
zone[get] UtmZoneUTM zone.

Methods

NameDescription
fromComponents (zone, hemisphere, easting, northing) Construct a tagged UTM coordinate.
tryFromComponents (zone, hemisphere, easting, northing, result) Construct a tagged UTM coordinate without throwing.

Example

Example using struct UtmCoordinate(T) if (isGeodesyScalar!T).

import geodesy;

const coordinate = UtmCoordinate!double.fromComponents(
    UtmZone.fromNumber(33),
    UtmHemisphere.north,
    500_000.0,
    5_340_000.0);

assert(coordinate.isValid);
assert(coordinate.zone.number == 33);
assert(coordinate.easting == 500_000.0);