ArcGIS Runtime SDK for WPF - Library Reference
MapPointToUsng Method
See Also 
ESRI.ArcGIS.Client.Geometry Namespace > CoordinateConversion Class : MapPointToUsng Method

point
A MapPoint representing the location to be converted.
numberOfDigits
A System.Int32 between 1 and 5 indicating the required precision of returned USNG coordinate string.
roundToNearestWholeNumber
true if the MGRS coordinate should be rounded to produce a lower precision coordinate notation; otherwise false to truncate the coordinate notation.
addSpaces
true if spaces should be added to the returned USNG coordinate notation; otherwise false.
Converts a MapPoint geometry to a coordinate notation string in the United States National Grid (USNG) format.

Syntax

Visual Basic (Declaration) 
Public Shared Function MapPointToUsng( _
   ByVal point As MapPoint, _
   ByVal numberOfDigits As Integer, _
   ByVal roundToNearestWholeNumber As Boolean, _
   ByVal addSpaces As Boolean _
) As String
C# 
public static string MapPointToUsng( 
   MapPoint point,
   int numberOfDigits,
   bool roundToNearestWholeNumber,
   bool addSpaces
)

Remarks

///

The number of digits refers to the digits in each part of the numerical grid reference and must be a value between 1 and 5, indicating the precision as follows:

  • 1 digit represents 10,000m precision e.g. 18SUUJ80
  • 2 digits represents 1,000m precision e.g. 18SUJ8401
  • 3 digits represents 100m precision e.g. 18SUJ836014
  • 4 digits represents 10m precision e.g. 18SUJ83630143
  • 5 digits represents 1m precision e.g. 18SUJ8362601432

Parameters

point
A MapPoint representing the location to be converted.
numberOfDigits
A System.Int32 between 1 and 5 indicating the required precision of returned USNG coordinate string.
roundToNearestWholeNumber
true if the MGRS coordinate should be rounded to produce a lower precision coordinate notation; otherwise false to truncate the coordinate notation.
addSpaces
true if spaces should be added to the returned USNG coordinate notation; otherwise false.

Return Value

A System.String in the requested coordinate notation format representing the location defined by the MapPoint.

Exceptions

ExceptionDescription
System.ArgumentExceptionThe numerOfDigits parameter must be greater than or equal to 1.

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8

See Also

© ESRI, Inc. All Rights Reserved.