00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
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 ProjCode;
00100
00103 short Projection;
00104
00108 short CTProjection;
00109
00111 int nParms;
00112
00117 double ProjParm[MAX_GTIF_PROJPARMS];
00118
00121 int ProjParmId[MAX_GTIF_PROJPARMS];
00122
00123
00126 int MapSys;
00127
00129 int Zone;
00130
00132 int DefnSet;
00133
00134 } GTIFDefn;
00135
00136 int CPL_DLL GTIFGetPCSInfo( int nPCSCode, char **ppszEPSGName,
00137 short *pnProjOp,
00138 short *pnUOMLengthCode, short *pnGeogCS );
00139 int CPL_DLL GTIFGetProjTRFInfo( int nProjTRFCode,
00140 char ** ppszProjTRFName,
00141 short * pnProjMethod,
00142 double * padfProjParms );
00143 int CPL_DLL GTIFGetGCSInfo( int nGCSCode, char **ppszName,
00144 short *pnDatum, short *pnPM, short *pnUOMAngle );
00145 int CPL_DLL GTIFGetDatumInfo( int nDatumCode, char **ppszName,
00146 short * pnEllipsoid );
00147 int CPL_DLL GTIFGetEllipsoidInfo( int nEllipsoid, char ** ppszName,
00148 double * pdfSemiMajor,
00149 double * pdfSemiMinor );
00150 int CPL_DLL GTIFGetPMInfo( int nPM, char **ppszName,
00151 double * pdfLongToGreenwich );
00152
00153 double CPL_DLL GTIFAngleStringToDD( const char *pszAngle, int nUOMAngle );
00154 int CPL_DLL GTIFGetUOMLengthInfo( int nUOMLengthCode,
00155 char **ppszUOMName,
00156 double * pdfInMeters );
00157 int CPL_DLL GTIFGetUOMAngleInfo( int nUOMAngleCode,
00158 char **ppszUOMName,
00159 double * pdfInDegrees );
00160 double CPL_DLL GTIFAngleToDD( double dfAngle, int nUOMAngle );
00161
00162
00163
00164 void CPL_DLL GTIFFreeMemory( char * );
00165 void CPL_DLL GTIFDeaccessCSV( void );
00166
00167 int CPL_DLL GTIFGetDefn( GTIF *psGTIF, GTIFDefn * psDefn );
00168 void CPL_DLL GTIFPrintDefn( GTIFDefn *, FILE * );
00169 void CPL_DLL GTIFFreeDefn( GTIF * );
00170
00171 void CPL_DLL SetCSVFilenameHook( const char *(*CSVFileOverride)(const char *) );
00172
00173 const char CPL_DLL *GTIFDecToDMS( double, const char *, int );
00174
00175
00176
00177
00178
00179
00180 #define MapSys_UTM_North -9001
00181 #define MapSys_UTM_South -9002
00182 #define MapSys_State_Plane_27 -9003
00183 #define MapSys_State_Plane_83 -9004
00184
00185 int CPL_DLL GTIFMapSysToPCS( int MapSys, int Datum, int nZone );
00186 int CPL_DLL GTIFMapSysToProj( int MapSys, int nZone );
00187 int CPL_DLL GTIFPCSToMapSys( int PCSCode, int * pDatum, int * pZone );
00188 int CPL_DLL GTIFProjToMapSys( int ProjCode, int * pZone );
00189
00190
00191
00192
00193 char CPL_DLL *GTIFGetProj4Defn( GTIFDefn * );
00194
00195 int CPL_DLL GTIFProj4ToLatLong( GTIFDefn *, int, double *, double * );
00196 int CPL_DLL GTIFProj4FromLatLong( GTIFDefn *, int, double *, double * );
00197
00198 int CPL_DLL GTIFSetFromProj4( GTIF *gtif, const char *proj4 );
00199
00200 #if defined(HAVE_LIBPROJ) && defined(HAVE_PROJECTS_H)
00201 # define HAVE_GTIFPROJ4
00202 #endif
00203
00204 #ifdef __cplusplus
00205 }
00206 #endif
00207
00208 #endif