Method FromUsng
FromUsng(String, SpatialReference)
Parses a coordinate in United States National Grid (USNG) notation and returns a MapPoint representing that location.
Declaration
public static MapPoint FromUsng(string coordinates, SpatialReference spatialReference)
Parameters
Type | Name | Description |
---|---|---|
System.String | coordinates | The USNG notation string for the coordinate. |
SpatialReference | spatialReference | An optional SpatialReference that defines the datum and ellipsoid referenced by the USNG coordinate. |
Returns
Type | Description |
---|---|
MapPoint | A MapPoint with the location from the USNG 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 USNG string. If no SpatialReference is provided and the USNG string is suffixed
with "(NAD 27)", it is assumed the USNG string is referenced to NAD 27. If no spatial reference is provided and no such suffix exists,
it is assumed the USNG string is referenced to Wgs84. The USNG 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.
USNG notation examples |
---|
13TFJ 23 59 |
13TFJ2374159574 |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
ArcGISRuntimeException | Given coordinates could not be parsed or converted. |
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 100.3 - 100.15 |
.NET 6.0 | 100.13 - 100.15 |
.NET 6.0 Windows | 100.13 - 100.15 |
.NET Framework | 100.1 - 100.15 |
.NET 5 | 100.10 - 100.12 |
.NET Core 3.1 | 100.7 - 100.12 |
Xamarin.Android | 100.1 - 100.15 |
Xamarin.iOS | 100.1 - 100.15 |
UWP | 100.1 - 100.15 |