Function tryApplyGeocentricTranslation

Apply EPSG method 1031 in the source-to-target direction.

bool tryApplyGeocentricTranslation(T)(
  const GeocentricCoordinate!T source,
  const GeocentricTranslation!T translation,
  out GeocentricCoordinate!T result
) pure nothrow @nogc @safe
if (isGeodesyScalar!T);

The source coordinate and translations must use the same linear unit.

Parameters

NameDescription
source Source geocentric coordinate.
translation Source-to-target translation parameters.
result Receives the target geocentric coordinate on success.

Returns

true when the finite input arithmetic produces a finite target in scalar type T; otherwise false. On failure result remains unchanged.

Example

Example applying a checked geocentric translation.

import geodesy;
const source = GeocentricCoordinate!double.fromComponents(1.0, 2.0, 3.0);
const shift = GeocentricTranslation!double.fromComponents(4.0, 5.0, 6.0);
GeocentricCoordinate!double target;
assert(tryApplyGeocentricTranslation(source, shift, target));
assert(target.x == 5.0);