MilitaryGridReferenceSystemGet_Box_Boundaries Method

Returns a populated MGRS_GridBox details based on the MGRS coordinate. This can be useful for grid zone junction adjacent partial boxes or when needing Lat/Long coordinates at the corners of the MGRS square.

Definition

Namespace: CoordinateSharp
Assembly: CoordinateSharp (in CoordinateSharp.dll) Version: 3.1.1.1
XMLNS for XAML: Not mapped to an xmlns.
C#
public MGRS_GridBox Get_Box_Boundaries()

Return Value

MGRS_GridBox
MGRS Grid Box

Example

The following example will create an MGRS_GridBox that will allow us to determine The MGRS Point at the bottom left of the current 100km grid square and convert it to Lat/Long.
C#
MilitaryGridReferenceSystem mgrs = new MilitaryGridReferenceSystem("N", 21, "SA", 66037, 61982);
var box = mgrs.Get_Box_Boundaries();

//Check if created MGRS coordinate is valid
if(!box.IsBoxValid){return;} //MGRS Coordinate GZD and Identifier are not standard. Box cannot be determined.

Console.WriteLine("BL: " + gb.Bottom_Left_MGRS_Point); //21N SA 66022 00000
Console.WriteLine("BL: " + gb.Bottom_Left_Coordinate_Point); //N 0º 0' 0" W 59º 59' 59.982"

See Also