Function UtmZone.tryFromNumber

Construct a UTM zone number without throwing.

static bool tryFromNumber(
  const(uint) number,
  out UtmZone result
) pure nothrow @nogc @safe;

Parameters

NameDescription
number Zone number in the closed interval [1,60].
result Receives the zone on success.

Returns

true for a valid zone number; otherwise false. On failure result is initialized to .init on entry and has no guaranteed value on failure.

Example

Example checking a UTM zone number without throwing.

import geodesy;
UtmZone zone;
assert(UtmZone.tryFromNumber(33, zone));
assert(zone.number == 33);