DilysDilys Global Mapper UserPosts: 41Trusted User
edited July 2010 in SDK
Hi Mike,

I have a problem of using GM_DecodeMGRSCoordinates function.

My definition of the function as below:

Public Declare Function GM_DecodeMGRSCoordinates Lib "GlobalMapperInterface" _
( _
ByVal aMgrsStr As String, _
ByRef aX As Double, _
ByRef aY As Double, _
ByVal aLatLon As Byte _
) As Int32

When I run below code:
Dim dblLat, dblLong As Double
Dim theErr As Int32 = GM_DecodeMGRSCoordinates("59JPF02351", dblLong, dblLat, 1)

it give me below message:

Invalid or missing northing.
CoordinateTransforms.cpp - 2859
Version: v1.33
Build Time: Mar 3 2010 16:03:06

Could you help me please?



  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited July 2010

    Are you sure that is a valid MGRS coordinate string? I would expect the coordinate digits to be an even number of digits so that the easting and northing values are the same length. Currently your coordinate part is '02351' which is an odd number of digits, so it's not obvious which part is the easting and which is the northing.

    Let me know if I can be of further assistance.


    Global Mapper Support
Sign In or Register to comment.