Function UtmZone.tryFromNumber

Read a UTM zone number from input data without throwing.

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

Standard UTM zones are numbered 1 through 60. Use this checked factory when a supplied number may fall outside that range.

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 remains .init.

Example

Example checking a UTM zone number without throwing.

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