Function UtmProjection.tryFromZone
Prepare an explicit UTM zone without throwing.
static bool tryFromZone(
const Ellipsoid!T ellipsoid,
const UtmZone zone,
const UtmHemisphere hemisphere,
out UtmProjection result
) pure nothrow @nogc @safe;
The ellipsoid is interpreted in metres and must satisfy 6,000,000 <= a <= 7,000,000 and 0 < f <= 0.01. Spheres are therefore intentionally excluded from UTM policy.
Parameters
| Name | Description |
|---|---|
| ellipsoid | Supported terrestrial oblate ellipsoid in metres. |
| zone | Valid explicit UTM zone. |
| hemisphere | North/south false-northing convention. |
| result | Receives the prepared projection on success. |
Returns
true when policy parameters and delegated TM preparation
succeed; otherwise false. On failure result is initialized to on entry and has no guaranteed value on failure.
Example
Example preparing UTM without throwing.
import geodesy;
UtmProjection!double projection;
assert(UtmProjection!double .tryFromZone(
wgs84!double(), UtmZone .fromNumber(33),
UtmHemisphere .north, projection));
assert(projection .isValid);