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 GDAL_ALG_H_INCLUDED
00032 #define GDAL_ALG_H_INCLUDED
00033
00040 #ifndef DOXYGEN_SKIP
00041 #include "gdal.h"
00042 #include "cpl_minixml.h"
00043 #include "ogr_api.h"
00044 #endif
00045
00046 CPL_C_START
00047
00048 int CPL_DLL CPL_STDCALL GDALComputeMedianCutPCT( GDALRasterBandH hRed,
00049 GDALRasterBandH hGreen,
00050 GDALRasterBandH hBlue,
00051 int (*pfnIncludePixel)(int,int,void*),
00052 int nColors,
00053 GDALColorTableH hColorTable,
00054 GDALProgressFunc pfnProgress,
00055 void * pProgressArg );
00056
00057 int CPL_DLL CPL_STDCALL GDALDitherRGB2PCT( GDALRasterBandH hRed,
00058 GDALRasterBandH hGreen,
00059 GDALRasterBandH hBlue,
00060 GDALRasterBandH hTarget,
00061 GDALColorTableH hColorTable,
00062 GDALProgressFunc pfnProgress,
00063 void * pProgressArg );
00064
00065 int CPL_DLL CPL_STDCALL GDALChecksumImage( GDALRasterBandH hBand,
00066 int nXOff, int nYOff, int nXSize, int nYSize );
00067
00068 CPLErr CPL_DLL CPL_STDCALL
00069 GDALComputeProximity( GDALRasterBandH hSrcBand,
00070 GDALRasterBandH hProximityBand,
00071 char **papszOptions,
00072 GDALProgressFunc pfnProgress,
00073 void * pProgressArg );
00074
00075 CPLErr CPL_DLL CPL_STDCALL
00076 GDALFillNodata( GDALRasterBandH hTargetBand,
00077 GDALRasterBandH hMaskBand,
00078 double dfMaxSearchDist,
00079 int bDeprecatedOption,
00080 int nSmoothingIterations,
00081 char **papszOptions,
00082 GDALProgressFunc pfnProgress,
00083 void * pProgressArg );
00084
00085 CPLErr CPL_DLL CPL_STDCALL
00086 GDALPolygonize( GDALRasterBandH hSrcBand,
00087 GDALRasterBandH hMaskBand,
00088 OGRLayerH hOutLayer, int iPixValField,
00089 char **papszOptions,
00090 GDALProgressFunc pfnProgress,
00091 void * pProgressArg );
00092
00093 CPLErr CPL_DLL CPL_STDCALL
00094 GDALFPolygonize( GDALRasterBandH hSrcBand,
00095 GDALRasterBandH hMaskBand,
00096 OGRLayerH hOutLayer, int iPixValField,
00097 char **papszOptions,
00098 GDALProgressFunc pfnProgress,
00099 void * pProgressArg );
00100
00101 CPLErr CPL_DLL CPL_STDCALL
00102 GDALSieveFilter( GDALRasterBandH hSrcBand, GDALRasterBandH hMaskBand,
00103 GDALRasterBandH hDstBand,
00104 int nSizeThreshold, int nConnectedness,
00105 char **papszOptions,
00106 GDALProgressFunc pfnProgress,
00107 void * pProgressArg );
00108
00109
00110
00111
00112
00113 typedef int
00114 (*GDALTransformerFunc)( void *pTransformerArg,
00115 int bDstToSrc, int nPointCount,
00116 double *x, double *y, double *z, int *panSuccess );
00117
00118 typedef struct {
00119 char szSignature[4];
00120 const char *pszClassName;
00121 GDALTransformerFunc pfnTransform;
00122 void (*pfnCleanup)( void * );
00123 CPLXMLNode *(*pfnSerialize)( void * );
00124
00125 } GDALTransformerInfo;
00126
00127 void CPL_DLL GDALDestroyTransformer( void *pTransformerArg );
00128 int CPL_DLL GDALUseTransformer( void *pTranformerArg,
00129 int bDstToSrc, int nPointCount,
00130 double *x, double *y, double *z,
00131 int *panSuccess );
00132
00133
00134
00135
00136
00137 void CPL_DLL *
00138 GDALCreateGenImgProjTransformer( GDALDatasetH hSrcDS, const char *pszSrcWKT,
00139 GDALDatasetH hDstDS, const char *pszDstWKT,
00140 int bGCPUseOK, double dfGCPErrorThreshold,
00141 int nOrder );
00142 void CPL_DLL *
00143 GDALCreateGenImgProjTransformer2( GDALDatasetH hSrcDS, GDALDatasetH hDstDS,
00144 char **papszOptions );
00145 void CPL_DLL *
00146 GDALCreateGenImgProjTransformer3( const char *pszSrcWKT,
00147 const double *padfSrcGeoTransform,
00148 const char *pszDstWKT,
00149 const double *padfDstGeoTransform );
00150 void CPL_DLL GDALSetGenImgProjTransformerDstGeoTransform( void *,
00151 const double * );
00152 void CPL_DLL GDALDestroyGenImgProjTransformer( void * );
00153 int CPL_DLL GDALGenImgProjTransform(
00154 void *pTransformArg, int bDstToSrc, int nPointCount,
00155 double *x, double *y, double *z, int *panSuccess );
00156
00157
00158 void CPL_DLL *
00159 GDALCreateReprojectionTransformer( const char *pszSrcWKT,
00160 const char *pszDstWKT );
00161 void CPL_DLL GDALDestroyReprojectionTransformer( void * );
00162 int CPL_DLL GDALReprojectionTransform(
00163 void *pTransformArg, int bDstToSrc, int nPointCount,
00164 double *x, double *y, double *z, int *panSuccess );
00165
00166
00167 void CPL_DLL *
00168 GDALCreateGCPTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
00169 int nReqOrder, int bReversed );
00170
00171
00172 void CPL_DLL *
00173 GDALCreateGCPRefineTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
00174 int nReqOrder, int bReversed, double tolerance, int minimumGcps);
00175
00176 void CPL_DLL GDALDestroyGCPTransformer( void *pTransformArg );
00177 int CPL_DLL GDALGCPTransform(
00178 void *pTransformArg, int bDstToSrc, int nPointCount,
00179 double *x, double *y, double *z, int *panSuccess );
00180
00181
00182
00183 void CPL_DLL *
00184 GDALCreateTPSTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
00185 int bReversed );
00186 void CPL_DLL GDALDestroyTPSTransformer( void *pTransformArg );
00187 int CPL_DLL GDALTPSTransform(
00188 void *pTransformArg, int bDstToSrc, int nPointCount,
00189 double *x, double *y, double *z, int *panSuccess );
00190
00191 char CPL_DLL ** RPCInfoToMD( GDALRPCInfo *psRPCInfo );
00192
00193
00194
00195 void CPL_DLL *
00196 GDALCreateRPCTransformer( GDALRPCInfo *psRPC, int bReversed,
00197 double dfPixErrThreshold,
00198 char **papszOptions );
00199 void CPL_DLL GDALDestroyRPCTransformer( void *pTransformArg );
00200 int CPL_DLL GDALRPCTransform(
00201 void *pTransformArg, int bDstToSrc, int nPointCount,
00202 double *x, double *y, double *z, int *panSuccess );
00203
00204
00205
00206 void CPL_DLL *
00207 GDALCreateGeoLocTransformer( GDALDatasetH hBaseDS,
00208 char **papszGeolocationInfo,
00209 int bReversed );
00210 void CPL_DLL GDALDestroyGeoLocTransformer( void *pTransformArg );
00211 int CPL_DLL GDALGeoLocTransform(
00212 void *pTransformArg, int bDstToSrc, int nPointCount,
00213 double *x, double *y, double *z, int *panSuccess );
00214
00215
00216 void CPL_DLL *
00217 GDALCreateApproxTransformer( GDALTransformerFunc pfnRawTransformer,
00218 void *pRawTransformerArg, double dfMaxError );
00219 void CPL_DLL GDALApproxTransformerOwnsSubtransformer( void *pCBData,
00220 int bOwnFlag );
00221 void CPL_DLL GDALDestroyApproxTransformer( void *pApproxArg );
00222 int CPL_DLL GDALApproxTransform(
00223 void *pTransformArg, int bDstToSrc, int nPointCount,
00224 double *x, double *y, double *z, int *panSuccess );
00225
00226
00227
00228
00229 int CPL_DLL CPL_STDCALL
00230 GDALSimpleImageWarp( GDALDatasetH hSrcDS,
00231 GDALDatasetH hDstDS,
00232 int nBandCount, int *panBandList,
00233 GDALTransformerFunc pfnTransform,
00234 void *pTransformArg,
00235 GDALProgressFunc pfnProgress,
00236 void *pProgressArg,
00237 char **papszWarpOptions );
00238
00239 CPLErr CPL_DLL CPL_STDCALL
00240 GDALSuggestedWarpOutput( GDALDatasetH hSrcDS,
00241 GDALTransformerFunc pfnTransformer,
00242 void *pTransformArg,
00243 double *padfGeoTransformOut,
00244 int *pnPixels, int *pnLines );
00245 CPLErr CPL_DLL CPL_STDCALL
00246 GDALSuggestedWarpOutput2( GDALDatasetH hSrcDS,
00247 GDALTransformerFunc pfnTransformer,
00248 void *pTransformArg,
00249 double *padfGeoTransformOut,
00250 int *pnPixels, int *pnLines,
00251 double *padfExtents,
00252 int nOptions );
00253
00254 CPLXMLNode CPL_DLL *
00255 GDALSerializeTransformer( GDALTransformerFunc pfnFunc, void *pTransformArg );
00256 CPLErr CPL_DLL GDALDeserializeTransformer( CPLXMLNode *psTree,
00257 GDALTransformerFunc *ppfnFunc,
00258 void **ppTransformArg );
00259
00260 CPLErr CPL_DLL
00261 GDALTransformGeolocations( GDALRasterBandH hXBand,
00262 GDALRasterBandH hYBand,
00263 GDALRasterBandH hZBand,
00264 GDALTransformerFunc pfnTransformer,
00265 void *pTransformArg,
00266 GDALProgressFunc pfnProgress,
00267 void *pProgressArg,
00268 char **papszOptions );
00269
00270
00271
00272
00273
00274 typedef CPLErr (*GDALContourWriter)( double dfLevel, int nPoints,
00275 double *padfX, double *padfY, void * );
00276
00277 typedef void *GDALContourGeneratorH;
00278
00279 GDALContourGeneratorH CPL_DLL
00280 GDAL_CG_Create( int nWidth, int nHeight,
00281 int bNoDataSet, double dfNoDataValue,
00282 double dfContourInterval, double dfContourBase,
00283 GDALContourWriter pfnWriter, void *pCBData );
00284 CPLErr CPL_DLL GDAL_CG_FeedLine( GDALContourGeneratorH hCG,
00285 double *padfScanline );
00286 void CPL_DLL GDAL_CG_Destroy( GDALContourGeneratorH hCG );
00287
00288 typedef struct
00289 {
00290 void *hLayer;
00291
00292 double adfGeoTransform[6];
00293
00294 int nElevField;
00295 int nIDField;
00296 int nNextID;
00297 } OGRContourWriterInfo;
00298
00299 CPLErr CPL_DLL
00300 OGRContourWriter( double, int, double *, double *, void *pInfo );
00301
00302 CPLErr CPL_DLL
00303 GDALContourGenerate( GDALRasterBandH hBand,
00304 double dfContourInterval, double dfContourBase,
00305 int nFixedLevelCount, double *padfFixedLevels,
00306 int bUseNoData, double dfNoDataValue,
00307 void *hLayer, int iIDField, int iElevField,
00308 GDALProgressFunc pfnProgress, void *pProgressArg );
00309
00310
00311
00312
00313
00314 CPLErr CPL_DLL
00315 GDALRasterizeGeometries( GDALDatasetH hDS,
00316 int nBandCount, int *panBandList,
00317 int nGeomCount, OGRGeometryH *pahGeometries,
00318 GDALTransformerFunc pfnTransformer,
00319 void *pTransformArg,
00320 double *padfGeomBurnValue,
00321 char **papszOptions,
00322 GDALProgressFunc pfnProgress,
00323 void * pProgressArg );
00324 CPLErr CPL_DLL
00325 GDALRasterizeLayers( GDALDatasetH hDS,
00326 int nBandCount, int *panBandList,
00327 int nLayerCount, OGRLayerH *pahLayers,
00328 GDALTransformerFunc pfnTransformer,
00329 void *pTransformArg,
00330 double *padfLayerBurnValues,
00331 char **papszOptions,
00332 GDALProgressFunc pfnProgress,
00333 void *pProgressArg );
00334
00335 CPLErr CPL_DLL
00336 GDALRasterizeLayersBuf( void *pData, int nBufXSize, int nBufYSize,
00337 GDALDataType eBufType, int nPixelSpace, int nLineSpace,
00338 int nLayerCount, OGRLayerH *pahLayers,
00339 const char *pszDstProjection,
00340 double *padfDstGeoTransform,
00341 GDALTransformerFunc pfnTransformer,
00342 void *pTransformArg, double dfBurnValue,
00343 char **papszOptions, GDALProgressFunc pfnProgress,
00344 void *pProgressArg );
00345
00346
00347
00348
00349
00350
00352 typedef enum { GGA_InverseDistanceToAPower = 1, GGA_MovingAverage = 2, GGA_NearestNeighbor = 3, GGA_MetricMinimum = 4, GGA_MetricMaximum = 5, GGA_MetricRange = 6, GGA_MetricCount = 7, GGA_MetricAverageDistance = 8,
00362 GGA_MetricAverageDistancePts = 9
00363 } GDALGridAlgorithm;
00364
00366 typedef struct
00367 {
00369 double dfPower;
00371 double dfSmoothing;
00373 double dfAnisotropyRatio;
00375 double dfAnisotropyAngle;
00377 double dfRadius1;
00379 double dfRadius2;
00384 double dfAngle;
00391 GUInt32 nMaxPoints;
00397 GUInt32 nMinPoints;
00399 double dfNoDataValue;
00400 } GDALGridInverseDistanceToAPowerOptions;
00401
00403 typedef struct
00404 {
00406 double dfRadius1;
00408 double dfRadius2;
00413 double dfAngle;
00419 GUInt32 nMinPoints;
00421 double dfNoDataValue;
00422 } GDALGridMovingAverageOptions;
00423
00425 typedef struct
00426 {
00428 double dfRadius1;
00430 double dfRadius2;
00435 double dfAngle;
00437 double dfNoDataValue;
00438 } GDALGridNearestNeighborOptions;
00439
00441 typedef struct
00442 {
00444 double dfRadius1;
00446 double dfRadius2;
00451 double dfAngle;
00457 GUInt32 nMinPoints;
00459 double dfNoDataValue;
00460 } GDALGridDataMetricsOptions;
00461
00462 CPLErr CPL_DLL
00463 GDALGridCreate( GDALGridAlgorithm, const void *, GUInt32,
00464 const double *, const double *, const double *,
00465 double, double, double, double,
00466 GUInt32, GUInt32, GDALDataType, void *,
00467 GDALProgressFunc, void *);
00468
00469 GDAL_GCP CPL_DLL *
00470 GDALComputeMatchingPoints( GDALDatasetH hFirstImage,
00471 GDALDatasetH hSecondImage,
00472 char **papszOptions,
00473 int *pnGCPCount );
00474 CPL_C_END
00475
00476 #endif