Struct GeographicCoordinate

A two-dimensional geographic position represented by strong geodetic latitude and longitude values.

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

This value does not carry datum, CRS, axis-order, ellipsoid, or height semantics. The contained angular types enforce their own finite domains. .init represents latitude zero and longitude zero.

Construction and access perform no allocation.

Properties

NameTypeDescription
latitude[get] Latitude!TGeodetic latitude.
longitude[get] Longitude!TGeodetic longitude.

Methods

NameDescription
fromComponents (latitude, longitude) Construct from strong latitude and longitude values.

Example

Example constructing a geographic coordinate.

import geodesy;

const vienna = GeographicCoordinate!double.fromComponents(
    Latitude!double.fromDegrees(48.20849),
    Longitude!double.fromDegrees(16.37208));

assert(vienna.latitude.degrees > 48.0);
assert(vienna.longitude.degrees > 16.0);