Method ToMgrs
ToMgrs(MapPoint, MgrsConversionMode, Int32, Boolean)
Returns a formatted coordinate string in Military Grid Reference System (MGRS) notation
representing the given Map
Declaration
public static string ToMgrs(MapPoint point, MgrsConversionMode mgrsConversionMode, int precision, bool addSpaces)
Parameters
Type | Name | Description |
---|---|---|
Map |
point | The location to be represented in MGRS notation.
It must have a Spatial |
Mgrs |
mgrsConversionMode | The Mgrs |
System. |
precision | The precision with which to represent the coordinate. Value is expected to be between 0 to 8 (inclusive), and will be clamped if necessary. |
System. |
addSpaces | If |
Returns
Type | Description |
---|---|
System. |
An MGRS notation string representing the position of the given Map |
Remarks
For an explanation of the different modes for interpreting an MGRS notation string, please see Mgrsprecision
parameter controls the number of digits used
to represent each numerical easting and northing value within the returned MGRS string. For example:
precision parameter value |
addSpaces parameter value |
Example output | Approximate precision (to 1 significant figure) |
---|---|---|---|
0 | false | 30UVG |
100km |
1 | false | 30UVG89 |
10km |
2 | false | 30UVG8999 |
1km |
3 | false | 30UVG898998 |
100m |
4 | false | 30UVG89889988 |
10m |
5 | false | 30UVG8988499881 |
1m |
0 | true | 30U VG |
100km |
1 | true | 30U VG 8 9 |
10km |
2 | true | 30U VG 89 99 |
1km |
3 | true | 30U VG 898 998 |
100m |
4 | true | 30U VG 8988 9988 |
10m |
5 | true | 30U VG 89884 99881 |
1m |
Exceptions
Type | Condition |
---|---|
System. |
|
System. |
|
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 |