Crs.FormatUtmUps Method
Formats a LongLat point to UTM or UPS notation.
FormatUtmUps(GeodeticDatum geodeticDatum, System.Int32 numberOfDecimals, Point longLat)
Formats a LongLat point to UTM or UPS notation.Syntax
public static StringCollection FormatUtmUps (
GeodeticDatum geodeticDatum,
System.Int32 numberOfDecimals,
Point longLat
)
Parameters
The geodetic datum used, for both input and output.
The number of decimals for the easting and northing.
The input position expressed in LongLat.
Return Value
Three strings, representing grid zone designation, easting, and northing.
Remarks
This method will determine the standard UTM or UPS projection zone for the given LongLat point, then project the point, and return a collection of three strings:
The grid zone designation, for example "32V" or "B".
The easting in meters.
The northing in meters.
You can then print the three parts with the separators you prefer.
For example, using the WGS84 datum, no decimals, and the LongLat point (11.96505°, 57.70969°), the method returns the strings
32V
676644
6400255
and you may wish to print them as "32V6766446400255" or "32V 676644 6400255" or "32V, 676644 m E, 6400255 m N" or "676644, 6400255, zone 32V".
If the LongLat point is (166.41667°, -84.33333°) instead, the result will be
B
2147874
1387983
where the B tells us that this is UPS rather than UTM.
In general, if -80° ≤ latitude < 84°, then the standard projection for the point will be one of the 120 UTM projections, and the grid zone designation will be a zone number in the range 01 to 60, followed by a latitude band letter in the range C to X, excluding I and O. If the latitude band letter is N or later in the alphabet, the UTM projection is for the north hemisphere, otherwise for the south; this affects the meaning of the northing component.
If latitude < -80°, the standard projection for the point will be UPS (Universal Polar Stereographic) for Antarctica, and the grid zone designation will just be a single letter: A for the west hemisphere and B for the east. Similarly, if latitude ≥ 84°, the standard projection will be UPS for the Arctic, and the grid zone designation will be Y for the west hemisphere and Z for the east.
The use of a latitude band letter for the UTM notation is based on an official recommendation by NGA (US National Geospatial-Intelligence Agency) from 2014. If you wish to print the hemisphere instead, your application must check whether it should be North or South based on the latitude band letter or the original latitude value, but note that the abbreviations N and S for the hemispheres are not allowed by NGA, since they can be confused with latitude band letters. The full names "North" or "South" can be accepted, though.
If the number of decimals to print is positive, this method will use a decimal dot regardless of numeric locale. No thousands separator will be used. The easting and northing strings will get leading zeros, if necessary, so that the number of digits in the integer part is standardized:
UTM easting: 6 digits.
UTM northing: 7 digits.
UPS easting and northing: 7 digits.
Note that the method does not transform between geodetic datums: For example, if the geodeticDatum parameter represents ED50 (European Datum 1950), then the method formats ED50 LongLat into ED50 UTM. The geodetic datum parameter is still necessary, since the size and shape of the reference ellipsoid affects the conversion from LongLat to UTM/UPS.
The method will return three empty strings if the input longitude is not in the range -999.5° to 999.5°, or if the input latitude is not in the range -90° to 90°.
Platforms
Windows, Linux, Android