Function GeodeticCoordinate.tryFromComponents

Construct from strong angular values and finite ellipsoidal height without throwing.

static bool tryFromComponents(
  const Latitude!T latitude,
  const Longitude!T longitude,
  const T ellipsoidalHeight,
  out GeodeticCoordinate result
) pure nothrow @nogc @safe;

Parameters

NameDescription
latitude Geodetic latitude.
longitude Geodetic longitude.
ellipsoidalHeight Finite height in the caller-selected linear unit.
result Receives the constructed coordinate on success.

Returns

true on success; false when ellipsoidalHeight is NaN or infinite. On failure result is initialized to .init on entry and has no guaranteed value on failure.

Example

Example checking a geodetic coordinate without throwing.

import geodesy;
GeodeticCoordinate!double point;
assert(GeodeticCoordinate!double.tryFromComponents(
    Latitude!double.fromDegrees(48.0),
    Longitude!double.fromDegrees(16.0),
    171.0,
    point));
assert(point.ellipsoidalHeight == 171.0);