Knowledge Base



KB10820 - Converting coordinates between two coordinate systems.

A point can be converted between any two supported (and compatible) coordinate systems. The easiest way is to use EPSG codes (see also KB10821).

Example
Projection of points from WGS84 to the Irish National Map Grid coordinate system is performed as follows:

  TGIS_CSCoordinateSystem cs_in  = TGIS_CSFactory.ByEPSG( 4326 );
  TGIS_CSCoordinateSystem cs_out = TGIS_CSFactory.ByEPSG( 29901 );
  ptg_in.X = -2 ; // longitude
  ptg_in.Y = 60 ; // latitude

  ptg_out = cs_in.ToCS( cs_out, ptg_in ) ; 
 
  // alternative code
  ptg_out = cs_out.FromCS( cs_in, ptg_in ) ; 
Created: October 22, 2009, Modified: November 03, 2015