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