Converting from GM_PRJ_GEO to GM_PRJ_UTM

fxrazno1fxrazno1 Global Mapper UserPosts: 33Trusted User
edited January 2011 in SDK
Hi
I am trying to convert a coodinate from GM_PRJ_GEO in ARC_DEGREE to
GM_PRJ_UTM in METERS and I am getting an error.
Can you give me an example ?
The parameters for the new projection (UTM) are:
mProjSys=GM_PRJ_UTM
mDatum=GM_DATUM_WGS_84
mUnit =GM_PRJ_UNIT_METERS

Thanks
Raz

Comments

  • OseiOsei Global Mapper User Posts: 119Trusted User
    edited January 2011
    You have to set the UTM Zone you are using. You can choose say UTM Zone 30 and that should do the trick. Are you using the GM_ProjectPoint method?
    Use
    mAttrs[0].mAttr = ZONE;
    mAttrs[0].mValue = 30;
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited January 2011
    Thanks for the replay. Also set mNumAttrs = 1 when setting up the UTM zone.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • fxrazno1fxrazno1 Global Mapper User Posts: 33Trusted User
    edited January 2011
    Hi
    What if I don't know the UTM zone ? Is there a way to get the UTM zone if you know the lat,lon coordinates ?
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited January 2011
    The longitude is the main thing. The formula is:

    utm_zone = ::ceil( ( lon + 180 ) / 6 );

    If the latitude is in the southern hemisphere make the zone negative.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.