1
/******************************************************************************
2
* $Id: geo_normalize.h,v 1.3 2004/03/19 11:51:24 lubia Exp $
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
9
******************************************************************************
10
* Copyright (c) 1999, Frank Warmerdam
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:
19
* The above copyright notice and this permission notice shall be included
20
* in all copies or substantial portions of the Software.
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
******************************************************************************
31
* $Log: geo_normalize.h,v $
32
* Revision 1.3 2004/03/19 11:51:24 lubia
33
* Atualizada as bibliotecas Tif e GeoTif
35
* Revision 1.10 2003/01/15 04:39:16 warmerda
36
* Added GTIFDeaccessCSV
38
* Revision 1.9 2003/01/15 03:37:40 warmerda
39
* added GTIFFreeMemory()
41
* Revision 1.8 2002/11/28 22:27:42 warmerda
42
* preliminary upgrade to EPSG 6.2.2 tables
44
* Revision 1.7 1999/09/17 00:55:26 warmerda
45
* added GTIFGetUOMAngleInfo(), and UOMAngle in GTIFDefn
47
* Revision 1.6 1999/05/04 03:13:42 warmerda
50
* Revision 1.5 1999/04/29 23:02:55 warmerda
51
* added docs, and MapSys related stuff
53
* Revision 1.4 1999/03/18 21:35:19 geotiff
54
* Added PROJ.4 related stuff
56
* Revision 1.3 1999/03/17 20:44:04 geotiff
57
* added CPL_DLL related support
59
* Revision 1.2 1999/03/10 18:24:06 geotiff
60
* corrected to use int'
64
#ifndef GEO_NORMALIZE_H_INCLUDED
65
#define GEO_NORMALIZE_H_INCLUDED
75
* \file geo_normalize.h
77
* Include file for extended projection definition normalization api.
80
#define MAX_GTIF_PROJPARMS 10
83
* Holds a definition of a coordinate system in normalized form.
87
/** From GTModelTypeGeoKey tag. Can have the values ModelTypeGeographic
88
or ModelTypeProjected. */
91
/** From ProjectedCSTypeGeoKey tag. For example PCS_NAD27_UTM_zone_3N.*/
94
/** From GeographicTypeGeoKey tag. For example GCS_WGS_84 or
95
GCS_Voirol_1875_Paris. Includes datum and prime meridian value. */
98
/** From ProjLinearUnitsGeoKey. For example Linear_Meter. */
101
/** One UOMLength = UOMLengthInMeters meters. */
102
double UOMLengthInMeters;
104
/** The angular units of the GCS. */
107
/** One UOMAngle = UOMLengthInDegrees degrees. */
108
double UOMAngleInDegrees;
110
/** Datum from GeogGeodeticDatumGeoKey tag. For example Datum_WGS84 */
113
/** Prime meridian from GeogPrimeMeridianGeoKey. For example PM_Greenwich
117
/** Decimal degrees of longitude between this prime meridian and
118
Greenwich. Prime meridians to the west of Greenwich are negative. */
119
double PMLongToGreenwich;
121
/** Ellipsoid identifier from GeogELlipsoidGeoKey. For example
122
Ellipse_Clarke_1866. */
125
/** The length of the semi major ellipse axis in meters. */
128
/** The length of the semi minor ellipse axis in meters. */
131
/** Projection id from ProjectionGeoKey. For example Proj_UTM_11S. */
134
/** EPSG identifier for underlying projection method. From the EPSG
138
/** GeoTIFF identifier for underlying projection method. While some of
139
these values have corresponding vlaues in EPSG (Projection field),
140
others do not. For example CT_TransverseMercator. */
143
/** Number of projection parameters in ProjParm and ProjParmId. */
146
/** Projection parameter value. The identify of this parameter
147
is established from the corresponding entry in ProjParmId. The
148
value will be measured in meters, or decimal degrees if it is a
149
linear or angular measure. */
150
double ProjParm[MAX_GTIF_PROJPARMS];
152
/** Projection parameter identifier. For example ProjFalseEastingGeoKey.
153
The value will be 0 for unused table entries. */
154
int ProjParmId[MAX_GTIF_PROJPARMS]; /* geokey identifier,
155
eg. ProjFalseEastingGeoKey*/
157
/** Special zone map system code (MapSys_UTM_South, MapSys_UTM_North,
158
MapSys_State_Plane or KvUserDefined if none apply. */
161
/** UTM, or State Plane Zone number, zero if not known. */
166
int CPL_DLL GTIFGetPCSInfo( int nPCSCode, char **ppszEPSGName,
168
short *pnUOMLengthCode, short *pnGeogCS );
169
int CPL_DLL GTIFGetProjTRFInfo( int nProjTRFCode,
170
char ** ppszProjTRFName,
171
short * pnProjMethod,
172
double * padfProjParms );
173
int CPL_DLL GTIFGetGCSInfo( int nGCSCode, char **ppszName,
174
short *pnDatum, short *pnPM, short *pnUOMAngle );
175
int CPL_DLL GTIFGetDatumInfo( int nDatumCode, char **ppszName,
176
short * pnEllipsoid );
177
int CPL_DLL GTIFGetEllipsoidInfo( int nEllipsoid, char ** ppszName,
178
double * pdfSemiMajor,
179
double * pdfSemiMinor );
180
int CPL_DLL GTIFGetPMInfo( int nPM, char **ppszName,
181
double * pdfLongToGreenwich );
183
double CPL_DLL GTIFAngleStringToDD( const char *pszAngle, int nUOMAngle );
184
int CPL_DLL GTIFGetUOMLengthInfo( int nUOMLengthCode,
186
double * pdfInMeters );
187
int CPL_DLL GTIFGetUOMAngleInfo( int nUOMAngleCode,
189
double * pdfInDegrees );
191
/* this should be used to free strings returned by GTIFGet... funcs */
192
void CPL_DLL GTIFFreeMemory( char * );
193
void CPL_DLL GTIFDeaccessCSV();
195
int CPL_DLL GTIFGetDefn( GTIF *psGTIF, GTIFDefn * psDefn );
196
void CPL_DLL GTIFPrintDefn( GTIFDefn *, FILE * );
197
void CPL_DLL GTIFFreeDefn( GTIF * );
199
void CPL_DLL SetCSVFilenameHook( const char *(*CSVFileOverride)(const char *) );
201
const char CPL_DLL *GTIFDecToDMS( double, const char *, int );
204
* These are useful for recognising UTM and State Plane, with or without
205
* CSV files being found.
208
#define MapSys_UTM_North -9001
209
#define MapSys_UTM_South -9002
210
#define MapSys_State_Plane_27 -9003
211
#define MapSys_State_Plane_83 -9004
213
int CPL_DLL GTIFMapSysToPCS( int MapSys, int Datum, int nZone );
214
int CPL_DLL GTIFMapSysToProj( int MapSys, int nZone );
215
int CPL_DLL GTIFPCSToMapSys( int PCSCode, int * pDatum, int * pZone );
216
int CPL_DLL GTIFProjToMapSys( int ProjCode, int * pZone );
219
* These are only useful if using libgeotiff with libproj (PROJ.4+).
221
char CPL_DLL *GTIFGetProj4Defn( GTIFDefn * );
222
int CPL_DLL GTIFProj4ToLatLong( GTIFDefn *, int, double *, double * );
223
int CPL_DLL GTIFProj4FromLatLong( GTIFDefn *, int, double *, double * );
225
#if defined(HAVE_LIBPROJ) && defined(HAVE_PROJECTS_H)
226
# define HAVE_GTIFPROJ4
233
#endif /* ndef GEO_NORMALIZE_H_INCLUDED */