Method FromMgrs
FromMgrs(String, SpatialReference, MgrsConversionMode)
Parses a coordinate string in the Military Grid Reference System (MGRS) notation, and returns a MapPoint representing that location.
Declaration
public static MapPoint FromMgrs(string coordinates, SpatialReference spatialReference, MgrsConversionMode mgrsConversionMode)
Parameters
Type | Name | Description |
---|---|---|
System.String | coordinates | The MGRS notation string for the coordinate. |
SpatialReference | spatialReference | An optional SpatialReference that defines the datum and ellipsoid referenced by the MGRS string.
May be |
MgrsConversionMode | mgrsConversionMode | The MgrsConversionMode used by the given MGRS coordinates. |
Returns
Type | Description |
---|---|
MapPoint | A MapPoint with the location from the MGRS string in the spatial reference provided. |
Remarks
The provided spatialReference
parameter must have an ellipsoid and datum matching those used
by the source of the MGRS string. If no SpatialReference is provided, it is assumed that
the MGRS string is referenced to Wgs84.
For an explanation of the different modes for interpreting an MGRS notation string, please see MgrsConversionMode. Note that the choice between zone 01 and 60 has no impact when reading from an MGRS notation string. The MGRS string can contain leading and trailing whitespace and can have whitespace between the grid zone designator, the 100km square identifier, and the numerical eastings and northings.
MGRS notation examples |
---|
30UVG898998 |
30UVG 89885 99877 |
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
ArcGISRuntimeException | Given coordinates could not be parsed or converted. |
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 200.6 |
.NET | 100.13 - 200.6 |
.NET Windows | 100.13 - 200.6 |
.NET Android | 200.0 - 200.6 |
.NET iOS | 200.0 - 200.6 |
.NET Framework | 100.1 - 200.6 |
Xamarin.Android | 100.1 - 100.15 |
Xamarin.iOS | 100.1 - 100.15 |
UWP | 100.1 - 200.6 |