Skip to content
Back to skills

Gdal Knowledge Patch

ASecurity

GDAL

  • 25 stars
  • 0 votes
  • 0 copies
  • 8 views
  • Added September 5, 2026
developmentpythongojavac++c#sqlexpressawsazureapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill gdal-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gdal Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gdal Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-gdal-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-gdal-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gdal-knowledge-patch
description: GDAL
version: "3.13.2"
license: MIT
metadata:
  author: Nevaberry
---


# GDAL compatibility skill

Load this skill for GDAL application migrations, custom drivers, command pipelines,
raster and vector processing, multidimensional data, cloud access, and bindings or builds.
The quick reference highlights migration-sensitive behavior and common operations.
Use the topic references for complete option details, format-specific behavior, and examples.

## Reference index

| Reference | Topics |
| --- | --- |
| [Migrations and Core API](references/migrations-and-core-api.md) | Driver interfaces, constness, return values, removals, schemas, capabilities, configuration, algorithm API |
| [CLI and Pipelines](references/cli-and-pipelines.md) | Command migrations, nested pipelines, inspection output, validation, vector conversion, utility scripts |
| [Raster Processing](references/raster-processing.md) | Warping, nodata, resampling, overviews, VRT expressions, terrain, rasterization, statistics |
| [Raster Formats](references/raster-formats.md) | GeoTIFF, COG, LIBERTIFF, GTI, STAC, imagery, scientific formats, raster services |
| [Vector Formats and Databases](references/vector-formats-and-databases.md) | Arrow, Parquet, ADBC, GeoPackage, SQL, file geodatabases, XML, JSON, CAD, tables |
| [Multidimensional Data and Georeferencing](references/multidimensional-and-georeferencing.md) | Array views, netCDF, Zarr, HDF, coordinate systems, epochs, geolocation |
| [Virtual Filesystems and Cloud](references/virtual-filesystems-and-cloud.md) | VSI handles, archives, memory files, HTTP, S3, Azure, Google Cloud Storage |
| [Bindings, Build, and Packaging](references/bindings-build-and-packaging.md) | Python, NumPy, Java, C#, build dependencies, plugins, packages, source downloads |

## Breaking API changes and deprecations

Use the canonical declarations in `gcore/gdal_fwd.h` instead of downstream
redeclarations of GDAL opaque types. `DEBUG` builds use stricter type aliases.

For raster driver geotransform overrides, `GDALGeoTransform` wraps a
`std::array<double, 6>` and replaces the six-double pointer parameter.
The getter needs a trailing `const` in GDAL 3.12.

```cpp
CPLErr GetGeoTransform(GDALGeoTransform &gt) const override;
CPLErr SetGeoTransform(const GDALGeoTransform &gt) override;
```

- `OGRLayer::GetExtent()` and `GetExtent3D()` are nonvirtual and take `bool bForce`; move overrides to `IGetExtent(int, OGREnvelope *, bool)` and `IGetExtent3D(int, OGREnvelope3D *, bool)`.
- `SetSpatialFilter()` and `SetSpatialFilterRect()` are nonvirtual, return `OGRErr`, and validate geometry-field indices. Move driver overrides to `ISetSpatialFilter(int, const OGRGeometry *)` and check returned errors.
- `GDALDataset::ICreateLayer()` receives an optional `const OGRGeomFieldDefn *` carrying geometry type, spatial reference, and coordinate precision. The reference documents its declaration and the older spatial-reference parameter.
- `GDALMajorObject::GetMetadata()` and `GDALGetMetadata()` return `CSLConstList`; use that type for stored results. `SetMetadata()` takes `CSLConstList` and still accepts mutable lists.
- Update `GDALDataset::Close()` overrides to take `GDALProgressFunc pfnProgress` and `void *pProgressData`; both accept `nullptr`.
- Point mutation functions such as `OGR_G_SetPoint_2D` now return `OGRErr`; check the status and update function pointer declarations. The reference lists every affected function.
- Replace `MIN`, `MAX`, and `ABS` from `cpl_port.h` with `CPL_MIN`, `CPL_MAX`, and `CPL_ABS`.
- `GDALDestroyDriverManager()` and `OGRCleanupAll()` are deprecated. Update applications that call them at shutdown.

`GDALClose()` and `GDALFlushCache()` return `CPLErr`. A write can fail while
the driver finishes a file, so check the status of `GDALClose(output)`.
Driver metadata includes `DCAP_CREATE_ONLY_VISIBLE_AT_CLOSE_TIME` and
`DCAP_REOPEN_AFTER_WRITE_REQUIRED` for output visibility and read-back requirements.

## Command migrations and script output

Call `buffer`, `explode-collections`, `make-valid`, `segmentize`, `simplify`,
and `swap-xy` directly under `gdal vector`. The old `gdal vector geom` paths
work in 3.12 and are removed in 3.13. Replace `gdal vector geom set-type`
with `gdal vector set-geom-type`.

- `gdal raster info`, `gdal vector info`, and `gdal vsi list` default to text in the CLI and JSON through the API. Scripts parsing JSON should request it explicitly.
- The `gdal` CLI writes progress bars to standard output by default. Pass `--quiet` or `-q` for output without the progress bar; writing to `/vsistdout/` automatically enables quiet mode.
- Several unified arguments changed from `--src`/`--dst` to `--input`/`--output`; the CLI and C, C++, and Python APIs still accept the old names.
- Use `gdal vector sql --update` for in-place modifications, replacing deprecated `gdal vector info --update`.
- For `gdal raster update`, use `--input` in place of the removed `--dataset` alias.
- Use `gdal raster as-features` in place of the removed optional `gdal2ogr` executable.

```sh
gdal raster info --format=json input.tif
gdal vector sql --update parcels.gpkg --sql "UPDATE parcels SET status = 'active' WHERE status IS NULL"
```

## Raster access, numeric types and changed defaults

Account for `GDT_Float16` and `GDT_CFloat16` when dispatching on a band's data type.
If native scalar half precision is unsupported by the caller, request a
`GDT_Float32` buffer from `RasterIO()`.

RasterIO and VRT resampling operate in the output buffer type by default: a non-nearest
`RasterIO()` read of a Byte band into a Float32 buffer can return fractions.
To disable buffer-type resampling:

```cpp
GDALRasterIOExtraArg args;
INIT_RASTERIO_EXTRA_ARG(args);
args.bOperateInBufType = false;
```

- `gdal_translate` copies source nodata only if the output type represents it exactly; check output metadata when converting to a narrower type.
- `gdalbuildvrt -separate` adds every band of every input by default. Use `-b 1` to keep one band per input.
- `ComputeRasterMinMax()`, `ComputeStatistics()`, and `GetHistogram()` account for mask bands.
- Integer `ComputeRasterMinMax()` and `GetHistogram()` use exact nodata matching.
- `gdal_translate -scale` defaults the destination maximum to `255`; give explicit destination bounds when reproducing an older `255.999` result.

## Restricted sources and driver changes

Raw file access through `VRTRawRasterBand` is restricted by default. If a VRT
cannot open its raw source, check the `vrtrawrasterband_restricted_access` rules.
Build without raw bands using `-DGDAL_VRT_ENABLE_RAWRASTERBAND=OFF`, or disable
them at runtime with `GDAL_VRT_ENABLE_RAWRASTERBAND=NO`.

- Opening a `MEM:::` name containing an in-process buffer address requires `GDAL_MEM_ENABLE_OPEN=YES` at build time or as a configuration option. The raster-processing reference also gives the zero-band MEM dataset and `AddBand()` migration path; keep the buffer alive until closure.
- `Memory` is a deprecated alias for `MEM`, which supports vector, raster, and multidimensional datasets.
- `FileGDB` delegates creation and update to `OpenFileGDB`; `CREATE_MULTIPATCH=YES` provides compatibility with the FileGDB multipatch writer.
- `MRF_ENABLE_CACHING` replaces `MRF_BYPASSCACHING`; set the new environment variable to enable caching.
- The PDF writer no longer supports `GEO_ENCODING=OGC_BP`; remove that creation option.
- Driver removals, restored readers, removed writers, and out-of-tree driver locations are detailed in the core and format references.

## Warping, nodata and overviews

In GDAL 3.13.0, `gdalwarp` fails for `INIT_DEST=NO_DATA` without destination
nodata. `RESET_DEST_PIXELS=YES` clears the entire existing output to destination
nodata or zero and is supported by `gdalwarp` and `gdal raster reproject`.

- When a warp source has nodata and a per-dataset mask, the warper uses nodata, ignores the mask, and warns.
- With `UNIFIED_SRC_NODATA=YES`, a nodata match in one source band alone does not invalidate a multiband source pixel.
- `gdal raster reproject` defaults to `ALL_CPUS` for `--num-threads`; use `-j 1` for one thread.
- `gdalwarp -tps` defaults to `-wo SOURCE_EXTRA=5`.
- `gdal raster reproject --like` lets a reference raster define the target grid.
- `gdaladdo image.tif` can rebuild existing levels without listing factors and can reuse saved GeoTIFF `RESAMPLING` metadata when `-r` is omitted.
- Rebuild stored RMS overviews with 3.12.3 to apply the corrected normalization.

```sh
gdal raster reproject --like reference.tif input.tif aligned.tif
gdalwarp -wo RESET_DEST_PIXELS=YES input.tif existing.tif
```

## Pipelines and raster calculations

`gdal pipeline` combines raster and vector steps, supports nested pipelines,
and offers `tee` for a branch while the main pipeline continues. An `external`
step can run a command outside GDAL. Put `_` in an input list to use the previous
step's dataset in that position.

- `--help` shows help for the last pipeline step.
- `gdal raster calc` requires input datasets, accepts commas inside one formula argument, handles nodata, and supports `--flatten`.
- Use `--dialect=builtin` to compute one band from all bands of one input, or `--dialect=muparser` for muparser expressions.
- A raster calculation can consume nested pipeline inputs. Named inputs must have distinct, valid identifiers for use in formulas.
- Raster `mosaic` and `stack` accept nested pipeline results. A `tile` step can consume anonymous `materialize --format COG` output.
- Call `GDALAlgorithm::Run()` at most once per instance. Cancellation through a progress callback emits `CE_Failure`.

```sh
gdal raster calc -i A=a.tif -i B=b.tif '--calc=sum(A,B)' -o sum.tif
gdal raster pipeline read input.tif '!' materialize --format COG '!' tile tiles
```

## Raster creation and virtual processing

- COG creation supports `INTERLEAVE=BAND` and `INTERLEAVE=TILE`; `GDALDriver::Create()` supports random-write COG creation.
- Opening a COG for update requires `IGNORE_COG_LAYOUT_BREAK=YES` because edits can break its optimized layout.
- Native VRT expressions use `muparser`; advanced expressions can use the optional header-only `exprtk` dependency. The `reclassify` pixel function remaps values.
- A nested `<VRTDataset>` can replace `<SourceFilename>` inside `<SimpleSource>` or `<ComplexSource>`.
- `VRTProcessedDataset` supports processing steps and `<OutputBands>` for output band count and data type.
- GTI can select tile features with a SQL query and supports `SRS_BEHAVIOR=OVERRIDE` and `SRS_BEHAVIOR=REPROJECT`.

## Vector schemas, Arrow and SQL

- `OGR_SCHEMA` overrides detected schemas in CSV, GML, and SQLite. Use layer name `*` across layers and `srcType` or `srcSubType` to match source field types.
- Pass `DATETIME_AS_STRING=YES` to `OGRLayer::GetArrowStream()` for date-time strings; the Arrow translation path uses it for GeoPackage and FlatGeobuf to preserve source time zones.
- Arrow and Parquet support `LISTS_AS_STRING_JSON=YES` for exposing list columns as JSON strings.
- The Parquet driver supports update mode and `COMPRESSION_LEVEL`; reading and writing the Parquet `GEOMETRY` type requires libarrow 21 or later.
- New GeoPackages default to version 1.4; set an explicit creation version for consumers requiring older GeoPackages.
- `NOT IN` and `NOT LIKE` propagate NULL. To retain NULL rows, use `WHERE foo IS NULL OR foo NOT IN ('bar')` or the corresponding `NOT LIKE` condition.
- `ogr2ogr` fails if it cannot create an output field unless error skipping is enabled. Conversion warns about unsupported curve, Z, or M geometries unless quiet mode is enabled.

## Multidimensional data and coordinate operations

- `GDALDataset::AsMDArray()` exposes a classic raster as an array; `GDALMDArray::AsClassicDataset()` supports attribute-based band metadata.
- `gdal mdim mosaic` mosaics multidimensional datasets and accepts dimensions without indexing variables.
- netCDF and Zarr default `LIST_ALL_ARRAYS` to `NO`; request `LIST_ALL_ARRAYS=YES` for the full list.
- Zarr opens Kerchunk JSON or Parquet reference stores and direct `.zarray`, `.zgroup`, `.zmetadata`, and `zarr.json` entry points. Check `Close()` for write failures.
- Zarr v3 supports consolidated metadata, `sharding_indexed`, `crc32c`, `vlen-utf8`, and multidimensional overviews; format-specific conditions are in the reference.
- The time-aware overload of `OGRCoordinateTransformation::Transform()` and `TransformWithErrorCodes()` return `FALSE` if any point fails; inspect `pabSuccess[]` or `panErrorCodes[]` for individual outcomes.
- Use `-to ALLOW_BALLPARK=NO` and `-to ONLY_BEST=YES` in `gdalwarp`; `ogr2ogr` accepts these through `-ct_opt`.

## VSI, cloud access and bindings

- `/vsis3/` supports IAM Identity Center SSO, directory buckets, and `credential_process` profiles. Custom `AWS_S3_ENDPOINT` values can include `http://` or `https://`.
- Object storage handlers normalize `/./` and `/../` by default; `GDAL_HTTP_PATH_VERBATIM=YES` preserves the literal path.
- `GDAL_HTTP_MAX_CACHED_CONNECTIONS` and `GDAL_HTTP_MAX_TOTAL_CONNECTIONS` cap curl connection counts.
- `GDAL_CACHEMAX`, `CPL_VSIL_CURL_CACHE_SIZE`, and `CPL_VSIL_CURL_CHUNK_SIZE` accept explicit units.
- `/vsicurl/` drops `Authorization` on redirects to another host; use a redirect target that can authorize independently.
- Use `osgeo.gdal.VSIFile` for Python VSI access; importing `osgeo.gdal_fsspec` registers VSI handlers with fsspec.
- Python dataset context managers invalidate dataset-owned bands, layers, masks, and overviews on closure; use them within the block.
- Python exception settings are shared across `gdal`, `ogr`, and `osr`; select `gdal.UseExceptions()` or `gdal.DontUseExceptions()`, or use scoped `gdal.ExceptionMgr()`.

Generated Python algorithm functions accept keyword arguments and a `progress=` callback:

```python
from osgeo import gdal

gdal.alg.raster.convert(
    input="in.tif", output="out.tif", progress=gdal.TermProgress_nocb
)
```

For Conda-forge, `gdal` supplies Python bindings and utilities and pulls in
`libgdal-core`. GeoArrow IPC and GeoParquet support require the separate
`libgdal-arrow-parquet` package, which the `libgdal` metapackage does not include.

```sh
conda install -c conda-forge gdal libgdal-arrow-parquet
```

Files in this skill

  • SKILL.md10.2 KB
  • coverage.json2.3 KB
  • references/bindings-build-and-packaging.md6.2 KB
  • references/cli-and-pipelines.md11.5 KB
  • references/migrations-and-core-api.md10.2 KB
  • references/multidimensional-and-georeferencing.md5.1 KB
  • references/raster-formats.md10.4 KB
  • references/raster-processing.md9.3 KB
  • references/vector-formats-and-databases.md13.3 KB
  • references/virtual-filesystems-and-cloud.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.