Function PseudoMercator.tryReverse
Reverse a projected coordinate from the bounded represented sheet.
bool tryReverse(
const ProjectedCoordinate!T source,
out GeographicCoordinate!T result
) const pure nothrow @nogc @safe;
The represented sheet is the one produced by the corresponding forward operation, including its latitude and wrapped-longitude boundaries.
Parameters
| Name | Description |
|---|---|
| source | Projected easting and northing in the ellipsoid linear unit. |
| result | Receives the geographic coordinate on success. |
Returns
true when this operation is valid and source belongs to the
supported represented sheet with a finite representable inverse;
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 = PseudoMercator!double .fromParameters(
wgs84!double(), Longitude!double .fromDegrees(0.0), 0.0, 0.0);
const source = GeographicCoordinate!double .fromComponents(
Latitude!double .fromDegrees(48.20849),
Longitude!double .fromDegrees(16.37208));
const projected = projection .forward(source);
GeographicCoordinate!double result;
assert(projection .tryReverse(projected, result));
assert(result .latitude .degrees > 48.0);