Coverage Report

Created: 2026-04-01 06:20

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/gcore/gdal.h
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  GDAL Core
4
 * Purpose:  GDAL Core C/Public declarations.
5
 * Author:   Frank Warmerdam, warmerdam@pobox.com
6
 *
7
 ******************************************************************************
8
 * Copyright (c) 1998, 2002 Frank Warmerdam
9
 * Copyright (c) 2007-2014, Even Rouault <even dot rouault at spatialys.com>
10
 *
11
 * SPDX-License-Identifier: MIT
12
 ****************************************************************************/
13
14
#ifndef GDAL_H_INCLUDED
15
#define GDAL_H_INCLUDED
16
17
/**
18
 * \file gdal.h
19
 *
20
 * Public (C callable) GDAL entry points.
21
 */
22
23
#ifndef DOXYGEN_SKIP
24
#if defined(GDAL_COMPILATION)
25
#define DO_NOT_DEFINE_GDAL_DATE_NAME
26
#endif
27
#include "gdal_fwd.h"
28
#include "gdal_version.h"
29
#include "cpl_port.h"
30
#include "cpl_error.h"
31
#include "cpl_progress.h"
32
#include "cpl_virtualmem.h"
33
#include "cpl_minixml.h"
34
#include "ogr_api.h"
35
#endif
36
37
#include <stdbool.h>
38
#include <stdint.h>
39
40
/* -------------------------------------------------------------------- */
41
/*      Significant constants.                                          */
42
/* -------------------------------------------------------------------- */
43
44
CPL_C_START
45
46
/*! Pixel data types */
47
typedef enum
48
{
49
    /*! Unknown or unspecified type */ GDT_Unknown = 0,
50
    /*! 8-bit unsigned integer (GDT_Byte in GDAL < 3.13) */ GDT_UInt8 = 1,
51
    /*! 8-bit signed integer (GDAL >= 3.7) */ GDT_Int8 = 14,
52
    /*! 16-bit unsigned integer */ GDT_UInt16 = 2,
53
    /*! 16-bit signed integer */ GDT_Int16 = 3,
54
    /*! 32-bit unsigned integer */ GDT_UInt32 = 4,
55
    /*! 32-bit signed integer */ GDT_Int32 = 5,
56
    /*! 64 bit unsigned integer (GDAL >= 3.5)*/ GDT_UInt64 = 12,
57
    /*! 64 bit signed integer  (GDAL >= 3.5)*/ GDT_Int64 = 13,
58
    /*! 16-bit floating point */ GDT_Float16 = 15,
59
    /*! 32-bit floating point */ GDT_Float32 = 6,
60
    /*! 64-bit floating point */ GDT_Float64 = 7,
61
    /*! Complex Int16 */ GDT_CInt16 = 8,
62
    /*! Complex Int32 */ GDT_CInt32 = 9,
63
    /*! Complex Float16 */ GDT_CFloat16 = 16,
64
    /*! Complex Float32 */ GDT_CFloat32 = 10,
65
    /*! Complex Float64 */ GDT_CFloat64 = 11,
66
    GDT_TypeCount = 17 /* maximum type # + 1 */
67
} GDALDataType;
68
69
/** GDT_Byte is the name used before GDAL 3.13 for GDT_UInt8 */
70
0
#define GDT_Byte GDT_UInt8
71
72
int CPL_DLL CPL_STDCALL GDALGetDataTypeSize(GDALDataType)
73
    /*! @cond Doxygen_Suppress */
74
    CPL_WARN_DEPRECATED("Use GDALGetDataTypeSizeBits() or "
75
                        "GDALGetDataTypeSizeBytes() * 8 instead")
76
    /*! @endcond */
77
    ;
78
int CPL_DLL CPL_STDCALL GDALGetDataTypeSizeBits(GDALDataType eDataType);
79
int CPL_DLL CPL_STDCALL GDALGetDataTypeSizeBytes(GDALDataType);
80
int CPL_DLL CPL_STDCALL GDALDataTypeIsComplex(GDALDataType);
81
int CPL_DLL CPL_STDCALL GDALDataTypeIsInteger(GDALDataType);
82
int CPL_DLL CPL_STDCALL GDALDataTypeIsFloating(GDALDataType);
83
int CPL_DLL CPL_STDCALL GDALDataTypeIsSigned(GDALDataType);
84
const char CPL_DLL *CPL_STDCALL GDALGetDataTypeName(GDALDataType);
85
GDALDataType CPL_DLL CPL_STDCALL GDALGetDataTypeByName(const char *);
86
GDALDataType CPL_DLL CPL_STDCALL GDALDataTypeUnion(GDALDataType, GDALDataType);
87
GDALDataType CPL_DLL CPL_STDCALL GDALDataTypeUnionWithValue(GDALDataType eDT,
88
                                                            double dValue,
89
                                                            int bComplex);
90
GDALDataType CPL_DLL CPL_STDCALL GDALFindDataType(int nBits, int bSigned,
91
                                                  int bFloating, int bComplex);
92
GDALDataType CPL_DLL CPL_STDCALL GDALFindDataTypeForValue(double dValue,
93
                                                          int bComplex);
94
double CPL_DLL GDALAdjustValueToDataType(GDALDataType eDT, double dfValue,
95
                                         int *pbClamped, int *pbRounded);
96
bool CPL_DLL GDALIsValueExactAs(double dfValue, GDALDataType eDT);
97
bool CPL_DLL GDALIsValueInRangeOf(double dfValue, GDALDataType eDT);
98
GDALDataType CPL_DLL CPL_STDCALL GDALGetNonComplexDataType(GDALDataType);
99
int CPL_DLL CPL_STDCALL GDALDataTypeIsConversionLossy(GDALDataType eTypeFrom,
100
                                                      GDALDataType eTypeTo);
101
102
/**
103
 * status of the asynchronous stream
104
 */
105
typedef enum
106
{
107
    GARIO_PENDING = 0,
108
    GARIO_UPDATE = 1,
109
    GARIO_ERROR = 2,
110
    GARIO_COMPLETE = 3,
111
    GARIO_TypeCount = 4
112
} GDALAsyncStatusType;
113
114
const char CPL_DLL *CPL_STDCALL GDALGetAsyncStatusTypeName(GDALAsyncStatusType);
115
GDALAsyncStatusType CPL_DLL CPL_STDCALL
116
GDALGetAsyncStatusTypeByName(const char *);
117
118
/*! Flag indicating read/write, or read-only access to data. */
119
typedef enum
120
{
121
    /*! Read only (no update) access */ GA_ReadOnly = 0,
122
    /*! Read/write access. */ GA_Update = 1
123
} GDALAccess;
124
125
/*! Read/Write flag for RasterIO() method */
126
typedef enum
127
{
128
    /*! Read data */ GF_Read = 0,
129
    /*! Write data */ GF_Write = 1
130
} GDALRWFlag;
131
132
/* NOTE: values are selected to be consistent with GDALResampleAlg of
133
 * alg/gdalwarper.h */
134
/** RasterIO() resampling method.
135
 */
136
typedef enum
137
{
138
    /*! Nearest neighbour */ GRIORA_NearestNeighbour = 0,
139
    /*! Bilinear (2x2 kernel) */ GRIORA_Bilinear = 1,
140
    /*! Cubic Convolution Approximation (4x4 kernel) */ GRIORA_Cubic = 2,
141
    /*! Cubic B-Spline Approximation (4x4 kernel) */ GRIORA_CubicSpline = 3,
142
    /*! Lanczos windowed sinc interpolation (6x6 kernel) */ GRIORA_Lanczos = 4,
143
    /*! Average */ GRIORA_Average = 5,
144
    /*! Mode (selects the value which appears most often of all the sampled
145
       points) */
146
    GRIORA_Mode = 6,
147
    /*! Gauss blurring */ GRIORA_Gauss = 7,
148
    /* NOTE: values 8 to 13 are reserved for max,min,med,Q1,Q3,sum */
149
    /*! @cond Doxygen_Suppress */
150
    GRIORA_RESERVED_START = 8,
151
    GRIORA_RESERVED_END = 13,
152
    /*! @endcond */
153
    /** RMS: Root Mean Square / Quadratic Mean.
154
     * For complex numbers, applies on the real and imaginary part
155
     * independently.
156
     */
157
    GRIORA_RMS = 14,
158
    /*! @cond Doxygen_Suppress */
159
    GRIORA_LAST = GRIORA_RMS
160
    /*! @endcond */
161
} GDALRIOResampleAlg;
162
163
/* NOTE to developers: if required, only add members at the end of the
164
 * structure, and when doing so increase RASTERIO_EXTRA_ARG_CURRENT_VERSION.
165
 *
166
 * Also make sure to use GDALCopyRasterIOExtraArg() when creating a copy
167
 * from user input.
168
 */
169
170
/** Structure to pass extra arguments to RasterIO() method,
171
 * must be initialized with INIT_RASTERIO_EXTRA_ARG
172
 */
173
typedef struct
174
{
175
    /*! Version of structure (to allow future extensions of the structure) */
176
    int nVersion;
177
178
    /*! Resampling algorithm */
179
    GDALRIOResampleAlg eResampleAlg;
180
181
    /*! Progress callback */
182
    GDALProgressFunc pfnProgress;
183
    /*! Progress callback user data */
184
    void *pProgressData;
185
186
    /*! Indicate if dfXOff, dfYOff, dfXSize and dfYSize are set.
187
        Mostly reserved from the VRT driver to communicate a more precise
188
        source window. Must be such that dfXOff - nXOff < 1.0 and
189
        dfYOff - nYOff < 1.0 and nXSize - dfXSize < 1.0 and nYSize - dfYSize
190
       < 1.0 */
191
    int bFloatingPointWindowValidity;
192
    /*! Pixel offset to the top left corner. Only valid if
193
     * bFloatingPointWindowValidity = TRUE */
194
    double dfXOff;
195
    /*! Line offset to the top left corner. Only valid if
196
     * bFloatingPointWindowValidity = TRUE */
197
    double dfYOff;
198
    /*! Width in pixels of the area of interest. Only valid if
199
     * bFloatingPointWindowValidity = TRUE */
200
    double dfXSize;
201
    /*! Height in pixels of the area of interest. Only valid if
202
     * bFloatingPointWindowValidity = TRUE */
203
    double dfYSize;
204
    /*! Indicate if overviews should be considered. Tested in
205
        GDALBandGetBestOverviewLevel(), mostly reserved for use by
206
        GDALRegenerateOverviewsMultiBand()
207
        Only available if RASTERIO_EXTRA_ARG_CURRENT_VERSION >= 2
208
    */
209
    int bUseOnlyThisScale;
210
211
    /** Indicate if operations (typically non-nearest resampling)
212
     * should be done in the eBufType data type of the RasterIO() request
213
     * rather than the band data type.
214
     * Only available if RASTERIO_EXTRA_ARG_CURRENT_VERSION >= 3 (GDAL >= 3.13)
215
     * Defaults to TRUE in GDAL >= 3.13 (behavior in previous version was
216
     * mostly, but not always corresponding to setting it to FALSE)
217
    */
218
    int bOperateInBufType;
219
220
} GDALRasterIOExtraArg;
221
222
#ifndef DOXYGEN_SKIP
223
0
#define RASTERIO_EXTRA_ARG_CURRENT_VERSION 3
224
#endif
225
226
/** Macro to initialize an instance of GDALRasterIOExtraArg structure.
227
 */
228
#define INIT_RASTERIO_EXTRA_ARG(s)                                             \
229
0
    do                                                                         \
230
0
    {                                                                          \
231
0
        (s).nVersion = RASTERIO_EXTRA_ARG_CURRENT_VERSION;                     \
232
0
        (s).eResampleAlg = GRIORA_NearestNeighbour;                            \
233
0
        (s).pfnProgress = CPL_NULLPTR;                                         \
234
0
        (s).pProgressData = CPL_NULLPTR;                                       \
235
0
        (s).bFloatingPointWindowValidity = FALSE;                              \
236
0
        (s).bUseOnlyThisScale = FALSE;                                         \
237
0
        (s).bOperateInBufType = TRUE;                                          \
238
0
    } while (0)
239
240
/** Macro to return whether GDALRasterIOExtraArg::bOperateInBufType is set.
241
 *
242
 * @since 3.13
243
 */
244
#define GDAL_GET_OPERATE_IN_BUF_TYPE(s)                                        \
245
0
    ((s).nVersion < 3 || (s).bOperateInBufType)
246
247
/** Value indicating the start of the range for color interpretations belonging
248
 * to the InfraRed (IR) domain. All constants of the GDALColorInterp enumeration
249
 * in the IR domain are in the [GCI_IR_Start, GCI_IR_End] range.
250
 *
251
 * @since 3.10
252
 */
253
#define GCI_IR_Start 20
254
255
/** Value indicating the end of the range for color interpretations belonging
256
 * to the InfraRed (IR) domain. All constants of the GDALColorInterp enumeration
257
 * in the IR domain are in the [GCI_IR_Start, GCI_IR_End] range.
258
 *
259
 * @since 3.10
260
 */
261
#define GCI_IR_End 29
262
263
/** Value indicating the start of the range for color interpretations belonging
264
 * to the Synthetic Aperture Radar (SAR) domain.
265
 * All constants of the GDALColorInterp enumeration
266
 * in the SAR domain are in the [GCI_SAR_Start, GCI_SAR_End] range.
267
 *
268
 * @since 3.10
269
 */
270
#define GCI_SAR_Start 30
271
272
/** Value indicating the end of the range for color interpretations belonging
273
 * to the Synthetic Aperture Radar (SAR) domain.
274
 * All constants of the GDALColorInterp enumeration
275
 * in the SAR domain are in the [GCI_SAR_Start, GCI_SAR_End] range.
276
 *
277
 * @since 3.10
278
 */
279
#define GCI_SAR_End 39
280
281
/** Types of color interpretation for raster bands.
282
 *
283
 * For spectral bands, the wavelength ranges are indicative only, and may vary
284
 * depending on sensors. The CENTRAL_WAVELENGTH_UM and FWHM_UM metadata
285
 * items in the IMAGERY metadata domain of the raster band, when present, will
286
 * give more accurate characteristics.
287
 *
288
 * Values belonging to the IR domain are in the [GCI_IR_Start, GCI_IR_End] range.
289
 * Values belonging to the SAR domain are in the [GCI_SAR_Start, GCI_SAR_End] range.
290
 *
291
 * Values between GCI_PanBand to GCI_SAR_Reserved_2 have been added in GDAL 3.10.
292
 */
293
typedef enum
294
{
295
    /*! Undefined */ GCI_Undefined = 0,
296
    /*! Greyscale */ GCI_GrayIndex = 1,
297
    /*! Paletted (see associated color table) */ GCI_PaletteIndex = 2,
298
    /*! Red band of RGBA image, or red spectral band [0.62 - 0.69 um]*/
299
    GCI_RedBand = 3,
300
    /*! Green band of RGBA image, or green spectral band [0.51 - 0.60 um]*/
301
    GCI_GreenBand = 4,
302
    /*! Blue band of RGBA image, or blue spectral band [0.45 - 0.53 um] */
303
    GCI_BlueBand = 5,
304
    /*! Alpha (0=transparent, 255=opaque) */ GCI_AlphaBand = 6,
305
    /*! Hue band of HLS image */ GCI_HueBand = 7,
306
    /*! Saturation band of HLS image */ GCI_SaturationBand = 8,
307
    /*! Lightness band of HLS image */ GCI_LightnessBand = 9,
308
    /*! Cyan band of CMYK image */ GCI_CyanBand = 10,
309
    /*! Magenta band of CMYK image */ GCI_MagentaBand = 11,
310
    /*! Yellow band of CMYK image, or yellow spectral band [0.58 - 0.62 um] */
311
    GCI_YellowBand = 12,
312
    /*! Black band of CMYK image */ GCI_BlackBand = 13,
313
    /*! Y Luminance */ GCI_YCbCr_YBand = 14,
314
    /*! Cb Chroma */ GCI_YCbCr_CbBand = 15,
315
    /*! Cr Chroma */ GCI_YCbCr_CrBand = 16,
316
317
    /* GDAL 3.10 addition: begin */
318
    /*! Panchromatic band [0.40 - 1.00 um] */ GCI_PanBand = 17,
319
    /*! Coastal band [0.40 - 0.45 um] */ GCI_CoastalBand = 18,
320
    /*! Red-edge band [0.69 - 0.79 um] */ GCI_RedEdgeBand = 19,
321
322
    /*! Near-InfraRed (NIR) band [0.75 - 1.40 um] */ GCI_NIRBand =
323
        GCI_IR_Start + 0,
324
    /*! Short-Wavelength InfraRed (SWIR) band [1.40 - 3.00 um] */ GCI_SWIRBand =
325
        GCI_IR_Start + 1,
326
    /*! Mid-Wavelength InfraRed (MWIR) band [3.00 - 8.00 um] */ GCI_MWIRBand =
327
        GCI_IR_Start + 2,
328
    /*! Long-Wavelength InfraRed (LWIR) band [8.00 - 15 um] */ GCI_LWIRBand =
329
        GCI_IR_Start + 3,
330
    /*! Thermal InfraRed (TIR) band (MWIR or LWIR) [3 - 15 um] */ GCI_TIRBand =
331
        GCI_IR_Start + 4,
332
    /*! Other infrared band [0.75 - 1000 um] */ GCI_OtherIRBand =
333
        GCI_IR_Start + 5,
334
    /*! Reserved value. Do not set it ! */
335
    GCI_IR_Reserved_1 = GCI_IR_Start + 6,
336
    /*! Reserved value. Do not set it ! */
337
    GCI_IR_Reserved_2 = GCI_IR_Start + 7,
338
    /*! Reserved value. Do not set it ! */
339
    GCI_IR_Reserved_3 = GCI_IR_Start + 8,
340
    /*! Reserved value. Do not set it ! */
341
    GCI_IR_Reserved_4 = GCI_IR_Start + 9,
342
343
    /*! Synthetic Aperture Radar (SAR) Ka band [0.8 - 1.1 cm / 27 - 40 GHz] */
344
    GCI_SAR_Ka_Band = GCI_SAR_Start + 0,
345
    /*! Synthetic Aperture Radar (SAR) K band [1.1 - 1.7 cm / 18 - 27 GHz] */
346
    GCI_SAR_K_Band = GCI_SAR_Start + 1,
347
    /*! Synthetic Aperture Radar (SAR) Ku band [1.7 - 2.4 cm / 12 - 18 GHz] */
348
    GCI_SAR_Ku_Band = GCI_SAR_Start + 2,
349
    /*! Synthetic Aperture Radar (SAR) X band [2.4 - 3.8 cm / 8 - 12 GHz] */
350
    GCI_SAR_X_Band = GCI_SAR_Start + 3,
351
    /*! Synthetic Aperture Radar (SAR) C band [3.8 - 7.5 cm / 4 - 8 GHz] */
352
    GCI_SAR_C_Band = GCI_SAR_Start + 4,
353
    /*! Synthetic Aperture Radar (SAR) S band [7.5 - 15 cm / 2 - 4 GHz] */
354
    GCI_SAR_S_Band = GCI_SAR_Start + 5,
355
    /*! Synthetic Aperture Radar (SAR) L band [15 - 30 cm / 1 - 2 GHz] */
356
    GCI_SAR_L_Band = GCI_SAR_Start + 6,
357
    /*! Synthetic Aperture Radar (SAR) P band [30 - 100 cm / 0.3 - 1 GHz] */
358
    GCI_SAR_P_Band = GCI_SAR_Start + 7,
359
    /*! Reserved value. Do not set it ! */
360
    GCI_SAR_Reserved_1 = GCI_SAR_Start + 8,
361
    /*! Reserved value. Do not set it ! */
362
    GCI_SAR_Reserved_2 = GCI_SAR_Start + 9,
363
364
    /* GDAL 3.10 addition: end */
365
366
    /*! Max current value (equals to GCI_SAR_Reserved_2 currently) */ GCI_Max =
367
        GCI_SAR_Reserved_2
368
} GDALColorInterp;
369
370
const char CPL_DLL *GDALGetColorInterpretationName(GDALColorInterp);
371
GDALColorInterp CPL_DLL GDALGetColorInterpretationByName(const char *pszName);
372
373
const GDALColorInterp CPL_DLL *GDALGetColorInterpretationList(int *pnCount);
374
375
/*! Types of color interpretations for a GDALColorTable. */
376
typedef enum
377
{
378
    /*! Grayscale (in GDALColorEntry.c1) */ GPI_Gray = 0,
379
    /*! Red, Green, Blue and Alpha in (in c1, c2, c3 and c4) */ GPI_RGB = 1,
380
    /*! Cyan, Magenta, Yellow and Black (in c1, c2, c3 and c4)*/ GPI_CMYK = 2,
381
    /*! Hue, Lightness and Saturation (in c1, c2, and c3) */ GPI_HLS = 3
382
} GDALPaletteInterp;
383
384
const char CPL_DLL *GDALGetPaletteInterpretationName(GDALPaletteInterp);
385
386
/* "well known" metadata items. */
387
388
/** Metadata item for dataset that indicates the spatial interpretation of a
389
 *  pixel */
390
0
#define GDALMD_AREA_OR_POINT "AREA_OR_POINT"
391
/** Value for GDALMD_AREA_OR_POINT that indicates that a pixel represents an
392
 * area */
393
0
#define GDALMD_AOP_AREA "Area"
394
/** Value for GDALMD_AREA_OR_POINT that indicates that a pixel represents a
395
 * point */
396
0
#define GDALMD_AOP_POINT "Point"
397
398
/* -------------------------------------------------------------------- */
399
/*      GDAL Specific error codes.                                      */
400
/*                                                                      */
401
/*      error codes 100 to 299 reserved for GDAL.                       */
402
/* -------------------------------------------------------------------- */
403
#ifndef DOXYGEN_SKIP
404
#define CPLE_WrongFormat CPL_STATIC_CAST(CPLErrorNum, 200)
405
#endif
406
407
/* -------------------------------------------------------------------- */
408
/*      Types, enumerations.                                            */
409
/* -------------------------------------------------------------------- */
410
411
/** Type to express pixel, line or band spacing. Signed 64 bit integer. */
412
typedef GIntBig GSpacing;
413
414
/** Enumeration giving the class of a GDALExtendedDataType.
415
 * @since GDAL 3.1
416
 */
417
typedef enum
418
{
419
    /** Numeric value. Based on GDALDataType enumeration */
420
    GEDTC_NUMERIC,
421
    /** String value. */
422
    GEDTC_STRING,
423
    /** Compound data type. */
424
    GEDTC_COMPOUND
425
} GDALExtendedDataTypeClass;
426
427
/** Enumeration giving the subtype of a GDALExtendedDataType.
428
 * @since GDAL 3.4
429
 */
430
typedef enum
431
{
432
    /** None. */
433
    GEDTST_NONE,
434
    /** JSon. Only applies to GEDTC_STRING */
435
    GEDTST_JSON
436
} GDALExtendedDataTypeSubType;
437
438
/* ==================================================================== */
439
/*      Registration/driver related.                                    */
440
/* ==================================================================== */
441
442
/** Long name of the driver */
443
0
#define GDAL_DMD_LONGNAME "DMD_LONGNAME"
444
445
/** URL (relative to http://gdal.org/) to the help page of the driver */
446
0
#define GDAL_DMD_HELPTOPIC "DMD_HELPTOPIC"
447
448
/** MIME type handled by the driver. */
449
0
#define GDAL_DMD_MIMETYPE "DMD_MIMETYPE"
450
451
/** Extension handled by the driver. */
452
0
#define GDAL_DMD_EXTENSION "DMD_EXTENSION"
453
454
/** Connection prefix to provide as the file name of the open function.
455
 * Typically set for non-file based drivers. Generally used with open options.
456
 */
457
0
#define GDAL_DMD_CONNECTION_PREFIX "DMD_CONNECTION_PREFIX"
458
459
/** List of (space separated) extensions handled by the driver.
460
 */
461
0
#define GDAL_DMD_EXTENSIONS "DMD_EXTENSIONS"
462
463
/** XML snippet with creation options. */
464
0
#define GDAL_DMD_CREATIONOPTIONLIST "DMD_CREATIONOPTIONLIST"
465
466
/** XML snippet with overview creation options.
467
 * @since GDAL 3.12
468
 */
469
0
#define GDAL_DMD_OVERVIEW_CREATIONOPTIONLIST "DMD_OVERVIEW_CREATIONOPTIONLIST"
470
471
/** XML snippet with multidimensional dataset creation options.
472
 * @since GDAL 3.1
473
 */
474
#define GDAL_DMD_MULTIDIM_DATASET_CREATIONOPTIONLIST                           \
475
0
    "DMD_MULTIDIM_DATASET_CREATIONOPTIONLIST"
476
477
/** XML snippet with multidimensional group creation options.
478
 * @since GDAL 3.1
479
 */
480
#define GDAL_DMD_MULTIDIM_GROUP_CREATIONOPTIONLIST                             \
481
0
    "DMD_MULTIDIM_GROUP_CREATIONOPTIONLIST"
482
483
/** XML snippet with multidimensional dimension creation options.
484
 * @since GDAL 3.1
485
 */
486
#define GDAL_DMD_MULTIDIM_DIMENSION_CREATIONOPTIONLIST                         \
487
0
    "DMD_MULTIDIM_DIMENSION_CREATIONOPTIONLIST"
488
489
/** XML snippet with multidimensional array creation options.
490
 * @since GDAL 3.1
491
 */
492
#define GDAL_DMD_MULTIDIM_ARRAY_CREATIONOPTIONLIST                             \
493
0
    "DMD_MULTIDIM_ARRAY_CREATIONOPTIONLIST"
494
495
/** XML snippet with multidimensional array open options.
496
 * @since GDAL 3.6
497
 */
498
#define GDAL_DMD_MULTIDIM_ARRAY_OPENOPTIONLIST                                 \
499
0
    "DMD_MULTIDIM_ARRAY_OPENOPTIONLIST"
500
501
/** XML snippet with multidimensional attribute creation options.
502
 * @since GDAL 3.1
503
 */
504
#define GDAL_DMD_MULTIDIM_ATTRIBUTE_CREATIONOPTIONLIST                         \
505
0
    "DMD_MULTIDIM_ATTRIBUTE_CREATIONOPTIONLIST"
506
507
/** XML snippet with open options.
508
 */
509
0
#define GDAL_DMD_OPENOPTIONLIST "DMD_OPENOPTIONLIST"
510
511
/** List of (space separated) raster data types supported by the
512
 * Create()/CreateCopy() API. */
513
0
#define GDAL_DMD_CREATIONDATATYPES "DMD_CREATIONDATATYPES"
514
515
/** List of (space separated) vector field types supported by the CreateField()
516
 * API.
517
 * */
518
0
#define GDAL_DMD_CREATIONFIELDDATATYPES "DMD_CREATIONFIELDDATATYPES"
519
520
/** List of (space separated) vector field sub-types supported by the
521
 * CreateField() API.
522
 * */
523
0
#define GDAL_DMD_CREATIONFIELDDATASUBTYPES "DMD_CREATIONFIELDDATASUBTYPES"
524
525
/** Maximum size of a String field that can be created (OGRFieldDefn.GetWidth()).
526
 *
527
 * It is undefined whether this is a number of bytes or Unicode character count.
528
 * Most of the time, this will be a number of bytes, so a Unicode string whose
529
 * character count is the maximum size could not fit.
530
 *
531
 * This metadata item is set only on a small number of drivers, in particular
532
 * "ESRI Shapefile" and "MapInfo File", which use fixed-width storage of strings.
533
 *
534
 * @since GDAL 3.12
535
 */
536
0
#define GDAL_DMD_MAX_STRING_LENGTH "DMD_MAX_STRING_LENGTH"
537
538
/** List of (space separated) capability flags supported by the CreateField() API.
539
 *
540
 * Supported values are:
541
 *
542
 * - "WidthPrecision": field width and precision is supported.
543
 * - "Nullable": field (non-)nullable status is supported.
544
 * - "Unique": field unique constraint is supported.
545
 * - "Default": field default value is supported.
546
 * - "AlternativeName": field alternative name is supported.
547
 * - "Comment": field comment is supported.
548
 * - "Domain": field can be associated with a domain.
549
 *
550
 * @see GDAL_DMD_ALTER_FIELD_DEFN_FLAGS for capabilities supported when altering
551
 * existing fields.
552
 *
553
 * @since GDAL 3.7
554
 */
555
0
#define GDAL_DMD_CREATION_FIELD_DEFN_FLAGS "DMD_CREATION_FIELD_DEFN_FLAGS"
556
557
/** Capability set by a driver that exposes Subdatasets.
558
 *
559
 * This capability reflects that a raster driver supports child layers, such as
560
 * NetCDF or multi-table raster Geopackages.
561
 *
562
 * See GDAL_DCAP_MULTIPLE_VECTOR_LAYERS for a similar capability flag
563
 * for vector drivers.
564
 */
565
0
#define GDAL_DMD_SUBDATASETS "DMD_SUBDATASETS"
566
567
/** Capability set by a driver that can create subdatasets with the
568
 * APPEND_SUBDATASET=YES creation option.
569
 *
570
 * @since 3.11
571
 */
572
0
#define GDAL_DCAP_CREATE_SUBDATASETS "DCAP_CREATE_SUBDATASETS"
573
574
/** Capability set by a vector driver that supports field width and precision.
575
 *
576
 * This capability reflects that a vector driver includes the decimal separator
577
 * in the field width of fields of type OFTReal.
578
 *
579
 * See GDAL_DMD_NUMERIC_FIELD_WIDTH_INCLUDES_SIGN for a related capability flag.
580
 * @since GDAL 3.7
581
 */
582
#define GDAL_DMD_NUMERIC_FIELD_WIDTH_INCLUDES_DECIMAL_SEPARATOR                \
583
0
    "DMD_NUMERIC_FIELD_WIDTH_INCLUDES_DECIMAL_SEPARATOR"
584
585
/** Capability set by a vector driver that supports field width and precision.
586
 *
587
 * This capability reflects that a vector driver includes the sign
588
 * in the field width of fields of type OFTReal.
589
 *
590
 * See GDAL_DMD_NUMERIC_FIELD_WIDTH_INCLUDES_DECIMAL_SEPARATOR for a related capability flag.
591
 * @since GDAL 3.7
592
 */
593
#define GDAL_DMD_NUMERIC_FIELD_WIDTH_INCLUDES_SIGN                             \
594
0
    "DMD_NUMERIC_FIELD_WIDTH_INCLUDES_SIGN"
595
596
/** Capability set by a driver that implements the Open() API. */
597
0
#define GDAL_DCAP_OPEN "DCAP_OPEN"
598
599
/** Capability set by a driver that implements the Create() API.
600
 *
601
 * If GDAL_DCAP_CREATE is set, but GDAL_DCAP_CREATECOPY not, a generic
602
 * CreateCopy() implementation is available and will use the Create() API of
603
 * the driver.
604
 * So to test if some CreateCopy() implementation is available, generic or
605
 * specialize, test for both GDAL_DCAP_CREATE and GDAL_DCAP_CREATECOPY.
606
 */
607
0
#define GDAL_DCAP_CREATE "DCAP_CREATE"
608
609
/** Capability set by a driver that implements the CreateMultiDimensional() API.
610
 *
611
 * @since GDAL 3.1
612
 */
613
0
#define GDAL_DCAP_CREATE_MULTIDIMENSIONAL "DCAP_CREATE_MULTIDIMENSIONAL"
614
615
/** Capability set by a driver that implements the CreateCopy() API.
616
 *
617
 * If GDAL_DCAP_CREATECOPY is not defined, but GDAL_DCAP_CREATE is set, a
618
 * generic CreateCopy() implementation is available and will use the Create()
619
 * API of the driver. So to test if some CreateCopy() implementation is
620
 * available, generic or specialize, test for both GDAL_DCAP_CREATE and
621
 * GDAL_DCAP_CREATECOPY.
622
 */
623
0
#define GDAL_DCAP_CREATECOPY "DCAP_CREATECOPY"
624
625
/** Capability set by a driver that supports the \@CREATE_ONLY_VISIBLE_AT_CLOSE_TIME
626
 * hidden creation option.
627
 *
628
 * @since GDAL 3.12
629
 */
630
#define GDAL_DCAP_CREATE_ONLY_VISIBLE_AT_CLOSE_TIME                            \
631
0
    "DCAP_CREATE_ONLY_VISIBLE_AT_CLOSE_TIME"
632
633
/** Capability set by a driver that implements the VectorTranslateFrom() API.
634
 *
635
 * @since GDAL 3.8
636
 */
637
0
#define GDAL_DCAP_VECTOR_TRANSLATE_FROM "DCAP_VECTOR_TRANSLATE_FROM"
638
639
/** Capability set by a driver that implements the CreateCopy() API, but with
640
 * multidimensional raster as input and output.
641
 *
642
 * @since GDAL 3.1
643
 */
644
0
#define GDAL_DCAP_CREATECOPY_MULTIDIMENSIONAL "DCAP_CREATECOPY_MULTIDIMENSIONAL"
645
646
/** Capability set by a driver that supports multidimensional data.
647
 * @since GDAL 3.1
648
 */
649
0
#define GDAL_DCAP_MULTIDIM_RASTER "DCAP_MULTIDIM_RASTER"
650
651
/** Capability set by a driver that can copy over subdatasets. */
652
#define GDAL_DCAP_SUBCREATECOPY "DCAP_SUBCREATECOPY"
653
654
/** Capability set by a driver that supports the GDAL_OF_UPDATE flag and offers
655
 * feature appending capabilities.
656
 *
657
 * Note: feature appending capability is also implied if GDAL_DCAP_UPDATE or
658
 * GDAL_DCAP_CREATE_LAYER is set, in which case GDAL_DCAP_APPEND is not set.
659
 *
660
 * @since GDAL 3.12.
661
 */
662
0
#define GDAL_DCAP_APPEND "DCAP_APPEND"
663
664
/** Capability set by a driver that supports the GDAL_OF_UPDATE flag and offers
665
 * at least some update capabilities.
666
 * Exact update capabilities can be determined by the GDAL_DMD_UPDATE_ITEMS
667
 * metadata item
668
 * @since GDAL 3.11
669
 */
670
0
#define GDAL_DCAP_UPDATE "DCAP_UPDATE"
671
672
/** Capability set by a driver that can read/create datasets through the VSI*L
673
 * API. */
674
0
#define GDAL_DCAP_VIRTUALIO "DCAP_VIRTUALIO"
675
676
/** Capability set by a driver having raster capability.
677
 */
678
0
#define GDAL_DCAP_RASTER "DCAP_RASTER"
679
680
/** Capability set by a driver having vector capability.
681
 */
682
0
#define GDAL_DCAP_VECTOR "DCAP_VECTOR"
683
684
/** Capability set by a driver having geographical network model capability.
685
 */
686
0
#define GDAL_DCAP_GNM "DCAP_GNM"
687
688
/** Capability set by a driver that can create layers.
689
 * @since GDAL 3.6
690
 */
691
0
#define GDAL_DCAP_CREATE_LAYER "DCAP_CREATE_LAYER"
692
693
/** Capability set by a driver that can delete layers.
694
 * @since GDAL 3.6
695
 */
696
0
#define GDAL_DCAP_DELETE_LAYER "DCAP_DELETE_LAYER"
697
698
/** Capability set by a driver that can create fields.
699
 * @since GDAL 3.6
700
 */
701
0
#define GDAL_DCAP_CREATE_FIELD "DCAP_CREATE_FIELD"
702
703
/** Capability set by a driver that can delete fields.
704
 * @since GDAL 3.6
705
 */
706
0
#define GDAL_DCAP_DELETE_FIELD "DCAP_DELETE_FIELD"
707
708
/** Capability set by a driver that can reorder fields.
709
 * @since GDAL 3.6
710
 */
711
0
#define GDAL_DCAP_REORDER_FIELDS "DCAP_REORDER_FIELDS"
712
713
/** List of (space separated) flags supported by the OGRLayer::AlterFieldDefn()
714
 * API.
715
 *
716
 * Supported values are "Name", "Type", "WidthPrecision", "Nullable", "Default",
717
 * "Unique", "Domain", "AlternativeName" and "Comment", corresponding respectively
718
 * to the ALTER_NAME_FLAG, ALTER_TYPE_FLAG, ALTER_WIDTH_PRECISION_FLAG, ALTER_NULLABLE_FLAG,
719
 * ALTER_DEFAULT_FLAG, ALTER_UNIQUE_FLAG, ALTER_DOMAIN_FLAG,
720
 * ALTER_ALTERNATIVE_NAME_FLAG and ALTER_COMMENT_FLAG flags.
721
 *
722
 * Note that advertizing one of these flags doesn't necessarily mean that
723
 * all modifications of the corresponding property can be made. For example,
724
 * altering the field type may be restricted by the current type of the field,
725
 * etc.
726
 *
727
 * @see GDAL_DMD_CREATION_FIELD_DEFN_FLAGS for capabilities supported
728
 * when creating new fields.
729
 *
730
 * @since GDAL 3.6
731
 */
732
0
#define GDAL_DMD_ALTER_FIELD_DEFN_FLAGS "GDAL_DMD_ALTER_FIELD_DEFN_FLAGS"
733
734
/** List of (space separated) field names which are considered illegal by the
735
 * driver and should not be used when creating/altering fields.
736
 *
737
 * @since GDAL 3.7
738
 */
739
#define GDAL_DMD_ILLEGAL_FIELD_NAMES "GDAL_DMD_ILLEGAL_FIELD_NAMES"
740
741
/** Capability set by a driver that can create fields with NOT NULL constraint.
742
 */
743
0
#define GDAL_DCAP_NOTNULL_FIELDS "DCAP_NOTNULL_FIELDS"
744
745
/** Capability set by a driver that can create fields with UNIQUE constraint.
746
 * @since GDAL 3.2
747
 */
748
0
#define GDAL_DCAP_UNIQUE_FIELDS "DCAP_UNIQUE_FIELDS"
749
750
/** Capability set by a driver that can create fields with DEFAULT values.
751
 */
752
0
#define GDAL_DCAP_DEFAULT_FIELDS "DCAP_DEFAULT_FIELDS"
753
754
/** Capability set by a driver that can create geometry fields with NOT NULL
755
 * constraint.
756
 */
757
0
#define GDAL_DCAP_NOTNULL_GEOMFIELDS "DCAP_NOTNULL_GEOMFIELDS"
758
759
/** Capability set by a non-spatial driver having no support for geometries.
760
 * E.g. non-spatial vector drivers (e.g. spreadsheet format drivers) do not
761
 * support geometries, and accordingly will have this capability present.
762
 */
763
#define GDAL_DCAP_NONSPATIAL "DCAP_NONSPATIAL"
764
765
/** Capability set by a driver that can support curved geometries.
766
 * @since GDAL 3.6
767
 */
768
0
#define GDAL_DCAP_CURVE_GEOMETRIES "DCAP_CURVE_GEOMETRIES"
769
770
/** Capability set by a driver that can support measured geometries.
771
 *
772
 * @since GDAL 3.6
773
 */
774
0
#define GDAL_DCAP_MEASURED_GEOMETRIES "DCAP_MEASURED_GEOMETRIES"
775
776
/** Capability set by a driver that can support the Z dimension for geometries.
777
 *
778
 * @since GDAL 3.6
779
 */
780
0
#define GDAL_DCAP_Z_GEOMETRIES "DCAP_Z_GEOMETRIES"
781
782
/** List of (space separated) flags which reflect the geometry handling behavior
783
 * of a driver.
784
 *
785
 * Supported values are currently:
786
 *
787
 * - "EquatesMultiAndSingleLineStringDuringWrite" and
788
 * "EquatesMultiAndSinglePolygonDuringWrite". These flags indicate that the
789
 * driver does not differentiate between single-part and multi-part linestring
790
 * and polygon geometries when writing features respectively.
791
 *
792
 * @since GDAL 3.6
793
 */
794
0
#define GDAL_DMD_GEOMETRY_FLAGS "GDAL_DMD_GEOMETRY_FLAGS"
795
796
/** Capability set by drivers which support either reading or writing feature
797
 * styles.
798
 *
799
 * Consider using the more granular GDAL_DCAP_FEATURE_STYLES_READ or
800
 * GDAL_DCAP_FEATURE_STYLES_WRITE capabilities instead.
801
 *
802
 */
803
#define GDAL_DCAP_FEATURE_STYLES "DCAP_FEATURE_STYLES"
804
805
/** Capability set by drivers which support reading feature styles.
806
 * @since GDAL 3.7
807
 */
808
0
#define GDAL_DCAP_FEATURE_STYLES_READ "DCAP_FEATURE_STYLES_READ"
809
810
/** Capability set by drivers which support writing feature styles.
811
 * @since GDAL 3.7
812
 */
813
0
#define GDAL_DCAP_FEATURE_STYLES_WRITE "DCAP_FEATURE_STYLES_WRITE"
814
815
/** Capability set by drivers which support storing/retrieving coordinate epoch
816
 * for dynamic CRS
817
 * @since GDAL 3.4
818
 */
819
0
#define GDAL_DCAP_COORDINATE_EPOCH "DCAP_COORDINATE_EPOCH"
820
821
/** Capability set by drivers for formats which natively support multiple vector layers.
822
 *
823
 * GDAL_DCAP_MULTIPLE_VECTOR_LAYERS is only set for drivers of formats
824
 * which have a native concept of multiple vector layers (such as GeoPackage).
825
 *
826
 * Note: some GDAL drivers expose "virtual" layer support while the underlying
827
 * formats themselves do not (see GDAL_DCAP_MULTIPLE_VECTOR_LAYERS_IN_DIRECTORY).
828
 *
829
 * @since GDAL 3.4
830
 */
831
0
#define GDAL_DCAP_MULTIPLE_VECTOR_LAYERS "DCAP_MULTIPLE_VECTOR_LAYERS"
832
833
/** Capability set by drivers for formats which support multiple vector layers,
834
 * as individual files in a directory.
835
 *
836
 * For example "ESRI Shapefile", "MapInfo File", "CSV", "FlatGeoBuf" or
837
 * "MiraMonVector"
838
 *
839
 * @since GDAL 3.13
840
 */
841
#define GDAL_DCAP_MULTIPLE_VECTOR_LAYERS_IN_DIRECTORY                          \
842
0
    "GDAL_DCAP_MULTIPLE_VECTOR_LAYERS_IN_DIRECTORY"
843
844
/** Capability set by drivers for formats which support reading field domains.
845
 *
846
 * @since GDAL 3.5
847
 */
848
0
#define GDAL_DCAP_FIELD_DOMAINS "DCAP_FIELD_DOMAINS"
849
850
/** Capability set by drivers for formats which support reading table
851
 * relationships.
852
 *
853
 * @since GDAL 3.6
854
 */
855
0
#define GDAL_DCAP_RELATIONSHIPS "DCAP_RELATIONSHIPS"
856
857
/** Capability set by drivers for formats which support creating table
858
 * relationships.
859
 * @since GDAL 3.6
860
 */
861
0
#define GDAL_DCAP_CREATE_RELATIONSHIP "DCAP_CREATE_RELATIONSHIP"
862
863
/** Capability set by drivers for formats which support deleting table
864
 * relationships.
865
 * @since GDAL 3.6
866
 */
867
0
#define GDAL_DCAP_DELETE_RELATIONSHIP "DCAP_DELETE_RELATIONSHIP"
868
869
/** Capability set by drivers for formats which support updating existing table
870
 * relationships.
871
 * @since GDAL 3.6
872
 */
873
0
#define GDAL_DCAP_UPDATE_RELATIONSHIP "DCAP_UPDATE_RELATIONSHIP"
874
875
/** Capability set by drivers whose FlushCache() implementation returns a
876
 * dataset that can be opened afterwards and seen in a consistent state, without
877
 * requiring the dataset on which FlushCache() has been called to be closed.
878
 * @since GDAL 3.8
879
 */
880
0
#define GDAL_DCAP_FLUSHCACHE_CONSISTENT_STATE "DCAP_FLUSHCACHE_CONSISTENT_STATE"
881
882
/** Capability set by drivers which honor the OGRCoordinatePrecision settings
883
 * of geometry fields at layer creation and/or for OGRLayer::CreateGeomField().
884
 * Note that while those drivers honor the settings at feature writing time,
885
 * they might not be able to store the precision settings in layer metadata,
886
 * hence on reading it might not be possible to recover the precision with
887
 * which coordinates have been written.
888
 * @since GDAL 3.9
889
 */
890
#define GDAL_DCAP_HONOR_GEOM_COORDINATE_PRECISION                              \
891
0
    "DCAP_HONOR_GEOM_COORDINATE_PRECISION"
892
893
/** Capability set by drivers that implements OGRLayer::UpsertTeature().
894
 * @since GDAL 3.12
895
 */
896
0
#define GDAL_DCAP_UPSERT "DCAP_UPSERT"
897
898
/** List of (space separated) flags indicating the features of relationships are
899
 * supported by the driver.
900
 *
901
 * Supported values are:
902
 *
903
 * - "OneToOne": supports one-to-one relationships, see
904
 * GDALRelationshipCardinality::GRC_ONE_TO_ONE
905
 * - "OneToMany": supports one-to-many relationships, see
906
 * GDALRelationshipCardinality::GRC_ONE_TO_MANY
907
 * - "ManyToOne": supports many-to-one relationships, see
908
 * GDALRelationshipCardinality::GRC_MANY_TO_ONE
909
 * - "ManyToMany": supports many-to-many relationships, see
910
 * GDALRelationshipCardinality::GRC_MANY_TO_MANY
911
 * - "Composite": supports composite relationship types, see
912
 * GDALRelationshipType::GRT_COMPOSITE
913
 * - "Association": supports association relationship types, see
914
 * GDALRelationshipType::GRT_ASSOCIATION
915
 * - "Aggregation": supports aggregation relationship types, see
916
 * GDALRelationshipType::GRT_AGGREGATION
917
 * - "MultipleFieldKeys": multiple fields can be used for relationship keys. If
918
 * not present then only a single field name can be used.
919
 * - "ForwardPathLabel": supports forward path labels
920
 * - "BackwardPathLabel": supports backward path labels
921
 *
922
 * @since GDAL 3.6
923
 */
924
0
#define GDAL_DMD_RELATIONSHIP_FLAGS "GDAL_DMD_RELATIONSHIP_FLAGS"
925
926
/** List of (space separated) standard related table types which are recognised
927
 * by the driver.
928
 *
929
 * See GDALRelationshipGetRelatedTableType/GDALRelationshipSetRelatedTableType
930
 *
931
 * @since GDAL 3.7
932
 */
933
#define GDAL_DMD_RELATIONSHIP_RELATED_TABLE_TYPES                              \
934
    "GDAL_DMD_RELATIONSHIP_RELATED_TABLE_TYPES"
935
936
/** Capability set by drivers for formats which support renaming vector layers.
937
 *
938
 * @since GDAL 3.5
939
 */
940
0
#define GDAL_DCAP_RENAME_LAYERS "DCAP_RENAME_LAYERS"
941
942
/** List of (space separated) field domain types supported by the AddFieldDomain()
943
 * API.
944
 *
945
 * Supported values are Coded, Range and Glob, corresponding to the
946
 * OGRFieldDomainType::OFDT_CODED, OGRFieldDomainType::OFDT_RANGE, and
947
 * OGRFieldDomainType::OFDT_GLOB field domain types respectively.
948
 *
949
 * @since GDAL 3.5
950
 */
951
0
#define GDAL_DMD_CREATION_FIELD_DOMAIN_TYPES "DMD_CREATION_FIELD_DOMAIN_TYPES"
952
953
/** List of (space separated) flags supported by the
954
 * OGRLayer::AlterGeomFieldDefn() API.
955
 *
956
 * Supported values are "Name", "Type", "Nullable", "SRS", "CoordinateEpoch",
957
 * corresponding respectively to the ALTER_GEOM_FIELD_DEFN_NAME_FLAG,
958
 * ALTER_GEOM_FIELD_DEFN_TYPE_FLAG, ALTER_GEOM_FIELD_DEFN_NULLABLE_FLAG,
959
 * ALTER_GEOM_FIELD_DEFN_SRS_FLAG, ALTER_GEOM_FIELD_DEFN_SRS_COORD_EPOCH_FLAG
960
 * flags. Note that advertizing one of these flags doesn't necessarily mean that
961
 * all modifications of the corresponding property can be made. For example,
962
 * altering the geometry type may be restricted by the type of the geometries in
963
 * the field, or changing the nullable state to non-nullable is not possible if
964
 * null geometries are present, etc.
965
 *
966
 * @since GDAL 3.6
967
 */
968
0
#define GDAL_DMD_ALTER_GEOM_FIELD_DEFN_FLAGS "DMD_ALTER_GEOM_FIELD_DEFN_FLAGS"
969
970
/** List of (space separated) SQL dialects supported by the driver.
971
 *
972
 * The default SQL dialect for the driver will always be the first listed value.
973
 *
974
 * Standard values are:
975
 *
976
 * - "OGRSQL": the OGR SQL dialect, see
977
 * https://gdal.org/user/ogr_sql_dialect.html
978
 * - "SQLITE": the SQLite dialect, see
979
 * https://gdal.org/user/sql_sqlite_dialect.html
980
 * - "NATIVE": for drivers with an RDBMS backend this value indicates that the
981
 * SQL will be passed directly to that database backend, and therefore the
982
 * RDBMS' native dialect will be used
983
 *
984
 * Other dialect values may also be present for some drivers (for some of them,
985
 * the query string to use might not even by SQL but a dedicated query
986
 * language). For further details on their interpretation, see the documentation
987
 * for the respective driver.
988
 *
989
 * @since GDAL 3.6
990
 */
991
0
#define GDAL_DMD_SUPPORTED_SQL_DIALECTS "DMD_SUPPORTED_SQL_DIALECTS"
992
993
/*! @cond Doxygen_Suppress */
994
#define GDAL_DMD_PLUGIN_INSTALLATION_MESSAGE "DMD_PLUGIN_INSTALLATION_MESSAGE"
995
/*! @endcond */
996
997
/** List of (space separated) items that a dataset opened in update mode supports
998
 * updating. Possible values are:
999
 * - for raster: "GeoTransform" (through GDALDataset::SetGeoTransform),
1000
 *   "SRS" (GDALDataset::SetSpatialRef), "GCPs" (GDALDataset::SetGCPs()),
1001
 *    "NoData" (GDALRasterBand::SetNoDataValue),
1002
 *   "ColorInterpretation" (GDALRasterBand::SetColorInterpretation()),
1003
 *   "RasterValues" (GF_Write flag of GDALDataset::RasterIO() and GDALRasterBand::RasterIO()),
1004
 *   "DatasetMetadata" (GDALDataset::SetMetadata/SetMetadataItem), "BandMetadata"
1005
 *   (GDALRasterBand::SetMetadata/SetMetadataItem)
1006
 * - for vector: "Features" (OGRLayer::SetFeature()), "DatasetMetadata",
1007
 *   "LayerMetadata"
1008
 *
1009
 * No distinction is made if the update is done in the native format,
1010
 * or in a Persistent Auxiliary Metadata .aux.xml side car file.
1011
 *
1012
 * @since GDAL 3.11
1013
 */
1014
0
#define GDAL_DMD_UPDATE_ITEMS "DMD_UPDATE_ITEMS"
1015
1016
/** Value for GDALDimension::GetType() specifying the X axis of a horizontal
1017
 * CRS.
1018
 * @since GDAL 3.1
1019
 */
1020
0
#define GDAL_DIM_TYPE_HORIZONTAL_X "HORIZONTAL_X"
1021
1022
/** Value for GDALDimension::GetType() specifying the Y axis of a horizontal
1023
 * CRS.
1024
 * @since GDAL 3.1
1025
 */
1026
0
#define GDAL_DIM_TYPE_HORIZONTAL_Y "HORIZONTAL_Y"
1027
1028
/** Value for GDALDimension::GetType() specifying a vertical axis.
1029
 * @since GDAL 3.1
1030
 */
1031
#define GDAL_DIM_TYPE_VERTICAL "VERTICAL"
1032
1033
/** Value for GDALDimension::GetType() specifying a temporal axis.
1034
 * @since GDAL 3.1
1035
 */
1036
#define GDAL_DIM_TYPE_TEMPORAL "TEMPORAL"
1037
1038
/** Value for GDALDimension::GetType() specifying a parametric axis.
1039
 * @since GDAL 3.1
1040
 */
1041
#define GDAL_DIM_TYPE_PARAMETRIC "PARAMETRIC"
1042
1043
/** "Capability" set by drivers that require re-opening the dataset to be able
1044
 * to read its content if it has just been created previously
1045
 *
1046
 * @since GDAL 3.12
1047
 */
1048
0
#define GDAL_DCAP_REOPEN_AFTER_WRITE_REQUIRED "DCAP_REOPEN_AFTER_WRITE_REQUIRED"
1049
1050
/** Capability set by drivers that can read from a dataset, even if it deleted
1051
 * from disk after it has been opened (i.e. such drivers do not need to reopen
1052
 * or test the existence of the file at that point)
1053
 *
1054
 * @since GDAL 3.12
1055
 */
1056
0
#define GDAL_DCAP_CAN_READ_AFTER_DELETE "DCAP_CAN_READ_AFTER_DELETE"
1057
1058
#define GDsCAddRelationship                                                    \
1059
    "AddRelationship" /**< Dataset capability for supporting AddRelationship() \
1060
                         (at least partially) */
1061
#define GDsCDeleteRelationship                                                 \
1062
    "DeleteRelationship" /**< Dataset capability for supporting                \
1063
                            DeleteRelationship()*/
1064
#define GDsCUpdateRelationship                                                 \
1065
    "UpdateRelationship" /**< Dataset capability for supporting                \
1066
                            UpdateRelationship()*/
1067
1068
/** Dataset capability if GDALDataset::GetExtent() is fast.
1069
 *
1070
 * @since 3.12
1071
 */
1072
#define GDsCFastGetExtent "FastGetExtent"
1073
1074
/** Dataset capability if GDALDataset::GetExtentWGS84LongLat() is fast.
1075
 *
1076
 * @since 3.12
1077
 */
1078
#define GDsCFastGetExtentWGS84LongLat "FastGetExtentWGS84LongLat"
1079
1080
void CPL_DLL CPL_STDCALL GDALAllRegister(void);
1081
void CPL_DLL GDALRegisterPlugins(void);
1082
CPLErr CPL_DLL GDALRegisterPlugin(const char *name);
1083
1084
GDALDatasetH CPL_DLL CPL_STDCALL
1085
GDALCreate(GDALDriverH hDriver, const char *, int, int, int, GDALDataType,
1086
           CSLConstList) CPL_WARN_UNUSED_RESULT;
1087
GDALDatasetH CPL_DLL CPL_STDCALL GDALCreateCopy(GDALDriverH, const char *,
1088
                                                GDALDatasetH, int, CSLConstList,
1089
                                                GDALProgressFunc,
1090
                                                void *) CPL_WARN_UNUSED_RESULT;
1091
1092
GDALDriverH CPL_DLL CPL_STDCALL GDALIdentifyDriver(const char *pszFilename,
1093
                                                   CSLConstList papszFileList);
1094
1095
GDALDriverH CPL_DLL CPL_STDCALL GDALIdentifyDriverEx(
1096
    const char *pszFilename, unsigned int nIdentifyFlags,
1097
    const char *const *papszAllowedDrivers, const char *const *papszFileList);
1098
1099
GDALDatasetH CPL_DLL CPL_STDCALL
1100
GDALOpen(const char *pszFilename, GDALAccess eAccess) CPL_WARN_UNUSED_RESULT;
1101
GDALDatasetH CPL_DLL CPL_STDCALL GDALOpenShared(const char *, GDALAccess)
1102
    CPL_WARN_UNUSED_RESULT;
1103
1104
/* Note: we define GDAL_OF_READONLY and GDAL_OF_UPDATE to be on purpose */
1105
/* equals to GA_ReadOnly and GA_Update */
1106
1107
/** Open in read-only mode.
1108
 * Used by GDALOpenEx().
1109
 */
1110
0
#define GDAL_OF_READONLY 0x00
1111
1112
/** Open in update mode.
1113
 * Used by GDALOpenEx().
1114
 */
1115
0
#define GDAL_OF_UPDATE 0x01
1116
1117
/** Allow raster and vector drivers to be used.
1118
 * Used by GDALOpenEx().
1119
 */
1120
0
#define GDAL_OF_ALL 0x00
1121
1122
/** Allow raster drivers to be used.
1123
 * Used by GDALOpenEx().
1124
 */
1125
0
#define GDAL_OF_RASTER 0x02
1126
1127
/** Allow vector drivers to be used.
1128
 * Used by GDALOpenEx().
1129
 */
1130
0
#define GDAL_OF_VECTOR 0x04
1131
1132
/** Allow gnm drivers to be used.
1133
 * Used by GDALOpenEx().
1134
 */
1135
0
#define GDAL_OF_GNM 0x08
1136
1137
/** Allow multidimensional raster drivers to be used.
1138
 * Used by GDALOpenEx().
1139
 * @since GDAL 3.1
1140
 */
1141
0
#define GDAL_OF_MULTIDIM_RASTER 0x10
1142
1143
#ifndef DOXYGEN_SKIP
1144
0
#define GDAL_OF_KIND_MASK 0x1E
1145
#endif
1146
1147
/** Open in shared mode.
1148
 * Used by GDALOpenEx().
1149
 */
1150
0
#define GDAL_OF_SHARED 0x20
1151
1152
/** Emit error message in case of failed open.
1153
 * Used by GDALOpenEx().
1154
 */
1155
0
#define GDAL_OF_VERBOSE_ERROR 0x40
1156
1157
/** Open as internal dataset. Such dataset isn't registered in the global list
1158
 * of opened dataset. Cannot be used with GDAL_OF_SHARED.
1159
 *
1160
 * Used by GDALOpenEx().
1161
 */
1162
0
#define GDAL_OF_INTERNAL 0x80
1163
1164
/** Let GDAL decide if a array-based or hashset-based storage strategy for
1165
 * cached blocks must be used.
1166
 *
1167
 * GDAL_OF_DEFAULT_BLOCK_ACCESS, GDAL_OF_ARRAY_BLOCK_ACCESS and
1168
 * GDAL_OF_HASHSET_BLOCK_ACCESS are mutually exclusive.
1169
 *
1170
 * Used by GDALOpenEx().
1171
 */
1172
0
#define GDAL_OF_DEFAULT_BLOCK_ACCESS 0
1173
1174
/** Use a array-based storage strategy for cached blocks.
1175
 *
1176
 * GDAL_OF_DEFAULT_BLOCK_ACCESS, GDAL_OF_ARRAY_BLOCK_ACCESS and
1177
 * GDAL_OF_HASHSET_BLOCK_ACCESS are mutually exclusive.
1178
 *
1179
 * Used by GDALOpenEx().
1180
 */
1181
#define GDAL_OF_ARRAY_BLOCK_ACCESS 0x100
1182
1183
/** Use a hashset-based storage strategy for cached blocks.
1184
 *
1185
 * GDAL_OF_DEFAULT_BLOCK_ACCESS, GDAL_OF_ARRAY_BLOCK_ACCESS and
1186
 * GDAL_OF_HASHSET_BLOCK_ACCESS are mutually exclusive.
1187
 *
1188
 * Used by GDALOpenEx().
1189
 */
1190
0
#define GDAL_OF_HASHSET_BLOCK_ACCESS 0x200
1191
1192
#ifndef DOXYGEN_SKIP
1193
/* Reserved for a potential future alternative to GDAL_OF_ARRAY_BLOCK_ACCESS
1194
 * and GDAL_OF_HASHSET_BLOCK_ACCESS */
1195
#define GDAL_OF_RESERVED_1 0x300
1196
1197
/** Mask to detect the block access method */
1198
0
#define GDAL_OF_BLOCK_ACCESS_MASK 0x300
1199
#endif
1200
1201
#ifndef DOXYGEN_SKIP
1202
/** Set by GDALOpenEx() to indicate to Identify() method that they are called
1203
 * from it */
1204
0
#define GDAL_OF_FROM_GDALOPEN 0x400
1205
#endif
1206
1207
/** Open in thread-safe mode. Not compatible with
1208
 * GDAL_OF_VECTOR, GDAL_OF_MULTIDIM_RASTER or GDAL_OF_UPDATE
1209
 *
1210
 * Used by GDALOpenEx().
1211
 * @since GDAL 3.10
1212
 */
1213
0
#define GDAL_OF_THREAD_SAFE 0x800
1214
1215
GDALDatasetH CPL_DLL CPL_STDCALL GDALOpenEx(
1216
    const char *pszFilename, unsigned int nOpenFlags,
1217
    const char *const *papszAllowedDrivers, const char *const *papszOpenOptions,
1218
    const char *const *papszSiblingFiles) CPL_WARN_UNUSED_RESULT;
1219
1220
int CPL_DLL CPL_STDCALL GDALDumpOpenDatasets(FILE *);
1221
1222
GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriverByName(const char *);
1223
int CPL_DLL CPL_STDCALL GDALGetDriverCount(void);
1224
GDALDriverH CPL_DLL CPL_STDCALL GDALGetDriver(int);
1225
GDALDriverH CPL_DLL CPL_STDCALL GDALCreateDriver(void);
1226
void CPL_DLL CPL_STDCALL GDALDestroyDriver(GDALDriverH);
1227
int CPL_DLL CPL_STDCALL GDALRegisterDriver(GDALDriverH);
1228
void CPL_DLL CPL_STDCALL GDALDeregisterDriver(GDALDriverH);
1229
void CPL_DLL CPL_STDCALL GDALDestroyDriverManager(void);
1230
void CPL_DLL GDALClearMemoryCaches(void);
1231
void CPL_DLL GDALDestroy(void);
1232
CPLErr CPL_DLL CPL_STDCALL GDALDeleteDataset(GDALDriverH, const char *);
1233
CPLErr CPL_DLL CPL_STDCALL GDALRenameDataset(GDALDriverH,
1234
                                             const char *pszNewName,
1235
                                             const char *pszOldName);
1236
CPLErr CPL_DLL CPL_STDCALL GDALCopyDatasetFiles(GDALDriverH,
1237
                                                const char *pszNewName,
1238
                                                const char *pszOldName);
1239
int CPL_DLL CPL_STDCALL
1240
GDALValidateCreationOptions(GDALDriverH, CSLConstList papszCreationOptions);
1241
char CPL_DLL **GDALGetOutputDriversForDatasetName(const char *pszDestFilename,
1242
                                                  int nFlagRasterVector,
1243
                                                  bool bSingleMatch,
1244
                                                  bool bEmitWarning);
1245
1246
bool CPL_DLL GDALDriverHasOpenOption(GDALDriverH,
1247
                                     const char *pszOpenOptionName);
1248
1249
/* The following are deprecated */
1250
const char CPL_DLL *CPL_STDCALL GDALGetDriverShortName(GDALDriverH);
1251
const char CPL_DLL *CPL_STDCALL GDALGetDriverLongName(GDALDriverH);
1252
const char CPL_DLL *CPL_STDCALL GDALGetDriverHelpTopic(GDALDriverH);
1253
const char CPL_DLL *CPL_STDCALL GDALGetDriverCreationOptionList(GDALDriverH);
1254
1255
/* ==================================================================== */
1256
/*      GDAL_GCP                                                        */
1257
/* ==================================================================== */
1258
1259
/** Ground Control Point */
1260
typedef struct
1261
{
1262
    /** Unique identifier, often numeric */
1263
    char *pszId;
1264
1265
    /** Informational message or "" */
1266
    char *pszInfo;
1267
1268
    /** Pixel (x) location of GCP on raster */
1269
    double dfGCPPixel;
1270
    /** Line (y) location of GCP on raster */
1271
    double dfGCPLine;
1272
1273
    /** X position of GCP in georeferenced space */
1274
    double dfGCPX;
1275
1276
    /** Y position of GCP in georeferenced space */
1277
    double dfGCPY;
1278
1279
    /** Elevation of GCP, or zero if not known */
1280
    double dfGCPZ;
1281
} GDAL_GCP;
1282
1283
void CPL_DLL CPL_STDCALL GDALInitGCPs(int, GDAL_GCP *);
1284
void CPL_DLL CPL_STDCALL GDALDeinitGCPs(int, GDAL_GCP *);
1285
GDAL_GCP CPL_DLL *CPL_STDCALL GDALDuplicateGCPs(int, const GDAL_GCP *);
1286
1287
int CPL_DLL CPL_STDCALL GDALGCPsToGeoTransform(
1288
    int nGCPCount, const GDAL_GCP *pasGCPs, double *padfGeoTransform,
1289
    int bApproxOK) CPL_WARN_UNUSED_RESULT;
1290
int CPL_DLL CPL_STDCALL GDALInvGeoTransform(const double *padfGeoTransformIn,
1291
                                            double *padfInvGeoTransformOut)
1292
    CPL_WARN_UNUSED_RESULT;
1293
void CPL_DLL CPL_STDCALL GDALApplyGeoTransform(const double *, double, double,
1294
                                               double *, double *);
1295
void CPL_DLL GDALComposeGeoTransforms(const double *padfGeoTransform1,
1296
                                      const double *padfGeoTransform2,
1297
                                      double *padfGeoTransformOut);
1298
int CPL_DLL GDALGCPsToHomography(int nGCPCount, const GDAL_GCP *pasGCPs,
1299
                                 double *padfHomography) CPL_WARN_UNUSED_RESULT;
1300
int CPL_DLL GDALInvHomography(const double *padfHomographyIn,
1301
                              double *padfInvHomographyOut)
1302
    CPL_WARN_UNUSED_RESULT;
1303
int CPL_DLL GDALApplyHomography(const double *, double, double, double *,
1304
                                double *) CPL_WARN_UNUSED_RESULT;
1305
void CPL_DLL GDALComposeHomographies(const double *padfHomography1,
1306
                                     const double *padfHomography2,
1307
                                     double *padfHomographyOut);
1308
1309
/* ==================================================================== */
1310
/*      major objects (dataset, and, driver, drivermanager).            */
1311
/* ==================================================================== */
1312
1313
char CPL_DLL **CPL_STDCALL GDALGetMetadataDomainList(GDALMajorObjectH hObject);
1314
CSLConstList CPL_DLL CPL_STDCALL GDALGetMetadata(GDALMajorObjectH,
1315
                                                 const char *);
1316
CPLErr CPL_DLL CPL_STDCALL GDALSetMetadata(GDALMajorObjectH, CSLConstList,
1317
                                           const char *);
1318
const char CPL_DLL *CPL_STDCALL GDALGetMetadataItem(GDALMajorObjectH,
1319
                                                    const char *, const char *);
1320
CPLErr CPL_DLL CPL_STDCALL GDALSetMetadataItem(GDALMajorObjectH, const char *,
1321
                                               const char *, const char *);
1322
const char CPL_DLL *CPL_STDCALL GDALGetDescription(GDALMajorObjectH);
1323
void CPL_DLL CPL_STDCALL GDALSetDescription(GDALMajorObjectH, const char *);
1324
1325
/* ==================================================================== */
1326
/*      GDALDataset class ... normally this represents one file.        */
1327
/* ==================================================================== */
1328
1329
/** Name of driver metadata item for layer creation option list */
1330
0
#define GDAL_DS_LAYER_CREATIONOPTIONLIST "DS_LAYER_CREATIONOPTIONLIST"
1331
1332
GDALDriverH CPL_DLL CPL_STDCALL GDALGetDatasetDriver(GDALDatasetH);
1333
char CPL_DLL **CPL_STDCALL GDALGetFileList(GDALDatasetH);
1334
void CPL_DLL GDALDatasetMarkSuppressOnClose(GDALDatasetH);
1335
CPLErr CPL_DLL CPL_STDCALL GDALClose(GDALDatasetH);
1336
CPLErr CPL_DLL GDALCloseEx(GDALDatasetH hDS, GDALProgressFunc pfnProgress,
1337
                           void *pProgressData);
1338
bool CPL_DLL GDALDatasetGetCloseReportsProgress(GDALDatasetH hDS);
1339
CPLErr CPL_DLL GDALDatasetRunCloseWithoutDestroying(GDALDatasetH hDS);
1340
CPLErr CPL_DLL GDALDatasetRunCloseWithoutDestroyingEx(
1341
    GDALDatasetH hDS, GDALProgressFunc pfnProgress, void *pProgressData);
1342
int CPL_DLL CPL_STDCALL GDALGetRasterXSize(GDALDatasetH);
1343
int CPL_DLL CPL_STDCALL GDALGetRasterYSize(GDALDatasetH);
1344
int CPL_DLL CPL_STDCALL GDALGetRasterCount(GDALDatasetH);
1345
GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetRasterBand(GDALDatasetH, int);
1346
1347
bool CPL_DLL GDALDatasetIsThreadSafe(GDALDatasetH, int nScopeFlags,
1348
                                     CSLConstList papszOptions);
1349
GDALDatasetH CPL_DLL GDALGetThreadSafeDataset(GDALDatasetH, int nScopeFlags,
1350
                                              CSLConstList papszOptions);
1351
1352
CPLErr CPL_DLL CPL_STDCALL GDALAddBand(GDALDatasetH hDS, GDALDataType eType,
1353
                                       CSLConstList papszOptions);
1354
1355
GDALAsyncReaderH CPL_DLL CPL_STDCALL GDALBeginAsyncReader(
1356
    GDALDatasetH hDS, int nXOff, int nYOff, int nXSize, int nYSize, void *pBuf,
1357
    int nBufXSize, int nBufYSize, GDALDataType eBufType, int nBandCount,
1358
    int *panBandMap, int nPixelSpace, int nLineSpace, int nBandSpace,
1359
    CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
1360
1361
void CPL_DLL CPL_STDCALL GDALEndAsyncReader(GDALDatasetH hDS,
1362
                                            GDALAsyncReaderH hAsynchReaderH);
1363
1364
CPLErr CPL_DLL CPL_STDCALL GDALDatasetRasterIO(
1365
    GDALDatasetH hDS, GDALRWFlag eRWFlag, int nDSXOff, int nDSYOff,
1366
    int nDSXSize, int nDSYSize, void *pBuffer, int nBXSize, int nBYSize,
1367
    GDALDataType eBDataType, int nBandCount, const int *panBandCount,
1368
    int nPixelSpace, int nLineSpace, int nBandSpace) CPL_WARN_UNUSED_RESULT;
1369
1370
CPLErr CPL_DLL CPL_STDCALL GDALDatasetRasterIOEx(
1371
    GDALDatasetH hDS, GDALRWFlag eRWFlag, int nDSXOff, int nDSYOff,
1372
    int nDSXSize, int nDSYSize, void *pBuffer, int nBXSize, int nBYSize,
1373
    GDALDataType eBDataType, int nBandCount, const int *panBandCount,
1374
    GSpacing nPixelSpace, GSpacing nLineSpace, GSpacing nBandSpace,
1375
    GDALRasterIOExtraArg *psExtraArg) CPL_WARN_UNUSED_RESULT;
1376
1377
CPLErr CPL_DLL CPL_STDCALL GDALDatasetAdviseRead(
1378
    GDALDatasetH hDS, int nDSXOff, int nDSYOff, int nDSXSize, int nDSYSize,
1379
    int nBXSize, int nBYSize, GDALDataType eBDataType, int nBandCount,
1380
    int *panBandCount, CSLConstList papszOptions);
1381
1382
char CPL_DLL **
1383
GDALDatasetGetCompressionFormats(GDALDatasetH hDS, int nXOff, int nYOff,
1384
                                 int nXSize, int nYSize, int nBandCount,
1385
                                 const int *panBandList) CPL_WARN_UNUSED_RESULT;
1386
CPLErr CPL_DLL GDALDatasetReadCompressedData(
1387
    GDALDatasetH hDS, const char *pszFormat, int nXOff, int nYOff, int nXSize,
1388
    int nYSize, int nBandCount, const int *panBandList, void **ppBuffer,
1389
    size_t *pnBufferSize, char **ppszDetailedFormat);
1390
1391
const char CPL_DLL *CPL_STDCALL GDALGetProjectionRef(GDALDatasetH);
1392
OGRSpatialReferenceH CPL_DLL GDALGetSpatialRef(GDALDatasetH);
1393
CPLErr CPL_DLL CPL_STDCALL GDALSetProjection(GDALDatasetH, const char *);
1394
CPLErr CPL_DLL GDALSetSpatialRef(GDALDatasetH, OGRSpatialReferenceH);
1395
CPLErr CPL_DLL CPL_STDCALL GDALGetGeoTransform(GDALDatasetH, double *);
1396
CPLErr CPL_DLL CPL_STDCALL GDALSetGeoTransform(GDALDatasetH, const double *);
1397
1398
CPLErr CPL_DLL GDALGetExtent(GDALDatasetH, OGREnvelope *,
1399
                             OGRSpatialReferenceH hCRS);
1400
CPLErr CPL_DLL GDALGetExtentWGS84LongLat(GDALDatasetH, OGREnvelope *);
1401
1402
CPLErr CPL_DLL GDALDatasetGeolocationToPixelLine(
1403
    GDALDatasetH, double dfGeolocX, double dfGeolocY, OGRSpatialReferenceH hSRS,
1404
    double *pdfPixel, double *pdfLine, CSLConstList papszTransformerOptions);
1405
1406
CPLErr CPL_DLL GDALDatasetGetInterBandCovarianceMatrix(
1407
    GDALDatasetH hDS, double *padfCovMatrix, size_t nSize, int nBandCount,
1408
    const int *panBandList, bool bApproxOK, bool bForce,
1409
    bool bWriteIntoMetadata, int nDeltaDegreeOfFreedom,
1410
    GDALProgressFunc pfnProgress, void *pProgressData);
1411
1412
CPLErr CPL_DLL GDALDatasetComputeInterBandCovarianceMatrix(
1413
    GDALDatasetH hDS, double *padfCovMatrix, size_t nSize, int nBandCount,
1414
    const int *panBandList, bool bApproxOK, bool bWriteIntoMetadata,
1415
    int nDeltaDegreeOfFreedom, GDALProgressFunc pfnProgress,
1416
    void *pProgressData);
1417
1418
int CPL_DLL CPL_STDCALL GDALGetGCPCount(GDALDatasetH);
1419
const char CPL_DLL *CPL_STDCALL GDALGetGCPProjection(GDALDatasetH);
1420
OGRSpatialReferenceH CPL_DLL GDALGetGCPSpatialRef(GDALDatasetH);
1421
const GDAL_GCP CPL_DLL *CPL_STDCALL GDALGetGCPs(GDALDatasetH);
1422
CPLErr CPL_DLL CPL_STDCALL GDALSetGCPs(GDALDatasetH, int, const GDAL_GCP *,
1423
                                       const char *);
1424
CPLErr CPL_DLL GDALSetGCPs2(GDALDatasetH, int, const GDAL_GCP *,
1425
                            OGRSpatialReferenceH);
1426
1427
void CPL_DLL *CPL_STDCALL GDALGetInternalHandle(GDALDatasetH, const char *);
1428
int CPL_DLL CPL_STDCALL GDALReferenceDataset(GDALDatasetH);
1429
int CPL_DLL CPL_STDCALL GDALDereferenceDataset(GDALDatasetH);
1430
int CPL_DLL CPL_STDCALL GDALReleaseDataset(GDALDatasetH);
1431
1432
CPLErr CPL_DLL CPL_STDCALL GDALBuildOverviews(GDALDatasetH, const char *, int,
1433
                                              const int *, int, const int *,
1434
                                              GDALProgressFunc,
1435
                                              void *) CPL_WARN_UNUSED_RESULT;
1436
CPLErr CPL_DLL CPL_STDCALL GDALBuildOverviewsEx(
1437
    GDALDatasetH, const char *, int, const int *, int, const int *,
1438
    GDALProgressFunc, void *, CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
1439
void CPL_DLL CPL_STDCALL GDALGetOpenDatasets(GDALDatasetH **hDS, int *pnCount);
1440
int CPL_DLL CPL_STDCALL GDALGetAccess(GDALDatasetH hDS);
1441
CPLErr CPL_DLL CPL_STDCALL GDALFlushCache(GDALDatasetH hDS);
1442
CPLErr CPL_DLL CPL_STDCALL GDALDropCache(GDALDatasetH hDS);
1443
1444
CPLErr CPL_DLL CPL_STDCALL GDALCreateDatasetMaskBand(GDALDatasetH hDS,
1445
                                                     int nFlags);
1446
1447
CPLErr CPL_DLL CPL_STDCALL GDALDatasetCopyWholeRaster(
1448
    GDALDatasetH hSrcDS, GDALDatasetH hDstDS, CSLConstList papszOptions,
1449
    GDALProgressFunc pfnProgress, void *pProgressData) CPL_WARN_UNUSED_RESULT;
1450
1451
CPLErr CPL_DLL CPL_STDCALL GDALRasterBandCopyWholeRaster(
1452
    GDALRasterBandH hSrcBand, GDALRasterBandH hDstBand,
1453
    const char *const *constpapszOptions, GDALProgressFunc pfnProgress,
1454
    void *pProgressData) CPL_WARN_UNUSED_RESULT;
1455
1456
CPLErr CPL_DLL GDALRegenerateOverviews(GDALRasterBandH hSrcBand,
1457
                                       int nOverviewCount,
1458
                                       GDALRasterBandH *pahOverviewBands,
1459
                                       const char *pszResampling,
1460
                                       GDALProgressFunc pfnProgress,
1461
                                       void *pProgressData);
1462
1463
CPLErr CPL_DLL GDALRegenerateOverviewsEx(GDALRasterBandH hSrcBand,
1464
                                         int nOverviewCount,
1465
                                         GDALRasterBandH *pahOverviewBands,
1466
                                         const char *pszResampling,
1467
                                         GDALProgressFunc pfnProgress,
1468
                                         void *pProgressData,
1469
                                         CSLConstList papszOptions);
1470
1471
int CPL_DLL GDALDatasetGetLayerCount(GDALDatasetH);
1472
OGRLayerH CPL_DLL GDALDatasetGetLayer(GDALDatasetH, int);
1473
1474
/* Defined here to avoid circular dependency with ogr_api.h */
1475
GDALDatasetH CPL_DLL OGR_L_GetDataset(OGRLayerH hLayer);
1476
1477
OGRLayerH CPL_DLL GDALDatasetGetLayerByName(GDALDatasetH, const char *);
1478
int CPL_DLL GDALDatasetIsLayerPrivate(GDALDatasetH, int);
1479
OGRErr CPL_DLL GDALDatasetDeleteLayer(GDALDatasetH, int);
1480
OGRLayerH CPL_DLL GDALDatasetCreateLayer(GDALDatasetH, const char *,
1481
                                         OGRSpatialReferenceH,
1482
                                         OGRwkbGeometryType, CSLConstList);
1483
OGRLayerH CPL_DLL GDALDatasetCreateLayerFromGeomFieldDefn(GDALDatasetH,
1484
                                                          const char *,
1485
                                                          OGRGeomFieldDefnH,
1486
                                                          CSLConstList);
1487
OGRLayerH CPL_DLL GDALDatasetCopyLayer(GDALDatasetH, OGRLayerH, const char *,
1488
                                       CSLConstList);
1489
void CPL_DLL GDALDatasetResetReading(GDALDatasetH);
1490
OGRFeatureH CPL_DLL GDALDatasetGetNextFeature(GDALDatasetH hDS,
1491
                                              OGRLayerH *phBelongingLayer,
1492
                                              double *pdfProgressPct,
1493
                                              GDALProgressFunc pfnProgress,
1494
                                              void *pProgressData);
1495
int CPL_DLL GDALDatasetTestCapability(GDALDatasetH, const char *);
1496
OGRLayerH CPL_DLL GDALDatasetExecuteSQL(GDALDatasetH, const char *,
1497
                                        OGRGeometryH, const char *);
1498
OGRErr CPL_DLL GDALDatasetAbortSQL(GDALDatasetH);
1499
void CPL_DLL GDALDatasetReleaseResultSet(GDALDatasetH, OGRLayerH);
1500
OGRStyleTableH CPL_DLL GDALDatasetGetStyleTable(GDALDatasetH);
1501
void CPL_DLL GDALDatasetSetStyleTableDirectly(GDALDatasetH, OGRStyleTableH);
1502
void CPL_DLL GDALDatasetSetStyleTable(GDALDatasetH, OGRStyleTableH);
1503
OGRErr CPL_DLL GDALDatasetStartTransaction(GDALDatasetH hDS, int bForce);
1504
OGRErr CPL_DLL GDALDatasetCommitTransaction(GDALDatasetH hDS);
1505
OGRErr CPL_DLL GDALDatasetRollbackTransaction(GDALDatasetH hDS);
1506
void CPL_DLL GDALDatasetClearStatistics(GDALDatasetH hDS);
1507
1508
GDALMDArrayH CPL_DLL GDALDatasetAsMDArray(
1509
    GDALDatasetH hDS, CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
1510
1511
char CPL_DLL **GDALDatasetGetFieldDomainNames(GDALDatasetH, CSLConstList)
1512
    CPL_WARN_UNUSED_RESULT;
1513
OGRFieldDomainH CPL_DLL GDALDatasetGetFieldDomain(GDALDatasetH hDS,
1514
                                                  const char *pszName);
1515
bool CPL_DLL GDALDatasetAddFieldDomain(GDALDatasetH hDS,
1516
                                       OGRFieldDomainH hFieldDomain,
1517
                                       char **ppszFailureReason);
1518
bool CPL_DLL GDALDatasetDeleteFieldDomain(GDALDatasetH hDS, const char *pszName,
1519
                                          char **ppszFailureReason);
1520
bool CPL_DLL GDALDatasetUpdateFieldDomain(GDALDatasetH hDS,
1521
                                          OGRFieldDomainH hFieldDomain,
1522
                                          char **ppszFailureReason);
1523
1524
char CPL_DLL **GDALDatasetGetRelationshipNames(GDALDatasetH, CSLConstList)
1525
    CPL_WARN_UNUSED_RESULT;
1526
GDALRelationshipH CPL_DLL GDALDatasetGetRelationship(GDALDatasetH hDS,
1527
                                                     const char *pszName);
1528
1529
bool CPL_DLL GDALDatasetAddRelationship(GDALDatasetH hDS,
1530
                                        GDALRelationshipH hRelationship,
1531
                                        char **ppszFailureReason);
1532
bool CPL_DLL GDALDatasetDeleteRelationship(GDALDatasetH hDS,
1533
                                           const char *pszName,
1534
                                           char **ppszFailureReason);
1535
bool CPL_DLL GDALDatasetUpdateRelationship(GDALDatasetH hDS,
1536
                                           GDALRelationshipH hRelationship,
1537
                                           char **ppszFailureReason);
1538
1539
/** Type of functions to pass to GDALDatasetSetQueryLoggerFunc
1540
 * @since GDAL 3.7 */
1541
typedef void (*GDALQueryLoggerFunc)(const char *pszSQL, const char *pszError,
1542
                                    int64_t lNumRecords,
1543
                                    int64_t lExecutionTimeMilliseconds,
1544
                                    void *pQueryLoggerArg);
1545
1546
/**
1547
 * Sets the SQL query logger callback.
1548
 *
1549
 * When supported by the driver, the callback will be called with
1550
 * the executed SQL text, the error message, the execution time in milliseconds,
1551
 * the number of records fetched/affected and the client status data.
1552
 *
1553
 * A value of -1 in the execution time or in the number of records indicates
1554
 * that the values are unknown.
1555
 *
1556
 * @param hDS                   Dataset handle.
1557
 * @param pfnQueryLoggerFunc    Callback function
1558
 * @param poQueryLoggerArg      Opaque client status data
1559
 * @return                      true in case of success.
1560
 * @since                       GDAL 3.7
1561
 */
1562
bool CPL_DLL GDALDatasetSetQueryLoggerFunc(
1563
    GDALDatasetH hDS, GDALQueryLoggerFunc pfnQueryLoggerFunc,
1564
    void *poQueryLoggerArg);
1565
1566
/* ==================================================================== */
1567
/*      Informational utilities about subdatasets in file names         */
1568
/* ==================================================================== */
1569
1570
/**
1571
 * @brief Returns a new GDALSubdatasetInfo object with methods to extract
1572
 *        and manipulate subdataset information.
1573
 *        If the pszFileName argument is not recognized by any driver as
1574
 *        a subdataset descriptor, NULL is returned.
1575
 *        The returned object must be freed with GDALDestroySubdatasetInfo().
1576
 * @param pszFileName           File name with subdataset information
1577
 * @note                        This method does not check if the subdataset actually exists.
1578
 * @return                      Opaque pointer to a GDALSubdatasetInfo object or NULL if no drivers accepted the file name.
1579
 * @since                       GDAL 3.8
1580
 */
1581
GDALSubdatasetInfoH CPL_DLL GDALGetSubdatasetInfo(const char *pszFileName);
1582
1583
/**
1584
 * @brief Returns the file path component of a
1585
 *        subdataset descriptor effectively stripping the information about the subdataset
1586
 *        and returning the "parent" dataset descriptor.
1587
 *        The returned string must be freed with CPLFree().
1588
 * @param hInfo                 Pointer to GDALSubdatasetInfo object
1589
 * @note                        This method does not check if the subdataset actually exists.
1590
 * @return                      The original string with the subdataset information removed.
1591
 * @since                       GDAL 3.8
1592
 */
1593
char CPL_DLL *GDALSubdatasetInfoGetPathComponent(GDALSubdatasetInfoH hInfo);
1594
1595
/**
1596
 * @brief Returns the subdataset component of a subdataset descriptor descriptor.
1597
 *        The returned string must be freed with CPLFree().
1598
 * @param hInfo                 Pointer to GDALSubdatasetInfo object
1599
 * @note                        This method does not check if the subdataset actually exists.
1600
 * @return                      The subdataset name.
1601
 * @since                       GDAL 3.8
1602
 */
1603
char CPL_DLL *
1604
GDALSubdatasetInfoGetSubdatasetComponent(GDALSubdatasetInfoH hInfo);
1605
1606
/**
1607
 * @brief Replaces the path component of a subdataset descriptor.
1608
 *        The returned string must be freed with CPLFree().
1609
 * @param hInfo                 Pointer to GDALSubdatasetInfo object
1610
 * @param pszNewPath            New path.
1611
 * @note                        This method does not check if the subdataset actually exists.
1612
 * @return                      The original subdataset descriptor with the old path component replaced by newPath.
1613
 * @since                       GDAL 3.8
1614
 */
1615
char CPL_DLL *GDALSubdatasetInfoModifyPathComponent(GDALSubdatasetInfoH hInfo,
1616
                                                    const char *pszNewPath);
1617
1618
/**
1619
 * @brief Destroys a GDALSubdatasetInfo object.
1620
 * @param hInfo                 Pointer to GDALSubdatasetInfo object
1621
 * @since                       GDAL 3.8
1622
 */
1623
void CPL_DLL GDALDestroySubdatasetInfo(GDALSubdatasetInfoH hInfo);
1624
1625
/* ==================================================================== */
1626
/*      GDALRasterBand ... one band/channel in a dataset.               */
1627
/* ==================================================================== */
1628
1629
/* Note: the only user of SRCVAL() is alg/gdal_simplesurf.cpp */
1630
1631
/* clang-format off */
1632
/**
1633
 * SRCVAL - Macro which may be used by pixel functions to obtain
1634
 *          a pixel from a source buffer.
1635
 */
1636
#define SRCVAL(papoSource, eSrcType, ii) \
1637
    (eSrcType == GDT_UInt8 ? CPL_REINTERPRET_CAST(const GByte *, papoSource)[ii] : \
1638
     eSrcType == GDT_Int8 ? CPL_REINTERPRET_CAST(const GInt8 *, papoSource)[ii] : \
1639
     eSrcType == GDT_UInt16 ? CPL_REINTERPRET_CAST(const GUInt16 *, papoSource)[ii] : \
1640
     eSrcType == GDT_Int16 ? CPL_REINTERPRET_CAST(const GInt16 *, papoSource)[ii] : \
1641
     eSrcType == GDT_UInt32 ? CPL_REINTERPRET_CAST(const GUInt32 *, papoSource)[ii] : \
1642
     eSrcType == GDT_Int32 ? CPL_REINTERPRET_CAST(const GInt32 *, papoSource)[ii] : \
1643
     eSrcType == GDT_UInt64 ? CPL_STATIC_CAST(double, CPL_REINTERPRET_CAST(const GUInt64 *, papoSource)[ii]) : \
1644
     eSrcType == GDT_Int64 ? CPL_STATIC_CAST(double, CPL_REINTERPRET_CAST(const GUInt64 *, papoSource)[ii]) : \
1645
     eSrcType == GDT_Float32 ? CPL_STATIC_CAST(double, CPL_REINTERPRET_CAST(const float *, papoSource)[ii]) : \
1646
     eSrcType == GDT_Float64 ? CPL_REINTERPRET_CAST(const double *, papoSource)[ii] : \
1647
     eSrcType == GDT_CInt16 ? CPL_REINTERPRET_CAST(const GInt16 *, papoSource)[(ii)*2] : \
1648
     eSrcType == GDT_CInt32 ? CPL_REINTERPRET_CAST(const GInt32 *, papoSource)[(ii)*2] : \
1649
     eSrcType == GDT_CFloat32 ? CPL_STATIC_CAST(double, CPL_REINTERPRET_CAST(const float *, papoSource)[ii*2]) : \
1650
     eSrcType == GDT_CFloat64 ? CPL_REINTERPRET_CAST(const double *, papoSource)[ii*2] : \
1651
     0)
1652
1653
/* clang-format on */
1654
1655
/** Type of functions to pass to GDALAddDerivedBandPixelFunc.
1656
 */
1657
typedef CPLErr (*GDALDerivedPixelFunc)(void **papoSources, int nSources,
1658
                                       void *pData, int nBufXSize,
1659
                                       int nBufYSize, GDALDataType eSrcType,
1660
                                       GDALDataType eBufType, int nPixelSpace,
1661
                                       int nLineSpace);
1662
1663
/** Type of functions to pass to GDALAddDerivedBandPixelFuncWithArgs.
1664
 * @since GDAL 3.4 */
1665
typedef CPLErr (*GDALDerivedPixelFuncWithArgs)(
1666
    void **papoSources, int nSources, void *pData, int nBufXSize, int nBufYSize,
1667
    GDALDataType eSrcType, GDALDataType eBufType, int nPixelSpace,
1668
    int nLineSpace, CSLConstList papszFunctionArgs);
1669
1670
GDALDataType CPL_DLL CPL_STDCALL GDALGetRasterDataType(GDALRasterBandH);
1671
void CPL_DLL CPL_STDCALL GDALGetBlockSize(GDALRasterBandH, int *pnXSize,
1672
                                          int *pnYSize);
1673
1674
CPLErr CPL_DLL CPL_STDCALL GDALGetActualBlockSize(GDALRasterBandH,
1675
                                                  int nXBlockOff,
1676
                                                  int nYBlockOff, int *pnXValid,
1677
                                                  int *pnYValid);
1678
1679
CPLErr CPL_DLL CPL_STDCALL GDALRasterAdviseRead(GDALRasterBandH hRB,
1680
                                                int nDSXOff, int nDSYOff,
1681
                                                int nDSXSize, int nDSYSize,
1682
                                                int nBXSize, int nBYSize,
1683
                                                GDALDataType eBDataType,
1684
                                                CSLConstList papszOptions);
1685
1686
CPLErr CPL_DLL CPL_STDCALL GDALRasterIO(GDALRasterBandH hRBand,
1687
                                        GDALRWFlag eRWFlag, int nDSXOff,
1688
                                        int nDSYOff, int nDSXSize, int nDSYSize,
1689
                                        void *pBuffer, int nBXSize, int nBYSize,
1690
                                        GDALDataType eBDataType,
1691
                                        int nPixelSpace,
1692
                                        int nLineSpace) CPL_WARN_UNUSED_RESULT;
1693
CPLErr CPL_DLL CPL_STDCALL GDALRasterIOEx(
1694
    GDALRasterBandH hRBand, GDALRWFlag eRWFlag, int nDSXOff, int nDSYOff,
1695
    int nDSXSize, int nDSYSize, void *pBuffer, int nBXSize, int nBYSize,
1696
    GDALDataType eBDataType, GSpacing nPixelSpace, GSpacing nLineSpace,
1697
    GDALRasterIOExtraArg *psExtraArg) CPL_WARN_UNUSED_RESULT;
1698
CPLErr CPL_DLL CPL_STDCALL GDALReadBlock(GDALRasterBandH, int, int,
1699
                                         void *) CPL_WARN_UNUSED_RESULT;
1700
CPLErr CPL_DLL CPL_STDCALL GDALWriteBlock(GDALRasterBandH, int, int,
1701
                                          void *) CPL_WARN_UNUSED_RESULT;
1702
int CPL_DLL CPL_STDCALL GDALGetRasterBandXSize(GDALRasterBandH);
1703
int CPL_DLL CPL_STDCALL GDALGetRasterBandYSize(GDALRasterBandH);
1704
GDALAccess CPL_DLL CPL_STDCALL GDALGetRasterAccess(GDALRasterBandH);
1705
int CPL_DLL CPL_STDCALL GDALGetBandNumber(GDALRasterBandH);
1706
GDALDatasetH CPL_DLL CPL_STDCALL GDALGetBandDataset(GDALRasterBandH);
1707
1708
GDALColorInterp
1709
    CPL_DLL CPL_STDCALL GDALGetRasterColorInterpretation(GDALRasterBandH);
1710
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterColorInterpretation(GDALRasterBandH,
1711
                                                            GDALColorInterp);
1712
GDALColorTableH CPL_DLL CPL_STDCALL GDALGetRasterColorTable(GDALRasterBandH);
1713
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterColorTable(GDALRasterBandH,
1714
                                                   GDALColorTableH);
1715
int CPL_DLL CPL_STDCALL GDALHasArbitraryOverviews(GDALRasterBandH);
1716
int CPL_DLL CPL_STDCALL GDALGetOverviewCount(GDALRasterBandH);
1717
GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetOverview(GDALRasterBandH, int);
1718
double CPL_DLL CPL_STDCALL GDALGetRasterNoDataValue(GDALRasterBandH, int *);
1719
int64_t CPL_DLL CPL_STDCALL GDALGetRasterNoDataValueAsInt64(GDALRasterBandH,
1720
                                                            int *);
1721
uint64_t CPL_DLL CPL_STDCALL GDALGetRasterNoDataValueAsUInt64(GDALRasterBandH,
1722
                                                              int *);
1723
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterNoDataValue(GDALRasterBandH, double);
1724
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterNoDataValueAsInt64(GDALRasterBandH,
1725
                                                           int64_t);
1726
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterNoDataValueAsUInt64(GDALRasterBandH,
1727
                                                            uint64_t);
1728
CPLErr CPL_DLL CPL_STDCALL GDALDeleteRasterNoDataValue(GDALRasterBandH);
1729
char CPL_DLL **CPL_STDCALL GDALGetRasterCategoryNames(GDALRasterBandH);
1730
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterCategoryNames(GDALRasterBandH,
1731
                                                      CSLConstList);
1732
double CPL_DLL CPL_STDCALL GDALGetRasterMinimum(GDALRasterBandH,
1733
                                                int *pbSuccess);
1734
double CPL_DLL CPL_STDCALL GDALGetRasterMaximum(GDALRasterBandH,
1735
                                                int *pbSuccess);
1736
CPLErr CPL_DLL CPL_STDCALL GDALGetRasterStatistics(
1737
    GDALRasterBandH, int bApproxOK, int bForce, double *pdfMin, double *pdfMax,
1738
    double *pdfMean, double *pdfStdDev);
1739
CPLErr CPL_DLL CPL_STDCALL
1740
GDALComputeRasterStatistics(GDALRasterBandH, int bApproxOK, double *pdfMin,
1741
                            double *pdfMax, double *pdfMean, double *pdfStdDev,
1742
                            GDALProgressFunc pfnProgress, void *pProgressData);
1743
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterStatistics(GDALRasterBandH hBand,
1744
                                                   double dfMin, double dfMax,
1745
                                                   double dfMean,
1746
                                                   double dfStdDev);
1747
1748
GDALMDArrayH
1749
    CPL_DLL GDALRasterBandAsMDArray(GDALRasterBandH) CPL_WARN_UNUSED_RESULT;
1750
1751
const char CPL_DLL *CPL_STDCALL GDALGetRasterUnitType(GDALRasterBandH);
1752
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterUnitType(GDALRasterBandH hBand,
1753
                                                 const char *pszNewValue);
1754
double CPL_DLL CPL_STDCALL GDALGetRasterOffset(GDALRasterBandH, int *pbSuccess);
1755
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterOffset(GDALRasterBandH hBand,
1756
                                               double dfNewOffset);
1757
double CPL_DLL CPL_STDCALL GDALGetRasterScale(GDALRasterBandH, int *pbSuccess);
1758
CPLErr CPL_DLL CPL_STDCALL GDALSetRasterScale(GDALRasterBandH hBand,
1759
                                              double dfNewOffset);
1760
CPLErr CPL_DLL CPL_STDCALL GDALComputeRasterMinMax(GDALRasterBandH hBand,
1761
                                                   int bApproxOK,
1762
                                                   double adfMinMax[2]);
1763
CPLErr CPL_DLL GDALComputeRasterMinMaxLocation(GDALRasterBandH hBand,
1764
                                               double *pdfMin, double *pdfMax,
1765
                                               int *pnMinX, int *pnMinY,
1766
                                               int *pnMaxX, int *pnMaxY);
1767
CPLErr CPL_DLL CPL_STDCALL GDALFlushRasterCache(GDALRasterBandH hBand);
1768
CPLErr CPL_DLL CPL_STDCALL GDALDropRasterCache(GDALRasterBandH hBand);
1769
CPLErr CPL_DLL CPL_STDCALL GDALGetRasterHistogram(
1770
    GDALRasterBandH hBand, double dfMin, double dfMax, int nBuckets,
1771
    int *panHistogram, int bIncludeOutOfRange, int bApproxOK,
1772
    GDALProgressFunc pfnProgress, void *pProgressData)
1773
    /*! @cond Doxygen_Suppress */
1774
    CPL_WARN_DEPRECATED("Use GDALGetRasterHistogramEx() instead")
1775
    /*! @endcond */
1776
    ;
1777
CPLErr CPL_DLL CPL_STDCALL GDALGetRasterHistogramEx(
1778
    GDALRasterBandH hBand, double dfMin, double dfMax, int nBuckets,
1779
    GUIntBig *panHistogram, int bIncludeOutOfRange, int bApproxOK,
1780
    GDALProgressFunc pfnProgress, void *pProgressData);
1781
CPLErr CPL_DLL CPL_STDCALL
1782
GDALGetDefaultHistogram(GDALRasterBandH hBand, double *pdfMin, double *pdfMax,
1783
                        int *pnBuckets, int **ppanHistogram, int bForce,
1784
                        GDALProgressFunc pfnProgress, void *pProgressData)
1785
    /*! @cond Doxygen_Suppress */
1786
    CPL_WARN_DEPRECATED("Use GDALGetDefaultHistogramEx() instead")
1787
    /*! @endcond */
1788
    ;
1789
CPLErr CPL_DLL CPL_STDCALL
1790
GDALGetDefaultHistogramEx(GDALRasterBandH hBand, double *pdfMin, double *pdfMax,
1791
                          int *pnBuckets, GUIntBig **ppanHistogram, int bForce,
1792
                          GDALProgressFunc pfnProgress, void *pProgressData);
1793
CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultHistogram(GDALRasterBandH hBand,
1794
                                                   double dfMin, double dfMax,
1795
                                                   int nBuckets,
1796
                                                   int *panHistogram)
1797
    /*! @cond Doxygen_Suppress */
1798
    CPL_WARN_DEPRECATED("Use GDALSetDefaultHistogramEx() instead")
1799
    /*! @endcond */
1800
    ;
1801
CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultHistogramEx(GDALRasterBandH hBand,
1802
                                                     double dfMin, double dfMax,
1803
                                                     int nBuckets,
1804
                                                     GUIntBig *panHistogram);
1805
int CPL_DLL CPL_STDCALL GDALGetRandomRasterSample(GDALRasterBandH, int,
1806
                                                  float *);
1807
GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetRasterSampleOverview(GDALRasterBandH,
1808
                                                                int);
1809
GDALRasterBandH CPL_DLL CPL_STDCALL
1810
    GDALGetRasterSampleOverviewEx(GDALRasterBandH, GUIntBig);
1811
CPLErr CPL_DLL CPL_STDCALL GDALFillRaster(GDALRasterBandH hBand,
1812
                                          double dfRealValue,
1813
                                          double dfImaginaryValue);
1814
CPLErr CPL_DLL CPL_STDCALL GDALComputeBandStats(
1815
    GDALRasterBandH hBand, int nSampleStep, double *pdfMean, double *pdfStdDev,
1816
    GDALProgressFunc pfnProgress, void *pProgressData);
1817
CPLErr CPL_DLL GDALOverviewMagnitudeCorrection(GDALRasterBandH hBaseBand,
1818
                                               int nOverviewCount,
1819
                                               GDALRasterBandH *pahOverviews,
1820
                                               GDALProgressFunc pfnProgress,
1821
                                               void *pProgressData);
1822
1823
GDALRasterAttributeTableH CPL_DLL CPL_STDCALL
1824
GDALGetDefaultRAT(GDALRasterBandH hBand);
1825
CPLErr CPL_DLL CPL_STDCALL GDALSetDefaultRAT(GDALRasterBandH,
1826
                                             GDALRasterAttributeTableH);
1827
CPLErr CPL_DLL CPL_STDCALL GDALAddDerivedBandPixelFunc(
1828
    const char *pszName, GDALDerivedPixelFunc pfnPixelFunc);
1829
CPLErr CPL_DLL CPL_STDCALL GDALAddDerivedBandPixelFuncWithArgs(
1830
    const char *pszName, GDALDerivedPixelFuncWithArgs pfnPixelFunc,
1831
    const char *pszMetadata);
1832
1833
CPLErr CPL_DLL GDALRasterInterpolateAtPoint(GDALRasterBandH hBand,
1834
                                            double dfPixel, double dfLine,
1835
                                            GDALRIOResampleAlg eInterpolation,
1836
                                            double *pdfRealValue,
1837
                                            double *pdfImagValue);
1838
1839
CPLErr CPL_DLL GDALRasterInterpolateAtGeolocation(
1840
    GDALRasterBandH hBand, double dfGeolocX, double dfGeolocY,
1841
    OGRSpatialReferenceH hSRS, GDALRIOResampleAlg eInterpolation,
1842
    double *pdfRealValue, double *pdfImagValue,
1843
    CSLConstList papszTransformerOptions);
1844
1845
/** Generic pointer for the working structure of VRTProcessedDataset
1846
 * function. */
1847
typedef void *VRTPDWorkingDataPtr;
1848
1849
/** Initialization function to pass to GDALVRTRegisterProcessedDatasetFunc.
1850
 *
1851
 * This initialization function is called for each step of a VRTProcessedDataset
1852
 * that uses the related algorithm.
1853
 * The initialization function returns the output data type, output band count
1854
 * and potentially initializes a working structure, typically parsing arguments.
1855
 *
1856
 * @param pszFuncName Function name. Must be unique and not null.
1857
 * @param pUserData User data. May be nullptr. Must remain valid during the
1858
 *                  lifetime of GDAL.
1859
 * @param papszFunctionArgs Function arguments as a list of key=value pairs.
1860
 * @param nInBands Number of input bands.
1861
 * @param eInDT Input data type.
1862
 * @param[in,out] padfInNoData Array of nInBands values for the input nodata
1863
 *                             value. The init function may also override them.
1864
 * @param[in,out] pnOutBands Pointer whose value must be set to the number of
1865
 *                           output bands. This will be set to 0 by the caller
1866
 *                           when calling the function, unless this is the
1867
 *                           final step, in which case it will be initialized
1868
 *                           with the number of expected output bands.
1869
 * @param[out] peOutDT Pointer whose value must be set to the output
1870
 *                     data type.
1871
 * @param[in,out] ppadfOutNoData Pointer to an array of *pnOutBands values
1872
 *                               for the output nodata value that the
1873
 *                               function must set.
1874
 *                               For non-final steps, *ppadfOutNoData
1875
 *                               will be nullptr and it is the responsibility
1876
 *                               of the function to CPLMalloc()'ate it.
1877
 *                               If this is the final step, it will be
1878
 *                               already allocated and initialized with the
1879
 *                               expected nodata values from the output
1880
 *                               dataset (if the init function need to
1881
 *                               reallocate it, it must use CPLRealloc())
1882
 * @param pszVRTPath Directory of the VRT
1883
 * @param[out] ppWorkingData Pointer whose value must be set to a working
1884
 *                           structure, or nullptr.
1885
 * @return CE_None in case of success, error otherwise.
1886
 * @since GDAL 3.9 */
1887
typedef CPLErr (*GDALVRTProcessedDatasetFuncInit)(
1888
    const char *pszFuncName, void *pUserData, CSLConstList papszFunctionArgs,
1889
    int nInBands, GDALDataType eInDT, double *padfInNoData, int *pnOutBands,
1890
    GDALDataType *peOutDT, double **ppadfOutNoData, const char *pszVRTPath,
1891
    VRTPDWorkingDataPtr *ppWorkingData);
1892
1893
/** Free function to pass to GDALVRTRegisterProcessedDatasetFunc.
1894
 *
1895
 * @param pszFuncName Function name. Must be unique and not null.
1896
 * @param pUserData User data. May be nullptr. Must remain valid during the
1897
 *                  lifetime of GDAL.
1898
 * @param pWorkingData Value of the *ppWorkingData output parameter of
1899
 *                     GDALVRTProcessedDatasetFuncInit.
1900
 * @since GDAL 3.9
1901
 */
1902
typedef void (*GDALVRTProcessedDatasetFuncFree)(
1903
    const char *pszFuncName, void *pUserData, VRTPDWorkingDataPtr pWorkingData);
1904
1905
/** Processing function to pass to GDALVRTRegisterProcessedDatasetFunc.
1906
 * @param pszFuncName Function name. Must be unique and not null.
1907
 * @param pUserData User data. May be nullptr. Must remain valid during the
1908
 *                  lifetime of GDAL.
1909
 * @param pWorkingData Value of the *ppWorkingData output parameter of
1910
 *                     GDALVRTProcessedDatasetFuncInit.
1911
 * @param papszFunctionArgs Function arguments as a list of key=value pairs.
1912
 * @param nBufXSize Width in pixels of pInBuffer and pOutBuffer
1913
 * @param nBufYSize Height in pixels of pInBuffer and pOutBuffer
1914
 * @param pInBuffer Input buffer. It is pixel-interleaved
1915
 *                  (i.e. R00,G00,B00,R01,G01,B01, etc.)
1916
 * @param nInBufferSize Size in bytes of pInBuffer
1917
 * @param eInDT Data type of pInBuffer
1918
 * @param nInBands Number of bands in pInBuffer.
1919
 * @param padfInNoData Input nodata values.
1920
 * @param pOutBuffer Output buffer. It is pixel-interleaved
1921
 *                   (i.e. R00,G00,B00,R01,G01,B01, etc.)
1922
 * @param nOutBufferSize Size in bytes of pOutBuffer
1923
 * @param eOutDT Data type of pOutBuffer
1924
 * @param nOutBands Number of bands in pOutBuffer.
1925
 * @param padfOutNoData Input nodata values.
1926
 * @param dfSrcXOff Source X coordinate in pixel of the top-left of the region
1927
 * @param dfSrcYOff Source Y coordinate in pixel of the top-left of the region
1928
 * @param dfSrcXSize Width in pixels of the region
1929
 * @param dfSrcYSize Height in pixels of the region
1930
 * @param adfSrcGT Source geotransform
1931
 * @param pszVRTPath Directory of the VRT
1932
 * @param papszExtra Extra arguments (unused for now)
1933
 * @since GDAL 3.9
1934
 */
1935
typedef CPLErr (*GDALVRTProcessedDatasetFuncProcess)(
1936
    const char *pszFuncName, void *pUserData, VRTPDWorkingDataPtr pWorkingData,
1937
    CSLConstList papszFunctionArgs, int nBufXSize, int nBufYSize,
1938
    const void *pInBuffer, size_t nInBufferSize, GDALDataType eInDT,
1939
    int nInBands, const double *padfInNoData, void *pOutBuffer,
1940
    size_t nOutBufferSize, GDALDataType eOutDT, int nOutBands,
1941
    const double *padfOutNoData, double dfSrcXOff, double dfSrcYOff,
1942
    double dfSrcXSize, double dfSrcYSize, const double adfSrcGT[/*6*/],
1943
    const char *pszVRTPath, CSLConstList papszExtra);
1944
1945
CPLErr CPL_DLL GDALVRTRegisterProcessedDatasetFunc(
1946
    const char *pszFuncName, void *pUserData, const char *pszXMLMetadata,
1947
    GDALDataType eRequestedInputDT, const GDALDataType *paeSupportedInputDT,
1948
    size_t nSupportedInputDTSize, const int *panSupportedInputBandCount,
1949
    size_t nSupportedInputBandCountSize,
1950
    GDALVRTProcessedDatasetFuncInit pfnInit,
1951
    GDALVRTProcessedDatasetFuncFree pfnFree,
1952
    GDALVRTProcessedDatasetFuncProcess pfnProcess, CSLConstList papszOptions);
1953
1954
GDALRasterBandH CPL_DLL CPL_STDCALL GDALGetMaskBand(GDALRasterBandH hBand);
1955
int CPL_DLL CPL_STDCALL GDALGetMaskFlags(GDALRasterBandH hBand);
1956
CPLErr CPL_DLL CPL_STDCALL GDALCreateMaskBand(GDALRasterBandH hBand,
1957
                                              int nFlags);
1958
bool CPL_DLL GDALIsMaskBand(GDALRasterBandH hBand);
1959
1960
/** Flag returned by GDALGetMaskFlags() to indicate that all pixels are valid */
1961
0
#define GMF_ALL_VALID 0x01
1962
/** Flag returned by GDALGetMaskFlags() to indicate that the mask band is
1963
 * valid for all bands */
1964
0
#define GMF_PER_DATASET 0x02
1965
/** Flag returned by GDALGetMaskFlags() to indicate that the mask band is
1966
 * an alpha band */
1967
0
#define GMF_ALPHA 0x04
1968
/** Flag returned by GDALGetMaskFlags() to indicate that the mask band is
1969
 * computed from nodata values */
1970
0
#define GMF_NODATA 0x08
1971
1972
/** Flag returned by GDALGetDataCoverageStatus() when the driver does not
1973
 * implement GetDataCoverageStatus(). This flag should be returned together
1974
 * with GDAL_DATA_COVERAGE_STATUS_DATA */
1975
0
#define GDAL_DATA_COVERAGE_STATUS_UNIMPLEMENTED 0x01
1976
1977
/** Flag returned by GDALGetDataCoverageStatus() when there is (potentially)
1978
 * data in the queried window. Can be combined with the binary or operator
1979
 * with GDAL_DATA_COVERAGE_STATUS_UNIMPLEMENTED or
1980
 * GDAL_DATA_COVERAGE_STATUS_EMPTY */
1981
0
#define GDAL_DATA_COVERAGE_STATUS_DATA 0x02
1982
1983
/** Flag returned by GDALGetDataCoverageStatus() when there is nodata in the
1984
 * queried window. This is typically identified by the concept of missing block
1985
 * in formats that supports it.
1986
 * Can be combined with the binary or operator with
1987
 * GDAL_DATA_COVERAGE_STATUS_DATA */
1988
0
#define GDAL_DATA_COVERAGE_STATUS_EMPTY 0x04
1989
1990
int CPL_DLL CPL_STDCALL GDALGetDataCoverageStatus(GDALRasterBandH hBand,
1991
                                                  int nXOff, int nYOff,
1992
                                                  int nXSize, int nYSize,
1993
                                                  int nMaskFlagStop,
1994
                                                  double *pdfDataPct);
1995
1996
void CPL_DLL GDALComputedRasterBandRelease(GDALComputedRasterBandH hBand);
1997
1998
/** Raster algebra unary operation */
1999
typedef enum
2000
{
2001
    /** Logical not */
2002
    GRAUO_LOGICAL_NOT,
2003
    /** Absolute value (module for complex data type) */
2004
    GRAUO_ABS,
2005
    /** Square root */
2006
    GRAUO_SQRT,
2007
    /** Natural logarithm (``ln``) */
2008
    GRAUO_LOG,
2009
    /** Logarithm base 10 */
2010
    GRAUO_LOG10,
2011
} GDALRasterAlgebraUnaryOperation;
2012
2013
GDALComputedRasterBandH CPL_DLL GDALRasterBandUnaryOp(
2014
    GDALRasterBandH hBand,
2015
    GDALRasterAlgebraUnaryOperation eOp) CPL_WARN_UNUSED_RESULT;
2016
2017
/** Raster algebra binary operation */
2018
typedef enum
2019
{
2020
    /** Addition */
2021
    GRABO_ADD,
2022
    /** Subtraction */
2023
    GRABO_SUB,
2024
    /** Multiplication */
2025
    GRABO_MUL,
2026
    /** Division */
2027
    GRABO_DIV,
2028
    /** Power */
2029
    GRABO_POW,
2030
    /** Strictly greater than test*/
2031
    GRABO_GT,
2032
    /** Greater or equal to test */
2033
    GRABO_GE,
2034
    /** Strictly lesser than test */
2035
    GRABO_LT,
2036
    /** Lesser or equal to test */
2037
    GRABO_LE,
2038
    /** Equality test */
2039
    GRABO_EQ,
2040
    /** Non-equality test */
2041
    GRABO_NE,
2042
    /** Logical and */
2043
    GRABO_LOGICAL_AND,
2044
    /** Logical or */
2045
    GRABO_LOGICAL_OR
2046
} GDALRasterAlgebraBinaryOperation;
2047
2048
GDALComputedRasterBandH CPL_DLL GDALRasterBandBinaryOpBand(
2049
    GDALRasterBandH hBand, GDALRasterAlgebraBinaryOperation eOp,
2050
    GDALRasterBandH hOtherBand) CPL_WARN_UNUSED_RESULT;
2051
GDALComputedRasterBandH CPL_DLL GDALRasterBandBinaryOpDouble(
2052
    GDALRasterBandH hBand, GDALRasterAlgebraBinaryOperation eOp,
2053
    double constant) CPL_WARN_UNUSED_RESULT;
2054
GDALComputedRasterBandH CPL_DLL GDALRasterBandBinaryOpDoubleToBand(
2055
    double constant, GDALRasterAlgebraBinaryOperation eOp,
2056
    GDALRasterBandH hBand) CPL_WARN_UNUSED_RESULT;
2057
2058
GDALComputedRasterBandH CPL_DLL
2059
GDALRasterBandIfThenElse(GDALRasterBandH hCondBand, GDALRasterBandH hThenBand,
2060
                         GDALRasterBandH hElseBand) CPL_WARN_UNUSED_RESULT;
2061
2062
GDALComputedRasterBandH CPL_DLL GDALRasterBandAsDataType(
2063
    GDALRasterBandH hBand, GDALDataType eDT) CPL_WARN_UNUSED_RESULT;
2064
2065
GDALComputedRasterBandH CPL_DLL GDALMaximumOfNBands(
2066
    size_t nBandCount, GDALRasterBandH *pahBands) CPL_WARN_UNUSED_RESULT;
2067
GDALComputedRasterBandH CPL_DLL GDALRasterBandMaxConstant(
2068
    GDALRasterBandH hBand, double dfConstant) CPL_WARN_UNUSED_RESULT;
2069
GDALComputedRasterBandH CPL_DLL GDALMinimumOfNBands(
2070
    size_t nBandCount, GDALRasterBandH *pahBands) CPL_WARN_UNUSED_RESULT;
2071
GDALComputedRasterBandH CPL_DLL GDALRasterBandMinConstant(
2072
    GDALRasterBandH hBand, double dfConstant) CPL_WARN_UNUSED_RESULT;
2073
GDALComputedRasterBandH CPL_DLL GDALMeanOfNBands(
2074
    size_t nBandCount, GDALRasterBandH *pahBands) CPL_WARN_UNUSED_RESULT;
2075
2076
/* ==================================================================== */
2077
/*     GDALAsyncReader                                                  */
2078
/* ==================================================================== */
2079
2080
GDALAsyncStatusType CPL_DLL CPL_STDCALL GDALARGetNextUpdatedRegion(
2081
    GDALAsyncReaderH hARIO, double dfTimeout, int *pnXBufOff, int *pnYBufOff,
2082
    int *pnXBufSize, int *pnYBufSize);
2083
int CPL_DLL CPL_STDCALL GDALARLockBuffer(GDALAsyncReaderH hARIO,
2084
                                         double dfTimeout);
2085
void CPL_DLL CPL_STDCALL GDALARUnlockBuffer(GDALAsyncReaderH hARIO);
2086
2087
/* -------------------------------------------------------------------- */
2088
/*      Helper functions.                                               */
2089
/* -------------------------------------------------------------------- */
2090
int CPL_DLL CPL_STDCALL GDALGeneralCmdLineProcessor(int nArgc,
2091
                                                    char ***ppapszArgv,
2092
                                                    int nOptions);
2093
void CPL_DLL CPL_STDCALL GDALSwapWords(void *pData, int nWordSize,
2094
                                       int nWordCount, int nWordSkip);
2095
void CPL_DLL CPL_STDCALL GDALSwapWordsEx(void *pData, int nWordSize,
2096
                                         size_t nWordCount, int nWordSkip);
2097
2098
void CPL_DLL CPL_STDCALL GDALCopyWords(const void *CPL_RESTRICT pSrcData,
2099
                                       GDALDataType eSrcType,
2100
                                       int nSrcPixelOffset,
2101
                                       void *CPL_RESTRICT pDstData,
2102
                                       GDALDataType eDstType,
2103
                                       int nDstPixelOffset, int nWordCount);
2104
2105
void CPL_DLL CPL_STDCALL GDALCopyWords64(
2106
    const void *CPL_RESTRICT pSrcData, GDALDataType eSrcType,
2107
    int nSrcPixelOffset, void *CPL_RESTRICT pDstData, GDALDataType eDstType,
2108
    int nDstPixelOffset, GPtrDiff_t nWordCount);
2109
2110
void CPL_DLL GDALCopyBits(const GByte *pabySrcData, int nSrcOffset,
2111
                          int nSrcStep, GByte *pabyDstData, int nDstOffset,
2112
                          int nDstStep, int nBitCount, int nStepCount);
2113
2114
void CPL_DLL GDALDeinterleave(const void *pSourceBuffer, GDALDataType eSourceDT,
2115
                              int nComponents, void **ppDestBuffer,
2116
                              GDALDataType eDestDT, size_t nIters);
2117
2118
void CPL_DLL GDALTranspose2D(const void *pSrc, GDALDataType eSrcType,
2119
                             void *pDst, GDALDataType eDstType,
2120
                             size_t nSrcWidth, size_t nSrcHeight);
2121
2122
double CPL_DLL GDALGetNoDataReplacementValue(GDALDataType, double);
2123
2124
int CPL_DLL CPL_STDCALL GDALLoadWorldFile(const char *, double *);
2125
int CPL_DLL CPL_STDCALL GDALReadWorldFile(const char *, const char *, double *);
2126
int CPL_DLL CPL_STDCALL GDALWriteWorldFile(const char *, const char *,
2127
                                           double *);
2128
int CPL_DLL CPL_STDCALL GDALLoadTabFile(const char *, double *, char **, int *,
2129
                                        GDAL_GCP **);
2130
int CPL_DLL CPL_STDCALL GDALReadTabFile(const char *, double *, char **, int *,
2131
                                        GDAL_GCP **);
2132
int CPL_DLL CPL_STDCALL GDALLoadOziMapFile(const char *, double *, char **,
2133
                                           int *, GDAL_GCP **);
2134
int CPL_DLL CPL_STDCALL GDALReadOziMapFile(const char *, double *, char **,
2135
                                           int *, GDAL_GCP **);
2136
2137
const char CPL_DLL *CPL_STDCALL GDALDecToDMS(double, const char *, int);
2138
double CPL_DLL CPL_STDCALL GDALPackedDMSToDec(double);
2139
double CPL_DLL CPL_STDCALL GDALDecToPackedDMS(double);
2140
2141
/* Note to developers : please keep this section in sync with ogr_core.h */
2142
2143
#ifndef GDAL_VERSION_INFO_DEFINED
2144
#ifndef DOXYGEN_SKIP
2145
#define GDAL_VERSION_INFO_DEFINED
2146
#endif
2147
const char CPL_DLL *CPL_STDCALL GDALVersionInfo(const char *);
2148
#endif
2149
2150
#ifndef GDAL_CHECK_VERSION
2151
2152
int CPL_DLL CPL_STDCALL GDALCheckVersion(int nVersionMajor, int nVersionMinor,
2153
                                         const char *pszCallingComponentName);
2154
2155
/** Helper macro for GDALCheckVersion()
2156
  @see GDALCheckVersion()
2157
  */
2158
#define GDAL_CHECK_VERSION(pszCallingComponentName)                            \
2159
    GDALCheckVersion(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR,                   \
2160
                     pszCallingComponentName)
2161
2162
#endif
2163
2164
/*! @cond Doxygen_Suppress */
2165
#ifdef GDAL_COMPILATION
2166
#define GDALExtractRPCInfoV1 GDALExtractRPCInfo
2167
#else
2168
#define GDALRPCInfo GDALRPCInfoV2
2169
#define GDALExtractRPCInfo GDALExtractRPCInfoV2
2170
#endif
2171
2172
/* Deprecated: use GDALRPCInfoV2 */
2173
typedef struct
2174
{
2175
    double dfLINE_OFF;   /*!< Line offset */
2176
    double dfSAMP_OFF;   /*!< Sample/Pixel offset */
2177
    double dfLAT_OFF;    /*!< Latitude offset */
2178
    double dfLONG_OFF;   /*!< Longitude offset */
2179
    double dfHEIGHT_OFF; /*!< Height offset */
2180
2181
    double dfLINE_SCALE;   /*!< Line scale */
2182
    double dfSAMP_SCALE;   /*!< Sample/Pixel scale */
2183
    double dfLAT_SCALE;    /*!< Latitude scale */
2184
    double dfLONG_SCALE;   /*!< Longitude scale */
2185
    double dfHEIGHT_SCALE; /*!< Height scale */
2186
2187
    double adfLINE_NUM_COEFF[20]; /*!< Line Numerator Coefficients */
2188
    double adfLINE_DEN_COEFF[20]; /*!< Line Denominator Coefficients */
2189
    double adfSAMP_NUM_COEFF[20]; /*!< Sample/Pixel Numerator Coefficients */
2190
    double adfSAMP_DEN_COEFF[20]; /*!< Sample/Pixel Denominator Coefficients */
2191
2192
    double dfMIN_LONG; /*!< Minimum longitude */
2193
    double dfMIN_LAT;  /*!< Minimum latitude */
2194
    double dfMAX_LONG; /*!< Maximum longitude */
2195
    double dfMAX_LAT;  /*!< Maximum latitude */
2196
} GDALRPCInfoV1;
2197
2198
/*! @endcond */
2199
2200
/** Structure to store Rational Polynomial Coefficients / Rigorous Projection
2201
 * Model. See http://geotiff.maptools.org/rpc_prop.html */
2202
typedef struct
2203
{
2204
    double dfLINE_OFF;   /*!< Line offset */
2205
    double dfSAMP_OFF;   /*!< Sample/Pixel offset */
2206
    double dfLAT_OFF;    /*!< Latitude offset */
2207
    double dfLONG_OFF;   /*!< Longitude offset */
2208
    double dfHEIGHT_OFF; /*!< Height offset */
2209
2210
    double dfLINE_SCALE;   /*!< Line scale */
2211
    double dfSAMP_SCALE;   /*!< Sample/Pixel scale */
2212
    double dfLAT_SCALE;    /*!< Latitude scale */
2213
    double dfLONG_SCALE;   /*!< Longitude scale */
2214
    double dfHEIGHT_SCALE; /*!< Height scale */
2215
2216
    double adfLINE_NUM_COEFF[20]; /*!< Line Numerator Coefficients */
2217
    double adfLINE_DEN_COEFF[20]; /*!< Line Denominator Coefficients */
2218
    double adfSAMP_NUM_COEFF[20]; /*!< Sample/Pixel Numerator Coefficients */
2219
    double adfSAMP_DEN_COEFF[20]; /*!< Sample/Pixel Denominator Coefficients */
2220
2221
    double dfMIN_LONG; /*!< Minimum longitude */
2222
    double dfMIN_LAT;  /*!< Minimum latitude */
2223
    double dfMAX_LONG; /*!< Maximum longitude */
2224
    double dfMAX_LAT;  /*!< Maximum latitude */
2225
2226
    /* Those fields should be at the end. And all above fields should be the
2227
     * same as in GDALRPCInfoV1 */
2228
    double dfERR_BIAS; /*!< Bias error */
2229
    double dfERR_RAND; /*!< Random error */
2230
} GDALRPCInfoV2;
2231
2232
/*! @cond Doxygen_Suppress */
2233
int CPL_DLL CPL_STDCALL GDALExtractRPCInfoV1(CSLConstList, GDALRPCInfoV1 *);
2234
/*! @endcond */
2235
int CPL_DLL CPL_STDCALL GDALExtractRPCInfoV2(CSLConstList, GDALRPCInfoV2 *);
2236
2237
/* ==================================================================== */
2238
/*      Color tables.                                                   */
2239
/* ==================================================================== */
2240
2241
/** Color tuple */
2242
typedef struct
2243
{
2244
    /*! gray, red, cyan or hue */
2245
    short c1;
2246
2247
    /*! green, magenta, or lightness */
2248
    short c2;
2249
2250
    /*! blue, yellow, or saturation */
2251
    short c3;
2252
2253
    /*! alpha or blackband */
2254
    short c4;
2255
} GDALColorEntry;
2256
2257
GDALColorTableH CPL_DLL CPL_STDCALL GDALCreateColorTable(GDALPaletteInterp)
2258
    CPL_WARN_UNUSED_RESULT;
2259
void CPL_DLL CPL_STDCALL GDALDestroyColorTable(GDALColorTableH);
2260
GDALColorTableH CPL_DLL CPL_STDCALL GDALCloneColorTable(GDALColorTableH);
2261
GDALPaletteInterp
2262
    CPL_DLL CPL_STDCALL GDALGetPaletteInterpretation(GDALColorTableH);
2263
int CPL_DLL CPL_STDCALL GDALGetColorEntryCount(GDALColorTableH);
2264
const GDALColorEntry CPL_DLL *CPL_STDCALL GDALGetColorEntry(GDALColorTableH,
2265
                                                            int);
2266
int CPL_DLL CPL_STDCALL GDALGetColorEntryAsRGB(GDALColorTableH, int,
2267
                                               GDALColorEntry *);
2268
void CPL_DLL CPL_STDCALL GDALSetColorEntry(GDALColorTableH, int,
2269
                                           const GDALColorEntry *);
2270
void CPL_DLL CPL_STDCALL GDALCreateColorRamp(GDALColorTableH hTable,
2271
                                             int nStartIndex,
2272
                                             const GDALColorEntry *psStartColor,
2273
                                             int nEndIndex,
2274
                                             const GDALColorEntry *psEndColor);
2275
2276
/* ==================================================================== */
2277
/*      Raster Attribute Table                                          */
2278
/* ==================================================================== */
2279
2280
/** Field type of raster attribute table */
2281
typedef enum
2282
{
2283
    /*! Integer field */ GFT_Integer,
2284
    /*! Floating point (double) field */ GFT_Real,
2285
    /*! String field */ GFT_String,
2286
    /*! Boolean field (GDAL >= 3.12) */ GFT_Boolean,
2287
    /*! DateTime field (GDAL >= 3.12) */ GFT_DateTime,
2288
    /*! Geometry field, as WKB (GDAL >= 3.12) */ GFT_WKBGeometry
2289
} GDALRATFieldType;
2290
2291
/** First invalid value for the GDALRATFieldType enumeration */
2292
0
#define GFT_MaxCount (GFT_WKBGeometry + 1)
2293
2294
/** Field usage of raster attribute table */
2295
typedef enum
2296
{
2297
    /*! General purpose field. */ GFU_Generic = 0,
2298
    /*! Histogram pixel count */ GFU_PixelCount = 1,
2299
    /*! Class name */ GFU_Name = 2,
2300
    /*! Class range minimum */ GFU_Min = 3,
2301
    /*! Class range maximum */ GFU_Max = 4,
2302
    /*! Class value (min=max) */ GFU_MinMax = 5,
2303
    /*! Red class color (0-255) */ GFU_Red = 6,
2304
    /*! Green class color (0-255) */ GFU_Green = 7,
2305
    /*! Blue class color (0-255) */ GFU_Blue = 8,
2306
    /*! Alpha (0=transparent,255=opaque)*/ GFU_Alpha = 9,
2307
    /*! Color Range Red Minimum */ GFU_RedMin = 10,
2308
    /*! Color Range Green Minimum */ GFU_GreenMin = 11,
2309
    /*! Color Range Blue Minimum */ GFU_BlueMin = 12,
2310
    /*! Color Range Alpha Minimum */ GFU_AlphaMin = 13,
2311
    /*! Color Range Red Maximum */ GFU_RedMax = 14,
2312
    /*! Color Range Green Maximum */ GFU_GreenMax = 15,
2313
    /*! Color Range Blue Maximum */ GFU_BlueMax = 16,
2314
    /*! Color Range Alpha Maximum */ GFU_AlphaMax = 17,
2315
    /*! Maximum GFU value (equals to GFU_AlphaMax+1 currently) */ GFU_MaxCount
2316
} GDALRATFieldUsage;
2317
2318
/** RAT table type (thematic or athematic)
2319
 */
2320
typedef enum
2321
{
2322
    /*! Thematic table type */ GRTT_THEMATIC,
2323
    /*! Athematic table type */ GRTT_ATHEMATIC
2324
} GDALRATTableType;
2325
2326
GDALRasterAttributeTableH CPL_DLL CPL_STDCALL
2327
GDALCreateRasterAttributeTable(void) CPL_WARN_UNUSED_RESULT;
2328
2329
void CPL_DLL CPL_STDCALL
2330
    GDALDestroyRasterAttributeTable(GDALRasterAttributeTableH);
2331
2332
int CPL_DLL CPL_STDCALL GDALRATGetColumnCount(GDALRasterAttributeTableH);
2333
2334
const char CPL_DLL *CPL_STDCALL GDALRATGetNameOfCol(GDALRasterAttributeTableH,
2335
                                                    int);
2336
GDALRATFieldUsage CPL_DLL CPL_STDCALL
2337
GDALRATGetUsageOfCol(GDALRasterAttributeTableH, int);
2338
GDALRATFieldType CPL_DLL CPL_STDCALL
2339
GDALRATGetTypeOfCol(GDALRasterAttributeTableH, int);
2340
2341
const char CPL_DLL *GDALGetRATFieldTypeName(GDALRATFieldType);
2342
const char CPL_DLL *GDALGetRATFieldUsageName(GDALRATFieldUsage);
2343
2344
int CPL_DLL CPL_STDCALL GDALRATGetColOfUsage(GDALRasterAttributeTableH,
2345
                                             GDALRATFieldUsage);
2346
int CPL_DLL CPL_STDCALL GDALRATGetRowCount(GDALRasterAttributeTableH);
2347
2348
const char CPL_DLL *CPL_STDCALL
2349
GDALRATGetValueAsString(GDALRasterAttributeTableH, int iRow, int iField);
2350
int CPL_DLL CPL_STDCALL GDALRATGetValueAsInt(GDALRasterAttributeTableH,
2351
                                             int iRow, int iField);
2352
double CPL_DLL CPL_STDCALL GDALRATGetValueAsDouble(GDALRasterAttributeTableH,
2353
                                                   int iRow, int iField);
2354
bool CPL_DLL GDALRATGetValueAsBoolean(GDALRasterAttributeTableH, int iRow,
2355
                                      int iField);
2356
2357
#ifdef __cplusplus
2358
extern "C++"
2359
{
2360
#endif
2361
2362
    /** Structure encoding a DateTime field for a GDAL Raster Attribute Table.
2363
 *
2364
 * @since 3.12
2365
 */
2366
    struct GDALRATDateTime
2367
    {
2368
        /*! Year */ int nYear;
2369
        /*! Month [1, 12] */ int nMonth;
2370
        /*! Day [1, 31] */ int nDay;
2371
        /*! Hour [0, 23] */ int nHour;
2372
        /*! Minute [0, 59] */ int nMinute;
2373
        /*! Second [0, 61) */ float fSecond;
2374
        /*! Time zone hour [0, 23] */ int nTimeZoneHour;
2375
        /*! Time zone minute: 0, 15, 30, 45 */ int nTimeZoneMinute;
2376
        /*! Whether time zone is positive (or null) */ bool bPositiveTimeZone;
2377
        /*! Whether this object is valid */ bool bIsValid;
2378
2379
#ifdef __cplusplus
2380
        GDALRATDateTime()
2381
0
            : nYear(0), nMonth(0), nDay(0), nHour(0), nMinute(0), fSecond(0),
2382
0
              nTimeZoneHour(0), nTimeZoneMinute(0), bPositiveTimeZone(false),
2383
0
              bIsValid(false)
2384
0
        {
2385
0
        }
2386
#endif
2387
    };
2388
2389
#ifdef __cplusplus
2390
}
2391
#endif
2392
2393
/*! @cond Doxygen_Suppress */
2394
typedef struct GDALRATDateTime GDALRATDateTime;
2395
/*! @endcond */
2396
2397
CPLErr CPL_DLL GDALRATGetValueAsDateTime(GDALRasterAttributeTableH, int iRow,
2398
                                         int iField,
2399
                                         GDALRATDateTime *psDateTime);
2400
const GByte CPL_DLL *GDALRATGetValueAsWKBGeometry(GDALRasterAttributeTableH,
2401
                                                  int iRow, int iField,
2402
                                                  size_t *pnWKBSize);
2403
2404
void CPL_DLL CPL_STDCALL GDALRATSetValueAsString(GDALRasterAttributeTableH,
2405
                                                 int iRow, int iField,
2406
                                                 const char *);
2407
void CPL_DLL CPL_STDCALL GDALRATSetValueAsInt(GDALRasterAttributeTableH,
2408
                                              int iRow, int iField, int);
2409
void CPL_DLL CPL_STDCALL GDALRATSetValueAsDouble(GDALRasterAttributeTableH,
2410
                                                 int iRow, int iField, double);
2411
CPLErr CPL_DLL GDALRATSetValueAsBoolean(GDALRasterAttributeTableH, int iRow,
2412
                                        int iField, bool);
2413
CPLErr CPL_DLL GDALRATSetValueAsDateTime(GDALRasterAttributeTableH, int iRow,
2414
                                         int iField,
2415
                                         const GDALRATDateTime *psDateTime);
2416
CPLErr CPL_DLL GDALRATSetValueAsWKBGeometry(GDALRasterAttributeTableH, int iRow,
2417
                                            int iField, const void *pabyWKB,
2418
                                            size_t nWKBSize);
2419
2420
int CPL_DLL CPL_STDCALL
2421
GDALRATChangesAreWrittenToFile(GDALRasterAttributeTableH hRAT);
2422
2423
CPLErr CPL_DLL CPL_STDCALL GDALRATValuesIOAsDouble(
2424
    GDALRasterAttributeTableH hRAT, GDALRWFlag eRWFlag, int iField,
2425
    int iStartRow, int iLength, double *pdfData);
2426
CPLErr CPL_DLL CPL_STDCALL
2427
GDALRATValuesIOAsInteger(GDALRasterAttributeTableH hRAT, GDALRWFlag eRWFlag,
2428
                         int iField, int iStartRow, int iLength, int *pnData);
2429
CPLErr CPL_DLL CPL_STDCALL GDALRATValuesIOAsString(
2430
    GDALRasterAttributeTableH hRAT, GDALRWFlag eRWFlag, int iField,
2431
    int iStartRow, int iLength, char **papszStrList);
2432
CPLErr CPL_DLL GDALRATValuesIOAsBoolean(GDALRasterAttributeTableH hRAT,
2433
                                        GDALRWFlag eRWFlag, int iField,
2434
                                        int iStartRow, int iLength,
2435
                                        bool *pbData);
2436
CPLErr CPL_DLL GDALRATValuesIOAsDateTime(GDALRasterAttributeTableH hRAT,
2437
                                         GDALRWFlag eRWFlag, int iField,
2438
                                         int iStartRow, int iLength,
2439
                                         GDALRATDateTime *pasDateTime);
2440
CPLErr CPL_DLL GDALRATValuesIOAsWKBGeometry(GDALRasterAttributeTableH hRAT,
2441
                                            GDALRWFlag eRWFlag, int iField,
2442
                                            int iStartRow, int iLength,
2443
                                            GByte **ppabyWKB,
2444
                                            size_t *pnWKBSize);
2445
2446
void CPL_DLL CPL_STDCALL GDALRATSetRowCount(GDALRasterAttributeTableH, int);
2447
CPLErr CPL_DLL CPL_STDCALL GDALRATCreateColumn(GDALRasterAttributeTableH,
2448
                                               const char *, GDALRATFieldType,
2449
                                               GDALRATFieldUsage);
2450
CPLErr CPL_DLL CPL_STDCALL GDALRATSetLinearBinning(GDALRasterAttributeTableH,
2451
                                                   double, double);
2452
int CPL_DLL CPL_STDCALL GDALRATGetLinearBinning(GDALRasterAttributeTableH,
2453
                                                double *, double *);
2454
CPLErr CPL_DLL CPL_STDCALL GDALRATSetTableType(
2455
    GDALRasterAttributeTableH hRAT, const GDALRATTableType eInTableType);
2456
GDALRATTableType CPL_DLL CPL_STDCALL
2457
GDALRATGetTableType(GDALRasterAttributeTableH hRAT);
2458
CPLErr CPL_DLL CPL_STDCALL
2459
    GDALRATInitializeFromColorTable(GDALRasterAttributeTableH, GDALColorTableH);
2460
GDALColorTableH CPL_DLL CPL_STDCALL
2461
GDALRATTranslateToColorTable(GDALRasterAttributeTableH, int nEntryCount);
2462
void CPL_DLL CPL_STDCALL GDALRATDumpReadable(GDALRasterAttributeTableH, FILE *);
2463
GDALRasterAttributeTableH CPL_DLL CPL_STDCALL
2464
GDALRATClone(const GDALRasterAttributeTableH);
2465
2466
void CPL_DLL *CPL_STDCALL GDALRATSerializeJSON(GDALRasterAttributeTableH)
2467
    CPL_WARN_UNUSED_RESULT;
2468
2469
int CPL_DLL CPL_STDCALL GDALRATGetRowOfValue(GDALRasterAttributeTableH, double);
2470
void CPL_DLL CPL_STDCALL GDALRATRemoveStatistics(GDALRasterAttributeTableH);
2471
2472
/* -------------------------------------------------------------------- */
2473
/*                          Relationships                               */
2474
/* -------------------------------------------------------------------- */
2475
2476
/** Cardinality of relationship.
2477
 *
2478
 * @since GDAL 3.6
2479
 */
2480
typedef enum
2481
{
2482
    /** One-to-one */
2483
    GRC_ONE_TO_ONE,
2484
    /** One-to-many */
2485
    GRC_ONE_TO_MANY,
2486
    /** Many-to-one */
2487
    GRC_MANY_TO_ONE,
2488
    /** Many-to-many */
2489
    GRC_MANY_TO_MANY,
2490
} GDALRelationshipCardinality;
2491
2492
/** Type of relationship.
2493
 *
2494
 * @since GDAL 3.6
2495
 */
2496
typedef enum
2497
{
2498
    /** Composite relationship */
2499
    GRT_COMPOSITE,
2500
    /** Association relationship */
2501
    GRT_ASSOCIATION,
2502
    /** Aggregation relationship */
2503
    GRT_AGGREGATION,
2504
} GDALRelationshipType;
2505
2506
GDALRelationshipH CPL_DLL GDALRelationshipCreate(const char *, const char *,
2507
                                                 const char *,
2508
                                                 GDALRelationshipCardinality);
2509
void CPL_DLL CPL_STDCALL GDALDestroyRelationship(GDALRelationshipH);
2510
const char CPL_DLL *GDALRelationshipGetName(GDALRelationshipH);
2511
GDALRelationshipCardinality
2512
    CPL_DLL GDALRelationshipGetCardinality(GDALRelationshipH);
2513
const char CPL_DLL *GDALRelationshipGetLeftTableName(GDALRelationshipH);
2514
const char CPL_DLL *GDALRelationshipGetRightTableName(GDALRelationshipH);
2515
const char CPL_DLL *GDALRelationshipGetMappingTableName(GDALRelationshipH);
2516
void CPL_DLL GDALRelationshipSetMappingTableName(GDALRelationshipH,
2517
                                                 const char *);
2518
char CPL_DLL **GDALRelationshipGetLeftTableFields(GDALRelationshipH);
2519
char CPL_DLL **GDALRelationshipGetRightTableFields(GDALRelationshipH);
2520
void CPL_DLL GDALRelationshipSetLeftTableFields(GDALRelationshipH,
2521
                                                CSLConstList);
2522
void CPL_DLL GDALRelationshipSetRightTableFields(GDALRelationshipH,
2523
                                                 CSLConstList);
2524
char CPL_DLL **GDALRelationshipGetLeftMappingTableFields(GDALRelationshipH);
2525
char CPL_DLL **GDALRelationshipGetRightMappingTableFields(GDALRelationshipH);
2526
void CPL_DLL GDALRelationshipSetLeftMappingTableFields(GDALRelationshipH,
2527
                                                       CSLConstList);
2528
void CPL_DLL GDALRelationshipSetRightMappingTableFields(GDALRelationshipH,
2529
                                                        CSLConstList);
2530
GDALRelationshipType CPL_DLL GDALRelationshipGetType(GDALRelationshipH);
2531
void CPL_DLL GDALRelationshipSetType(GDALRelationshipH, GDALRelationshipType);
2532
const char CPL_DLL *GDALRelationshipGetForwardPathLabel(GDALRelationshipH);
2533
void CPL_DLL GDALRelationshipSetForwardPathLabel(GDALRelationshipH,
2534
                                                 const char *);
2535
const char CPL_DLL *GDALRelationshipGetBackwardPathLabel(GDALRelationshipH);
2536
void CPL_DLL GDALRelationshipSetBackwardPathLabel(GDALRelationshipH,
2537
                                                  const char *);
2538
const char CPL_DLL *GDALRelationshipGetRelatedTableType(GDALRelationshipH);
2539
void CPL_DLL GDALRelationshipSetRelatedTableType(GDALRelationshipH,
2540
                                                 const char *);
2541
2542
/* ==================================================================== */
2543
/*      GDAL Cache Management                                           */
2544
/* ==================================================================== */
2545
2546
void CPL_DLL CPL_STDCALL GDALSetCacheMax(int nBytes);
2547
int CPL_DLL CPL_STDCALL GDALGetCacheMax(void);
2548
int CPL_DLL CPL_STDCALL GDALGetCacheUsed(void);
2549
void CPL_DLL CPL_STDCALL GDALSetCacheMax64(GIntBig nBytes);
2550
GIntBig CPL_DLL CPL_STDCALL GDALGetCacheMax64(void);
2551
GIntBig CPL_DLL CPL_STDCALL GDALGetCacheUsed64(void);
2552
2553
int CPL_DLL CPL_STDCALL GDALFlushCacheBlock(void);
2554
2555
/* ==================================================================== */
2556
/*      GDAL virtual memory                                             */
2557
/* ==================================================================== */
2558
2559
CPLVirtualMem CPL_DLL *GDALDatasetGetVirtualMem(
2560
    GDALDatasetH hDS, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize,
2561
    int nYSize, int nBufXSize, int nBufYSize, GDALDataType eBufType,
2562
    int nBandCount, int *panBandMap, int nPixelSpace, GIntBig nLineSpace,
2563
    GIntBig nBandSpace, size_t nCacheSize, size_t nPageSizeHint,
2564
    int bSingleThreadUsage, CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2565
2566
CPLVirtualMem CPL_DLL *GDALRasterBandGetVirtualMem(
2567
    GDALRasterBandH hBand, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize,
2568
    int nYSize, int nBufXSize, int nBufYSize, GDALDataType eBufType,
2569
    int nPixelSpace, GIntBig nLineSpace, size_t nCacheSize,
2570
    size_t nPageSizeHint, int bSingleThreadUsage,
2571
    CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2572
2573
CPLVirtualMem CPL_DLL *
2574
GDALGetVirtualMemAuto(GDALRasterBandH hBand, GDALRWFlag eRWFlag,
2575
                      int *pnPixelSpace, GIntBig *pnLineSpace,
2576
                      CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2577
2578
/**! Enumeration to describe the tile organization */
2579
typedef enum
2580
{
2581
    /*! Tile Interleaved by Pixel: tile (0,0) with internal band interleaved by
2582
       pixel organization, tile (1, 0), ...  */
2583
    GTO_TIP,
2584
    /*! Band Interleaved by Tile : tile (0,0) of first band, tile (0,0) of
2585
       second band, ... tile (1,0) of first band, tile (1,0) of second band, ...
2586
     */
2587
    GTO_BIT,
2588
    /*! Band SeQuential : all the tiles of first band, all the tiles of
2589
       following band... */
2590
    GTO_BSQ
2591
} GDALTileOrganization;
2592
2593
CPLVirtualMem CPL_DLL *GDALDatasetGetTiledVirtualMem(
2594
    GDALDatasetH hDS, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize,
2595
    int nYSize, int nTileXSize, int nTileYSize, GDALDataType eBufType,
2596
    int nBandCount, int *panBandMap, GDALTileOrganization eTileOrganization,
2597
    size_t nCacheSize, int bSingleThreadUsage,
2598
    CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2599
2600
CPLVirtualMem CPL_DLL *GDALRasterBandGetTiledVirtualMem(
2601
    GDALRasterBandH hBand, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize,
2602
    int nYSize, int nTileXSize, int nTileYSize, GDALDataType eBufType,
2603
    size_t nCacheSize, int bSingleThreadUsage,
2604
    CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2605
2606
/* ==================================================================== */
2607
/*      VRTPansharpenedDataset class.                                   */
2608
/* ==================================================================== */
2609
2610
GDALDatasetH CPL_DLL GDALCreatePansharpenedVRT(
2611
    const char *pszXML, GDALRasterBandH hPanchroBand, int nInputSpectralBands,
2612
    GDALRasterBandH *pahInputSpectralBands) CPL_WARN_UNUSED_RESULT;
2613
2614
/* =================================================================== */
2615
/*      Misc API                                                        */
2616
/* ==================================================================== */
2617
2618
CPLXMLNode CPL_DLL *
2619
GDALGetJPEG2000Structure(const char *pszFilename,
2620
                         CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2621
2622
/* ==================================================================== */
2623
/*      Multidimensional API_api                                       */
2624
/* ==================================================================== */
2625
2626
GDALDatasetH CPL_DLL
2627
GDALCreateMultiDimensional(GDALDriverH hDriver, const char *pszName,
2628
                           CSLConstList papszRootGroupOptions,
2629
                           CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2630
2631
GDALExtendedDataTypeH CPL_DLL GDALExtendedDataTypeCreate(GDALDataType eType)
2632
    CPL_WARN_UNUSED_RESULT;
2633
GDALExtendedDataTypeH CPL_DLL GDALExtendedDataTypeCreateString(
2634
    size_t nMaxStringLength) CPL_WARN_UNUSED_RESULT;
2635
GDALExtendedDataTypeH CPL_DLL GDALExtendedDataTypeCreateStringEx(
2636
    size_t nMaxStringLength,
2637
    GDALExtendedDataTypeSubType eSubType) CPL_WARN_UNUSED_RESULT;
2638
GDALExtendedDataTypeH CPL_DLL GDALExtendedDataTypeCreateCompound(
2639
    const char *pszName, size_t nTotalSize, size_t nComponents,
2640
    const GDALEDTComponentH *comps) CPL_WARN_UNUSED_RESULT;
2641
void CPL_DLL GDALExtendedDataTypeRelease(GDALExtendedDataTypeH hEDT);
2642
const char CPL_DLL *GDALExtendedDataTypeGetName(GDALExtendedDataTypeH hEDT);
2643
GDALExtendedDataTypeClass CPL_DLL
2644
GDALExtendedDataTypeGetClass(GDALExtendedDataTypeH hEDT);
2645
GDALDataType CPL_DLL
2646
GDALExtendedDataTypeGetNumericDataType(GDALExtendedDataTypeH hEDT);
2647
size_t CPL_DLL GDALExtendedDataTypeGetSize(GDALExtendedDataTypeH hEDT);
2648
size_t CPL_DLL
2649
GDALExtendedDataTypeGetMaxStringLength(GDALExtendedDataTypeH hEDT);
2650
GDALEDTComponentH CPL_DLL *
2651
GDALExtendedDataTypeGetComponents(GDALExtendedDataTypeH hEDT,
2652
                                  size_t *pnCount) CPL_WARN_UNUSED_RESULT;
2653
void CPL_DLL GDALExtendedDataTypeFreeComponents(GDALEDTComponentH *components,
2654
                                                size_t nCount);
2655
int CPL_DLL GDALExtendedDataTypeCanConvertTo(GDALExtendedDataTypeH hSourceEDT,
2656
                                             GDALExtendedDataTypeH hTargetEDT);
2657
int CPL_DLL GDALExtendedDataTypeEquals(GDALExtendedDataTypeH hFirstEDT,
2658
                                       GDALExtendedDataTypeH hSecondEDT);
2659
GDALExtendedDataTypeSubType CPL_DLL
2660
GDALExtendedDataTypeGetSubType(GDALExtendedDataTypeH hEDT);
2661
GDALRasterAttributeTableH CPL_DLL
2662
GDALExtendedDataTypeGetRAT(GDALExtendedDataTypeH hEDT) CPL_WARN_UNUSED_RESULT;
2663
2664
GDALEDTComponentH CPL_DLL
2665
GDALEDTComponentCreate(const char *pszName, size_t nOffset,
2666
                       GDALExtendedDataTypeH hType) CPL_WARN_UNUSED_RESULT;
2667
void CPL_DLL GDALEDTComponentRelease(GDALEDTComponentH hComp);
2668
const char CPL_DLL *GDALEDTComponentGetName(GDALEDTComponentH hComp);
2669
size_t CPL_DLL GDALEDTComponentGetOffset(GDALEDTComponentH hComp);
2670
GDALExtendedDataTypeH CPL_DLL GDALEDTComponentGetType(GDALEDTComponentH hComp)
2671
    CPL_WARN_UNUSED_RESULT;
2672
2673
GDALGroupH CPL_DLL GDALDatasetGetRootGroup(GDALDatasetH hDS)
2674
    CPL_WARN_UNUSED_RESULT;
2675
void CPL_DLL GDALGroupRelease(GDALGroupH hGroup);
2676
const char CPL_DLL *GDALGroupGetName(GDALGroupH hGroup);
2677
const char CPL_DLL *GDALGroupGetFullName(GDALGroupH hGroup);
2678
char CPL_DLL **
2679
GDALGroupGetMDArrayNames(GDALGroupH hGroup,
2680
                         CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2681
char CPL_DLL **GDALGroupGetMDArrayFullNamesRecursive(
2682
    GDALGroupH hGroup, CSLConstList papszGroupOptions,
2683
    CSLConstList papszArrayOptions) CPL_WARN_UNUSED_RESULT;
2684
GDALMDArrayH CPL_DLL
2685
GDALGroupOpenMDArray(GDALGroupH hGroup, const char *pszMDArrayName,
2686
                     CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2687
GDALMDArrayH CPL_DLL GDALGroupOpenMDArrayFromFullname(
2688
    GDALGroupH hGroup, const char *pszMDArrayName,
2689
    CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2690
GDALMDArrayH CPL_DLL GDALGroupResolveMDArray(
2691
    GDALGroupH hGroup, const char *pszName, const char *pszStartingPoint,
2692
    CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2693
char CPL_DLL **
2694
GDALGroupGetGroupNames(GDALGroupH hGroup,
2695
                       CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2696
GDALGroupH CPL_DLL
2697
GDALGroupOpenGroup(GDALGroupH hGroup, const char *pszSubGroupName,
2698
                   CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2699
GDALGroupH CPL_DLL GDALGroupOpenGroupFromFullname(
2700
    GDALGroupH hGroup, const char *pszMDArrayName,
2701
    CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2702
char CPL_DLL **
2703
GDALGroupGetVectorLayerNames(GDALGroupH hGroup,
2704
                             CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2705
OGRLayerH CPL_DLL
2706
GDALGroupOpenVectorLayer(GDALGroupH hGroup, const char *pszVectorLayerName,
2707
                         CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2708
GDALDimensionH CPL_DLL *
2709
GDALGroupGetDimensions(GDALGroupH hGroup, size_t *pnCount,
2710
                       CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2711
GDALAttributeH CPL_DLL GDALGroupGetAttribute(
2712
    GDALGroupH hGroup, const char *pszName) CPL_WARN_UNUSED_RESULT;
2713
GDALAttributeH CPL_DLL *
2714
GDALGroupGetAttributes(GDALGroupH hGroup, size_t *pnCount,
2715
                       CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2716
CSLConstList CPL_DLL GDALGroupGetStructuralInfo(GDALGroupH hGroup);
2717
GDALGroupH CPL_DLL
2718
GDALGroupCreateGroup(GDALGroupH hGroup, const char *pszSubGroupName,
2719
                     CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2720
bool CPL_DLL GDALGroupDeleteGroup(GDALGroupH hGroup, const char *pszName,
2721
                                  CSLConstList papszOptions);
2722
GDALDimensionH CPL_DLL GDALGroupCreateDimension(
2723
    GDALGroupH hGroup, const char *pszName, const char *pszType,
2724
    const char *pszDirection, GUInt64 nSize,
2725
    CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2726
GDALMDArrayH CPL_DLL GDALGroupCreateMDArray(
2727
    GDALGroupH hGroup, const char *pszName, size_t nDimensions,
2728
    GDALDimensionH *pahDimensions, GDALExtendedDataTypeH hEDT,
2729
    CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2730
bool CPL_DLL GDALGroupDeleteMDArray(GDALGroupH hGroup, const char *pszName,
2731
                                    CSLConstList papszOptions);
2732
GDALAttributeH CPL_DLL GDALGroupCreateAttribute(
2733
    GDALGroupH hGroup, const char *pszName, size_t nDimensions,
2734
    const GUInt64 *panDimensions, GDALExtendedDataTypeH hEDT,
2735
    CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2736
bool CPL_DLL GDALGroupDeleteAttribute(GDALGroupH hGroup, const char *pszName,
2737
                                      CSLConstList papszOptions);
2738
bool CPL_DLL GDALGroupRename(GDALGroupH hGroup, const char *pszNewName);
2739
GDALGroupH CPL_DLL GDALGroupSubsetDimensionFromSelection(
2740
    GDALGroupH hGroup, const char *pszSelection, CSLConstList papszOptions);
2741
size_t CPL_DLL GDALGroupGetDataTypeCount(GDALGroupH hGroup);
2742
GDALExtendedDataTypeH CPL_DLL GDALGroupGetDataType(GDALGroupH hGroup,
2743
                                                   size_t nIdx);
2744
2745
void CPL_DLL GDALMDArrayRelease(GDALMDArrayH hMDArray);
2746
const char CPL_DLL *GDALMDArrayGetName(GDALMDArrayH hArray);
2747
const char CPL_DLL *GDALMDArrayGetFullName(GDALMDArrayH hArray);
2748
GUInt64 CPL_DLL GDALMDArrayGetTotalElementsCount(GDALMDArrayH hArray);
2749
size_t CPL_DLL GDALMDArrayGetDimensionCount(GDALMDArrayH hArray);
2750
GDALDimensionH CPL_DLL *
2751
GDALMDArrayGetDimensions(GDALMDArrayH hArray,
2752
                         size_t *pnCount) CPL_WARN_UNUSED_RESULT;
2753
GDALExtendedDataTypeH CPL_DLL GDALMDArrayGetDataType(GDALMDArrayH hArray)
2754
    CPL_WARN_UNUSED_RESULT;
2755
int CPL_DLL GDALMDArrayRead(GDALMDArrayH hArray, const GUInt64 *arrayStartIdx,
2756
                            const size_t *count, const GInt64 *arrayStep,
2757
                            const GPtrDiff_t *bufferStride,
2758
                            GDALExtendedDataTypeH bufferDatatype,
2759
                            void *pDstBuffer, const void *pDstBufferAllocStart,
2760
                            size_t nDstBufferllocSize);
2761
int CPL_DLL GDALMDArrayWrite(GDALMDArrayH hArray, const GUInt64 *arrayStartIdx,
2762
                             const size_t *count, const GInt64 *arrayStep,
2763
                             const GPtrDiff_t *bufferStride,
2764
                             GDALExtendedDataTypeH bufferDatatype,
2765
                             const void *pSrcBuffer,
2766
                             const void *psrcBufferAllocStart,
2767
                             size_t nSrcBufferllocSize);
2768
int CPL_DLL GDALMDArrayAdviseRead(GDALMDArrayH hArray,
2769
                                  const GUInt64 *arrayStartIdx,
2770
                                  const size_t *count);
2771
int CPL_DLL GDALMDArrayAdviseReadEx(GDALMDArrayH hArray,
2772
                                    const GUInt64 *arrayStartIdx,
2773
                                    const size_t *count,
2774
                                    CSLConstList papszOptions);
2775
GDALAttributeH CPL_DLL GDALMDArrayGetAttribute(
2776
    GDALMDArrayH hArray, const char *pszName) CPL_WARN_UNUSED_RESULT;
2777
GDALAttributeH CPL_DLL *
2778
GDALMDArrayGetAttributes(GDALMDArrayH hArray, size_t *pnCount,
2779
                         CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2780
GDALAttributeH CPL_DLL GDALMDArrayCreateAttribute(
2781
    GDALMDArrayH hArray, const char *pszName, size_t nDimensions,
2782
    const GUInt64 *panDimensions, GDALExtendedDataTypeH hEDT,
2783
    CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2784
bool CPL_DLL GDALMDArrayDeleteAttribute(GDALMDArrayH hArray,
2785
                                        const char *pszName,
2786
                                        CSLConstList papszOptions);
2787
bool CPL_DLL GDALMDArrayResize(GDALMDArrayH hArray,
2788
                               const GUInt64 *panNewDimSizes,
2789
                               CSLConstList papszOptions);
2790
const void CPL_DLL *GDALMDArrayGetRawNoDataValue(GDALMDArrayH hArray);
2791
double CPL_DLL GDALMDArrayGetNoDataValueAsDouble(GDALMDArrayH hArray,
2792
                                                 int *pbHasNoDataValue);
2793
int64_t CPL_DLL GDALMDArrayGetNoDataValueAsInt64(GDALMDArrayH hArray,
2794
                                                 int *pbHasNoDataValue);
2795
uint64_t CPL_DLL GDALMDArrayGetNoDataValueAsUInt64(GDALMDArrayH hArray,
2796
                                                   int *pbHasNoDataValue);
2797
int CPL_DLL GDALMDArraySetRawNoDataValue(GDALMDArrayH hArray, const void *);
2798
int CPL_DLL GDALMDArraySetNoDataValueAsDouble(GDALMDArrayH hArray,
2799
                                              double dfNoDataValue);
2800
int CPL_DLL GDALMDArraySetNoDataValueAsInt64(GDALMDArrayH hArray,
2801
                                             int64_t nNoDataValue);
2802
int CPL_DLL GDALMDArraySetNoDataValueAsUInt64(GDALMDArrayH hArray,
2803
                                              uint64_t nNoDataValue);
2804
int CPL_DLL GDALMDArraySetScale(GDALMDArrayH hArray, double dfScale);
2805
int CPL_DLL GDALMDArraySetScaleEx(GDALMDArrayH hArray, double dfScale,
2806
                                  GDALDataType eStorageType);
2807
double CPL_DLL GDALMDArrayGetScale(GDALMDArrayH hArray, int *pbHasValue);
2808
double CPL_DLL GDALMDArrayGetScaleEx(GDALMDArrayH hArray, int *pbHasValue,
2809
                                     GDALDataType *peStorageType);
2810
int CPL_DLL GDALMDArraySetOffset(GDALMDArrayH hArray, double dfOffset);
2811
int CPL_DLL GDALMDArraySetOffsetEx(GDALMDArrayH hArray, double dfOffset,
2812
                                   GDALDataType eStorageType);
2813
double CPL_DLL GDALMDArrayGetOffset(GDALMDArrayH hArray, int *pbHasValue);
2814
double CPL_DLL GDALMDArrayGetOffsetEx(GDALMDArrayH hArray, int *pbHasValue,
2815
                                      GDALDataType *peStorageType);
2816
GUInt64 CPL_DLL *GDALMDArrayGetBlockSize(GDALMDArrayH hArray, size_t *pnCount);
2817
int CPL_DLL GDALMDArraySetUnit(GDALMDArrayH hArray, const char *);
2818
const char CPL_DLL *GDALMDArrayGetUnit(GDALMDArrayH hArray);
2819
int CPL_DLL GDALMDArraySetSpatialRef(GDALMDArrayH, OGRSpatialReferenceH);
2820
OGRSpatialReferenceH CPL_DLL GDALMDArrayGetSpatialRef(GDALMDArrayH hArray);
2821
size_t CPL_DLL *GDALMDArrayGetProcessingChunkSize(GDALMDArrayH hArray,
2822
                                                  size_t *pnCount,
2823
                                                  size_t nMaxChunkMemory);
2824
CSLConstList CPL_DLL GDALMDArrayGetStructuralInfo(GDALMDArrayH hArray);
2825
GDALMDArrayH CPL_DLL GDALMDArrayGetView(GDALMDArrayH hArray,
2826
                                        const char *pszViewExpr);
2827
GDALMDArrayH CPL_DLL GDALMDArrayTranspose(GDALMDArrayH hArray,
2828
                                          size_t nNewAxisCount,
2829
                                          const int *panMapNewAxisToOldAxis);
2830
GDALMDArrayH CPL_DLL GDALMDArrayGetUnscaled(GDALMDArrayH hArray);
2831
GDALMDArrayH CPL_DLL GDALMDArrayGetMask(GDALMDArrayH hArray,
2832
                                        CSLConstList papszOptions);
2833
GDALDatasetH CPL_DLL GDALMDArrayAsClassicDataset(GDALMDArrayH hArray,
2834
                                                 size_t iXDim, size_t iYDim);
2835
GDALDatasetH CPL_DLL GDALMDArrayAsClassicDatasetEx(GDALMDArrayH hArray,
2836
                                                   size_t iXDim, size_t iYDim,
2837
                                                   GDALGroupH hRootGroup,
2838
                                                   CSLConstList papszOptions);
2839
CPLErr CPL_DLL GDALMDArrayGetStatistics(
2840
    GDALMDArrayH hArray, GDALDatasetH, int bApproxOK, int bForce,
2841
    double *pdfMin, double *pdfMax, double *pdfMean, double *pdfStdDev,
2842
    GUInt64 *pnValidCount, GDALProgressFunc pfnProgress, void *pProgressData);
2843
int CPL_DLL GDALMDArrayComputeStatistics(GDALMDArrayH hArray, GDALDatasetH,
2844
                                         int bApproxOK, double *pdfMin,
2845
                                         double *pdfMax, double *pdfMean,
2846
                                         double *pdfStdDev,
2847
                                         GUInt64 *pnValidCount,
2848
                                         GDALProgressFunc, void *pProgressData);
2849
int CPL_DLL GDALMDArrayComputeStatisticsEx(
2850
    GDALMDArrayH hArray, GDALDatasetH, int bApproxOK, double *pdfMin,
2851
    double *pdfMax, double *pdfMean, double *pdfStdDev, GUInt64 *pnValidCount,
2852
    GDALProgressFunc, void *pProgressData, CSLConstList papszOptions);
2853
GDALMDArrayH CPL_DLL GDALMDArrayGetResampled(GDALMDArrayH hArray,
2854
                                             size_t nNewDimCount,
2855
                                             const GDALDimensionH *pahNewDims,
2856
                                             GDALRIOResampleAlg resampleAlg,
2857
                                             OGRSpatialReferenceH hTargetSRS,
2858
                                             CSLConstList papszOptions);
2859
GDALMDArrayH CPL_DLL GDALMDArrayGetGridded(
2860
    GDALMDArrayH hArray, const char *pszGridOptions, GDALMDArrayH hXArray,
2861
    GDALMDArrayH hYArray, CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2862
2863
GDALMDArrayH CPL_DLL *
2864
GDALMDArrayGetCoordinateVariables(GDALMDArrayH hArray,
2865
                                  size_t *pnCount) CPL_WARN_UNUSED_RESULT;
2866
2867
GDALMDArrayH CPL_DLL *
2868
GDALMDArrayGetMeshGrid(const GDALMDArrayH *pahInputArrays,
2869
                       size_t nCountInputArrays, size_t *pnCountOutputArrays,
2870
                       CSLConstList papszOptions) CPL_WARN_UNUSED_RESULT;
2871
2872
#ifdef __cplusplus
2873
extern "C++"
2874
{
2875
#endif
2876
2877
    /** Information on a raw block of a GDALMDArray
2878
     *
2879
     * @since 3.12
2880
     */
2881
    struct
2882
#ifdef __cplusplus
2883
        CPL_DLL
2884
#endif
2885
        GDALMDArrayRawBlockInfo
2886
    {
2887
        /** Filename into which the raw block is found */
2888
        char *pszFilename;
2889
        /** File offset within pszFilename of the start of the raw block */
2890
        uint64_t nOffset;
2891
        /** Size in bytes of the raw block */
2892
        uint64_t nSize;
2893
        /** NULL or Null-terminated list of driver specific information on the
2894
         * raw block */
2895
        char **papszInfo;
2896
        /** In-memory buffer of nSize bytes. When this is set, pszFilename and
2897
         * nOffset are set to NULL.
2898
         *
2899
         * When using C++ copy constructor or copy-assignment operator, if
2900
         * a memory allocation fails, a CPLError() will be emitted and this
2901
         * field will be NULL, but nSize not zero.
2902
         */
2903
        GByte *pabyInlineData;
2904
2905
#ifdef __cplusplus
2906
        /*! @cond Doxygen_Suppress */
2907
        inline GDALMDArrayRawBlockInfo()
2908
0
            : pszFilename(nullptr), nOffset(0), nSize(0), papszInfo(nullptr),
2909
0
              pabyInlineData(nullptr)
2910
0
        {
2911
0
        }
2912
2913
        ~GDALMDArrayRawBlockInfo();
2914
2915
        void clear();
2916
2917
        GDALMDArrayRawBlockInfo(const GDALMDArrayRawBlockInfo &);
2918
        GDALMDArrayRawBlockInfo &operator=(const GDALMDArrayRawBlockInfo &);
2919
        GDALMDArrayRawBlockInfo(GDALMDArrayRawBlockInfo &&);
2920
        GDALMDArrayRawBlockInfo &operator=(GDALMDArrayRawBlockInfo &&);
2921
        /*! @endcond */
2922
#endif
2923
    };
2924
2925
#ifdef __cplusplus
2926
}
2927
#endif
2928
2929
/*! @cond Doxygen_Suppress */
2930
typedef struct GDALMDArrayRawBlockInfo GDALMDArrayRawBlockInfo;
2931
/*! @endcond */
2932
2933
GDALMDArrayRawBlockInfo CPL_DLL *GDALMDArrayRawBlockInfoCreate(void);
2934
void CPL_DLL
2935
GDALMDArrayRawBlockInfoRelease(GDALMDArrayRawBlockInfo *psBlockInfo);
2936
bool CPL_DLL GDALMDArrayGetRawBlockInfo(GDALMDArrayH hArray,
2937
                                        const uint64_t *panBlockCoordinates,
2938
                                        GDALMDArrayRawBlockInfo *psBlockInfo);
2939
2940
int CPL_DLL GDALMDArrayGetOverviewCount(GDALMDArrayH hArray);
2941
GDALMDArrayH CPL_DLL GDALMDArrayGetOverview(GDALMDArrayH hArray, int nIdx);
2942
CPLErr CPL_DLL GDALMDArrayBuildOverviews(
2943
    GDALMDArrayH hArray, const char *pszResampling, int nOverviews,
2944
    const int *panOverviewList, GDALProgressFunc pfnProgress,
2945
    void *pProgressData, CSLConstList papszOptions);
2946
2947
void CPL_DLL GDALReleaseArrays(GDALMDArrayH *arrays, size_t nCount);
2948
int CPL_DLL GDALMDArrayCache(GDALMDArrayH hArray, CSLConstList papszOptions);
2949
bool CPL_DLL GDALMDArrayRename(GDALMDArrayH hArray, const char *pszNewName);
2950
2951
GDALRasterAttributeTableH CPL_DLL GDALCreateRasterAttributeTableFromMDArrays(
2952
    GDALRATTableType eTableType, int nArrays, const GDALMDArrayH *ahArrays,
2953
    const GDALRATFieldUsage *paeUsages);
2954
2955
void CPL_DLL GDALAttributeRelease(GDALAttributeH hAttr);
2956
void CPL_DLL GDALReleaseAttributes(GDALAttributeH *attributes, size_t nCount);
2957
const char CPL_DLL *GDALAttributeGetName(GDALAttributeH hAttr);
2958
const char CPL_DLL *GDALAttributeGetFullName(GDALAttributeH hAttr);
2959
GUInt64 CPL_DLL GDALAttributeGetTotalElementsCount(GDALAttributeH hAttr);
2960
size_t CPL_DLL GDALAttributeGetDimensionCount(GDALAttributeH hAttr);
2961
GUInt64 CPL_DLL *
2962
GDALAttributeGetDimensionsSize(GDALAttributeH hAttr,
2963
                               size_t *pnCount) CPL_WARN_UNUSED_RESULT;
2964
GDALExtendedDataTypeH CPL_DLL GDALAttributeGetDataType(GDALAttributeH hAttr)
2965
    CPL_WARN_UNUSED_RESULT;
2966
GByte CPL_DLL *GDALAttributeReadAsRaw(GDALAttributeH hAttr,
2967
                                      size_t *pnSize) CPL_WARN_UNUSED_RESULT;
2968
void CPL_DLL GDALAttributeFreeRawResult(GDALAttributeH hAttr, GByte *raw,
2969
                                        size_t nSize);
2970
const char CPL_DLL *GDALAttributeReadAsString(GDALAttributeH hAttr);
2971
int CPL_DLL GDALAttributeReadAsInt(GDALAttributeH hAttr);
2972
int64_t CPL_DLL GDALAttributeReadAsInt64(GDALAttributeH hAttr);
2973
double CPL_DLL GDALAttributeReadAsDouble(GDALAttributeH hAttr);
2974
char CPL_DLL **
2975
GDALAttributeReadAsStringArray(GDALAttributeH hAttr) CPL_WARN_UNUSED_RESULT;
2976
int CPL_DLL *GDALAttributeReadAsIntArray(GDALAttributeH hAttr, size_t *pnCount)
2977
    CPL_WARN_UNUSED_RESULT;
2978
int64_t CPL_DLL *
2979
GDALAttributeReadAsInt64Array(GDALAttributeH hAttr,
2980
                              size_t *pnCount) CPL_WARN_UNUSED_RESULT;
2981
double CPL_DLL *
2982
GDALAttributeReadAsDoubleArray(GDALAttributeH hAttr,
2983
                               size_t *pnCount) CPL_WARN_UNUSED_RESULT;
2984
int CPL_DLL GDALAttributeWriteRaw(GDALAttributeH hAttr, const void *, size_t);
2985
int CPL_DLL GDALAttributeWriteString(GDALAttributeH hAttr, const char *);
2986
int CPL_DLL GDALAttributeWriteStringArray(GDALAttributeH hAttr, CSLConstList);
2987
int CPL_DLL GDALAttributeWriteInt(GDALAttributeH hAttr, int);
2988
int CPL_DLL GDALAttributeWriteIntArray(GDALAttributeH hAttr, const int *,
2989
                                       size_t);
2990
int CPL_DLL GDALAttributeWriteInt64(GDALAttributeH hAttr, int64_t);
2991
int CPL_DLL GDALAttributeWriteInt64Array(GDALAttributeH hAttr, const int64_t *,
2992
                                         size_t);
2993
int CPL_DLL GDALAttributeWriteDouble(GDALAttributeH hAttr, double);
2994
int CPL_DLL GDALAttributeWriteDoubleArray(GDALAttributeH hAttr, const double *,
2995
                                          size_t);
2996
bool CPL_DLL GDALAttributeRename(GDALAttributeH hAttr, const char *pszNewName);
2997
2998
void CPL_DLL GDALDimensionRelease(GDALDimensionH hDim);
2999
void CPL_DLL GDALReleaseDimensions(GDALDimensionH *dims, size_t nCount);
3000
const char CPL_DLL *GDALDimensionGetName(GDALDimensionH hDim);
3001
const char CPL_DLL *GDALDimensionGetFullName(GDALDimensionH hDim);
3002
const char CPL_DLL *GDALDimensionGetType(GDALDimensionH hDim);
3003
const char CPL_DLL *GDALDimensionGetDirection(GDALDimensionH hDim);
3004
GUInt64 CPL_DLL GDALDimensionGetSize(GDALDimensionH hDim);
3005
GDALMDArrayH CPL_DLL GDALDimensionGetIndexingVariable(GDALDimensionH hDim)
3006
    CPL_WARN_UNUSED_RESULT;
3007
int CPL_DLL GDALDimensionSetIndexingVariable(GDALDimensionH hDim,
3008
                                             GDALMDArrayH hArray);
3009
bool CPL_DLL GDALDimensionRename(GDALDimensionH hDim, const char *pszNewName);
3010
3011
CPL_C_END
3012
3013
#endif /* ndef GDAL_H_INCLUDED */