Utm constructor
Creates UTM coordinates with lonZone, hemisphere, easting,
northing based on the datum.
You can also provide optional elev (elevation) and m (measure value).
The lonZone represents UTM 6° longitudinal zone (1..60 covering
180°W..180°E).
The hemisphere of the Earth (north or south) is represented by 'N' or
'S' in UTM coordinates.
Easting is in metres from the false easting (-500km from the central meridian).
Northing is in metres from the equator (N) or from the false northing -10,000km (S).
2D positions are constructed as Projected(x: easting, y: northing)
and 3D positions as Projected(x: easting, y: northing, z: elev).
The datum indicates the geodetic reference (ie. ellipsoid and other
parameters) used when projecting geographic coordinates to projected
coordinates.
Use datum to set the datum for calculations with a reference ellipsoid
and datum transformation parameters.
If verifyEN is true it's validated that easting/northing is within
'normal' values (may be suppressed for extended coherent coordinates or
alternative datums e.g. ED50, see epsg.io/23029). The 'normal' values are
roughly 0..1000000m for easting, and 0..9329006m for northing in the
northern hemisphere and 1116914..10000000m in the southern hemisphere.
May throw a FormatException if the UTM zone, hemisphere, easting or northing are invalid.
Examples:
// UTM coordinates with 2D position in zone 31N and WGS84 datum
// (easting 448251.0, northing 5411932.0).
final utmCoord = Utm(31, 'N', 448251.0, 5411932.0);
Implementation
factory Utm(
int lonZone,
String hemisphere,
double easting,
double northing, {
double? elev,
double? m,
Datum datum = Datum.WGS84,
bool verifyEN = true,
}) {
final utmZone = UtmZone(lonZone, hemisphere);
final projected = Projected(x: easting, y: northing, z: elev, m: m);
if (verifyEN) {
_verifyEN(projected, utmZone.hemisphere);
}
return Utm._coordinates(utmZone, projected, datum: datum);
}