Knowledge Base



KB10889 - Converting coordinates between coordinate systems and "text" projections such as MGRS and GEOREF.


Example
Projection of points from Word Mercator to the MGRS system is performed as follows:

  TGIS_CSCoordinateSystem cs_in    = TGIS_CSFactory.ByEPSG( 3395);
  TGIS_CSProjGridAbstract prj_mgrs = (TGIS_CSProjGridAbstract)( TGIS_Utils.CSProjList.ByWKT( "MGRS" ) ) ;

  ptg_in.X = 2003750; // easting
  ptg_in.Y = 7135562; // northing

  ptg_radians = cs_in.ToWGS( ptg_in ) ; 

  txt = prj_mgrs.ProjectedText( ptg_radians ) ;

  // reverting
  ptg_radians = prj_mgrs.UnprojectedTxt( txt ) ;
  ptg_out = cs_in.FromWGS( prg_radians ) ;


Created: December 04, 2012, Modified: December 14, 2012
follow us on Facebook  follow us on Twitter  follow us on Google +  follow us on LinkedIn  Embarcadero