libgeotiff
geo_normalize.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id: geo_normalize.h,v 1.13 2008/05/21 04:12:57 fwarmerdam Exp $
3  *
4  * Project: libgeotiff
5  * Purpose: Include file related to geo_normalize.c containing Code to
6  * normalize PCS and other composite codes in a GeoTIFF file.
7  * Author: Frank Warmerdam, warmerda@home.com
8  *
9  ******************************************************************************
10  * Copyright (c) 1999, Frank Warmerdam
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a
13  * copy of this software and associated documentation files (the "Software"),
14  * to deal in the Software without restriction, including without limitation
15  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  * and/or sell copies of the Software, and to permit persons to whom the
17  * Software is furnished to do so, subject to the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be included
20  * in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28  * DEALINGS IN THE SOFTWARE.
29  ******************************************************************************
30  *
31  * $Log: geo_normalize.h,v $
32  * Revision 1.13 2008/05/21 04:12:57 fwarmerdam
33  * added preliminary GTIFSetFromProj4() support
34  *
35  * Revision 1.12 2005/08/26 16:08:14 fwarmerdam
36  * Include void in empty argument list for prototype.
37  *
38  * Revision 1.11 2004/02/03 17:19:50 warmerda
39  * export GTIFAngleToDD() - used by GDAL mrsiddataset.cpp
40  *
41  * Revision 1.10 2003/01/15 04:39:16 warmerda
42  * Added GTIFDeaccessCSV
43  *
44  * Revision 1.9 2003/01/15 03:37:40 warmerda
45  * added GTIFFreeMemory()
46  *
47  * Revision 1.8 2002/11/28 22:27:42 warmerda
48  * preliminary upgrade to EPSG 6.2.2 tables
49  *
50  * Revision 1.7 1999/09/17 00:55:26 warmerda
51  * added GTIFGetUOMAngleInfo(), and UOMAngle in GTIFDefn
52  *
53  * Revision 1.6 1999/05/04 03:13:42 warmerda
54  * Added prototype
55  *
56  * Revision 1.5 1999/04/29 23:02:55 warmerda
57  * added docs, and MapSys related stuff
58  *
59  * Revision 1.4 1999/03/18 21:35:19 geotiff
60  * Added PROJ.4 related stuff
61  *
62  * Revision 1.3 1999/03/17 20:44:04 geotiff
63  * added CPL_DLL related support
64  *
65  * Revision 1.2 1999/03/10 18:24:06 geotiff
66  * corrected to use int'
67  *
68  */
69 
70 #ifndef GEO_NORMALIZE_H_INCLUDED
71 #define GEO_NORMALIZE_H_INCLUDED
72 
73 #include <stdio.h>
74 #include "geotiff.h"
75 
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79 
86 #define MAX_GTIF_PROJPARMS 10
87 
92 typedef struct {
95  short Model;
96 
98  short PCS;
99 
102  short GCS;
103 
105  short UOMLength;
106 
109 
111  short UOMAngle;
112 
115 
117  short Datum;
118 
121  short PM;
122 
126 
129  short Ellipsoid;
130 
132  double SemiMajor;
133 
135  double SemiMinor;
136 
138  short ProjCode;
139 
142  short Projection;
143 
147  short CTProjection;
148 
150  int nParms;
151 
156  double ProjParm[MAX_GTIF_PROJPARMS];
157 
160  int ProjParmId[MAX_GTIF_PROJPARMS]; /* geokey identifier,
161  eg. ProjFalseEastingGeoKey*/
162 
165  int MapSys;
166 
168  int Zone;
169 
170 } GTIFDefn;
171 
172 int CPL_DLL GTIFGetPCSInfo( int nPCSCode, char **ppszEPSGName,
173  short *pnProjOp,
174  short *pnUOMLengthCode, short *pnGeogCS );
175 int CPL_DLL GTIFGetProjTRFInfo( int nProjTRFCode,
176  char ** ppszProjTRFName,
177  short * pnProjMethod,
178  double * padfProjParms );
179 int CPL_DLL GTIFGetGCSInfo( int nGCSCode, char **ppszName,
180  short *pnDatum, short *pnPM, short *pnUOMAngle );
181 int CPL_DLL GTIFGetDatumInfo( int nDatumCode, char **ppszName,
182  short * pnEllipsoid );
183 int CPL_DLL GTIFGetEllipsoidInfo( int nEllipsoid, char ** ppszName,
184  double * pdfSemiMajor,
185  double * pdfSemiMinor );
186 int CPL_DLL GTIFGetPMInfo( int nPM, char **ppszName,
187  double * pdfLongToGreenwich );
188 
189 double CPL_DLL GTIFAngleStringToDD( const char *pszAngle, int nUOMAngle );
190 int CPL_DLL GTIFGetUOMLengthInfo( int nUOMLengthCode,
191  char **ppszUOMName,
192  double * pdfInMeters );
193 int CPL_DLL GTIFGetUOMAngleInfo( int nUOMAngleCode,
194  char **ppszUOMName,
195  double * pdfInDegrees );
196 double CPL_DLL GTIFAngleToDD( double dfAngle, int nUOMAngle );
197 
198 
199 /* this should be used to free strings returned by GTIFGet... funcs */
200 void CPL_DLL GTIFFreeMemory( char * );
201 void CPL_DLL GTIFDeaccessCSV( void );
202 
203 int CPL_DLL GTIFGetDefn( GTIF *psGTIF, GTIFDefn * psDefn );
204 void CPL_DLL GTIFPrintDefn( GTIFDefn *, FILE * );
205 void CPL_DLL GTIFFreeDefn( GTIF * );
206 
207 void CPL_DLL SetCSVFilenameHook( const char *(*CSVFileOverride)(const char *) );
208 
209 const char CPL_DLL *GTIFDecToDMS( double, const char *, int );
210 
211 /*
212  * These are useful for recognising UTM and State Plane, with or without
213  * CSV files being found.
214  */
215 
216 #define MapSys_UTM_North -9001
217 #define MapSys_UTM_South -9002
218 #define MapSys_State_Plane_27 -9003
219 #define MapSys_State_Plane_83 -9004
220 
221 int CPL_DLL GTIFMapSysToPCS( int MapSys, int Datum, int nZone );
222 int CPL_DLL GTIFMapSysToProj( int MapSys, int nZone );
223 int CPL_DLL GTIFPCSToMapSys( int PCSCode, int * pDatum, int * pZone );
224 int CPL_DLL GTIFProjToMapSys( int ProjCode, int * pZone );
225 
226 /*
227  * These are only useful if using libgeotiff with libproj (PROJ.4+).
228  */
229 char CPL_DLL *GTIFGetProj4Defn( GTIFDefn * );
230 
231 int CPL_DLL GTIFProj4ToLatLong( GTIFDefn *, int, double *, double * );
232 int CPL_DLL GTIFProj4FromLatLong( GTIFDefn *, int, double *, double * );
233 
234 int CPL_DLL GTIFSetFromProj4( GTIF *gtif, const char *proj4 );
235 
236 #if defined(HAVE_LIBPROJ) && defined(HAVE_PROJECTS_H)
237 # define HAVE_GTIFPROJ4
238 #endif
239 
240 #ifdef __cplusplus
241 }
242 #endif
243 
244 #endif /* ndef GEO_NORMALIZE_H_INCLUDED */

Generated for libgeotiff by doxygen 1.8.3.1