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