Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release > by-pkgid > 1113753f4f1993337154e9a221eac889 > files > 36

geotiff-1.2.5-9.mga5.x86_64.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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>libgeotiff: geo_normalize.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libgeotiff
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">geo_normalize.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
<code>#include &quot;<a class="el" href="geotiff_8h_source.html">geotiff.h</a>&quot;</code><br />
</div>
<p><a href="geo__normalize_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structGTIFDefn.html">GTIFDefn</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aa9103035c7660f7f4c1565746535381f"><td class="memItemLeft" align="right" valign="top">int CPL_DLL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="geo__normalize_8h.html#aa9103035c7660f7f4c1565746535381f">GTIFGetDefn</a> (<a class="el" href="structgtiff.html">GTIF</a> *psGTIF, <a class="el" href="structGTIFDefn.html">GTIFDefn</a> *psDefn)</td></tr>
<tr class="separator:aa9103035c7660f7f4c1565746535381f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13c1de026f5e74ea5944f9f17619fdc0"><td class="memItemLeft" align="right" valign="top">void CPL_DLL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="geo__normalize_8h.html#a13c1de026f5e74ea5944f9f17619fdc0">SetCSVFilenameHook</a> (const char *(*CSVFileOverride)(const char *))</td></tr>
<tr class="separator:a13c1de026f5e74ea5944f9f17619fdc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a354649dba7406f27846861104f38d703"><td class="memItemLeft" align="right" valign="top">int CPL_DLL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="geo__normalize_8h.html#a354649dba7406f27846861104f38d703">GTIFPCSToMapSys</a> (int PCSCode, int *pDatum, int *pZone)</td></tr>
<tr class="separator:a354649dba7406f27846861104f38d703"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a590db66e88edf329982ec482cad0c4dc"><td class="memItemLeft" align="right" valign="top">int CPL_DLL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="geo__normalize_8h.html#a590db66e88edf329982ec482cad0c4dc">GTIFProjToMapSys</a> (int ProjCode, int *pZone)</td></tr>
<tr class="separator:a590db66e88edf329982ec482cad0c4dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Include file for extended projection definition normalization api. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="aa9103035c7660f7f4c1565746535381f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int CPL_DLL GTIFGetDefn </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structgtiff.html">GTIF</a> *&#160;</td>
          <td class="paramname"><em>psGTIF</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structGTIFDefn.html">GTIFDefn</a> *&#160;</td>
          <td class="paramname"><em>psDefn</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">psGTIF</td><td>GeoTIFF information handle as returned by GTIFNew. </td></tr>
    <tr><td class="paramname">psDefn</td><td>Pointer to an existing <a class="el" href="structGTIFDefn.html">GTIFDefn</a> structure. This structure does not need to have been pre-initialized at all.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE if the function has been successful, otherwise FALSE.</dd></dl>
<p>This function reads the coordinate system definition from a GeoTIFF file, and <em>normalizes</em> it into a set of component information using definitions from CSV (Comma Seperated Value ASCII) files derived from EPSG tables. This function is intended to simplify correct support for reading files with defined PCS (Projected Coordinate System) codes that wouldn't otherwise be directly known by application software by reducing it to the underlying projection method, parameters, datum, ellipsoid, prime meridian and units.</p>
<p>The application should pass a pointer to an existing uninitialized <a class="el" href="structGTIFDefn.html">GTIFDefn</a> structure, and <a class="el" href="geo__normalize_8h.html#aa9103035c7660f7f4c1565746535381f">GTIFGetDefn()</a> will fill it in. The fuction currently always returns TRUE but in the future will return FALSE if CSV files are not found. In any event, all geokeys actually found in the file will be copied into the <a class="el" href="structGTIFDefn.html">GTIFDefn</a>. However, if the CSV files aren't found codes implied by other codes will not be set properly.</p>
<p><a class="el" href="geo__normalize_8h.html#aa9103035c7660f7f4c1565746535381f">GTIFGetDefn()</a> will not generally work if the EPSG derived CSV files cannot be found. By default a modest attempt will be made to find them, but in general it is necessary for the calling application to override the logic to find them. This can be done by calling the <a class="el" href="geo__normalize_8h.html#a13c1de026f5e74ea5944f9f17619fdc0">SetCSVFilenameHook()</a> function to override the search method based on application knowledge of where they are found.</p>
<p>The normalization methodology operates by fetching tags from the GeoTIFF file, and then setting all other tags implied by them in the structure. The implied relationships are worked out by reading definitions from the various EPSG derived CSV tables.</p>
<p>For instance, if a PCS (ProjectedCSTypeGeoKey) is found in the GeoTIFF file this code is used to lookup a record in the <code>horiz_cs.csv</code> CSV file. For example given the PCS 26746 we can find the name (NAD27 / California zone VI), the GCS 4257 (NAD27), and the ProjectionCode 10406 (California CS27 zone VI). The GCS, and ProjectionCode can in turn be looked up in other tables until all the details of units, ellipsoid, prime meridian, datum, projection (LambertConfConic_2SP) and projection parameters are established. A full listgeo dump of a file for this result might look like the following, all based on a single PCS value:</p>
<pre>
% listgeo -norm ~/data/geotiff/pci_eg/spaf27.tif
Geotiff_Information:
   Version: 1
   Key_Revision: 1.0
   Tagged_Information:
      ModelTiepointTag (2,3):
         0                0                0                
         1577139.71       634349.176       0                
      ModelPixelScaleTag (1,3):
         195.509321       198.32184        0                
      End_Of_Tags.
   Keyed_Information:
      GTModelTypeGeoKey (Short,1): ModelTypeProjected
      GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
      ProjectedCSTypeGeoKey (Short,1): PCS_NAD27_California_VI
      End_Of_Keys.
   End_Of_Geotiff.</pre><pre>PCS = 26746 (NAD27 / California zone VI)
Projection = 10406 (California CS27 zone VI)
Projection Method: CT_LambertConfConic_2SP
   ProjStdParallel1GeoKey: 33.883333
   ProjStdParallel2GeoKey: 32.766667
   ProjFalseOriginLatGeoKey: 32.166667
   ProjFalseOriginLongGeoKey: -116.233333
   ProjFalseEastingGeoKey: 609601.219202
   ProjFalseNorthingGeoKey: 0.000000
GCS: 4267/NAD27
Datum: 6267/North American Datum 1927
Ellipsoid: 7008/Clarke 1866 (6378206.40,6356583.80)
Prime Meridian: 8901/Greenwich (0.000000)
Projection Linear Units: 9003/US survey foot (0.304801m)
</pre><p>Note that <a class="el" href="geo__normalize_8h.html#aa9103035c7660f7f4c1565746535381f">GTIFGetDefn()</a> does not inspect or return the tiepoints and scale. This must be handled seperately as it normally would. It is intended to simplify capture and normalization of the coordinate system definition. Note that <a class="el" href="geo__normalize_8h.html#aa9103035c7660f7f4c1565746535381f">GTIFGetDefn()</a> also does the following things:</p>
<ol>
<li>
Convert all angular values to decimal degrees. </li>
<li>
Convert all linear values to meters. </li>
<li>
Return the linear units and conversion to meters for the tiepoints and scale (though the tiepoints and scale remain in their native units). </li>
<li>
When reading projection parameters a variety of differences between different GeoTIFF generators are handled, and a normalized set of parameters for each projection are always returned. </li>
</ol>
<p>Code fields in the <a class="el" href="structGTIFDefn.html">GTIFDefn</a> are filled with KvUserDefined if there is not value to assign. The parameter lists for each of the underlying projection transform methods can be found at the <a href="http://www.remotesensing.org/geotiff/proj_list">Projections</a> page. Note that nParms will be set based on the maximum parameter used. Some of the parameters may not be used in which case the <a class="el" href="structGTIFDefn.html#ac0ba000217e21cd1a6ceac8a9944849a">GTIFDefn::ProjParmId</a>[] will be zero. This is done to retain correspondence to the EPSG parameter numbering scheme.</p>
<p>The <a href="http://www.remotesensing.org/cgi-bin/cvsweb.cgi/~checkout~/osrs/geotiff/libgeotiff/geotiff_proj4.c">geotiff_proj4.c</a> module distributed with libgeotiff can be used as an example of code that converts a <a class="el" href="structGTIFDefn.html">GTIFDefn</a> into another projection system.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="geotiff_8h.html#a642241ece835de8b4dd1be0a656df8a5">GTIFKeySet()</a>, <a class="el" href="geo__normalize_8h.html#a13c1de026f5e74ea5944f9f17619fdc0">SetCSVFilenameHook()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a354649dba7406f27846861104f38d703"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int CPL_DLL GTIFPCSToMapSys </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>PCSCode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>pDatum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>pZone</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Translate a PCS_ code into a UTM or State Plane map system, a datum, and a zone if possible.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PCSCode</td><td>The projection code (PCS_*) as would be stored in the ProjectedCSTypeGeoKey of a GeoTIFF file.</td></tr>
    <tr><td class="paramname">pDatum</td><td>Pointer to an integer into which the datum code (GCS_*) is put if the function succeeds.</td></tr>
    <tr><td class="paramname">pZone</td><td>Pointer to an integer into which the zone will be placed if the function is successful.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns either MapSys_UTM_North, MapSys_UTM_South, MapSys_State_Plane_83, MapSys_State_Plane_27 or KvUserDefined. KvUserDefined indicates that the function failed to recognise the projection as UTM or State Plane.</dd></dl>
<p>The zone value is only set if the return code is other than KvUserDefined. For utm map system the returned zone will be between 1 and 60. For State Plane, the USGS state plane zone number is returned. For instance, Alabama East is zone 101.</p>
<p>The datum (really this is the GCS) is set to a GCS_ value such as GCS_NAD27.</p>
<p>This function is useful to recognise (most) UTM and State Plane coordinate systems, even if CSV files aren't available to translate them automatically. It is used as a fallback mechanism by <a class="el" href="geo__normalize_8h.html#aa9103035c7660f7f4c1565746535381f">GTIFGetDefn()</a> for normalization when CSV files aren't found. </p>

</div>
</div>
<a class="anchor" id="a590db66e88edf329982ec482cad0c4dc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int CPL_DLL GTIFProjToMapSys </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>ProjCode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>pZone</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Translate a Proj_ code into a UTM or State Plane map system, and a zone if possible.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ProjCode</td><td>The projection code (Proj_*) as would be stored in the ProjectionGeoKey of a GeoTIFF file. </td></tr>
    <tr><td class="paramname">pZone</td><td>Pointer to an integer into which the zone will be placed if the function is successful.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns either MapSys_UTM_North, MapSys_UTM_South, MapSys_State_Plane_27, MapSys_State_Plane_83 or KvUserDefined. KvUserDefined indicates that the function failed to recognise the projection as UTM or State Plane.</dd></dl>
<p>The zone value is only set if the return code is other than KvUserDefined. For utm map system the returned zone will be between 1 and 60. For State Plane, the USGS state plane zone number is returned. For instance, Alabama East is zone 101.</p>
<p>This function is useful to recognise UTM and State Plane coordinate systems, and to extract zone numbers so the projections can be represented as UTM rather than as the underlying projection method such Transverse Mercator for instance. </p>

</div>
</div>
<a class="anchor" id="a13c1de026f5e74ea5944f9f17619fdc0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void CPL_DLL SetCSVFilenameHook </td>
          <td>(</td>
          <td class="paramtype">const char *(*)(const char *)&#160;</td>
          <td class="paramname"><em>pfnNewHook</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Override CSV file search method.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CSVFileOverride</td><td>The pointer to a function which will return the full path for a given filename.</td></tr>
  </table>
  </dd>
</dl>
<p>This function allows an application to override how the <a class="el" href="geo__normalize_8h.html#aa9103035c7660f7f4c1565746535381f">GTIFGetDefn()</a> and related function find the CSV (Comma Separated Value) values required. The pfnHook argument should be a pointer to a function that will take in a CSV filename and return a full path to the file. The returned string should be to an internal static buffer so that the caller doesn't have to free the result.</p>
<p><b>Example:</b><br />
</p>
<p>The listgeo utility uses the following override function if the user specified a CSV file directory with the -t commandline switch (argument put into CSVDirName). </p>
<pre>
<pre class="fragment">...


SetCSVFilenameHook( CSVFileOverride );

...
</pre></pre><pre>static const char *CSVFileOverride( const char * pszInput )</pre><pre>{
    static char         szPath[1024];</pre><pre>#ifdef WIN32
    sprintf( szPath, "%s\\%s", CSVDirName, pszInput );
#else    
    sprintf( szPath, "%s/%s", CSVDirName, pszInput );
#endif    
</p><pre class="fragment">return( szPath );
</pre><p>
}
</pre> 
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 16 2014 11:17:58 for libgeotiff by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>