toGeoRef static method

String toGeoRef(
  1. {required ArcGISPoint point,
  2. required int precision}
)

Returns a formatted coordinate in World Geographic Reference System (GEOREF) notation representing the given point's location.

The precision value controls the number of digits used to represent the fractional part of coordinate's latitude and longitude, expressed in minutes. For example:

precision Example output Angular precision Approx precision*
0 MKML5056 1min 2km
1 MKML5056 1min 2km
2 MKML5056 1min 2km
3 MKML502566 0.1min 200m
4 MKML50285665 0.01min 20m
5 MKML5028256652 0.001min 2m

At the equator to 1 significant figure. The 'precision' should be in the interval [0, 9]. The point must have a spatial reference. Returns null on error.

Parameters:

  • point — The location to be represented in GEOREF notation.
  • precision — The precision with which to represent the coordinate.

Return Value: A GEOREF notation string representing the position of the given point.

Implementation

static String toGeoRef({required ArcGISPoint point, required int precision}) {
  _initializeArcGISEnvironmentIfNeeded();
  final stringHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_CoordinateFormatter_toGeoRef(
        point._handle, precision, errorHandler);
  });
  return stringHandle.toDartString();
}