Click or drag to resize

MilitaryGridReferenceSystemTryParse Method (String, Double, Double, MilitaryGridReferenceSystem)

Attempts to parse a string into an MGRS coordinate.

Namespace:  CoordinateSharp
Assembly:  CoordinateSharp (in CoordinateSharp.dll) Version: 2.12.1.1
Syntax
C#
public static bool TryParse(
	string value,
	double radius,
	double flattening,
	out MilitaryGridReferenceSystem mgrs
)

Parameters

value
Type: SystemString
string
radius
Type: SystemDouble
Equatorial Radius (Semi-Major Axis)
flattening
Type: SystemDouble
Inverse Flattening
mgrs
Type: CoordinateSharpMilitaryGridReferenceSystem
MilitaryGridReferenceSystem

Return Value

Type: Boolean
MilitaryGridReferenceSystem
Examples
The following example attempts to parse an MGRS coordinate set with GRS80 system ellipsoid values.
MilitaryGridReferenceSystem mgrs;
if(!MilitaryGridReferenceSystem.TryParse("16U EA 00872 05009", 6378137.0, 298.257222101, out mgrs))
{
    Console.WriteLine(mgrs);//16U EA 00872 05009
}
See Also