fromGars static method
- required String coordinates,
- SpatialReference? spatialReference,
- required GarsConversionMode garsConversionMode,
Parses a coordinate in Global Area Reference System (GARS) 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 GARS string. If no spatial reference is provided, it is assumed the GARS string is referenced to WGS 84. The GARS string must not contain any whitespace.
GARS notation examples |
---|
354ND |
354ND22 |
Parameters:
coordinates
— The GARS notation string for the coordinate.spatialReference
— A spatial reference that defines the datum and ellipsoid referenced by the GARS coordinate.garsConversionMode
— Select whether the returned point's location represents the south-west corner of the GARS cell the coordinate lies within, or its center.
Return Value: A point with the location from the GARS string in the spatial reference provided.
Implementation
static ArcGISPoint fromGars({
required String coordinates,
SpatialReference? spatialReference,
required GarsConversionMode garsConversionMode,
}) {
_initializeArcGISEnvironmentIfNeeded();
final coreCoordinates = _CString(coordinates);
final objectHandle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_CoordinateFormatter_fromGARS(
coreCoordinates.bytes,
spatialReference?._handle ?? ffi.nullptr,
garsConversionMode.coreValue,
errorHandler,
);
});
return ArcGISPoint._fromHandle(
objectHandle,
)!;
}