Documentation for "convertCoordinates"

PURPOSE ^

CONVERTCOORDINATES transformation between coordinate systems

SYNOPSIS ^

function [x2,y2,OPT]=convertCoordinates(x1,y1,varargin)

DESCRIPTION ^

CONVERTCOORDINATES transformation between coordinate systems

 [x2,y2,<log>] = convertCoordinatesNew(x1,y1,'keyword','value')

 Note 1: Beware of the Lon-Lat order of in- and output arguments!
 Note 2: (x1,y1) can be vectors or matrices.
 Note 3: Does not work for MatLab 7.0 and older (gives invalid MEX file
         warnings)
 Note 4: Rijksdriehoek(RD) to WGS 84 conversions are NOT exact. Accuracy
         is better than 0.5m, but multiple conversions can mess things up.
         For accurate conversions, see  <a href="http://www.rdnap.nl/">www.rdnap.nl/</a>

 x1,y1 : values of the coordinates to be transformed   , either X-Y or Lon-Lat.
 x2,y2 : values of the coordinates after transformation, either X-Y or Lon-Lat.
 log   : contains all conversion parameters that were used.
         To check this output, use 'var2evalstr(log)'.

 Optionally the data structure with EPSG codes van be pre-loaded, this
 greatly speeds up the routine if many calls are made. The call is either

    EPSG        = load('EPSG');
    [x2,y2,log] = convertCoordinates(x1,y1,EPSG,'keyword','value')

    or:

    [x2,y2,log] = convertCoordinates(x1,y1,     'keyword','value')

 The most important keyword value pairs are the identifiers for the
 coordinate systems:
    (from) 'Coordinate System 1' (CS1)
    (to)   'Coordinate System 2' (CS2).

 Any combination of name, type and code that identifies a unique
 coordinate system will do.

    CS1.name = coordinate system name
    CS1.code = coordinate system reference code
    CS1.type = projection type

 When multiple coordinate systems fit the criteria, an error message is
 returende that lists these options.

 Projection types supported     : projected and geographic 2D
 Projection not (yet) supported : engineering, geographic 3D, vertical, geocentric,  compound

 Supported synonyms for 'projected'    : 'xy','proj','cartesian','cart'
 Supported synonyms for 'geographic 2D': 'geo','latlon','lat lon','geographic','geographic2d'

 Example 1: 4 different notations of 1 single transformation case:

    [x,y,log]=convertCoordinates(5,52,'CS1.name','WGS 84','CS1.type','geo','CS2.name','WGS 84 / UTM zone 31N','CS2.type','xy')
    [x,y,log]=convertCoordinates(5,52,'CS1.code',4326                     ,'CS2.name','WGS 84 / UTM zone 31N')

    ESPG = load('EPSG')

    [x,y,log]=convertCoordinates(52,5,EPSG,'CS1.name','WGS 84','CS1.type','geo','CS2.code',32631)
    [x,y,log]=convertCoordinates(52,5,EPSG,'CS1.code',4326                     ,'CS2.code',32631)

 Example 2: Rijksdriehoek to WGS 84:

   [lon,lat,log]=convertCoordinates(xRD,yRD,'CS1.code',28992,'CS2.code',4326)

 Example 3: decimal degree to sexagesimal DMS conversion:

   [lon,lat,log]=convertCoordinates(52,5.5,'CS1.code',4326,'CS2.code',4326,'CS2.UoM.name','sexagesimal DMS')

 +-------+-------------------------+------------------+
 | code  |  name                   |  type            |
 +-------+-------------------------+------------------+
 |  4326 | 'WGS 84'                | 'geographic 2D'  |  To find specifications of
 | 28992 | 'Amersfoort / RD New'   | 'projected'      |  more coordinate systems
 | 32631 | 'WGS 84 / UTM zone 31N' | 'projected'      |  (name <=> code):
 | 23031 | 'ED50 / UTM zone 31N'   | 'projected'      |  <a href="http://www.epsg-registry.org">www.epsg-registry.org</a>
 +-------+-------------------------+------------------+

 See also: SuperTrans, EPSG.mat

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Wed 05-Jan-2011 21:42:04 by m2html using template 3frames © Guillaume Flandin, Lorenz Gerstmayr, 2003-2005