Click or drag to resize

MilitaryGridReferenceSystemTryParse Method (String, Earth_Ellipsoid_Spec, 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,
	Earth_Ellipsoid_Spec spec,
	out MilitaryGridReferenceSystem mgrs
)

Parameters

value
Type: SystemString
string
spec
Type: CoordinateSharpEarth_Ellipsoid_Spec
Earth_Ellipsoid_Spec
mgrs
Type: CoordinateSharpMilitaryGridReferenceSystem
MilitaryGridReferenceSystem

Return Value

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