Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 7fd7c575020aa78a8e2e309ea8909f43 > files > 983

gdal-1.6.2-6.fc13.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OGR: OGR Projections Tutorial</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2-20100208 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">


<h1><a class="anchor" id="osr_tutorial">OGR Projections Tutorial </a></h1><h2><a class="anchor" id="osr_tutorial_intro">
Introduction</a></h2>
<p>The <a class="el" href="classOGRSpatialReference.html">OGRSpatialReference</a>, and <a class="el" href="classOGRCoordinateTransformation.html">OGRCoordinateTransformation</a> classes provide services to represent coordinate systems (projections and datums) and to transform between them. These services are loosely modelled on the OpenGIS Coordinate Transformations specification, and use the same Well Known Text format for describing coordinate systems.</p>
<p>Some background on OpenGIS coordinate systems and services can be found in the Simple Features for COM, and Spatial Reference Systems Abstract Model documents available from <a href="http://www.opengis.org/">www.opengis.org</a>. The GeoTIFF Projections Transform List (<a href="http://www.remotesensing.org/geotiff/proj_list">http://www.remotesensing.org/geotiff/proj_list</a>) may also be of assistance in understanding formulations of projections in WKT. The <a href="http://www.epsg.org">EPSG</a> Geodesy web page is also a useful resource.</p>
<h2><a class="anchor" id="osr_tutorial_cs">
Defining a Geographic Coordinate System</a></h2>
<p>Coordinate systems are encapsulated in the <a class="el" href="classOGRSpatialReference.html">OGRSpatialReference</a> class. There are a number of ways of initializing an <a class="el" href="classOGRSpatialReference.html">OGRSpatialReference</a> object to a valid coordinate system. There are two primary kinds of coordinate systems. The first is geographic (positions are measured in long/lat) and the second is projected (such as UTM - positions are measured in meters or feet).</p>
<p>A Geographic coordinate system contains information on the datum (which implies an spheroid described by a semi-major axis, and inverse flattening), prime meridian(normally Greenwich), and an angular units type which is normally degrees. The following code initializes a geographic coordinate system on supplying all this information along with a user visible name for the geographic coordinate system.</p>
<div class="fragment"><pre class="fragment">        <a class="code" href="classOGRSpatialReference.html">OGRSpatialReference</a> oSRS;

        oSRS.<a class="code" href="classOGRSpatialReference.html#a1c8d3eaf2751d9912797c75f477549fe">SetGeogCS</a>( <span class="stringliteral">&quot;My geographic coordinate system&quot;</span>,
                        <span class="stringliteral">&quot;WGS_1984&quot;</span>, 
                        <span class="stringliteral">&quot;My WGS84 Spheroid&quot;</span>, 
                        SRS_WGS84_SEMIMAJOR, SRS_WGS84_INVFLATTENING, 
                        <span class="stringliteral">&quot;Greenwich&quot;</span>, 0.0, 
                        <span class="stringliteral">&quot;degree&quot;</span>, SRS_UA_DEGREE_CONV );
</pre></div><p>Of these values, the names "My geographic coordinate system", "My WGS84 
Spheroid", "Greenwich" and "degree" are not keys, but are used for display to the user. However, the datum name "WGS_1984" is used as a key to identify the datum, and there are rules on what values can be used. NOTE: Prepare writeup somewhere on valid datums!</p>
<p>The <a class="el" href="classOGRSpatialReference.html">OGRSpatialReference</a> has built in support for a few well known coordinate systems, which include "NAD27", "NAD83", "WGS72" and "WGS84" which can be defined in a single call to SetWellKnownGeogCS().</p>
<div class="fragment"><pre class="fragment">        oSRS.<a class="code" href="classOGRSpatialReference.html#a096b8dde4fd2eb475acd376060940b02">SetWellKnownGeogCS</a>( <span class="stringliteral">&quot;WGS84&quot;</span> );
</pre></div><p>Furthermore, any geographic coordinate system in the EPSG database can be set by it's GCS code number if the EPSG database is available.</p>
<div class="fragment"><pre class="fragment">        oSRS.<a class="code" href="classOGRSpatialReference.html#a096b8dde4fd2eb475acd376060940b02">SetWellKnownGeogCS</a>( <span class="stringliteral">&quot;EPSG:4326&quot;</span> );
</pre></div><p>For serializization, and transmission of projection definitions to other packages, the OpenGIS Well Known Text format for coordinate systems is used. An <a class="el" href="classOGRSpatialReference.html">OGRSpatialReference</a> can be initialized from well known text, or converted back into well known text.</p>
<div class="fragment"><pre class="fragment">        <span class="keywordtype">char</span>    *pszWKT = NULL;

        oSRS.<a class="code" href="classOGRSpatialReference.html#a096b8dde4fd2eb475acd376060940b02">SetWellKnownGeogCS</a>( <span class="stringliteral">&quot;WGS84&quot;</span> );
        oSRS.<a class="code" href="classOGRSpatialReference.html#a596b8e527d66a5054408159f0006fdac">exportToWkt</a>( &amp;pszWKT );
        printf( <span class="stringliteral">&quot;%s\n&quot;</span>, pszWKT );
</pre></div><p>gives something like:</p>
<pre>
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG",7030]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG",6326]],
PRIMEM["Greenwich",0,AUTHORITY["EPSG",8901]],UNIT["DMSH",0.0174532925199433,
AUTHORITY["EPSG",9108]],AXIS["Lat",NORTH],AXIS["Long",EAST],AUTHORITY["EPSG",
4326]]
</pre><p>or in more readable form:</p>
<pre>
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG",7030]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG",6326]],
    PRIMEM["Greenwich",0,AUTHORITY["EPSG",8901]],
    UNIT["DMSH",0.0174532925199433,AUTHORITY["EPSG",9108]],
    AXIS["Lat",NORTH],
    AXIS["Long",EAST],
    AUTHORITY["EPSG",4326]]
</pre><p>The <a class="el" href="classOGRSpatialReference.html#ab74cfc985bd05404a4c61d2d633a6343">OGRSpatialReference::importFromWkt()</a> method can be used to set an <a class="el" href="classOGRSpatialReference.html">OGRSpatialReference</a> from a WKT coordinate system definition.</p>
<h2><a class="anchor" id="osr_tutorial_proj">
Defining a Projected Coordinate System</a></h2>
<p>A projected coordinate system (such as UTM, Lambert Conformal Conic, etc) requires and underlying geographic coordinate system as well as a definition for the projection transform used to translate between linear positions (in meters or feet) and angular long/lat positions. The following code defines a UTM zone 17 projected coordinate system with and underlying geographic coordinate system (datum) of WGS84.</p>
<div class="fragment"><pre class="fragment">        <a class="code" href="classOGRSpatialReference.html">OGRSpatialReference</a>     oSRS;

        oSRS.<a class="code" href="classOGRSpatialReference.html#a208118581246feb29646acf2ea5d4237">SetProjCS</a>( <span class="stringliteral">&quot;UTM 17 (WGS84) in northern hemisphere.&quot;</span> );
        oSRS.<a class="code" href="classOGRSpatialReference.html#a096b8dde4fd2eb475acd376060940b02">SetWellKnownGeogCS</a>( <span class="stringliteral">&quot;WGS84&quot;</span> );
        oSRS.<a class="code" href="classOGRSpatialReference.html#a0c4f6fcab663c9eb6d465787cad3833c">SetUTM</a>( 17, TRUE );
</pre></div><p>Calling SetProjCS() sets a user name for the projected coordinate system and establishes that the system is projected. The SetWellKnownGeogCS() associates a geographic coordinate system, and the SetUTM() call sets detailed projection transformation parameters. At this time the above order is important in order to create a valid definition, but in the future the object will automatically reorder the internal representation as needed to remain valid. For now <b>be careful of the order of steps defining an OGRSpatialReference!</b></p>
<p>The above definition would give a WKT version that looks something like the following. Note that the UTM 17 was expanded into the details transverse mercator definition of the UTM zone.</p>
<pre>
PROJCS["UTM 17 (WGS84) in northern hemisphere.",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG",7030]],
            TOWGS84[0,0,0,0,0,0,0],
            AUTHORITY["EPSG",6326]],
        PRIMEM["Greenwich",0,AUTHORITY["EPSG",8901]],
        UNIT["DMSH",0.0174532925199433,AUTHORITY["EPSG",9108]],
        AXIS["Lat",NORTH],
        AXIS["Long",EAST],
        AUTHORITY["EPSG",4326]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-81],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0]]
</pre><p>There are methods for many projection methods including SetTM() (Transverse Mercator), SetLCC() (Lambert Conformal Conic), and SetMercator().</p>
<h2><a class="anchor" id="osr_tutorial_query">
Querying Coordinate System</a></h2>
<p>Once an <a class="el" href="classOGRSpatialReference.html">OGRSpatialReference</a> has been established, various information about it can be queried. It can be established if it is a projected or geographic coordinate system using the <a class="el" href="classOGRSpatialReference.html#a1186e3473d7ac2f81ec2ca5d0c4ec027">OGRSpatialReference::IsProjected()</a> and <a class="el" href="classOGRSpatialReference.html#a764ba5d91530ad721d78ac629c0eaba8">OGRSpatialReference::IsGeographic()</a> methods. The <a class="el" href="classOGRSpatialReference.html#ae4a85fc76fb96e5d253897d0589aea33">OGRSpatialReference::GetSemiMajor()</a>, <a class="el" href="classOGRSpatialReference.html#ae004d56063c3dedf18bc3a8c705deacb">OGRSpatialReference::GetSemiMinor()</a> and <a class="el" href="classOGRSpatialReference.html#ab8e5f09148eb80ea4c8242d30591ba32">OGRSpatialReference::GetInvFlattening()</a> methods can be used to get information about the spheroid. The <a class="el" href="classOGRSpatialReference.html#acc815e7bd21c1c052304368c0eefe8be">OGRSpatialReference::GetAttrValue()</a> method can be used to get the PROJCS, GEOGCS, DATUM, SPHEROID, and PROJECTION names strings. The <a class="el" href="classOGRSpatialReference.html#a603c654bc0616f26c9300b3c66952cdb">OGRSpatialReference::GetProjParm()</a> method can be used to get the projection parameters. The <a class="el" href="classOGRSpatialReference.html#af2821ab555a3bb2d6bb1df49d076a198">OGRSpatialReference::GetLinearUnits()</a> method can be used to fetch the linear units type, and translation to meters.</p>
<p>The following code (from ogr_srs_proj4.cpp) demonstrates use of GetAttrValue() to get the projection, and GetProjParm() to get projection parameters. The GetAttrValue() method searches for the first "value" node associated with the named entry in the WKT text representation. The define'ed constants for projection parameters (such as SRS_PP_CENTRAL_MERIDIAN) should be used when fetching projection parameter with GetProjParm(). The code for the Set methods of the various projections in ogrspatialreference.cpp can be consulted to find which parameters apply to which projections.</p>
<div class="fragment"><pre class="fragment">    <span class="keyword">const</span> <span class="keywordtype">char</span> *pszProjection = poSRS-&gt;GetAttrValue(<span class="stringliteral">&quot;PROJECTION&quot;</span>);

    <span class="keywordflow">if</span>( pszProjection == NULL )
    {
        <span class="keywordflow">if</span>( poSRS-&gt;IsGeographic() )
            sprintf( szProj4+strlen(szProj4), <span class="stringliteral">&quot;+proj=longlat &quot;</span> );
        <span class="keywordflow">else</span>
            sprintf( szProj4+strlen(szProj4), <span class="stringliteral">&quot;unknown &quot;</span> );
    }
    <span class="keywordflow">else</span> <span class="keywordflow">if</span>( EQUAL(pszProjection,SRS_PT_CYLINDRICAL_EQUAL_AREA) )
    {
        sprintf( szProj4+strlen(szProj4),
           <span class="stringliteral">&quot;+proj=cea +lon_0=%.9f +lat_ts=%.9f +x_0=%.3f +y_0=%.3f &quot;</span>,
                 poSRS-&gt;GetProjParm(SRS_PP_CENTRAL_MERIDIAN,0.0),
                 poSRS-&gt;GetProjParm(SRS_PP_STANDARD_PARALLEL_1,0.0),
                 poSRS-&gt;GetProjParm(SRS_PP_FALSE_EASTING,0.0),
                 poSRS-&gt;GetProjParm(SRS_PP_FALSE_NORTHING,0.0) );
    }
    ...
</pre></div><h2><a class="anchor" id="osr_tutorial_transform">
Coordinate Transformation</a></h2>
<p>The <a class="el" href="classOGRCoordinateTransformation.html">OGRCoordinateTransformation</a> class is used for translating positions between different coordinate systems. New transformation objects are created using <a class="el" href="ogr__spatialref_8h.html#aae11bd08e45cdb2e71e1d9c31f1e550f">OGRCreateCoordinateTransformation()</a>, and then the <a class="el" href="classOGRCoordinateTransformation.html#abf141396940b4f7b1f8118ea025d569b">OGRCoordinateTransformation::Transform()</a> method can be used to convert points between coordinate systems.</p>
<div class="fragment"><pre class="fragment">        <a class="code" href="classOGRSpatialReference.html">OGRSpatialReference</a> oSourceSRS, oTargetSRS;
        <a class="code" href="classOGRCoordinateTransformation.html">OGRCoordinateTransformation</a> *poCT;
        <span class="keywordtype">double</span>                  x, y;
            
        oSourceSRS.<a class="code" href="classOGRSpatialReference.html#a8a5b8c9a205eedc6b88a14aa0c219969">importFromEPSG</a>( atoi(papszArgv[i+1]) );
        oTargetSRS.<a class="code" href="classOGRSpatialReference.html#a8a5b8c9a205eedc6b88a14aa0c219969">importFromEPSG</a>( atoi(papszArgv[i+2]) );
            
        poCT = <a class="code" href="ogr__spatialref_8h.html#aae11bd08e45cdb2e71e1d9c31f1e550f">OGRCreateCoordinateTransformation</a>( &amp;oSourceSRS,
                                                  &amp;oTargetSRS );
        x = atof( papszArgv[i+3] );
        y = atof( papszArgv[i+4] );
            
        <span class="keywordflow">if</span>( poCT == NULL || !poCT-&gt;<a class="code" href="classOGRCoordinateTransformation.html#abf141396940b4f7b1f8118ea025d569b">Transform</a>( 1, &amp;x, &amp;y ) )
            printf( <span class="stringliteral">&quot;Transformation failed.\n&quot;</span> );
        <span class="keywordflow">else</span>
            printf( <span class="stringliteral">&quot;(%f,%f) -&gt; (%f,%f)\n&quot;</span>, 
                    atof( papszArgv[i+3] ),
                    atof( papszArgv[i+4] ),
                    x, y );
</pre></div><p>There are a couple of points at which transformations can fail. First, <a class="el" href="ogr__spatialref_8h.html#aae11bd08e45cdb2e71e1d9c31f1e550f">OGRCreateCoordinateTransformation()</a> may fail, generally because the internals recognise that no transformation between the indicated systems can be established. This might be due to use of a projection not supported by the internal PROJ.4 library, differing datums for which no relationship is known, or one of the coordinate systems being inadequately defined. If <a class="el" href="ogr__spatialref_8h.html#aae11bd08e45cdb2e71e1d9c31f1e550f">OGRCreateCoordinateTransformation()</a> fails it will return a NULL.</p>
<p>The <a class="el" href="classOGRCoordinateTransformation.html#abf141396940b4f7b1f8118ea025d569b">OGRCoordinateTransformation::Transform()</a> method itself can also fail. This may be as a delayed result of one of the above problems, or as a result of an operation being numerically undefined for one or more of the passed in points. The Transform() function will return TRUE on success, or FALSE if any of the points fail to transform. The point array is left in an indeterminate state on error.</p>
<p>Though not shown above, the coordinate transformation service can take 3D points, and will adjust elevations for elevation differents in spheroids, and datums. At some point in the future shifts between different vertical datums may also be applied. If no Z is passed, it is assume that the point is on the geoide.</p>
<p>The following example shows how to conveniently create a lat/long coordinate system using the same geographic coordinate system as a projected coordinate system, and using that to transform between projected coordinates and lat/long.</p>
<div class="fragment"><pre class="fragment">    <a class="code" href="classOGRSpatialReference.html">OGRSpatialReference</a>    oUTM, *poLatLong;
    <a class="code" href="classOGRCoordinateTransformation.html">OGRCoordinateTransformation</a> *poTransform;

    oUTM.<a class="code" href="classOGRSpatialReference.html#a208118581246feb29646acf2ea5d4237">SetProjCS</a>(<span class="stringliteral">&quot;UTM 17 / WGS84&quot;</span>);
    oUTM.<a class="code" href="classOGRSpatialReference.html#a096b8dde4fd2eb475acd376060940b02">SetWellKnownGeogCS</a>( <span class="stringliteral">&quot;WGS84&quot;</span> );
    oUTM.<a class="code" href="classOGRSpatialReference.html#a0c4f6fcab663c9eb6d465787cad3833c">SetUTM</a>( 17 );

    poLatLong = oUTM.CloneGeogCS();
    
    poTransform = <a class="code" href="ogr__spatialref_8h.html#aae11bd08e45cdb2e71e1d9c31f1e550f">OGRCreateCoordinateTransformation</a>( &amp;oUTM, poLatLong );
    <span class="keywordflow">if</span>( poTransform == NULL )
    {
        ...
    }
    
    ...

    <span class="keywordflow">if</span>( !poTransform-&gt;<a class="code" href="classOGRCoordinateTransformation.html#abf141396940b4f7b1f8118ea025d569b">Transform</a>( nPoints, x, y, z ) )
    ...
</pre></div><h2><a class="anchor" id="osr_tutorial_apis">
Alternate Interfaces</a></h2>
<p>A C interface to the coordinate system services is defined in <a class="el" href="ogr__srs__api_8h.html">ogr_srs_api.h</a>, and Python bindings are available via the osr.py module. Methods are close analogs of the C++ methods but C and Python bindings are missing for some C++ methods.</p>
<h3>C Bindings</h3>
<div class="fragment"><pre class="fragment"><span class="keyword">typedef</span> <span class="keywordtype">void</span> *OGRSpatialReferenceH;                               
<span class="keyword">typedef</span> <span class="keywordtype">void</span> *OGRCoordinateTransformationH;

OGRSpatialReferenceH OSRNewSpatialReference( <span class="keyword">const</span> <span class="keywordtype">char</span> * );
<span class="keywordtype">void</span>    OSRDestroySpatialReference( OGRSpatialReferenceH );

<span class="keywordtype">int</span>     OSRReference( OGRSpatialReferenceH );
<span class="keywordtype">int</span>     OSRDereference( OGRSpatialReferenceH );

OGRErr  OSRImportFromEPSG( OGRSpatialReferenceH, <span class="keywordtype">int</span> );
OGRErr  <a class="code" href="ogr__srs__api_8h.html#a37a167850021c64dfec606e24a1c1e71">OSRImportFromWkt</a>( OGRSpatialReferenceH, <span class="keywordtype">char</span> ** );
OGRErr  <a class="code" href="ogr__srs__api_8h.html#a92d97dc5f5d09d76310b143f86b0f101">OSRExportToWkt</a>( OGRSpatialReferenceH, <span class="keywordtype">char</span> ** );

OGRErr  OSRSetAttrValue( OGRSpatialReferenceH hSRS, <span class="keyword">const</span> <span class="keywordtype">char</span> * pszNodePath,
                         <span class="keyword">const</span> <span class="keywordtype">char</span> * pszNewNodeValue );
<span class="keyword">const</span> <span class="keywordtype">char</span> *OSRGetAttrValue( OGRSpatialReferenceH hSRS,
                             <span class="keyword">const</span> <span class="keywordtype">char</span> * pszName, <span class="keywordtype">int</span> iChild);

OGRErr  OSRSetLinearUnits( OGRSpatialReferenceH, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span> );
<span class="keywordtype">double</span>  OSRGetLinearUnits( OGRSpatialReferenceH, <span class="keywordtype">char</span> ** );

<span class="keywordtype">int</span>     OSRIsGeographic( OGRSpatialReferenceH );
<span class="keywordtype">int</span>     OSRIsProjected( OGRSpatialReferenceH );
<span class="keywordtype">int</span>     OSRIsSameGeogCS( OGRSpatialReferenceH, OGRSpatialReferenceH );
<span class="keywordtype">int</span>     OSRIsSame( OGRSpatialReferenceH, OGRSpatialReferenceH );

OGRErr  OSRSetProjCS( OGRSpatialReferenceH hSRS, <span class="keyword">const</span> <span class="keywordtype">char</span> * pszName );
OGRErr  OSRSetWellKnownGeogCS( OGRSpatialReferenceH hSRS,
                               <span class="keyword">const</span> <span class="keywordtype">char</span> * pszName );

OGRErr  OSRSetGeogCS( OGRSpatialReferenceH hSRS,
                      <span class="keyword">const</span> <span class="keywordtype">char</span> * pszGeogName,
                      <span class="keyword">const</span> <span class="keywordtype">char</span> * pszDatumName,
                      <span class="keyword">const</span> <span class="keywordtype">char</span> * pszEllipsoidName,
                      <span class="keywordtype">double</span> dfSemiMajor, <span class="keywordtype">double</span> dfInvFlattening,
                      <span class="keyword">const</span> <span class="keywordtype">char</span> * pszPMName ,
                      <span class="keywordtype">double</span> dfPMOffset ,
                      <span class="keyword">const</span> <span class="keywordtype">char</span> * pszUnits,
                      <span class="keywordtype">double</span> dfConvertToRadians );

<span class="keywordtype">double</span>  OSRGetSemiMajor( OGRSpatialReferenceH, OGRErr * );
<span class="keywordtype">double</span>  OSRGetSemiMinor( OGRSpatialReferenceH, OGRErr * );
<span class="keywordtype">double</span>  OSRGetInvFlattening( OGRSpatialReferenceH, OGRErr * );

OGRErr  OSRSetAuthority( OGRSpatialReferenceH hSRS,
                         <span class="keyword">const</span> <span class="keywordtype">char</span> * pszTargetKey,
                         <span class="keyword">const</span> <span class="keywordtype">char</span> * pszAuthority,
                         <span class="keywordtype">int</span> nCode );
OGRErr  OSRSetProjParm( OGRSpatialReferenceH, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">double</span> );
<span class="keywordtype">double</span>  OSRGetProjParm( OGRSpatialReferenceH hSRS,
                        <span class="keyword">const</span> <span class="keywordtype">char</span> * pszParmName, 
                        <span class="keywordtype">double</span> dfDefault,
                        OGRErr * );

OGRErr  OSRSetUTM( OGRSpatialReferenceH hSRS, <span class="keywordtype">int</span> nZone, <span class="keywordtype">int</span> bNorth );
<span class="keywordtype">int</span>     OSRGetUTMZone( OGRSpatialReferenceH hSRS, <span class="keywordtype">int</span> *pbNorth );

OGRCoordinateTransformationH
OCTNewCoordinateTransformation( OGRSpatialReferenceH hSourceSRS,
                                OGRSpatialReferenceH hTargetSRS );
<span class="keywordtype">void</span> OCTDestroyCoordinateTransformation( OGRCoordinateTransformationH );

<span class="keywordtype">int</span> OCTTransform( OGRCoordinateTransformationH hCT,
                  <span class="keywordtype">int</span> nCount, <span class="keywordtype">double</span> *x, <span class="keywordtype">double</span> *y, <span class="keywordtype">double</span> *z );
</pre></div><h3>Python Bindings</h3>
<div class="fragment"><pre class="fragment"><span class="keyword">class </span>osr.SpatialReference
    def __init__(self,obj=None):
    def ImportFromWkt( <span class="keyword">self</span>, wkt ):
    def ExportToWkt(self):
    def ImportFromEPSG(self,code):
    def IsGeographic(self):
    def IsProjected(self):
    def GetAttrValue(self, name, child = 0):
    def SetAttrValue(self, name, value):
    def SetWellKnownGeogCS(self, name):
    def SetProjCS(self, name = <span class="stringliteral">&quot;unnamed&quot;</span> ):
    def IsSameGeogCS(self, other):
    def IsSame(self, other):
    def SetLinearUnits(self, units_name, to_meters ):
    def SetUTM(self, zone, is_north = 1):

class CoordinateTransformation:
    def __init__(self,source,target):
    def TransformPoint(self, x, y, z = 0):
    def TransformPoints(self, points):
</pre></div><h2><a class="anchor" id="osr_tutorial_impl">
Internal Implementation</a></h2>
<p>The <a class="el" href="classOGRCoordinateTransformation.html">OGRCoordinateTransformation</a> service is implemented on top of the <a href="http://www.remotesensing.org/proj">PROJ.4</a> library originally written by Gerald Evenden of the USGS. </p>
</div>
<hr>

Generated for GDAL by 
<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.6.2-20100208.
</body>
</html>