- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

# geo_normalize.h

Go to the documentation of this file.

    00001 /******************************************************************************
    00002  * $Id: geo_normalize.h 1983 2011-03-10 02:10:00Z warmerdam $
    00003  *
    00004  * Project:  libgeotiff
    00005  * Purpose:  Include file related to geo_normalize.c containing Code to
    00006  *           normalize PCS and other composite codes in a GeoTIFF file.
    00007  * Author:   Frank Warmerdam, warmerda@home.com
    00008  *
    00009  ******************************************************************************
    00010  * Copyright (c) 1999, Frank Warmerdam
    00011  *
    00012  * Permission is hereby granted, free of charge, to any person obtaining a
    00013  * copy of this software and associated documentation files (the "Software"),
    00014  * to deal in the Software without restriction, including without limitation
    00015  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    00016  * and/or sell copies of the Software, and to permit persons to whom the
    00017  * Software is furnished to do so, subject to the following conditions:
    00018  *
    00019  * The above copyright notice and this permission notice shall be included
    00020  * in all copies or substantial portions of the Software.
    00021  *
    00022  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00023  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00024  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    00025  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00026  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    00027  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    00028  * DEALINGS IN THE SOFTWARE.
    00029  *****************************************************************************/
    00030
    00031 #ifndef GEO_NORMALIZE_H_INCLUDED
    00032 #define GEO_NORMALIZE_H_INCLUDED
    00033
    00034 #include <stdio.h>
    00035 #include "geotiff.h"
    00036
    00037 #ifdef __cplusplus
    00038 extern "C" {
    00039 #endif
    00040
    00047 #define MAX_GTIF_PROJPARMS      10
    00048
    00053 typedef struct {
    00056     short       Model;
    00057
    00059     short       PCS;
    00060
    00063     short       GCS;
    00064
    00066     short       UOMLength;
    00067
    00069     double      UOMLengthInMeters;
    00070
    00072     short       UOMAngle;
    00073
    00075     double      UOMAngleInDegrees;
    00076
    00078     short       Datum;
    00079
    00082     short       PM;
    00083
    00086     double      PMLongToGreenwich;
    00087
    00090     short       Ellipsoid;
    00091
    00093     double      SemiMajor;
    00094
    00096     double      SemiMinor;
    00097
    00099     short       TOWGS84Count;
    00100
    00102     double      TOWGS84[7];
    00103
    00105     short       ProjCode;
    00106
    00109     short       Projection;
    00110
    00114     short       CTProjection;
    00115
    00117     int         nParms;
    00118
    00123     double      ProjParm[MAX_GTIF_PROJPARMS];
    00124
    00127     int         ProjParmId[MAX_GTIF_PROJPARMS]; /* geokey identifier,
    00128                                                    eg. ProjFalseEastingGeoKey*/
    00129
    00132     int         MapSys;
    00133
    00135     int         Zone;
    00136
    00138     int         DefnSet;
    00139
    00140 } GTIFDefn;
    00141
    00142 int CPL_DLL GTIFGetPCSInfo( int nPCSCode, char **ppszEPSGName,
    00143                             short *pnProjOp,
    00144                             short *pnUOMLengthCode, short *pnGeogCS );
    00145 int CPL_DLL GTIFGetProjTRFInfo( int nProjTRFCode,
    00146                                 char ** ppszProjTRFName,
    00147                                 short * pnProjMethod,
    00148                                 double * padfProjParms );
    00149 int CPL_DLL GTIFGetGCSInfo( int nGCSCode, char **ppszName,
    00150                             short *pnDatum, short *pnPM, short *pnUOMAngle );
    00151 int CPL_DLL GTIFGetDatumInfo( int nDatumCode, char **ppszName,
    00152                               short * pnEllipsoid );
    00153 int CPL_DLL GTIFGetEllipsoidInfo( int nEllipsoid, char ** ppszName,
    00154                                   double * pdfSemiMajor,
    00155                                   double * pdfSemiMinor );
    00156 int CPL_DLL GTIFGetPMInfo( int nPM, char **ppszName,
    00157                            double * pdfLongToGreenwich );
    00158
    00159 double CPL_DLL GTIFAngleStringToDD( const char *pszAngle, int nUOMAngle );
    00160 int CPL_DLL GTIFGetUOMLengthInfo( int nUOMLengthCode,
    00161                                   char **ppszUOMName,
    00162                                   double * pdfInMeters );
    00163 int CPL_DLL GTIFGetUOMAngleInfo( int nUOMAngleCode,
    00164                                  char **ppszUOMName,
    00165                                  double * pdfInDegrees );
    00166 double CPL_DLL GTIFAngleToDD( double dfAngle, int nUOMAngle );
    00167
    00168
    00169 /* this should be used to free strings returned by GTIFGet... funcs */
    00170 void CPL_DLL GTIFFreeMemory( char * );
    00171 void CPL_DLL GTIFDeaccessCSV( void );
    00172
    00173 int CPL_DLL GTIFGetDefn( GTIF *psGTIF, GTIFDefn * psDefn );
    00174 void CPL_DLL GTIFPrintDefn( GTIFDefn *, FILE * );
    00175 void CPL_DLL GTIFFreeDefn( GTIF * );
    00176
    00177 void CPL_DLL SetCSVFilenameHook( const char *(*CSVFileOverride)(const char *) );
    00178
    00179 const char CPL_DLL *GTIFDecToDMS( double, const char *, int );
    00180
    00181 /*
    00182  * These are useful for recognising UTM and State Plane, with or without
    00183  * CSV files being found.
    00184  */
    00185
    00186 #define MapSys_UTM_North        -9001
    00187 #define MapSys_UTM_South        -9002
    00188 #define MapSys_State_Plane_27   -9003
    00189 #define MapSys_State_Plane_83   -9004
    00190
    00191 int CPL_DLL   GTIFMapSysToPCS( int MapSys, int Datum, int nZone );
    00192 int CPL_DLL   GTIFMapSysToProj( int MapSys, int nZone );
    00193 int CPL_DLL   GTIFPCSToMapSys( int PCSCode, int * pDatum, int * pZone );
    00194 int CPL_DLL   GTIFProjToMapSys( int ProjCode, int * pZone );
    00195
    00196 /*
    00197  * These are only useful if using libgeotiff with libproj (PROJ.4+).
    00198  */
    00199 char CPL_DLL *GTIFGetProj4Defn( GTIFDefn * );
    00200
    00201 int  CPL_DLL  GTIFProj4ToLatLong( GTIFDefn *, int, double *, double * );
    00202 int  CPL_DLL  GTIFProj4FromLatLong( GTIFDefn *, int, double *, double * );
    00203
    00204 int  CPL_DLL  GTIFSetFromProj4( GTIF *gtif, const char *proj4 );
    00205
    00206 #if defined(HAVE_LIBPROJ) && defined(HAVE_PROJECTS_H)
    00207 #  define HAVE_GTIFPROJ4
    00208 #endif
    00209
    00210 #ifdef __cplusplus
    00211 }
    00212 #endif
    00213
    00214 #endif /* ndef GEO_NORMALIZE_H_INCLUDED */