Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.12.3] 2026-03-21

### Added
- GDAL 3.12.3

## [3.12.2] 2026-02-11

### Added
Expand Down
2 changes: 1 addition & 1 deletion deps/libgdal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/libgdal"

GDAL_VERSION=3.12.2
GDAL_VERSION=3.12.3
GDAL_VERSION_SUFFIX=
dir_gdal=./gdal
dir_formats_gyp=./gyp-formats
Expand Down
4 changes: 2 additions & 2 deletions deps/libgdal/gdal/CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: Please cite this software using these metadata or in the CITATION file.
type: software
title: GDAL
version: 3.12.2
date-released: 2026-02-03
version: 3.12.3
date-released: 2026-03-17
doi: 10.5281/zenodo.5884351
abstract: GDAL is a translator library for raster and vector geospatial data
formats that is released under an MIT style Open Source License by the Open
Expand Down
2 changes: 1 addition & 1 deletion deps/libgdal/gdal/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12.2
3.12.3
4 changes: 2 additions & 2 deletions deps/libgdal/gdal/alg/gdal_homography.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ static void *GDALCreateSimilarHomographyTransformer(void *hTransformArg,
double homography[9];
for (int i = 0; i < 3; i++)
{
homography[3 * i + 1] = psInfo->padfForward[3 * i + 1] / dfRatioX;
homography[3 * i + 2] = psInfo->padfForward[3 * i + 2] / dfRatioY;
homography[3 * i + 1] = psInfo->padfForward[3 * i + 1] * dfRatioX;
homography[3 * i + 2] = psInfo->padfForward[3 * i + 2] * dfRatioY;
homography[3 * i] = psInfo->padfForward[3 * i];
}
psInfo = static_cast<HomographyTransformInfo *>(
Expand Down
26 changes: 17 additions & 9 deletions deps/libgdal/gdal/alg/gdalwarper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,15 @@ CPLErr CPL_STDCALL GDALCreateAndReprojectImage(
int nPixels = 0;
int nLines = 0;

if (GDALSuggestedWarpOutput(hSrcDS, GDALGenImgProjTransform, hTransformArg,
adfDstGeoTransform, &nPixels,
&nLines) != CE_None)
return CE_Failure;
CPLErr eErr =
GDALSuggestedWarpOutput(hSrcDS, GDALGenImgProjTransform, hTransformArg,
adfDstGeoTransform, &nPixels, &nLines);

GDALDestroyGenImgProjTransformer(hTransformArg);

if (eErr != CE_None)
return eErr;

/* -------------------------------------------------------------------- */
/* Create the output file. */
/* -------------------------------------------------------------------- */
Expand All @@ -292,9 +294,9 @@ CPLErr CPL_STDCALL GDALCreateAndReprojectImage(
/* -------------------------------------------------------------------- */
/* Perform the reprojection. */
/* -------------------------------------------------------------------- */
CPLErr eErr = GDALReprojectImage(
hSrcDS, pszSrcWKT, hDstDS, pszDstWKT, eResampleAlg, dfWarpMemoryLimit,
dfMaxError, pfnProgress, pProgressArg, psOptions);
eErr = GDALReprojectImage(hSrcDS, pszSrcWKT, hDstDS, pszDstWKT,
eResampleAlg, dfWarpMemoryLimit, dfMaxError,
pfnProgress, pProgressArg, psOptions);

GDALClose(hDstDS);

Expand Down Expand Up @@ -371,6 +373,11 @@ CPLErr GDALWarpNoDataMasker(void *pMaskFuncArg, int nBandCount,
*ppImageData, // Already a GByte *.
panValidityMask, pbOutAllValid);

case GDT_Int8:
return GDALWarpNoDataMaskerT(
padfNoData, nPixels, reinterpret_cast<int8_t *>(*ppImageData),
panValidityMask, pbOutAllValid);

case GDT_Int16:
return GDALWarpNoDataMaskerT(
padfNoData, nPixels, reinterpret_cast<GInt16 *>(*ppImageData),
Expand Down Expand Up @@ -1756,8 +1763,6 @@ void CPL_STDCALL GDALWarpResolveWorkingDataType(GDALWarpOptions *psOptions)
return;
}

psOptions->eWorkingDataType = GDT_Byte;

// If none of the provided input nodata values can be represented in the
// data type of the corresponding source band, ignore them.
if (psOptions->hSrcDS && psOptions->padfSrcNoDataReal)
Expand Down Expand Up @@ -1843,6 +1848,9 @@ void CPL_STDCALL GDALWarpResolveWorkingDataType(GDALWarpOptions *psOptions)
}
}

if (psOptions->eWorkingDataType == GDT_Unknown)
psOptions->eWorkingDataType = GDT_Byte;

const bool bApplyVerticalShift = CPLFetchBool(
psOptions->papszWarpOptions, "APPLY_VERTICAL_SHIFT", false);
if (bApplyVerticalShift &&
Expand Down
9 changes: 9 additions & 0 deletions deps/libgdal/gdal/alg/gdalwarpkernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ static CPLErr GWKBilinearNoMasksOrDstDensityOnlyDouble(GDALWarpKernel *poWK);
#endif
static CPLErr GWKCubicNoMasksOrDstDensityOnlyShort(GDALWarpKernel *poWK);
static CPLErr GWKCubicSplineNoMasksOrDstDensityOnlyShort(GDALWarpKernel *poWK);
static CPLErr GWKNearestInt8(GDALWarpKernel *poWK);
static CPLErr GWKNearestShort(GDALWarpKernel *poWK);
static CPLErr GWKNearestUnsignedShort(GDALWarpKernel *poWK);
static CPLErr GWKNearestNoMasksOrDstDensityOnlyFloat(GDALWarpKernel *poWK);
Expand Down Expand Up @@ -1253,6 +1254,9 @@ CPLErr GDALWarpKernel::PerformWarp()
bNoMasksOrDstDensityOnly)
return GWKBilinearNoMasksOrDstDensityOnlyUShort(this);

if (eWorkingDataType == GDT_Int8 && eResample == GRA_NearestNeighbour)
return GWKNearestInt8(this);

if (eWorkingDataType == GDT_Int16 && eResample == GRA_NearestNeighbour)
return GWKNearestShort(this);

Expand Down Expand Up @@ -6660,6 +6664,11 @@ static CPLErr GWKCubicSplineNoMasksOrDstDensityOnlyUShort(GDALWarpKernel *poWK)
GWKResampleNoMasksOrDstDensityOnlyThread<GUInt16, GRA_CubicSpline>);
}

static CPLErr GWKNearestInt8(GDALWarpKernel *poWK)
{
return GWKRun(poWK, "GWKNearestInt8", GWKNearestThread<int8_t>);
}

static CPLErr GWKNearestShort(GDALWarpKernel *poWK)
{
return GWKRun(poWK, "GWKNearestShort", GWKNearestThread<GInt16>);
Expand Down
11 changes: 7 additions & 4 deletions deps/libgdal/gdal/alg/viewshed/viewshed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,14 @@ GDALDatasetH GDALViewshedGenerate(
"dfInvisibleVal out of range. Must be [0, 255].");
return nullptr;
}
if (!GDALIsValueInRange<uint8_t>(dfOutOfRangeVal))
if (oOpts.outputMode == viewshed::OutputMode::Normal)
{
CPLError(CE_Failure, CPLE_AppDefined,
"dfOutOfRangeVal out of range. Must be [0, 255].");
return nullptr;
if (!GDALIsValueInRange<uint8_t>(dfOutOfRangeVal))
{
CPLError(CE_Failure, CPLE_AppDefined,
"dfOutOfRangeVal out of range. Must be [0, 255].");
return nullptr;
}
}
oOpts.visibleVal = dfVisibleVal;
oOpts.invisibleVal = dfInvisibleVal;
Expand Down
2 changes: 1 addition & 1 deletion deps/libgdal/gdal/apps/gdal_grid_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ GDALGridOptionsGetParser(GDALGridOptions *psOptions,
.help(_("Set the size of the output file."));

argParser->add_argument("-tr")
.metavar("<xres> <yes>")
.metavar("<xres> <yres>")
.nargs(2)
.scan<'g', double>()
.help(_("Set target resolution."));
Expand Down
2 changes: 1 addition & 1 deletion deps/libgdal/gdal/apps/gdal_translate_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2944,7 +2944,7 @@ GDALTranslateOptionsGetParser(GDALTranslateOptions *psOptions,
.help(_("Set the size of the output file."));

argParser->add_argument("-tr")
.metavar("<xres> <yes>")
.metavar("<xres> <yres>")
.nargs(2)
.scan<'g', double>()
.help(_("Set target resolution."));
Expand Down
3 changes: 3 additions & 0 deletions deps/libgdal/gdal/apps/gdalalg_abstract_pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ class GDALPipelineStepAlgorithm /* non final */ : public GDALAlgorithm
void AddVectorInputArgs(bool hiddenForCLI);
void AddVectorOutputArgs(bool hiddenForCLI,
bool shortNameOutputLayerAllowed);
using GDALAlgorithm::AddOutputLayerNameArg;
void AddOutputLayerNameArg(bool hiddenForCLI,
bool shortNameOutputLayerAllowed);

private:
bool RunImpl(GDALProgressFunc pfnProgress, void *pProgressData) override;
Expand Down
20 changes: 15 additions & 5 deletions deps/libgdal/gdal/apps/gdalalg_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,7 @@ void GDALPipelineStepAlgorithm::AddVectorOutputArgs(
}
if (m_constructorOptions.addOutputLayerNameArgument)
{
AddArg(GDAL_ARG_NAME_OUTPUT_LAYER,
shortNameOutputLayerAllowed ? 'l' : 0, _("Output layer name"),
&m_outputLayerName)
.AddHiddenAlias("nln") // For ogr2ogr nostalgic people
.SetHiddenForCLI(hiddenForCLI);
AddOutputLayerNameArg(hiddenForCLI, shortNameOutputLayerAllowed);
}
if (m_constructorOptions.addSkipErrorsArgument)
{
Expand All @@ -235,6 +231,20 @@ void GDALPipelineStepAlgorithm::AddVectorOutputArgs(
}
}

/************************************************************************/
/* GDALPipelineStepAlgorithm::AddOutputLayerNameArg() */
/************************************************************************/

void GDALPipelineStepAlgorithm::AddOutputLayerNameArg(
bool hiddenForCLI, bool shortNameOutputLayerAllowed)
{
AddArg(GDAL_ARG_NAME_OUTPUT_LAYER, shortNameOutputLayerAllowed ? 'l' : 0,
_("Output layer name"),
&m_outputLayerName)
.AddHiddenAlias("nln") // For ogr2ogr nostalgic people
.SetHiddenForCLI(hiddenForCLI);
}

/************************************************************************/
/* GDALPipelineStepAlgorithm::RunImpl() */
/************************************************************************/
Expand Down
8 changes: 6 additions & 2 deletions deps/libgdal/gdal/apps/gdalalg_raster_calc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ struct SourceProperties
int nBands{0};
int nX{0};
int nY{0};
bool hasGT{false};
GDALGeoTransform gt{};
std::unique_ptr<OGRSpatialReference, OGRSpatialReferenceReleaser> srs{
nullptr};
Expand Down Expand Up @@ -777,7 +778,7 @@ static std::unique_ptr<GDALDataset> GDALCalcCreateVRTDerived(
out.nBands = 1;
out.srs.reset(ds->GetSpatialRef() ? ds->GetSpatialRef()->Clone()
: nullptr);
ds->GetGeoTransform(out.gt);
out.hasGT = ds->GetGeoTransform(out.gt) == CE_None;
}

CPLXMLTreeCloser root(CPLCreateXMLNode(nullptr, CXT_Element, "VRTDataset"));
Expand Down Expand Up @@ -847,7 +848,10 @@ static std::unique_ptr<GDALDataset> GDALCalcCreateVRTDerived(
{
return nullptr;
};
ds->SetGeoTransform(out.gt);
if (out.hasGT)
{
ds->SetGeoTransform(out.gt);
}
if (out.srs)
{
ds->SetSpatialRef(out.srs.get());
Expand Down
5 changes: 5 additions & 0 deletions deps/libgdal/gdal/apps/gdalalg_raster_contour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ GDALRasterContourAlgorithm::GDALRasterContourAlgorithm(bool standaloneStep)
AddRasterInputArgs(false, false);
AddVectorOutputArgs(false, false);
}
else
{
AddOutputLayerNameArg(/* hiddenForCLI = */ false,
/* shortNameOutputLayerAllowed = */ false);
}

// gdal_contour specific options
AddBandArg(&m_band).SetDefault(1);
Expand Down
1 change: 1 addition & 0 deletions deps/libgdal/gdal/apps/gdalalg_raster_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ GDALRasterEditAlgorithm::GDALRasterEditAlgorithm(bool standaloneStep)
&m_dataset, GDAL_OF_RASTER | GDAL_OF_UPDATE)
.SetPositional()
.SetRequired();
AddOpenOptionsArg(&m_openOptions);
AddArg("auxiliary", 0,
_("Ask for an auxiliary .aux.xml file to be edited"),
&m_readOnly)
Expand Down
5 changes: 5 additions & 0 deletions deps/libgdal/gdal/apps/gdalalg_raster_polygonize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ GDALRasterPolygonizeAlgorithm::GDALRasterPolygonizeAlgorithm(
AddRasterInputArgs(false, false);
AddVectorOutputArgs(false, false);
}
else
{
AddOutputLayerNameArg(/* hiddenForCLI = */ false,
/* shortNameOutputLayerAllowed = */ false);
}

// gdal_polygonize specific options
AddBandArg(&m_band).SetDefault(m_band);
Expand Down
4 changes: 1 addition & 3 deletions deps/libgdal/gdal/apps/gdalalg_raster_viewshed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ GDALRasterViewshedAlgorithm::GDALRasterViewshedAlgorithm(bool standaloneStep)
_("Pixel value to set for the cells that fall outside of the range "
"specified by the observer location and the maximum distance"),
&m_opts.outOfRangeVal)
.SetDefault(m_opts.outOfRangeVal)
.SetMinValueIncluded(0)
.SetMaxValueIncluded(255);
.SetDefault(m_opts.outOfRangeVal);
AddArg("dst-nodata", 0,
_("The value to be set for the cells in the output raster that have "
"no data."),
Expand Down
18 changes: 13 additions & 5 deletions deps/libgdal/gdal/apps/gdalalg_vector_select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ GDALVectorSelectAlgorithm::GDALVectorSelectAlgorithm(bool standaloneStep)
: GDALVectorPipelineStepAlgorithm(NAME, DESCRIPTION, HELP_URL,
standaloneStep)
{
if (!standaloneStep)
{
AddOutputLayerNameArg(/* hiddenForCLI = */ false,
/* shortNameOutputLayerAllowed = */ false);
}
AddActiveLayerArg(&m_activeLayer);
AddArg("fields", 0, _("Fields to select (or exclude if --exclude)"),
&m_fields)
Expand Down Expand Up @@ -90,11 +95,14 @@ class GDALVectorSelectAlgorithmLayer final
}

public:
explicit GDALVectorSelectAlgorithmLayer(OGRLayer &oSrcLayer)
explicit GDALVectorSelectAlgorithmLayer(
OGRLayer &oSrcLayer, const std::string &osOutputLayerName)
: GDALVectorPipelineOutputLayer(oSrcLayer),
m_poFeatureDefn(new OGRFeatureDefn(oSrcLayer.GetName()))
m_poFeatureDefn(new OGRFeatureDefn(osOutputLayerName.empty()
? oSrcLayer.GetName()
: osOutputLayerName.c_str()))
{
SetDescription(oSrcLayer.GetDescription());
SetDescription(m_poFeatureDefn->GetName());
SetMetadata(oSrcLayer.GetMetadata());
m_poFeatureDefn->SetGeomType(wkbNone);
m_poFeatureDefn->Reference();
Expand Down Expand Up @@ -301,8 +309,8 @@ bool GDALVectorSelectAlgorithm::RunStep(GDALPipelineStepRunContext &)
if (m_activeLayer.empty() ||
m_activeLayer == poSrcLayer->GetDescription())
{
auto poLayer =
std::make_unique<GDALVectorSelectAlgorithmLayer>(*poSrcLayer);
auto poLayer = std::make_unique<GDALVectorSelectAlgorithmLayer>(
*poSrcLayer, m_outputLayerName);
if (m_exclude)
{
poLayer->ExcludeFields(m_fields);
Expand Down
2 changes: 1 addition & 1 deletion deps/libgdal/gdal/apps/gdalbuildvrt_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2202,7 +2202,7 @@ GDALBuildVRTOptionsGetParser(GDALBuildVRTOptions *psOptions,
.help(_("Control the way the output resolution is computed."));

argParser->add_argument("-tr")
.metavar("<xres> <yes>")
.metavar("<xres> <yres>")
.nargs(2)
.scan<'g', double>()
.help(_("Set target resolution."));
Expand Down
5 changes: 3 additions & 2 deletions deps/libgdal/gdal/apps/gdalinfo_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ GDALInfoAppOptionsGetParser(GDALInfoOptions *psOptions,
"system."));

argParser->add_argument("-wkt_format")
.metavar("<WKT1|WKT2|WKT2_2015|WKT2_2018|WKT2_2019>")
.choices("WKT1", "WKT2", "WKT2_2015", "WKT2_2018", "WKT2_2019")
.metavar("<WKT1|WKT1_ESRI|WKT2|WKT2_2015|WKT2_2018|WKT2_2019>")
.choices("WKT1", "WKT1_ESRI", "WKT2", "WKT2_2015", "WKT2_2018",
"WKT2_2019")
.store_into(psOptions->osWKTFormat)
.help(_("WKT format used for SRS."));

Expand Down
Loading
Loading