Home > Working with SGWorld > CoordServices (ICoordServices6) > ConvertCoordinateToMGRS

ConvertCoordinateToMGRS

This method converts a given coordinate from the coordinate system of the terrain database to Military Grid Reference System coordinates. The X and Y coordinates to be converted should be given in X and Y respectively. After the method is completed, bstrMGRS returns the converted coordinates as a string value.

 

JavaScript

 

ConvertCoordinateToMGRS(X, Y)

 

C#

 

string ConvertCoordinateToMGRS(

      double      X,

      double      Y)

 

C++

 

HRESULT ConvertCoordinateToMGRS(

       double     X,

       double     Y,

       BSTR *     bstrMGRS )

Parameters

X

The X- coordinate in coordinate system units.

Y

The Y- coordinate in coordinate system units.

bstrMGRS

Returns the MGRS coordinate as a string value.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.