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
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
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);
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
112void CPL_DLL *
113GDALCreateGenImgProjTransformer(GDALDatasetH hSrcDS, const char *pszSrcWKT,
114 GDALDatasetH hDstDS, const char *pszDstWKT,
115 int bGCPUseOK, double dfGCPErrorThreshold,
116 int nOrder);
118 GDALDatasetH hDstDS,
119 char **papszOptions);
121 const char *pszSrcWKT, const double *padfSrcGeoTransform,
122 const char *pszDstWKT, const double *padfDstGeoTransform);
123
125 OGRSpatialReferenceH hSrcSRS, const double *padfSrcGeoTransform,
126 OGRSpatialReferenceH hDstSRS, const double *padfDstGeoTransform,
127 const char *const *papszOptions);
128
130 const double *);
131void CPL_DLL GDALDestroyGenImgProjTransformer(void *);
132int CPL_DLL GDALGenImgProjTransform(void *pTransformArg, int bDstToSrc,
133 int nPointCount, double *x, double *y,
134 double *z, int *panSuccess);
135
136void GDALSetTransformerDstGeoTransform(void *, const double *);
137void GDALGetTransformerDstGeoTransform(void *, double *);
138
139/* Geo to geo reprojection transformer. */
140void CPL_DLL *GDALCreateReprojectionTransformer(const char *pszSrcWKT,
141 const char *pszDstWKT);
142void CPL_DLL *
144 OGRSpatialReferenceH hDstSRS,
145 const char *const *papszOptions);
146void CPL_DLL GDALDestroyReprojectionTransformer(void *);
147int CPL_DLL GDALReprojectionTransform(void *pTransformArg, int bDstToSrc,
148 int nPointCount, double *x, double *y,
149 double *z, int *panSuccess);
150
151/* GCP based transformer ... forward is to georef coordinates */
152void CPL_DLL *GDALCreateGCPTransformer(int nGCPCount,
153 const GDAL_GCP *pasGCPList,
154 int nReqOrder, int bReversed);
155
156/* GCP based transformer with refinement of the GCPs ... forward is to georef
157 * coordinates */
158void CPL_DLL *GDALCreateGCPRefineTransformer(int nGCPCount,
159 const GDAL_GCP *pasGCPList,
160 int nReqOrder, int bReversed,
161 double tolerance, int minimumGcps);
162
163void CPL_DLL GDALDestroyGCPTransformer(void *pTransformArg);
164int CPL_DLL GDALGCPTransform(void *pTransformArg, int bDstToSrc,
165 int nPointCount, double *x, double *y, double *z,
166 int *panSuccess);
167
168/* Thin Plate Spine transformer ... forward is to georef coordinates */
169
170void CPL_DLL *GDALCreateTPSTransformer(int nGCPCount,
171 const GDAL_GCP *pasGCPList,
172 int bReversed);
173void CPL_DLL GDALDestroyTPSTransformer(void *pTransformArg);
174int CPL_DLL GDALTPSTransform(void *pTransformArg, int bDstToSrc,
175 int nPointCount, double *x, double *y, double *z,
176 int *panSuccess);
177
179#ifdef GDAL_COMPILATION
180#define RPCInfoV1ToMD RPCInfoToMD
181#else
182#define RPCInfoToMD RPCInfoV2ToMD
183#endif
184char CPL_DLL **RPCInfoV1ToMD(GDALRPCInfoV1 *psRPCInfo);
185char CPL_DLL **RPCInfoV2ToMD(GDALRPCInfoV2 *psRPCInfo);
188/* RPC based transformer ... src is pixel/line/elev, dst is long/lat/elev */
189
191#ifdef GDAL_COMPILATION
192#define GDALCreateRPCTransformerV1 GDALCreateRPCTransformer
193#else
194#define GDALCreateRPCTransformer GDALCreateRPCTransformerV2
195#endif
196
197void CPL_DLL *GDALCreateRPCTransformerV1(GDALRPCInfoV1 *psRPC, int bReversed,
198 double dfPixErrThreshold,
199 char **papszOptions);
202void CPL_DLL *GDALCreateRPCTransformerV2(const GDALRPCInfoV2 *psRPC,
203 int bReversed,
204 double dfPixErrThreshold,
205 char **papszOptions);
206
207void CPL_DLL GDALDestroyRPCTransformer(void *pTransformArg);
208int CPL_DLL GDALRPCTransform(void *pTransformArg, int bDstToSrc,
209 int nPointCount, double *x, double *y, double *z,
210 int *panSuccess);
211
212/* Geolocation transformer */
213
214void CPL_DLL *GDALCreateGeoLocTransformer(GDALDatasetH hBaseDS,
215 char **papszGeolocationInfo,
216 int bReversed);
217void CPL_DLL GDALDestroyGeoLocTransformer(void *pTransformArg);
218int CPL_DLL GDALGeoLocTransform(void *pTransformArg, int bDstToSrc,
219 int nPointCount, double *x, double *y,
220 double *z, int *panSuccess);
221
222/* Approximate transformer */
223void CPL_DLL *GDALCreateApproxTransformer(GDALTransformerFunc pfnRawTransformer,
224 void *pRawTransformerArg,
225 double dfMaxError);
226void CPL_DLL GDALApproxTransformerOwnsSubtransformer(void *pCBData,
227 int bOwnFlag);
228void CPL_DLL GDALDestroyApproxTransformer(void *pApproxArg);
229int CPL_DLL GDALApproxTransform(void *pTransformArg, int bDstToSrc,
230 int nPointCount, double *x, double *y,
231 double *z, int *panSuccess);
232
233int CPL_DLL CPL_STDCALL GDALSimpleImageWarp(
234 GDALDatasetH hSrcDS, GDALDatasetH hDstDS, int nBandCount, int *panBandList,
235 GDALTransformerFunc pfnTransform, void *pTransformArg,
236 GDALProgressFunc pfnProgress, void *pProgressArg, char **papszWarpOptions);
237
238CPLErr CPL_DLL CPL_STDCALL
240 void *pTransformArg, double *padfGeoTransformOut,
241 int *pnPixels, int *pnLines);
242
244#define GDAL_SWO_ROUND_UP_SIZE 0x1
246#define GDAL_SWO_FORCE_SQUARE_PIXEL 0x2
247
248CPLErr CPL_DLL CPL_STDCALL GDALSuggestedWarpOutput2(
249 GDALDatasetH hSrcDS, GDALTransformerFunc pfnTransformer,
250 void *pTransformArg, double *padfGeoTransformOut, int *pnPixels,
251 int *pnLines, double *padfExtent, int nOptions);
252
254CPLXMLNode CPL_DLL *GDALSerializeTransformer(GDALTransformerFunc pfnFunc,
255 void *pTransformArg);
256CPLErr CPL_DLL GDALDeserializeTransformer(CPLXMLNode *psTree,
257 GDALTransformerFunc *ppfnFunc,
258 void **ppTransformArg);
262 GDALRasterBandH hXBand, GDALRasterBandH hYBand, GDALRasterBandH hZBand,
263 GDALTransformerFunc pfnTransformer, void *pTransformArg,
264 GDALProgressFunc pfnProgress, void *pProgressArg, char **papszOptions);
265
266/* -------------------------------------------------------------------- */
267/* Contour Line Generation */
268/* -------------------------------------------------------------------- */
269
271typedef CPLErr (*GDALContourWriter)(double dfLevel, int nPoints, double *padfX,
272 double *padfY, void *);
273
276
278GDAL_CG_Create(int nWidth, int nHeight, int bNoDataSet, double dfNoDataValue,
279 double dfContourInterval, double dfContourBase,
280 GDALContourWriter pfnWriter, void *pCBData);
282 double *padfScanline);
283void CPL_DLL GDAL_CG_Destroy(GDALContourGeneratorH hCG);
284
286typedef struct
287{
288 void *hLayer;
289
290 double adfGeoTransform[6];
291
292 int nElevField;
293 int nElevFieldMin;
294 int nElevFieldMax;
295 int nIDField;
296 int nNextID;
297
298 GIntBig nWrittenFeatureCountSinceLastCommit;
299 GIntBig nTransactionCommitInterval;
300} OGRContourWriterInfo;
301
302CPLErr CPL_DLL OGRContourWriter(double, int, double *, double *, void *pInfo);
306 GDALRasterBandH hBand, double dfContourInterval, double dfContourBase,
307 int nFixedLevelCount, double *padfFixedLevels, int bUseNoData,
308 double dfNoDataValue, void *hLayer, int iIDField, int iElevField,
309 GDALProgressFunc pfnProgress, void *pProgressArg);
310
311CPLErr CPL_DLL GDALContourGenerateEx(GDALRasterBandH hBand, void *hLayer,
312 CSLConstList options,
313 GDALProgressFunc pfnProgress,
314 void *pProgressArg);
315
316/* -------------------------------------------------------------------- */
317/* Viewshed Generation */
318/* -------------------------------------------------------------------- */
319
321typedef enum
322{
323 GVM_Diagonal = 1,
324 GVM_Edge = 2,
325 GVM_Max = 3,
326 GVM_Min = 4
328
330typedef enum
331{
332 GVOT_NORMAL = 1,
333 GVOT_MIN_TARGET_HEIGHT_FROM_DEM = 2,
334 GVOT_MIN_TARGET_HEIGHT_FROM_GROUND = 3
336
338 GDALRasterBandH hBand, const char *pszDriverName,
339 const char *pszTargetRasterName, CSLConstList papszCreationOptions,
340 double dfObserverX, double dfObserverY, double dfObserverHeight,
341 double dfTargetHeight, double dfVisibleVal, double dfInvisibleVal,
342 double dfOutOfRangeVal, double dfNoDataVal, double dfCurvCoeff,
343 GDALViewshedMode eMode, double dfMaxDistance, GDALProgressFunc pfnProgress,
344 void *pProgressArg, GDALViewshedOutputType heightMode,
345 CSLConstList papszExtraOptions);
346
347bool CPL_DLL GDALIsLineOfSightVisible(
348 const GDALRasterBandH, const int xA, const int yA, const double zA,
349 const int xB, const int yB, const double zB, int *pnxTerrainIntersection,
350 int *pnyTerrainIntersection, CSLConstList papszOptions);
351
352/************************************************************************/
353/* Rasterizer API - geometries burned into GDAL raster. */
354/************************************************************************/
355
357 GDALDatasetH hDS, int nBandCount, const int *panBandList, int nGeomCount,
358 const OGRGeometryH *pahGeometries, GDALTransformerFunc pfnTransformer,
359 void *pTransformArg, const double *padfGeomBurnValues,
360 CSLConstList papszOptions, GDALProgressFunc pfnProgress,
361 void *pProgressArg);
362
364 GDALDatasetH hDS, int nBandCount, const int *panBandList, int nGeomCount,
365 const OGRGeometryH *pahGeometries, GDALTransformerFunc pfnTransformer,
366 void *pTransformArg, const int64_t *panGeomBurnValues,
367 CSLConstList papszOptions, GDALProgressFunc pfnProgress,
368 void *pProgressArg);
369
371 GDALDatasetH hDS, int nBandCount, int *panBandList, int nLayerCount,
372 OGRLayerH *pahLayers, GDALTransformerFunc pfnTransformer,
373 void *pTransformArg, double *padfLayerBurnValues, char **papszOptions,
374 GDALProgressFunc pfnProgress, void *pProgressArg);
375
377 void *pData, int nBufXSize, int nBufYSize, GDALDataType eBufType,
378 int nPixelSpace, int nLineSpace, int nLayerCount, OGRLayerH *pahLayers,
379 const char *pszDstProjection, double *padfDstGeoTransform,
380 GDALTransformerFunc pfnTransformer, void *pTransformArg, double dfBurnValue,
381 char **papszOptions, GDALProgressFunc pfnProgress, void *pProgressArg);
382
383/************************************************************************/
384/* Gridding interface. */
385/************************************************************************/
386
406
444
484
525
527typedef struct
528{
533 double dfRadius1;
535 double dfRadius2;
540 double dfAngle;
544
580
582typedef struct
583{
592 double dfRadius;
596
597CPLErr CPL_DLL GDALGridCreate(GDALGridAlgorithm, const void *, GUInt32,
598 const double *, const double *, const double *,
599 double, double, double, double, GUInt32, GUInt32,
600 GDALDataType, void *, GDALProgressFunc, void *);
601
604
605GDALGridContext CPL_DLL *
606GDALGridContextCreate(GDALGridAlgorithm eAlgorithm, const void *poOptions,
607 GUInt32 nPoints, const double *padfX, const double *padfY,
608 const double *padfZ, int bCallerWillKeepPointArraysAlive);
609
610void CPL_DLL GDALGridContextFree(GDALGridContext *psContext);
611
612CPLErr CPL_DLL GDALGridContextProcess(GDALGridContext *psContext, double dfXMin,
613 double dfXMax, double dfYMin,
614 double dfYMax, GUInt32 nXSize,
615 GUInt32 nYSize, GDALDataType eType,
616 void *pData, GDALProgressFunc pfnProgress,
617 void *pProgressArg);
618
620 GDALDatasetH hSecondImage,
621 char **papszOptions,
622 int *pnGCPCount);
623
624/************************************************************************/
625/* Delaunay triangulation interface. */
626/************************************************************************/
627
629typedef struct
630{
631 int anVertexIdx[3];
632 int anNeighborIdx[3];
634 /* anNeighborIdx[k] is the triangle to the opposite side */
635 /* of the opposite segment of anVertexIdx[k] */
637
645typedef struct
646{
647 double dfMul1X;
648 double dfMul1Y;
649 double dfMul2X;
650 double dfMul2Y;
651 double dfCstX;
652 double dfCstY;
654
663
664int CPL_DLL GDALHasTriangulation(void);
665
667 const double *padfX,
668 const double *padfY);
670 GDALTriangulation *psDT, const double *padfX, const double *padfY);
672 const GDALTriangulation *psDT, int nFacetIdx, double dfX, double dfY,
673 double *pdfL1, double *pdfL2, double *pdfL3);
675 double dfX, double dfY,
676 int *panOutputFacetIdx);
678 int nFacetIdx, double dfX,
679 double dfY,
680 int *panOutputFacetIdx);
681void CPL_DLL GDALTriangulationFree(GDALTriangulation *psDT);
682
684#ifndef CPL_WARN_DEPRECATED_GDALOpenVerticalShiftGrid
685#define CPL_WARN_DEPRECATED_GDALOpenVerticalShiftGrid CPL_WARN_DEPRECATED
686#endif
689GDALDatasetH CPL_DLL GDALOpenVerticalShiftGrid(const char *pszProj4Geoidgrids,
690 int *pbError)
692 CPL_WARN_DEPRECATED_GDALOpenVerticalShiftGrid(
693 "GDALOpenVerticalShiftGrid() will be removed in GDAL 4.0")
695 ;
696
698#ifndef CPL_WARN_DEPRECATED_GDALApplyVerticalShiftGrid
699#define CPL_WARN_DEPRECATED_GDALApplyVerticalShiftGrid CPL_WARN_DEPRECATED
700#endif
704 GDALDatasetH hGridDataset,
705 int bInverse,
706 double dfSrcUnitToMeter,
707 double dfDstUnitToMeter,
708 const char *const *papszOptions)
710 CPL_WARN_DEPRECATED_GDALApplyVerticalShiftGrid(
711 "GDALApplyVerticalShiftGrid() will be removed in GDAL 4.0")
713 ;
714
716
717#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:283
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:279
unsigned int GUInt32
Unsigned int32 type.
Definition cpl_port.h:161
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1179
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:169
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition cpl_port.h:199
Public (C callable) GDAL entry points.
GDALDataType
Definition gdal.h:48
void * GDALDatasetH
Opaque type used for the C bindings of the C++ GDALDataset class.
Definition gdal.h:376
void * GDALRasterBandH
Opaque type used for the C bindings of the C++ GDALRasterBand class.
Definition gdal.h:379
void * GDALColorTableH
Opaque type used for the C bindings of the C++ GDALColorTable class.
Definition gdal.h:385
CPLErr GDALContourGenerateEx(GDALRasterBandH hBand, void *hLayer, CSLConstList options, GDALProgressFunc pfnProgress, void *pProgressArg)
Create vector contours from raster DEM.
Definition contour.cpp:563
void * GDALCreateGeoLocTransformer(GDALDatasetH hBaseDS, char **papszGeolocationInfo, int bReversed)
Create GeoLocation transformer.
Definition gdalgeoloc.cpp:2035
struct GDALGridContext GDALGridContext
Grid context opaque type.
Definition gdal_alg.h:603
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:968
int GDALGenImgProjTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Perform general image reprojection transformation.
Definition gdaltransformer.cpp:2836
GDALTriangulation * GDALTriangulationCreateDelaunay(int nPoints, const double *padfX, const double *padfY)
Computes a Delaunay triangulation of the passed points.
Definition delaunay.c:107
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:928
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:3305
void * GDALCreateReprojectionTransformerEx(OGRSpatialReferenceH hSrcSRS, OGRSpatialReferenceH hDstSRS, const char *const *papszOptions)
Create reprojection transformer.
Definition gdaltransformer.cpp:3374
void GDALSetGenImgProjTransformerDstGeoTransform(void *, const double *)
Set GenImgProj output geotransform.
Definition gdaltransformer.cpp:2767
void GDALDestroyGeoLocTransformer(void *pTransformArg)
Destroy GeoLocation transformer.
Definition gdalgeoloc.cpp:2048
void GDALGridContextFree(GDALGridContext *psContext)
Free a context used created by GDALGridContextCreate()
Definition gdalgrid.cpp:3351
void GDALTriangulationFree(GDALTriangulation *psDT)
Free a triangulation.
Definition delaunay.c:269
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:1395
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:3640
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:945
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:136
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:377
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:341
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:498
GDALViewshedMode
Viewshed Modes.
Definition gdal_alg.h:322
void GDALDestroyGCPTransformer(void *pTransformArg)
Destroy GCP transformer.
Definition gdal_crs.cpp:389
GDALGridAlgorithm
Gridding Algorithms.
Definition gdal_alg.h:389
@ GGA_MetricMinimum
Definition gdal_alg.h:393
@ GGA_InverseDistanceToAPowerNearestNeighbor
Definition gdal_alg.h:404
@ GGA_InverseDistanceToAPower
Definition gdal_alg.h:390
@ GGA_MetricAverageDistancePts
Definition gdal_alg.h:399
@ GGA_MetricMaximum
Definition gdal_alg.h:394
@ GGA_NearestNeighbor
Definition gdal_alg.h:392
@ GGA_MetricAverageDistance
Definition gdal_alg.h:397
@ GGA_MovingAverage
Definition gdal_alg.h:391
@ GGA_MetricCount
Definition gdal_alg.h:396
@ GGA_MetricRange
Definition gdal_alg.h:395
@ GGA_Linear
Definition gdal_alg.h:401
void GDALDestroyGenImgProjTransformer(void *)
GenImgProjTransformer deallocator.
Definition gdaltransformer.cpp:2798
int GDALRPCTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
RPC transform.
Definition gdal_rpc.cpp:1784
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:129
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:422
GDALDatasetH GDALOpenVerticalShiftGrid(const char *pszProj4Geoidgrids, int *pbError)
Load proj.4 geoidgrids as GDAL dataset.
Definition gdalapplyverticalshiftgrid.cpp:563
void GDAL_CG_Destroy(GDALContourGeneratorH hCG)
Destroy contour generator.
Definition contour.cpp:960
void GDALApproxTransformerOwnsSubtransformer(void *pCBData, int bOwnFlag)
Set bOwnSubtransformer flag.
Definition gdaltransformer.cpp:3867
int GDALApproxTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Perform approximate transformation.
Definition gdaltransformer.cpp:4182
void * GDALCreateGenImgProjTransformer4(OGRSpatialReferenceH hSrcSRS, const double *padfSrcGeoTransform, OGRSpatialReferenceH hDstSRS, const double *padfDstGeoTransform, const char *const *papszOptions)
Create image to image transformer.
Definition gdaltransformer.cpp:2659
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:574
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:3405
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:2748
CPLErr GDALSuggestedWarpOutput(GDALDatasetH hSrcDS, GDALTransformerFunc pfnTransformer, void *pTransformArg, double *padfGeoTransformOut, int *pnPixels, int *pnLines)
Suggest output file size.
Definition gdaltransformer.cpp:172
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:4822
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:115
CPLErr GDAL_CG_FeedLine(GDALContourGeneratorH hCG, double *padfScanline)
Feed a line to the contour generator.
Definition contour.cpp:947
int GDALTriangulationComputeBarycentricCoefficients(GDALTriangulation *psDT, const double *padfX, const double *padfY)
Computes barycentric coefficients for each triangles of the triangulation.
Definition delaunay.c:295
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
void * GDALCreateRPCTransformerV2(const GDALRPCInfoV2 *psRPC, int bReversed, double dfPixErrThreshold, char **papszOptions)
Create an RPC based transformer.
Definition gdal_rpc.cpp:800
GDALViewshedOutputType
Viewshed output types.
Definition gdal_alg.h:331
void GDALDestroyApproxTransformer(void *pApproxArg)
Cleanup approximate transformer.
Definition gdaltransformer.cpp:3888
void * GDALCreateGenImgProjTransformer3(const char *pszSrcWKT, const double *padfSrcGeoTransform, const char *pszDstWKT, const double *padfDstGeoTransform)
Create image to image transformer.
Definition gdaltransformer.cpp:2610
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:347
int GDALHasTriangulation(void)
Returns if GDAL is built with Delaunay triangulation support.
Definition delaunay.c:84
CPLErr(* GDALContourWriter)(double dfLevel, int nPoints, double *padfX, double *padfY, void *)
Contour writer callback type.
Definition gdal_alg.h:271
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:1866
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:330
int GDALChecksumImage(GDALRasterBandH hBand, int nXOff, int nYOff, int nXSize, int nYSize)
Compute checksum for image region.
Definition gdalchecksum.cpp:48
int(* GDALTransformerFunc)(void *pTransformerArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Definition gdal_alg.h:79
void GDALSetTransformerDstGeoTransform(void *, const double *)
Set ApproxTransformer or GenImgProj output geotransform.
Definition gdaltransformer.cpp:4797
void * GDALContourGeneratorH
Contour generator opaque type.
Definition gdal_alg.h:275
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:328
void GDALDestroyRPCTransformer(void *pTransformArg)
Destroy RPC transformer.
Definition gdal_rpc.cpp:1082
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:1492
void * GDALCreateGenImgProjTransformer2(GDALDatasetH hSrcDS, GDALDatasetH hDstDS, char **papszOptions)
Create image to image transformer.
Definition gdaltransformer.cpp:1907
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:3470
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:3503
void * GDALCreateApproxTransformer(GDALTransformerFunc pfnRawTransformer, void *pRawTransformerArg, double dfMaxError)
Create an approximating transformer.
Definition gdaltransformer.cpp:3829
int GDALGeoLocTransform(void *pTransformArg, int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)
Use GeoLocation transformer.
Definition gdalgeoloc.cpp:2081
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:517
void * GDALCreateTPSTransformer(int nGCPCount, const GDAL_GCP *pasGCPList, int bReversed)
Create Thin Plate Spline transformer from GCPs.
Definition gdal_tps.cpp:123
void GDALDestroyTPSTransformer(void *pTransformArg)
Destroy TPS transformer.
Definition gdal_tps.cpp:288
C API and defines for OGRFeature, OGRGeometry, and OGRDataSource related classes.
void * OGRGeometryH
Opaque type for a geometry.
Definition ogr_api.h:50
void * OGRSpatialReferenceH
Opaque type for a spatial reference system.
Definition ogr_api.h:65
void * OGRLayerH
Opaque type for a layer (OGRLayer)
Definition ogr_api.h:676
Document node structure.
Definition cpl_minixml.h:55
Data metrics method control options.
Definition gdal_alg.h:547
double dfRadius2
Definition gdal_alg.h:554
double dfAngle
Definition gdal_alg.h:559
double dfNoDataValue
Definition gdal_alg.h:567
double dfRadius1
Definition gdal_alg.h:552
size_t nSizeOfStructure
Definition gdal_alg.h:550
GUInt32 nMinPointsPerQuadrant
Definition gdal_alg.h:578
GUInt32 nMinPoints
Definition gdal_alg.h:565
GUInt32 nMaxPointsPerQuadrant
Definition gdal_alg.h:572
Inverse distance to a power, with nearest neighbour search, control options.
Definition gdal_alg.h:448
size_t nSizeOfStructure
Definition gdal_alg.h:451
GUInt32 nMinPointsPerQuadrant
Definition gdal_alg.h:482
GUInt32 nMaxPointsPerQuadrant
Definition gdal_alg.h:476
Inverse distance to a power method control options.
Definition gdal_alg.h:409
GUInt32 nMinPoints
Definition gdal_alg.h:440
double dfPower
Definition gdal_alg.h:414
double dfRadius2
Definition gdal_alg.h:424
double dfNoDataValue
Definition gdal_alg.h:442
double dfSmoothing
Definition gdal_alg.h:416
double dfAngle
Definition gdal_alg.h:429
double dfRadius1
Definition gdal_alg.h:422
GUInt32 nMaxPoints
Definition gdal_alg.h:434
size_t nSizeOfStructure
Definition gdal_alg.h:412
double dfAnisotropyRatio
Definition gdal_alg.h:418
double dfAnisotropyAngle
Definition gdal_alg.h:420
Linear method control options.
Definition gdal_alg.h:583
size_t nSizeOfStructure
Definition gdal_alg.h:586
double dfNoDataValue
Definition gdal_alg.h:594
double dfRadius
Definition gdal_alg.h:592
Moving average method control options.
Definition gdal_alg.h:487
GUInt32 nMaxPoints
Definition gdal_alg.h:504
double dfRadius1
Definition gdal_alg.h:492
double dfNoDataValue
Definition gdal_alg.h:512
double dfAngle
Definition gdal_alg.h:499
GUInt32 nMinPoints
Definition gdal_alg.h:510
double dfRadius2
Definition gdal_alg.h:494
GUInt32 nMinPointsPerQuadrant
Definition gdal_alg.h:523
size_t nSizeOfStructure
Definition gdal_alg.h:490
GUInt32 nMaxPointsPerQuadrant
Definition gdal_alg.h:517
Nearest neighbor method control options.
Definition gdal_alg.h:528
double dfNoDataValue
Definition gdal_alg.h:542
size_t nSizeOfStructure
Definition gdal_alg.h:531
double dfRadius2
Definition gdal_alg.h:535
double dfAngle
Definition gdal_alg.h:540
double dfRadius1
Definition gdal_alg.h:533
Structure to store Rational Polynomial Coefficients / Rigorous Projection Model.
Definition gdal.h:2019
Triangle barycentric coefficients.
Definition gdal_alg.h:646
double dfCstY
dfCstY
Definition gdal_alg.h:652
double dfCstX
dfCstX
Definition gdal_alg.h:651
double dfMul2Y
dfMul2Y
Definition gdal_alg.h:650
double dfMul1Y
dfMul1Y
Definition gdal_alg.h:648
double dfMul2X
dfMul2X
Definition gdal_alg.h:649
double dfMul1X
dfMul1X
Definition gdal_alg.h:647
Triangle fact.
Definition gdal_alg.h:630
Triangulation structure.
Definition gdal_alg.h:657
GDALTriBarycentricCoefficients * pasFacetCoefficients
arra of nFacets barycentric coefficients
Definition gdal_alg.h:661
int nFacets
number of facets
Definition gdal_alg.h:658
GDALTriFacet * pasFacets
array of nFacets facets
Definition gdal_alg.h:659
Ground Control Point.
Definition gdal.h:1168