Function TopocentricFrame.tryFromGeodeticOrigin

Prepare a frame from a geodetic origin without throwing.

static bool tryFromGeodeticOrigin(
  const Ellipsoid!T ellipsoid,
  const GeodeticCoordinate!T origin,
  out TopocentricFrame result
) pure nothrow @nogc @safe;

At either geographic pole, the explicitly supplied longitude defines East/North orientation and is used directly rather than reconstructed from ECEF.

Parameters

NameDescription
ellipsoid Valid ellipsoid defining the frame linear unit.
origin Finite geodetic origin using the same linear unit for height.
result Receives the prepared frame on success.

Returns

true when EPSG 9602 preparation and ENU orientation are finite; otherwise false. On failure result is initialized to .init on entry and has no guaranteed value on failure.

Example

Example preparing an ENU frame from a geodetic origin without throwing.

import geodesy;
const origin = GeodeticCoordinate!double.fromComponents(
    Latitude!double.fromDegrees(48.20849),
    Longitude!double.fromDegrees(16.37208),
    171.0);
TopocentricFrame!double frame;
assert(TopocentricFrame!double.tryFromGeodeticOrigin(
    wgs84!double(), origin, frame));
assert(frame.isValid);