Skip to content

Commit ae86dcf

Browse files
authored
update GDAL to 3.11.3 (#227)
* update GDAL to 3.11.3 * add cpl_float.h * add the missing source files * cpl_float exists since 3.5 * include GDAL first * include cpl_float only on GDAL > 3.11
1 parent c6514b6 commit ae86dcf

169 files changed

Lines changed: 6072 additions & 1404 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [3.11.1]
8+
## [3.11.3] 2025-07-13
9+
10+
### Added
11+
- GDAL 3.11.3
912

1013
### Changed
1114
- Fix [mmomtchev/node-gdal-async#221](https://github.com/mmomtchev/node-gdal-async/issues/221):

deps/libgdal.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -eu
55
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
66
cd "$DIR/libgdal"
77

8-
GDAL_VERSION=3.11.0
8+
GDAL_VERSION=3.11.3
99
GDAL_VERSION_SUFFIX=
1010
dir_gdal=./gdal
1111
dir_formats_gyp=./gyp-formats

deps/libgdal/gdal/CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ cff-version: 1.2.0
22
message: Please cite this software using these metadata or in the CITATION file.
33
type: software
44
title: GDAL
5-
version: 3.11.0
6-
date-released: 2025-05-06
5+
version: 3.11.3
6+
date-released: 2025-07-12
77
doi: 10.5281/zenodo.5884351
88
abstract: GDAL is a translator library for raster and vector geospatial data
99
formats that is released under an MIT style Open Source License by the Open

deps/libgdal/gdal/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.11.0
1+
3.11.3

deps/libgdal/gdal/alg/gdal_homography.cpp

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ void *GDALCreateHomographyTransformer(double adfHomography[9])
110110
return psInfo;
111111
}
112112

113+
CPLError(CE_Failure, CPLE_AppDefined,
114+
"GDALCreateHomographyTransformer() failed, because "
115+
"GDALInvHomography() failed");
113116
GDALDestroyHomographyTransformer(psInfo);
114117
return nullptr;
115118
}
@@ -172,14 +175,17 @@ int GDALGCPsToHomography(int nGCPCount, const GDAL_GCP *pasGCPList,
172175
max_geoy = std::max(max_geoy, pasGCPList[i].dfGCPY);
173176
}
174177

175-
double EPS = 1.0e-12;
178+
constexpr double EPSILON = 1.0e-12;
176179

177-
if (std::abs(max_pixel - min_pixel) < EPS ||
178-
std::abs(max_line - min_line) < EPS ||
179-
std::abs(max_geox - min_geox) < EPS ||
180-
std::abs(max_geoy - min_geoy) < EPS)
180+
if (std::abs(max_pixel - min_pixel) < EPSILON ||
181+
std::abs(max_line - min_line) < EPSILON ||
182+
std::abs(max_geox - min_geox) < EPSILON ||
183+
std::abs(max_geoy - min_geoy) < EPSILON)
181184
{
182-
return FALSE; // degenerate in at least one dimension.
185+
CPLError(CE_Failure, CPLE_AppDefined,
186+
"GDALGCPsToHomography() failed: GCPs degenerate in at least "
187+
"one dimension.");
188+
return FALSE;
183189
}
184190

185191
double pl_normalize[9], geo_normalize[9];
@@ -207,6 +213,8 @@ int GDALGCPsToHomography(int nGCPCount, const GDAL_GCP *pasGCPList,
207213
double inv_geo_normalize[9] = {0.0};
208214
if (!GDALInvHomography(geo_normalize, inv_geo_normalize))
209215
{
216+
CPLError(CE_Failure, CPLE_AppDefined,
217+
"GDALGCPsToHomography() failed: GDALInvHomography() failed");
210218
return FALSE;
211219
}
212220

@@ -231,6 +239,10 @@ int GDALGCPsToHomography(int nGCPCount, const GDAL_GCP *pasGCPList,
231239
!GDALApplyHomography(geo_normalize, pasGCPList[i].dfGCPX,
232240
pasGCPList[i].dfGCPY, &geox, &geoy))
233241
{
242+
CPLError(CE_Failure, CPLE_AppDefined,
243+
"GDALGCPsToHomography() failed: GDALApplyHomography() "
244+
"failed on GCP %d.",
245+
i);
234246
return FALSE;
235247
}
236248

@@ -260,10 +272,15 @@ int GDALGCPsToHomography(int nGCPCount, const GDAL_GCP *pasGCPList,
260272
GDALMatrix h_normalized(9, 1);
261273
if (!GDALLinearSystemSolve(AtA, rhs, h_normalized))
262274
{
275+
CPLError(
276+
CE_Failure, CPLE_AppDefined,
277+
"GDALGCPsToHomography() failed: GDALLinearSystemSolve() failed");
263278
return FALSE;
264279
}
265280
if (std::abs(h_normalized(6, 0)) < 1.0e-15)
266281
{
282+
CPLError(CE_Failure, CPLE_AppDefined,
283+
"GDALGCPsToHomography() failed: h_normalized(6, 0) not zero");
267284
return FALSE;
268285
}
269286

@@ -295,6 +312,8 @@ int GDALGCPsToHomography(int nGCPCount, const GDAL_GCP *pasGCPList,
295312
double cross23 = x[2] * y[3] - x[3] * y[2];
296313
if (cross12 * cross23 <= 0.0)
297314
{
315+
CPLError(CE_Failure, CPLE_AppDefined,
316+
"GDALGCPsToHomography() failed: cross12 * cross23 <= 0.0");
298317
return FALSE;
299318
}
300319

@@ -423,7 +442,7 @@ int GDALApplyHomography(const double *padfHomography, double dfPixel,
423442
int GDALInvHomography(const double *padfHIn, double *padfHOut)
424443

425444
{
426-
// Special case - no rotation - to avoid computing determinate
445+
// Special case - no rotation - to avoid computing determinant
427446
// and potential precision issues.
428447
if (padfHIn[2] == 0.0 && padfHIn[4] == 0.0 && padfHIn[1] != 0.0 &&
429448
padfHIn[5] != 0.0 && padfHIn[7] == 0.0 && padfHIn[8] == 0.0 &&
@@ -438,10 +457,10 @@ int GDALInvHomography(const double *padfHIn, double *padfHOut)
438457
padfHOut[6] = 1.0 / padfHIn[6];
439458
padfHOut[7] = 0.0;
440459
padfHOut[8] = 0.0;
441-
return 1;
460+
return TRUE;
442461
}
443462

444-
// Compute determinate.
463+
// Compute determinant.
445464

446465
const double det = padfHIn[1] * padfHIn[5] * padfHIn[6] -
447466
padfHIn[2] * padfHIn[4] * padfHIn[6] +
@@ -454,7 +473,11 @@ int GDALInvHomography(const double *padfHIn, double *padfHOut)
454473
std::max(fabs(padfHIn[4]), fabs(padfHIn[5])));
455474

456475
if (fabs(det) <= 1e-10 * magnitude * magnitude)
457-
return 0;
476+
{
477+
CPLError(CE_Failure, CPLE_AppDefined,
478+
"GDALInvHomography() failed: null determinant");
479+
return FALSE;
480+
}
458481

459482
const double inv_det = 1.0 / det;
460483

@@ -472,7 +495,7 @@ int GDALInvHomography(const double *padfHIn, double *padfHOut)
472495
padfHOut[3] = (padfHIn[0] * padfHIn[4] - padfHIn[1] * padfHIn[3]) * inv_det;
473496
padfHOut[6] = (padfHIn[1] * padfHIn[5] - padfHIn[2] * padfHIn[4]) * inv_det;
474497

475-
return 1;
498+
return TRUE;
476499
}
477500

478501
/************************************************************************/

deps/libgdal/gdal/alg/gdalchecksum.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ int CPL_STDCALL GDALChecksumImage(GDALRasterBandH hBand, int nXOff, int nYOff,
151151
"Checksum value could not be computed due to I/O "
152152
"read error.");
153153
nChecksum = -1;
154-
iYBlock = nYBlocks;
155154
break;
156155
}
157156
const size_t xIters =
@@ -176,6 +175,9 @@ int CPL_STDCALL GDALChecksumImage(GDALRasterBandH hBand, int nXOff, int nYOff,
176175
nChecksum &= 0xffff;
177176
}
178177
}
178+
179+
if (nChecksum < 0)
180+
break;
179181
}
180182

181183
CPLFree(padfLineData);
@@ -285,7 +287,6 @@ int CPL_STDCALL GDALChecksumImage(GDALRasterBandH hBand, int nXOff, int nYOff,
285287
"Checksum value could not be computed due to I/O "
286288
"read error.");
287289
nChecksum = -1;
288-
iYBlock = nYBlocks;
289290
break;
290291
}
291292
const size_t xIters =
@@ -310,6 +311,9 @@ int CPL_STDCALL GDALChecksumImage(GDALRasterBandH hBand, int nXOff, int nYOff,
310311
nChecksum &= 0xffff;
311312
}
312313
}
314+
315+
if (nChecksum < 0)
316+
break;
313317
}
314318

315319
CPLFree(panChunkData);

deps/libgdal/gdal/alg/gdaltransformer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,6 +1952,8 @@ const char *GDALGetGenImgProjTranformerOptionList(void)
19521952
"description for details, assumptions, and defaults. If this "
19531953
"option is set, DST_METHOD=GEOLOC_ARRAY will be assumed if not "
19541954
"set.'/>"
1955+
"<Option name='NUM_THREADS' type='string' "
1956+
"description='Number of threads to use'/>"
19551957
"</OptionList>";
19561958
}
19571959

deps/libgdal/gdal/alg/viewshed/viewshed.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
****************************************************************************/
1313

1414
#include <algorithm>
15+
#include <array>
1516

1617
#include "gdal_alg.h"
1718
#include "gdal_priv_templates.hpp"

deps/libgdal/gdal/apps/data/gdalinfo_output.schema.json

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
"band": {
3535
"type": "integer"
3636
},
37+
"description": {
38+
"type": "string"
39+
},
3740
"block": {
3841
"$ref": "#/definitions/arrayOfTwoIntegers"
3942
},
@@ -43,6 +46,17 @@
4346
"colorInterpretation": {
4447
"type": "string"
4548
},
49+
"noDataValue": {
50+
"anyOf": [
51+
{
52+
"type": "number"
53+
},
54+
{
55+
"type": "string",
56+
"const": "NaN"
57+
}
58+
]
59+
},
4660
"type": {
4761
"enum": [
4862
"Byte",
@@ -52,11 +66,13 @@
5266
"UInt32",
5367
"Int32",
5468
"UInt64",
55-
"Int32",
69+
"Int64",
70+
"Float16",
5671
"Float32",
5772
"Float64",
5873
"CInt16",
5974
"CInt32",
75+
"CFloat16",
6076
"CFloat32",
6177
"CFloat64"
6278
]
@@ -118,6 +134,31 @@
118134
},
119135
"metadata": {
120136
"$ref": "#/definitions/metadata"
137+
},
138+
"colorTable": {
139+
"type": "object",
140+
"properties": {
141+
"entries": {
142+
"type": "array",
143+
"items": {
144+
"type": "array",
145+
"items": {
146+
"type": "integer",
147+
"minItems": 4,
148+
"maxItems": 4
149+
}
150+
}
151+
},
152+
"count": {
153+
"type": "integer"
154+
},
155+
"palette": {
156+
"type": "string"
157+
}
158+
}
159+
},
160+
"rat": {
161+
"type": "object"
121162
}
122163
},
123164
"required": [
@@ -193,6 +234,9 @@
193234
"cornerCoordinates": {
194235
"$ref": "#/definitions/cornerCoordinates"
195236
},
237+
"extent": {
238+
"type": "object"
239+
},
196240
"wgs84Extent": {
197241
"$ref": "https://geojson.org/schema/Geometry.json"
198242
},

deps/libgdal/gdal/apps/data/gdalmdiminfo_output.schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,20 @@
166166
"type": "string",
167167
"enum": [
168168
"String",
169+
"Int8",
169170
"Byte",
170171
"Int16",
171172
"UInt16",
172173
"Int32",
173174
"UInt32",
175+
"Int64",
176+
"UInt64",
177+
"Float16",
174178
"Float32",
175179
"Float64",
176180
"CInt16",
177181
"CInt32",
182+
"CFloat16",
178183
"CFloat32",
179184
"CFloat64"
180185
]

0 commit comments

Comments
 (0)