Function TransverseMercator.tryReverse
Reverse a projected coordinate.
bool tryReverse(
const ProjectedCoordinate!T source,
out GeographicCoordinate!T result
) const pure nothrow @nogc @safe;
The represented-coordinate sheet must correspond to the supported forward domain. Reverse handling preserves the projection's defined pole canonicalization and representation-aware sheet boundaries.
Parameters
| Name | Description |
|---|---|
| source | Projected easting and northing in the ellipsoid linear unit. |
| result | Receives the geographic coordinate on success. |
Returns
true for a valid projection and supported represented coordinate;
otherwise false. On failure result is initialized to on entry and has no guaranteed value on failure.
Example
Example reversing a projected coordinate without throwing.
import geodesy;
const projection = TransverseMercator!double .fromParameters(
wgs84!double(),
Latitude!double .fromDegrees(0.0),
Longitude!double .fromDegrees(15.0),
0.9996,
500_000.0,
0.0);
const source = GeographicCoordinate!double .fromComponents(
Latitude!double .fromDegrees(48.20849),
Longitude!double .fromDegrees(16.37208));
GeographicCoordinate!double recovered;
assert(projection .tryReverse(projection .forward(source), recovered));
assert(recovered .latitude .degrees > 48.0);