GDAL
gdal_alg.h
Go to the documentation of this file.
1/******************************************************************************
2 * $Id$
3 *
4 * Project: GDAL Image Processing Algorithms
5 * Purpose: Prototypes, and definitions for various GDAL based algorithms.
6 * Author: Frank Warmerdam, warmerdam@pobox.com
7 *
8 ******************************************************************************
9 * Copyright (c) 2001, Frank Warmerdam
10 * Copyright (c) 2008-2012, Even Rouault <even dot rouault at spatialys.com>
11 *
12 * SPDX-License-Identifier: MIT
13 ****************************************************************************/
14
15#ifndef GDAL_ALG_H_INCLUDED
16#define GDAL_ALG_H_INCLUDED
17
23
24#ifndef DOXYGEN_SKIP
25#include "gdal.h"
26#include "cpl_minixml.h"
27#include "ogr_api.h"
28#include <stdint.h>
29#endif
30
32
33int CPL_DLL CPL_STDCALL GDALComputeMedianCutPCT(
35 int (*pfnIncludePixel)(int, int, void *), int nColors,
36 GDALColorTableH hColorTable, GDALProgressFunc pfnProgress,
37 void *pProgressArg);
38
39int CPL_DLL CPL_STDCALL GDALDitherRGB2PCT(
41 GDALRasterBandH hTarget, GDALColorTableH hColorTable,
42 GDALProgressFunc pfnProgress, void *pProgressArg);
43
44int CPL_DLL CPL_STDCALL GDALChecksumImage(GDALRasterBandH hBand, int nXOff,
45 int nYOff, int nXSize, int nYSize);
46
47CPLErr CPL_DLL CPL_STDCALL GDALComputeProximity(GDALRasterBandH hSrcBand,
48 GDALRasterBandH hProximityBand,
49 char **papszOptions,
50 GDALProgressFunc pfnProgress,
51 void *pProgressArg);
52
53CPLErr CPL_DLL CPL_STDCALL GDALFillNodata(
54 GDALRasterBandH hTargetBand, GDALRasterBandH hMaskBand,
55 double dfMaxSearchDist, int bDeprecatedOption, int nSmoothingIterations,
56 char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg);
57
58CPLErr CPL_DLL CPL_STDCALL GDALPolygonize(GDALRasterBandH hSrcBand,
59 GDALRasterBandH hMaskBand,
60 OGRLayerH hOutLayer, int iPixValField,
61 char **papszOptions,
62 GDALProgressFunc pfnProgress,
63 void *pProgressArg);
64
65CPLErr CPL_DLL CPL_STDCALL
67 OGRLayerH hOutLayer, int iPixValField, char **papszOptions,
68 GDALProgressFunc pfnProgress, void *pProgressArg);
69
70CPLErr CPL_DLL CPL_STDCALL GDALSieveFilter(
71 GDALRasterBandH hSrcBand, GDALRasterBandH hMaskBand,
72 GDALRasterBandH hDstBand, int nSizeThreshold, int nConnectedness,
73 char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg);
74
75/*
76 * Warp Related.
77 */
78
79typedef int (*GDALTransformerFunc)(void *pTransformerArg, int bDstToSrc,
80 int nPointCount, double *x, double *y,
81 double *z, int *panSuccess);
82
84#define GDAL_GTI2_SIGNATURE "GTI2"
85
86typedef struct
87{
88 GByte abySignature[4];
89 const char *pszClassName;
90 GDALTransformerFunc pfnTransform;
91 void (*pfnCleanup)(void *pTransformerArg);
92 CPLXMLNode *(*pfnSerialize)(void *pTransformerArg);
93 void *(*pfnCreateSimilar)(void *pTransformerArg, double dfSrcRatioX,
94 double dfSrcRatioY);
95} GDALTransformerInfo;
96
98
100void CPL_DLL GDALDestroyTransformer(void *pTransformerArg);
101int CPL_DLL GDALUseTransformer(void *pTransformerArg, int bDstToSrc,
102 int nPointCount, double *x, double *y, double *z,
103 int *panSuccess);
104void *GDALCreateSimilarTransformer(void *psTransformerArg, double dfSrcRatioX,
105 double dfSrcRatioY);
107
108/* High level transformer for going from image coordinates on one file
109 to image coordinates on another, potentially doing reprojection,
110 utilizing GCPs or using the geotransform. */
111
112const char CPL_DLL *GDALGetGenImgProjTranformerOptionList(void);
113
114void CPL_DLL *
115GDALCreateGenImgProjTransformer(GDALDatasetH hSrcDS, const char *pszSrcWKT,
116 GDALDatasetH hDstDS, const char *pszDstWKT,
117 int bGCPUseOK, double dfGCPErrorThreshold,
118 int nOrder);
120 GDALDatasetH hDstDS,
121 CSLConstList papszOptions);
123 const char *pszSrcWKT, const double *padfSrcGeoTransform,
124 const char *pszDstWKT, const double *padfDstGeoTransform);
125
127 OGRSpatialReferenceH hSrcSRS, const double *padfSrcGeoTransform,
128 OGRSpatialReferenceH hDstSRS, const double *padfDstGeoTransform,
129 const char *const *papszOptions);
130
132 const double *);
133void CPL_DLL GDALDestroyGenImgProjTransformer(void *);
134int CPL_DLL GDALGenImgProjTransform(void *pTransformArg, int bDstToSrc,
135 int nPointCount, double *x, double *y,
136 double *z, int *panSuccess);
137
138void GDALSetTransformerDstGeoTransform(void *, const double *);
139void GDALGetTransformerDstGeoTransform(void *, double *);
140
141/* Geo to geo reprojection transformer. */
142void CPL_DLL *GDALCreateReprojectionTransformer(const char *pszSrcWKT,
143 const char *pszDstWKT);
144void CPL_DLL *
146 OGRSpatialReferenceH hDstSRS,
147 const char *const *papszOptions);
148void CPL_DLL GDALDestroyReprojectionTransformer(void *);
149int CPL_DLL GDALReprojectionTransform(void *pTransformArg, int bDstToSrc,
150 int nPointCount, double *x, double *y,
151 double *z, int *panSuccess);
152
153/* GCP based transformer ... forward is to georef coordinates */
154void CPL_DLL *GDALCreateGCPTransformer(int nGCPCount,
155 const GDAL_GCP *pasGCPList,
156 int nReqOrder, int bReversed);
157
158/* GCP based transformer with refinement of the GCPs ... forward is to georef
159 * coordinates */
160void CPL_DLL *GDALCreateGCPRefineTransformer(int nGCPCount,
161 const GDAL_GCP *pasGCPList,
162 int nReqOrder, int bReversed,
163 double tolerance, int minimumGcps);
164
165void CPL_DLL GDALDestroyGCPTransformer(void *pTransformArg);
166int CPL_DLL GDALGCPTransform(void *pTransformArg, int bDstToSrc,
167 int nPointCount, double *x, double *y, double *z,
168 int *panSuccess);
169
170/* Homography transformer ... forward is to georef coordinates */
171void CPL_DLL *GDALCreateHomographyTransformer(double adfHomography[9]);
172void CPL_DLL *
174 const GDAL_GCP *pasGCPList);
175void CPL_DLL GDALDestroyHomographyTransformer(void *pTransformArg);
176int CPL_DLL GDALHomographyTransform(void *pTransformArg, int bDstToSrc,
177 int nPointCount, double *x, double *y,
178 double *z, int *panSuccess);
179
180/* Thin Plate Spine transformer ... forward is to georef coordinates */
181
182void CPL_DLL *GDALCreateTPSTransformer(int nGCPCount,
183 const GDAL_GCP *pasGCPList,
184 int bReversed);
185void CPL_DLL GDALDestroyTPSTransformer(void *pTransformArg);
186int CPL_DLL GDALTPSTransform(void *pTransformArg, int bDstToSrc,
187 int nPointCount, double *x, double *y, double *z,
188 int *panSuccess);
189
191#ifdef GDAL_COMPILATION
192#define RPCInfoV1ToMD RPCInfoToMD
193#else
194#define RPCInfoToMD RPCInfoV2ToMD
195#endif
196char CPL_DLL **RPCInfoV1ToMD(GDALRPCInfoV1 *psRPCInfo);
197char CPL_DLL **RPCInfoV2ToMD(GDALRPCInfoV2 *psRPCInfo);
199
200/* RPC based transformer ... src is pixel/line/elev, dst is long/lat/elev */
201
203#ifdef GDAL_COMPILATION
204#define GDALCreateRPCTransformerV1 GDALCreateRPCTransformer
205#else
206#define GDALCreateRPCTransformer GDALCreateRPCTransformerV2
207#endif
208
209void CPL_DLL *GDALCreateRPCTransformerV1(GDALRPCInfoV1 *psRPC, int bReversed,
210 double dfPixErrThreshold,
211 char **papszOptions);
213
214void CPL_DLL *GDALCreateRPCTransformerV2(const GDALRPCInfoV2 *psRPC,
215 int bReversed,
216 double dfPixErrThreshold,
217 CSLConstList papszOptions);
218
219void CPL_DLL GDALDestroyRPCTransformer(void *pTransformArg);
220int CPL_DLL GDALRPCTransform(void *pTransformArg, int bDstToSrc,
221 int nPointCount, double *x, double *y, double *z,
222 int *panSuccess);
223
224/* Geolocation transformer */
225
226void CPL_DLL *GDALCreateGeoLocTransformer(GDALDatasetH hBaseDS,
227 char **papszGeolocationInfo,
228 int bReversed);
229void CPL_DLL GDALDestroyGeoLocTransformer(void *pTransformArg);
230int CPL_DLL GDALGeoLocTransform(void *pTransformArg, int bDstToSrc,
231 int nPointCount, double *x, double *y,
232 double *z, int *panSuccess);
233
234/* Approximate transformer */
235void CPL_DLL *GDALCreateApproxTransformer(GDALTransformerFunc pfnRawTransformer,
236 void *pRawTransformerArg,
237 double dfMaxError);
238void CPL_DLL GDALApproxTransformerOwnsSubtransformer(void *pCBData,
239 int bOwnFlag);
240void CPL_DLL GDALDestroyApproxTransformer(void *pApproxArg);
241int CPL_DLL GDALApproxTransform(void *pTransformArg, int bDstToSrc,
242 int nPointCount, double *x, double *y,
243 double *z, int *panSuccess);
244
245int CPL_DLL CPL_STDCALL GDALSimpleImageWarp(
246 GDALDatasetH hSrcDS, GDALDatasetH hDstDS, int nBandCount, int *panBandList,
247 GDALTransformerFunc pfnTransform, void *pTransformArg,
248 GDALProgressFunc pfnProgress, void *pProgressArg, char **papszWarpOptions);
249
250CPLErr CPL_DLL CPL_STDCALL
252 void *pTransformArg, double *padfGeoTransformOut,
253 int *pnPixels, int *pnLines);
254
256#define GDAL_SWO_ROUND_UP_SIZE 0x1
258#define GDAL_SWO_FORCE_SQUARE_PIXEL 0x2
259
260CPLErr CPL_DLL CPL_STDCALL GDALSuggestedWarpOutput2(
261 GDALDatasetH hSrcDS, GDALTransformerFunc pfnTransformer,
262 void *pTransformArg, double *padfGeoTransformOut, int *pnPixels,
263 int *pnLines, double *padfExtent, int nOptions);
264
266CPLXMLNode CPL_DLL *GDALSerializeTransformer(GDALTransformerFunc pfnFunc,
267 void *pTransformArg);
268CPLErr CPL_DLL GDALDeserializeTransformer(CPLXMLNode *psTree,
269 GDALTransformerFunc *ppfnFunc,
270 void **ppTransformArg);
272
274 GDALRasterBandH hXBand, GDALRasterBandH hYBand, GDALRasterBandH hZBand,
275 GDALTransformerFunc pfnTransformer, void *pTransformArg,
276 GDALProgressFunc pfnProgress, void *pProgressArg, char **papszOptions);
277
278/* -------------------------------------------------------------------- */
279/* Contour Line Generation */
280/* -------------------------------------------------------------------- */
281
283typedef CPLErr (*GDALContourWriter)(double dfLevel, int nPoints, double *padfX,
284 double *padfY, void *);
285
288
290GDAL_CG_Create(int nWidth, int nHeight, int bNoDataSet, double dfNoDataValue,
291 double dfContourInterval, double dfContourBase,
292 GDALContourWriter pfnWriter, void *pCBData);
294 double *padfScanline);
295void CPL_DLL GDAL_CG_Destroy(GDALContourGeneratorH hCG);
296
298typedef struct
299{
300 void *hLayer;
301
302 double adfGeoTransform[6];
303
304 int nElevField;
305 int nElevFieldMin;
306 int nElevFieldMax;
307 int nIDField;
308 int nNextID;
309
310 GIntBig nWrittenFeatureCountSinceLastCommit;
311 GIntBig nTransactionCommitInterval;
312} OGRContourWriterInfo;
313
314CPLErr CPL_DLL OGRContourWriter(double, int, double *, double *, void *pInfo);
316
318 GDALRasterBandH hBand, double dfContourInterval, double dfContourBase,
319 int nFixedLevelCount, double *padfFixedLevels, int bUseNoData,
320 double dfNoDataValue, void *hLayer, int iIDField, int iElevField,
321 GDALProgressFunc pfnProgress, void *pProgressArg);
322
323CPLErr CPL_DLL GDALContourGenerateEx(GDALRasterBandH hBand, void *hLayer,
324 CSLConstList options,
325 GDALProgressFunc pfnProgress,
326 void *pProgressArg);
327
328/* -------------------------------------------------------------------- */
329/* Viewshed Generation */
330/* -------------------------------------------------------------------- */
331
333typedef enum
334{
335 GVM_Diagonal = 1,
336 GVM_Edge = 2,
337 GVM_Max = 3,
338 GVM_Min = 4
340
342typedef enum
343{
344 GVOT_NORMAL = 1,
345 GVOT_MIN_TARGET_HEIGHT_FROM_DEM = 2,
346 GVOT_MIN_TARGET_HEIGHT_FROM_GROUND = 3
348
350 GDALRasterBandH hBand, const char *pszDriverName,
351 const char *pszTargetRasterName, CSLConstList papszCreationOptions,
352 double dfObserverX, double dfObserverY, double dfObserverHeight,
353 double dfTargetHeight, double dfVisibleVal, double dfInvisibleVal,
354 double dfOutOfRangeVal, double dfNoDataVal, double dfCurvCoeff,
355 GDALViewshedMode eMode, double dfMaxDistance, GDALProgressFunc pfnProgress,
356 void *pProgressArg, GDALViewshedOutputType heightMode,
357 CSLConstList papszExtraOptions);
358
359bool CPL_DLL GDALIsLineOfSightVisible(
360 const GDALRasterBandH, const int xA, const int yA, const double zA,
361 const int xB, const int yB, const double zB, int *pnxTerrainIntersection,
362 int *pnyTerrainIntersection, CSLConstList papszOptions);
363
364/************************************************************************/
365/* Rasterizer API - geometries burned into GDAL raster. */
366/************************************************************************/
367
369 GDALDatasetH hDS, int nBandCount, const int *panBandList, int nGeomCount,
370 const OGRGeometryH *pahGeometries, GDALTransformerFunc pfnTransformer,
371 void *pTransformArg, const double *padfGeomBurnValues,
372 CSLConstList papszOptions, GDALProgressFunc pfnProgress,
373 void *pProgressArg);
374
376 GDALDatasetH hDS, int nBandCount, const int *panBandList, int nGeomCount,
377 const OGRGeometryH *pahGeometries, GDALTransformerFunc pfnTransformer,
378 void *pTransformArg, const int64_t *panGeomBurnValues,
379 CSLConstList papszOptions, GDALProgressFunc pfnProgress,
380 void *pProgressArg);
381
383 GDALDatasetH hDS, int nBandCount, int *panBandList, int nLayerCount,
384 OGRLayerH *pahLayers, GDALTransformerFunc pfnTransformer,
385 void *pTransformArg, double *padfLayerBurnValues, char **papszOptions,
386 GDALProgressFunc pfnProgress, void *pProgressArg);
387
389 void *pData, int nBufXSize, int nBufYSize, GDALDataType eBufType,
390 int nPixelSpace, int nLineSpace, int nLayerCount, OGRLayerH *pahLayers,
391 const char *pszDstProjection, double *padfDstGeoTransform,
392 GDALTransformerFunc pfnTransformer, void *pTransformArg, double dfBurnValue,
393 char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg);
394
395/************************************************************************/
396/* Gridding interface. */
397/************************************************************************/
398
418
456
496
537
539typedef struct
540{
545 double dfRadius1;
547 double dfRadius2;
552 double dfAngle;
556
592
594typedef struct
595{
604 double dfRadius;
608
609CPLErr CPL_DLL GDALGridCreate(GDALGridAlgorithm, const void *, GUInt32,
610 const double *, const double *, const double *,
611 double, double, double, double, GUInt32, GUInt32,
612 GDALDataType, void *, GDALProgressFunc, void *);
613
615typedef struct GDALGridContext GDALGridContext;
616
617GDALGridContext CPL_DLL *
618GDALGridContextCreate(GDALGridAlgorithm eAlgorithm, const void *poOptions,
619 GUInt32 nPoints, const double *padfX, const double *padfY,
620 const double *padfZ, int bCallerWillKeepPointArraysAlive);
621
622void CPL_DLL GDALGridContextFree(GDALGridContext *psContext);
623
624CPLErr CPL_DLL GDALGridContextProcess(GDALGridContext *psContext, double dfXMin,
625 double dfXMax, double dfYMin,
626 double dfYMax, GUInt32 nXSize,
627 GUInt32 nYSize, GDALDataType eType,
628 void *pData, GDALProgressFunc pfnProgress,
629 void *pProgressArg);
630
632 GDALDatasetH hSecondImage,
633 char **papszOptions,
634 int *pnGCPCount);
635
636/************************************************************************/
637/* Delaunay triangulation interface. */
638/************************************************************************/
639
641typedef struct
642{
643 int anVertexIdx[3];
646 /* anNeighborIdx[k] is the triangle to the opposite side */
647 /* of the opposite segment of anVertexIdx[k] */
649
657typedef struct
658{
659 double dfMul1X;
660 double dfMul1Y;
661 double dfMul2X;
662 double dfMul2Y;
663 double dfCstX;
664 double dfCstY;
666
675
676int CPL_DLL GDALHasTriangulation(void);
677
679 const double *padfX,
680 const double *padfY);
682 GDALTriangulation *psDT, const double *padfX, const double *padfY);
684 const GDALTriangulation *psDT, int nFacetIdx, double dfX, double dfY,
685 double *pdfL1, double *pdfL2, double *pdfL3);
687 double dfX, double dfY,
688 int *panOutputFacetIdx);
690 int nFacetIdx, double dfX,
691 double dfY,
692 int *panOutputFacetIdx);
693void CPL_DLL GDALTriangulationFree(GDALTriangulation *psDT);
694
696#ifndef CPL_WARN_DEPRECATED_GDALOpenVerticalShiftGrid
697#define CPL_WARN_DEPRECATED_GDALOpenVerticalShiftGrid CPL_WARN_DEPRECATED
698#endif
700
701GDALDatasetH CPL_DLL GDALOpenVerticalShiftGrid(const char *pszProj4Geoidgrids,
702 int *pbError)
704 CPL_WARN_DEPRECATED_GDALOpenVerticalShiftGrid(
705 "GDALOpenVerticalShiftGrid() will be removed in GDAL 4.0")
707 ;
708
710#ifndef CPL_WARN_DEPRECATED_GDALApplyVerticalShiftGrid
711#define CPL_WARN_DEPRECATED_GDALApplyVerticalShiftGrid CPL_WARN_DEPRECATED
712#endif
714
716 GDALDatasetH hGridDataset,
717 int bInverse,
718 double dfSrcUnitToMeter,
719 double dfDstUnitToMeter,
720 const char *const *papszOptions)
722 CPL_WARN_DEPRECATED_GDALApplyVerticalShiftGrid(
723 "GDALApplyVerticalShiftGrid() will be removed in GDAL 4.0")
725 ;
726
727/************************************************************************/
728/* Zonal statistics interface */
729/************************************************************************/
730
731CPLErr CPL_DLL GDALZonalStats(GDALDatasetH hSrcDS, GDALDatasetH hWeightsDS,
732 GDALDatasetH hZonesDS, GDALDatasetH hOutDS,
733 CSLConstList papszOptions,
734 GDALProgressFunc pfnProgress, void *pProgressArg);
735
737
738#endif /* ndef GDAL_ALG_H_INCLUDED */
CPLErr
Error category.
Definition cpl_error.h:37
Definitions for CPL mini XML Parser/Serializer.
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:289
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285
unsigned int GUInt32
Unsigned int32 type.
Definition cpl_port.h:167
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1087
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:205
Public (C callable) GDAL entry points.
GDALDataType
Definition gdal.h:48
CPLErr GDALContourGenerateEx(GDALRasterBandH hBand, void *hLayer, CSLConstList options, GDALProgressFunc pfnProgress, void *pProgressArg)
Create vector contours from raster DEM.
Definition contour.cpp:569
void * GDALCreateGeoLocTransformer(GDALDatasetH hBaseDS, char **papszGeolocationInfo, int bReversed)
Create GeoLocation transformer.
Definition gdalgeoloc.cpp:2065
CPLErr GDALFillNodata(GDALRasterBandH hTargetBand, GDALRasterBandH hMaskBand, double dfMaxSearchDist, int bDeprecatedOption, int nSmoothingIterations, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Fill selected raster regions by interpolation from the edges.
Definition rasterfill.cpp:394
CPLErr GDALRasterizeGeometriesInt64(GDALDatasetH hDS, int nBandCount, const int *panBandList, int nGeomCount, const OGRGeometryH *pahGeometries, GDALTransformerFunc pfnTransformer, void *pTransformArg, const int64_t *panGeomBurnValues, CSLConstList papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Burn geometries into raster.
Definition gdalrasterize.cpp:1004
int GDALGenImgProjTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Perform general image reprojection transformation.
Definition gdaltransformer.cpp:3086
GDALTriangulation * GDALTriangulationCreateDelaunay(int nPoints, const double *padfX, const double *padfY)
Computes a Delaunay triangulation of the passed points.
Definition delaunay.c:105
GDALContourGeneratorH GDAL_CG_Create(int nWidth, int nHeight, int bNoDataSet, double dfNoDataValue, double dfContourInterval, double dfContourBase, GDALContourWriter pfnWriter, void *pCBData)
Create contour generator.
Definition contour.cpp:1005
void * GDALCreateGCPRefineTransformer(int nGCPCount, const GDAL_GCP *pasGCPList, int nReqOrder, int bReversed, double tolerance, int minimumGcps)
Create GCP based polynomial transformer, with a tolerance threshold to discard GCPs that transform ba...
Definition gdal_crs.cpp:365
void * GDALCreateReprojectionTransformer(const char *pszSrcWKT, const char *pszDstWKT)
Create reprojection transformer.
Definition gdaltransformer.cpp:3480
void * GDALCreateHomographyTransformerFromGCPs(int nGCPCount, const GDAL_GCP *pasGCPList)
Create Homography transformer from GCPs.
Definition gdal_homography.cpp:516
void * GDALCreateReprojectionTransformerEx(OGRSpatialReferenceH hSrcSRS, OGRSpatialReferenceH hDstSRS, const char *const *papszOptions)
Create reprojection transformer.
Definition gdaltransformer.cpp:3569
void GDALSetGenImgProjTransformerDstGeoTransform(void *, const double *)
Set GenImgProj output geotransform.
Definition gdaltransformer.cpp:3016
void GDALDestroyGeoLocTransformer(void *pTransformArg)
Destroy GeoLocation transformer.
Definition gdalgeoloc.cpp:2078
void GDALGridContextFree(GDALGridContext *psContext)
Free a context used created by GDALGridContextCreate().
Definition gdalgrid.cpp:3356
void GDALTriangulationFree(GDALTriangulation *psDT)
Free a triangulation.
Definition delaunay.c:266
void * GDALCreateGenImgProjTransformer(GDALDatasetH hSrcDS, const char *pszSrcWKT, GDALDatasetH hDstDS, const char *pszDstWKT, int bGCPUseOK, double dfGCPErrorThreshold, int nOrder)
Create image to image transformer.
Definition gdaltransformer.cpp:1392
CPLErr GDALGridCreate(GDALGridAlgorithm, const void *, GUInt32, const double *, const double *, const double *, double, double, double, double, GUInt32, GUInt32, GDALDataType, void *, GDALProgressFunc, void *)
Create regular grid from the scattered data.
Definition gdalgrid.cpp:3645
CPLErr GDALRasterizeGeometries(GDALDatasetH hDS, int nBandCount, const int *panBandList, int nGeomCount, const OGRGeometryH *pahGeometries, GDALTransformerFunc pfnTransformer, void *pTransformArg, const double *padfGeomBurnValues, CSLConstList papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Burn geometries into raster.
Definition gdalrasterize.cpp:981
int GDALDitherRGB2PCT(GDALRasterBandH hRed, GDALRasterBandH hGreen, GDALRasterBandH hBlue, GDALRasterBandH hTarget, GDALColorTableH hColorTable, GDALProgressFunc pfnProgress, void *pProgressArg)
24bit to 8bit conversion with dithering.
Definition gdaldither.cpp:139
int GDALTriangulationComputeBarycentricCoordinates(const GDALTriangulation *psDT, int nFacetIdx, double dfX, double dfY, double *pdfL1, double *pdfL2, double *pdfL3)
Computes the barycentric coordinates of a point.
Definition delaunay.c:372
const char * GDALGetGenImgProjTranformerOptionList(void)
Return a XML string describing options accepted by GDALCreateGenImgProjTransformer2().
Definition gdaltransformer.cpp:1732
CPLErr GDALSieveFilter(GDALRasterBandH hSrcBand, GDALRasterBandH hMaskBand, GDALRasterBandH hDstBand, int nSizeThreshold, int nConnectedness, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Removes small raster polygons.
Definition gdalsievefilter.cpp:178
GDALDatasetH GDALApplyVerticalShiftGrid(GDALDatasetH hSrcDataset, GDALDatasetH hGridDataset, int bInverse, double dfSrcUnitToMeter, double dfDstUnitToMeter, const char *const *papszOptions)
Apply a vertical shift grid to a source (DEM typically) dataset.
Definition gdalapplyverticalshiftgrid.cpp:339
bool GDALIsLineOfSightVisible(const GDALRasterBandH, const int xA, const int yA, const double zA, const int xB, const int yB, const double zB, int *pnxTerrainIntersection, int *pnyTerrainIntersection, CSLConstList papszOptions)
Check Line of Sight between two points.
Definition los.cpp:177
CPLErr GDALPolygonize(GDALRasterBandH hSrcBand, GDALRasterBandH hMaskBand, OGRLayerH hOutLayer, int iPixValField, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Create polygon coverage from raster data.
Definition polygonize.cpp:518
GDALViewshedMode
Viewshed Modes.
Definition gdal_alg.h:334
void GDALDestroyGCPTransformer(void *pTransformArg)
Destroy GCP transformer.
Definition gdal_crs.cpp:389
GDALGridAlgorithm
Gridding Algorithms.
Definition gdal_alg.h:401
@ GGA_MetricMinimum
Definition gdal_alg.h:405
@ GGA_InverseDistanceToAPowerNearestNeighbor
Definition gdal_alg.h:416
@ GGA_InverseDistanceToAPower
Definition gdal_alg.h:402
@ GGA_MetricAverageDistancePts
Definition gdal_alg.h:411
@ GGA_MetricMaximum
Definition gdal_alg.h:406
@ GGA_NearestNeighbor
Definition gdal_alg.h:404
@ GGA_MetricAverageDistance
Definition gdal_alg.h:409
@ GGA_MovingAverage
Definition gdal_alg.h:403
@ GGA_MetricCount
Definition gdal_alg.h:408
@ GGA_MetricRange
Definition gdal_alg.h:407
@ GGA_Linear
Definition gdal_alg.h:413
void * GDALCreateHomographyTransformer(double adfHomography[9])
Create Homography transformer from GCPs.
Definition gdal_homography.cpp:90
void GDALDestroyGenImgProjTransformer(void *)
GenImgProjTransformer deallocator.
Definition gdaltransformer.cpp:3048
int GDALRPCTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
RPC transform.
Definition gdal_rpc.cpp:1813
int GDALComputeMedianCutPCT(GDALRasterBandH hRed, GDALRasterBandH hGreen, GDALRasterBandH hBlue, int(*pfnIncludePixel)(int, int, void *), int nColors, GDALColorTableH hColorTable, GDALProgressFunc pfnProgress, void *pProgressArg)
Compute optimal PCT for RGB image.
Definition gdalmediancut.cpp:130
int GDALTriangulationFindFacetBruteForce(const GDALTriangulation *psDT, double dfX, double dfY, int *panOutputFacetIdx)
Returns the index of the triangle that contains the point by iterating over all triangles.
Definition delaunay.c:416
GDALDatasetH GDALOpenVerticalShiftGrid(const char *pszProj4Geoidgrids, int *pbError)
Load proj.4 geoidgrids as GDAL dataset.
Definition gdalapplyverticalshiftgrid.cpp:564
void GDAL_CG_Destroy(GDALContourGeneratorH hCG)
Destroy contour generator.
Definition contour.cpp:1037
void GDALApproxTransformerOwnsSubtransformer(void *pCBData, int bOwnFlag)
Set bOwnSubtransformer flag.
Definition gdaltransformer.cpp:4056
void GDALDestroyHomographyTransformer(void *pTransformArg)
Destroy Homography transformer.
Definition gdal_homography.cpp:542
int GDALApproxTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Perform approximate transformation.
Definition gdaltransformer.cpp:4374
void * GDALCreateGenImgProjTransformer4(OGRSpatialReferenceH hSrcSRS, const double *padfSrcGeoTransform, OGRSpatialReferenceH hDstSRS, const double *padfDstGeoTransform, const char *const *papszOptions)
Create image to image transformer.
Definition gdaltransformer.cpp:2915
CPLErr GDALFPolygonize(GDALRasterBandH hSrcBand, GDALRasterBandH hMaskBand, OGRLayerH hOutLayer, int iPixValField, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Create polygon coverage from raster data.
Definition polygonize.cpp:602
CPLErr GDALGridContextProcess(GDALGridContext *psContext, double dfXMin, double dfXMax, double dfYMin, double dfYMax, GUInt32 nXSize, GUInt32 nYSize, GDALDataType eType, void *pData, GDALProgressFunc pfnProgress, void *pProgressArg)
Do the gridding of a window of a raster.
Definition gdalgrid.cpp:3409
GDALGridContext * GDALGridContextCreate(GDALGridAlgorithm eAlgorithm, const void *poOptions, GUInt32 nPoints, const double *padfX, const double *padfY, const double *padfZ, int bCallerWillKeepPointArraysAlive)
Creates a context to do regular gridding from the scattered data.
Definition gdalgrid.cpp:2752
CPLErr GDALSuggestedWarpOutput(GDALDatasetH hSrcDS, GDALTransformerFunc pfnTransformer, void *pTransformArg, double *padfGeoTransformOut, int *pnPixels, int *pnLines)
Suggest output file size.
Definition gdaltransformer.cpp:173
int GDALHomographyTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Transforms point based on homography.
Definition gdal_homography.cpp:582
CPLErr GDALComputeProximity(GDALRasterBandH hSrcBand, GDALRasterBandH hProximityBand, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Compute the proximity of all pixels in the image to a set of pixels in the source image.
Definition gdalproximity.cpp:94
CPLErr GDALTransformGeolocations(GDALRasterBandH hXBand, GDALRasterBandH hYBand, GDALRasterBandH hZBand, GDALTransformerFunc pfnTransformer, void *pTransformArg, GDALProgressFunc pfnProgress, void *pProgressArg, char **papszOptions)
Transform locations held in bands.
Definition gdaltransformgeolocs.cpp:49
void GDALGetTransformerDstGeoTransform(void *, double *)
Get ApproxTransformer or GenImgProj output geotransform.
Definition gdaltransformer.cpp:5020
GDAL_GCP * GDALComputeMatchingPoints(GDALDatasetH hFirstImage, GDALDatasetH hSecondImage, char **papszOptions, int *pnGCPCount)
GDALComputeMatchingPoints.
Definition gdalmatching.cpp:168
GDALDatasetH GDALViewshedGenerate(GDALRasterBandH hBand, const char *pszDriverName, const char *pszTargetRasterName, CSLConstList papszCreationOptions, double dfObserverX, double dfObserverY, double dfObserverHeight, double dfTargetHeight, double dfVisibleVal, double dfInvisibleVal, double dfOutOfRangeVal, double dfNoDataVal, double dfCurvCoeff, GDALViewshedMode eMode, double dfMaxDistance, GDALProgressFunc pfnProgress, void *pProgressArg, GDALViewshedOutputType heightMode, CSLConstList papszExtraOptions)
Create viewshed from raster DEM.
Definition viewshed.cpp:116
CPLErr GDAL_CG_FeedLine(GDALContourGeneratorH hCG, double *padfScanline)
Feed a line to the contour generator.
Definition contour.cpp:1024
int GDALTriangulationComputeBarycentricCoefficients(GDALTriangulation *psDT, const double *padfX, const double *padfY)
Computes barycentric coefficients for each triangles of the triangulation.
Definition delaunay.c:291
int GDALGCPTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Transforms point based on GCP derived polynomial model.
Definition gdal_crs.cpp:428
GDALViewshedOutputType
Viewshed output types.
Definition gdal_alg.h:343
int(* GDALTransformerFunc)(void *pTransformerArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Definition gdal_alg.h:79
void GDALDestroyApproxTransformer(void *pApproxArg)
Cleanup approximate transformer.
Definition gdaltransformer.cpp:4078
void * GDALCreateGenImgProjTransformer3(const char *pszSrcWKT, const double *padfSrcGeoTransform, const char *pszDstWKT, const double *padfDstGeoTransform)
Create image to image transformer.
Definition gdaltransformer.cpp:2866
CPLErr GDALSuggestedWarpOutput2(GDALDatasetH hSrcDS, GDALTransformerFunc pfnTransformer, void *pTransformArg, double *padfGeoTransformOut, int *pnPixels, int *pnLines, double *padfExtent, int nOptions)
Suggest output file size.
Definition gdaltransformer.cpp:342
int GDALHasTriangulation(void)
Returns if GDAL is built with Delaunay triangulation support.
Definition delaunay.c:83
CPLErr(* GDALContourWriter)(double dfLevel, int nPoints, double *padfX, double *padfY, void *)
Contour writer callback type.
Definition gdal_alg.h:283
CPLErr GDALRasterizeLayersBuf(void *pData, int nBufXSize, int nBufYSize, GDALDataType eBufType, int nPixelSpace, int nLineSpace, int nLayerCount, OGRLayerH *pahLayers, const char *pszDstProjection, double *padfDstGeoTransform, GDALTransformerFunc pfnTransformer, void *pTransformArg, double dfBurnValue, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Burn geometries from the specified list of layer into raster.
Definition gdalrasterize.cpp:1905
int GDALTPSTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Transforms point based on GCP derived polynomial model.
Definition gdal_tps.cpp:397
int GDALChecksumImage(GDALRasterBandH hBand, int nXOff, int nYOff, int nXSize, int nYSize)
Compute checksum for image region.
Definition gdalchecksum.cpp:48
void GDALSetTransformerDstGeoTransform(void *, const double *)
Set ApproxTransformer or GenImgProj output geotransform.
Definition gdaltransformer.cpp:4995
void * GDALContourGeneratorH
Contour generator opaque type.
Definition gdal_alg.h:287
CPLErr GDALContourGenerate(GDALRasterBandH hBand, double dfContourInterval, double dfContourBase, int nFixedLevelCount, double *padfFixedLevels, int bUseNoData, double dfNoDataValue, void *hLayer, int iIDField, int iElevField, GDALProgressFunc pfnProgress, void *pProgressArg)
Create vector contours from raster DEM.
Definition contour.cpp:332
void GDALDestroyRPCTransformer(void *pTransformArg)
Destroy RPC transformer.
Definition gdal_rpc.cpp:1097
void * GDALCreateGenImgProjTransformer2(GDALDatasetH hSrcDS, GDALDatasetH hDstDS, CSLConstList papszOptions)
Create image to image transformer.
Definition gdaltransformer.cpp:2236
CPLErr GDALRasterizeLayers(GDALDatasetH hDS, int nBandCount, int *panBandList, int nLayerCount, OGRLayerH *pahLayers, GDALTransformerFunc pfnTransformer, void *pTransformArg, double *padfLayerBurnValues, char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Burn geometries from the specified list of layers into raster.
Definition gdalrasterize.cpp:1526
int GDALSimpleImageWarp(GDALDatasetH hSrcDS, GDALDatasetH hDstDS, int nBandCount, int *panBandList, GDALTransformerFunc pfnTransform, void *pTransformArg, GDALProgressFunc pfnProgress, void *pProgressArg, char **papszWarpOptions)
Perform simple image warp.
Definition gdalsimplewarp.cpp:217
void GDALDestroyReprojectionTransformer(void *)
Destroy reprojection transformation.
Definition gdaltransformer.cpp:3675
void * GDALCreateGCPTransformer(int nGCPCount, const GDAL_GCP *pasGCPList, int nReqOrder, int bReversed)
Create GCP based polynomial transformer.
Definition gdal_crs.cpp:354
int GDALReprojectionTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Perform reprojection transformation.
Definition gdaltransformer.cpp:3708
void * GDALCreateApproxTransformer(GDALTransformerFunc pfnRawTransformer, void *pRawTransformerArg, double dfMaxError)
Create an approximating transformer.
Definition gdaltransformer.cpp:4019
int GDALGeoLocTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Use GeoLocation transformer.
Definition gdalgeoloc.cpp:2111
int GDALTriangulationFindFacetDirected(const GDALTriangulation *psDT, int nFacetIdx, double dfX, double dfY, int *panOutputFacetIdx)
Returns the index of the triangle that contains the point by walking in the triangulation.
Definition delaunay.c:510
void * GDALCreateRPCTransformerV2(const GDALRPCInfoV2 *psRPC, int bReversed, double dfPixErrThreshold, CSLConstList papszOptions)
Create an RPC based transformer.
Definition gdal_rpc.cpp:814
void * GDALCreateTPSTransformer(int nGCPCount, const GDAL_GCP *pasGCPList, int bReversed)
Create Thin Plate Spline transformer from GCPs.
Definition gdal_tps.cpp:127
CPLErr GDALZonalStats(GDALDatasetH hSrcDS, GDALDatasetH hWeightsDS, GDALDatasetH hZonesDS, GDALDatasetH hOutDS, CSLConstList papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg)
Compute statistics of raster values within defined zones.
Definition zonal.cpp:2128
void GDALDestroyTPSTransformer(void *pTransformArg)
Destroy TPS transformer.
Definition gdal_tps.cpp:355
void * OGRGeometryH
Opaque type for a geometry.
Definition gdal_fwd.h:96
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition gdal_fwd.h:42
void * OGRSpatialReferenceH
Opaque type for a spatial reference system.
Definition gdal_fwd.h:195
void * OGRLayerH
Opaque type for a layer (OGRLayer).
Definition gdal_fwd.h:157
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition gdal_fwd.h:45
void * GDALColorTableH
Opaque type used for the C bindings of the C++ GDALColorTable class.
Definition gdal_fwd.h:54
C API and defines for OGRFeature, OGRGeometry, and OGRDataSource related classes.
Document node structure.
Definition cpl_minixml.h:54
Data metrics method control options.
Definition gdal_alg.h:559
double dfRadius2
Definition gdal_alg.h:566
double dfAngle
Definition gdal_alg.h:571
double dfNoDataValue
Definition gdal_alg.h:579
double dfRadius1
Definition gdal_alg.h:564
size_t nSizeOfStructure
Definition gdal_alg.h:562
GUInt32 nMinPointsPerQuadrant
Definition gdal_alg.h:590
GUInt32 nMinPoints
Definition gdal_alg.h:577
GUInt32 nMaxPointsPerQuadrant
Definition gdal_alg.h:584
Inverse distance to a power, with nearest neighbour search, control options.
Definition gdal_alg.h:460
size_t nSizeOfStructure
Definition gdal_alg.h:463
GUInt32 nMinPointsPerQuadrant
Definition gdal_alg.h:494
GUInt32 nMaxPointsPerQuadrant
Definition gdal_alg.h:488
Inverse distance to a power method control options.
Definition gdal_alg.h:421
GUInt32 nMinPoints
Definition gdal_alg.h:452
double dfPower
Definition gdal_alg.h:426
double dfRadius2
Definition gdal_alg.h:436
double dfNoDataValue
Definition gdal_alg.h:454
double dfSmoothing
Definition gdal_alg.h:428
double dfAngle
Definition gdal_alg.h:441
double dfRadius1
Definition gdal_alg.h:434
GUInt32 nMaxPoints
Definition gdal_alg.h:446
size_t nSizeOfStructure
Definition gdal_alg.h:424
double dfAnisotropyRatio
Definition gdal_alg.h:430
double dfAnisotropyAngle
Definition gdal_alg.h:432
Linear method control options.
Definition gdal_alg.h:595
size_t nSizeOfStructure
Definition gdal_alg.h:598
double dfNoDataValue
Definition gdal_alg.h:606
double dfRadius
Definition gdal_alg.h:604
Moving average method control options.
Definition gdal_alg.h:499
GUInt32 nMaxPoints
Definition gdal_alg.h:516
double dfRadius1
Definition gdal_alg.h:504
double dfNoDataValue
Definition gdal_alg.h:524
double dfAngle
Definition gdal_alg.h:511
GUInt32 nMinPoints
Definition gdal_alg.h:522
double dfRadius2
Definition gdal_alg.h:506
GUInt32 nMinPointsPerQuadrant
Definition gdal_alg.h:535
size_t nSizeOfStructure
Definition gdal_alg.h:502
GUInt32 nMaxPointsPerQuadrant
Definition gdal_alg.h:529
Nearest neighbor method control options.
Definition gdal_alg.h:540
double dfNoDataValue
Definition gdal_alg.h:554
size_t nSizeOfStructure
Definition gdal_alg.h:543
double dfRadius2
Definition gdal_alg.h:547
double dfAngle
Definition gdal_alg.h:552
double dfRadius1
Definition gdal_alg.h:545
Structure to store Rational Polynomial Coefficients / Rigorous Projection Model.
Definition gdal.h:2145
Triangle barycentric coefficients.
Definition gdal_alg.h:658
double dfCstY
dfCstY
Definition gdal_alg.h:664
double dfCstX
dfCstX
Definition gdal_alg.h:663
double dfMul2Y
dfMul2Y
Definition gdal_alg.h:662
double dfMul1Y
dfMul1Y
Definition gdal_alg.h:660
double dfMul2X
dfMul2X
Definition gdal_alg.h:661
double dfMul1X
dfMul1X
Definition gdal_alg.h:659
Triangle fact.
Definition gdal_alg.h:642
int anVertexIdx[3]
index to the padfX/padfY arrays
Definition gdal_alg.h:643
int anNeighborIdx[3]
index to GDALDelaunayTriangulation.pasFacets, or -1
Definition gdal_alg.h:644
Triangulation structure.
Definition gdal_alg.h:669
GDALTriBarycentricCoefficients * pasFacetCoefficients
array of nFacets barycentric coefficients
Definition gdal_alg.h:673
int nFacets
number of facets
Definition gdal_alg.h:670
GDALTriFacet * pasFacets
array of nFacets facets
Definition gdal_alg.h:671
Ground Control Point.
Definition gdal.h:1221