fromUtm static method

ArcGISPoint fromUtm({
  1. required String coordinates,
  2. SpatialReference? spatialReference,
  3. required UtmConversionMode utmConversionMode,
})

Parses a coordinate in Universal Transverse Mercator (UTM) notation, and returns a Point representing that location.

The spatial reference provided must have an ellipsoid and datum matching those used by the source of the UTM string. If no spatial reference is provided, it is assumed the UTM string is referenced to WGS 84. The UTM string can contain leading and trailing whitespace and can have whitespace between the zone and latitude designator and the numerical eastings and northings.

UTM notation examples
30U 489885 6199877
30U4898856199877
30N 489885 6199877 (using N/S indicator)
489885.32,6199877.36,30U (this form supports sub-meter precision)
Returns null on error, including when the given string is not valid UTM notation.

Parameters:

  • coordinates — The UTM notation string for the coordinate.
  • spatialReference — A spatial reference that defines the datum and ellipsoid referenced by the UTM coordinate.
  • utmConversionMode — The latitude notation scheme used by the given UTM coordinate, either a latitudinal band, or a hemisphere designator.

Return Value: A point with the location from the UTM string in the spatial reference provided.

Implementation

static ArcGISPoint fromUtm({
  required String coordinates,
  SpatialReference? spatialReference,
  required UtmConversionMode utmConversionMode,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreCoordinates = _CString(coordinates);
  final objectHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_CoordinateFormatter_fromUTM(
      coreCoordinates.bytes,
      spatialReference?._handle ?? ffi.nullptr,
      utmConversionMode.coreValue,
      errorHandler,
    );
  });
  return ArcGISPoint._fromHandle(
    objectHandle,
  )!;
}