This document is archived and information here might be outdated. Recommended version. |
Returns the USNG description of a point.
[Visual Basic .NET] Public Function GetUSNGFromCoords ( _ ByVal numDigits As Integer, _ ByVal numericRounding As Boolean, _ ByVal addSpaces As Boolean _ ) As String
[C#] public string GetUSNGFromCoords ( int numDigits, bool numericRounding, bool addSpaces );
[C++]
HRESULT GetUSNGFromCoords(
long numDigits,
VARIANT_BOOL numericRounding,
VARIANT_BOOL addSpaces
);
[C++]
Parameters numDigits
numDigits is a parameter of type long numericRounding
numericRounding is a parameter of type bool addSpaces
addSpaces is a parameter of type bool
The GetUSNGFromCoords method returns a USNG string. The United States National Grid (USNG) is a simplified version of the Military Grid Reference System (MGRS) and is an alphanumeric way to represent a location. The Point must have a spatial reference that includes a coordinate system. It does not have to a be a geographic coordinate system. The precision parameter controls the length of the string. The sample USNG string below has a precision of 5 which means it is to the closest meter. The geographic coordinates are using the WGS 1984 geographic coordinate system. The first two numbers in the string are the UTM zone number.
latitude=40.0
longitude=-100.0
USNG=14TMK1463928236