Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
AbelPau committed Sep 25, 2024
2 parents 0c973a1 + 388d97f commit 324b3cd
Show file tree
Hide file tree
Showing 467 changed files with 19,046 additions and 5,046 deletions.
1 change: 1 addition & 0 deletions .github/workflows/alpine/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RUN apk add \
kealib-dev \
libaec-dev \
libarchive-dev \
libavif-dev \
libdeflate-dev \
libgeotiff-dev \
libheif-dev \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/alpine_32bit/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ RUN apk add \
kealib-dev \
libaec-dev \
libarchive-dev \
libavif-dev \
libdeflate-dev \
libgeotiff-dev \
libheif-dev \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cmake_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ jobs:
mingw-w64-x86_64-geos mingw-w64-x86_64-libspatialite mingw-w64-x86_64-proj
mingw-w64-x86_64-cgal mingw-w64-x86_64-libfreexl mingw-w64-x86_64-hdf5 mingw-w64-x86_64-netcdf mingw-w64-x86_64-poppler mingw-w64-x86_64-podofo mingw-w64-x86_64-postgresql
mingw-w64-x86_64-libgeotiff mingw-w64-x86_64-libpng mingw-w64-x86_64-libtiff mingw-w64-x86_64-openjpeg2
mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-numpy mingw-w64-x86_64-python-pytest mingw-w64-x86_64-python-setuptools mingw-w64-x86_64-python-lxml mingw-w64-x86_64-swig mingw-w64-x86_64-python-psutil mingw-w64-x86_64-blosc
mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-numpy mingw-w64-x86_64-python-pytest mingw-w64-x86_64-python-setuptools mingw-w64-x86_64-python-lxml mingw-w64-x86_64-swig mingw-w64-x86_64-python-psutil mingw-w64-x86_64-blosc mingw-w64-x86_64-libavif
- name: Setup cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: cache
Expand Down Expand Up @@ -429,7 +429,7 @@ jobs:
cfitsio freexl geotiff libjpeg-turbo libpq libspatialite libwebp-base pcre pcre2 postgresql \
sqlite tiledb zstd cryptopp cgal doxygen librttopo libkml openssl xz \
openjdk ant qhull armadillo blas blas-devel libblas libcblas liblapack liblapacke blosc libarchive \
arrow-cpp pyarrow libaec cmake
arrow-cpp pyarrow libaec libavif cmake
- name: Check CMake version
shell: bash -l {0}
run: |
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ jobs:
# SC2129: (style): Consider using { cmd1; cmd2; } >> file instead of individual redirects
run: shellcheck -e SC2086,SC2046,SC2164,SC2054,SC2129 $(find . -name '*.sh' -a -not -name ltmain.sh -a -not -wholename "./autotest/*" -a -not -wholename "./.github/*")

binary_files:
runs-on: ubuntu-latest
steps:

- name: Install Requirements
run: |
sudo apt-get install -y python3 coreutils
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Detect binary files
run: python3 ./scripts/check_binaries.py

linting:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/fedora_rawhide/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RUN dnf install -y clang make diffutils ccache cmake \
armadillo-devel qhull-devel \
hdf-devel hdf5-devel netcdf-devel \
libpq-devel \
libavif-devel \
python3-setuptools python3-pip python3-devel python3-lxml swig \
glibc-gconv-extra

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ubuntu_22.04/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN apt-get update && \
g++ \
git \
gpsbabel \
libavif-dev \
libblosc-dev \
libboost-dev \
libcairo2-dev \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu_22.04/services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ set -ex
##################

# MSSQL: server side
docker rm -f gdal-sql1
docker pull mcr.microsoft.com/mssql/server:2017-latest
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=DummyPassw0rd' -p 1433:1433 --name gdal-sql1 -d mcr.microsoft.com/mssql/server:2017-latest
#docker rm -f gdal-sql1
#docker pull mcr.microsoft.com/mssql/server:2017-latest
#docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=DummyPassw0rd' -p 1433:1433 --name gdal-sql1 -d mcr.microsoft.com/mssql/server:2017-latest

# MySQL 8
docker rm -f gdal-mysql1
Expand Down Expand Up @@ -38,7 +38,7 @@ docker run --name gdal-mongo -p 27018:27017 -d mongo:4.4
sleep 10

# MSSQL
docker exec -t gdal-sql1 /opt/mssql-tools/bin/sqlcmd -l 30 -S localhost -U SA -P DummyPassw0rd -Q "CREATE DATABASE TestDB"
#docker exec -t gdal-sql1 /opt/mssql-tools/bin/sqlcmd -l 30 -S localhost -U SA -P DummyPassw0rd -Q "CREATE DATABASE TestDB"

# MySQL
docker exec gdal-mysql1 sh -c "echo 'CREATE DATABASE test; SELECT Version()' | mysql -uroot -ppasswd"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_22.04/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ AZURE_STORAGE_CONNECTION_STRING=${AZURITE_STORAGE_CONNECTION_STRING} python3 -c
# MongoDB v3
(cd autotest && MONGODBV3_TEST_PORT=27018 MONGODBV3_TEST_HOST=$IP $PYTEST ogr/ogr_mongodbv3.py)

(cd autotest && OGR_MSSQL_CONNECTION_STRING="MSSQL:server=$IP;database=TestDB;driver=ODBC Driver 17 for SQL Server;UID=SA;PWD=DummyPassw0rd" $PYTEST ogr/ogr_mssqlspatial.py)
#(cd autotest && OGR_MSSQL_CONNECTION_STRING="MSSQL:server=$IP;database=TestDB;driver=ODBC Driver 17 for SQL Server;UID=SA;PWD=DummyPassw0rd" $PYTEST ogr/ogr_mssqlspatial.py)

(cd autotest && $PYTEST)
1 change: 1 addition & 0 deletions .github/workflows/ubuntu_24.04/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ RUN apt-get update && \
g++ \
git \
gpsbabel \
libavif-dev \
libblosc-dev \
libboost-dev \
libcairo2-dev \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu_24.04/services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ set -ex
##################

# MSSQL: server side
docker rm -f gdal-sql1
docker pull mcr.microsoft.com/mssql/server:2017-latest
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=DummyPassw0rd' -p 1433:1433 --name gdal-sql1 -d mcr.microsoft.com/mssql/server:2017-latest
#docker rm -f gdal-sql1
#docker pull mcr.microsoft.com/mssql/server:2017-latest
#docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=DummyPassw0rd' -p 1433:1433 --name gdal-sql1 -d mcr.microsoft.com/mssql/server:2017-latest

# MySQL 8
docker rm -f gdal-mysql1
Expand Down Expand Up @@ -38,7 +38,7 @@ docker run --name gdal-mongo -p 27018:27017 -d mongo:4.4
sleep 10

# MSSQL
docker exec -t gdal-sql1 /opt/mssql-tools/bin/sqlcmd -l 30 -S localhost -U SA -P DummyPassw0rd -Q "CREATE DATABASE TestDB"
#docker exec -t gdal-sql1 /opt/mssql-tools/bin/sqlcmd -l 30 -S localhost -U SA -P DummyPassw0rd -Q "CREATE DATABASE TestDB"

# MySQL
docker exec gdal-mysql1 sh -c "echo 'CREATE DATABASE test; SELECT Version()' | mysql -uroot -ppasswd"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu_24.04/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ AZURE_STORAGE_CONNECTION_STRING=${AZURITE_STORAGE_CONNECTION_STRING} python3 -c
# MongoDB v3
(cd autotest && MONGODBV3_TEST_PORT=27018 MONGODBV3_TEST_HOST=$IP $PYTEST ogr/ogr_mongodbv3.py)

(cd autotest && OGR_MSSQL_CONNECTION_STRING="MSSQL:server=$IP;database=TestDB;driver=ODBC Driver 17 for SQL Server;UID=SA;PWD=DummyPassw0rd" $PYTEST ogr/ogr_mssqlspatial.py)
# (cd autotest && OGR_MSSQL_CONNECTION_STRING="MSSQL:server=$IP;database=TestDB;driver=ODBC Driver 17 for SQL Server;UID=SA;PWD=DummyPassw0rd" $PYTEST ogr/ogr_mssqlspatial.py)

(cd autotest && $PYTEST)
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:

jobs:
post_checkout:
- (git --no-pager log --pretty="tformat:%s -- %b" -1 | grep -viqP "skip ci|ci skip") || exit 183
- (git --no-pager log --pretty="tformat:%s -- %b" -1 | paste -s -d " " | grep -viqP "skip ci|ci skip") || exit 183
pre_build:
- ./doc/rtd/pre_build.sh
- cd doc && make doxygen generated_rst_files
Expand Down
1 change: 1 addition & 0 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ INPUT = port \
gcore \
frmts/gdalallregister.cpp \
alg \
alg/viewshed \
frmts/vrt \
apps \
ogr \
Expand Down
3 changes: 3 additions & 0 deletions MIGRATION_GUIDE.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ MIGRATION GUIDE FROM GDAL 3.9 to GDAL 3.10
- Python bindings: Band.GetStatistics() and Band.ComputeStatistics() now
return a None value in case of error (when exceptions are not enabled)

- New color interpretation (GCI_xxxx) items have been added to the GDALColorInterp
enumeration. Code testing color interpretation may need to be adapted.

MIGRATION GUIDE FROM GDAL 3.8 to GDAL 3.9
-----------------------------------------

Expand Down
7 changes: 6 additions & 1 deletion alg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ add_library(
rasterfill.cpp
thinplatespline.cpp
gdal_simplesurf.cpp
viewshed.cpp
viewshed/combiner.cpp
viewshed/cumulative.cpp
viewshed/progress.cpp
viewshed/util.cpp
viewshed/viewshed.cpp
viewshed/viewshed_executor.cpp
gdalgenericinverse.cpp
gdal_interpolateatpoint.cpp
)
Expand Down
3 changes: 2 additions & 1 deletion alg/gdaltransformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3828,7 +3828,8 @@ static CPLXMLNode *GDALSerializeApproxTransformer(void *pTransformArg)
* @param pBaseTransformArg the callback argument for the high precision
* transformer.
* @param dfMaxError the maximum cartesian error in the "output" space that
* is to be accepted in the linear approximation.
* is to be accepted in the linear approximation, evaluated as a Manhattan
* distance.
*
* @return callback pointer suitable for use with GDALApproxTransform(). It
* should be deallocated with GDALDestroyApproxTransformer().
Expand Down
46 changes: 45 additions & 1 deletion alg/gdalwarper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,20 @@ CPLErr GDALWarpDstAlphaMasker(void *pMaskFuncArg, int nBandCount,
* will be selected, not just those whose center point falls within the
* polygon.</li>
*
* <li>XSCALE: Ratio expressing the resampling factor (number of destination
* pixels per source pixel) along the target horizontal axis.
* The scale is used to determine the number of source pixels along the x-axis
* that are considered by the resampling algorithm.
* Equals to one for no resampling, below one for downsampling
* and above one for upsampling. This is automatically computed, for each
* processing chunk, and may thus vary among them, depending on the
* shape of output regions vs input regions. Such variations can be undesired
* in some situations. If the resampling factor can be considered as constant
* over the warped area, setting a constant value can lead to more reproducible
* pixel output.</li>
*
* <li>YSCALE: Same as XSCALE, but along the horizontal axis.</li>
*
* <li>OPTIMIZE_SIZE: This defaults to FALSE, but may be set to TRUE
* typically when writing to a compressed dataset (GeoTIFF with
* COMPRESS creation option set for example) for achieving a smaller
Expand All @@ -1176,7 +1190,11 @@ CPLErr GDALWarpDstAlphaMasker(void *pMaskFuncArg, int nBandCount,
* of the file. However sticking to target block size may cause major
* processing slowdown for some particular reprojections. Starting
* with GDAL 3.8, OPTIMIZE_SIZE mode is automatically enabled when it is safe
* to do so.</li>
* to do so.
* As this parameter influences the shape of warping chunk, and by default the
* XSCALE and YSCALE parameters are computed per warping chunk, this parameter may
* influence the pixel output.
* </li>
*
* <li>NUM_THREADS: (GDAL >= 1.10) Can be set to a numeric value or ALL_CPUS to
* set the number of threads to use to parallelize the computation part of the
Expand Down Expand Up @@ -1536,6 +1554,32 @@ void CPL_STDCALL GDALWarpResolveWorkingDataType(GDALWarpOptions *psOptions)

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)
{
int nCountInvalidSrcNoDataReal = 0;
for (int iBand = 0; iBand < psOptions->nBandCount; iBand++)
{
GDALRasterBandH hSrcBand = GDALGetRasterBand(
psOptions->hSrcDS, psOptions->panSrcBands[iBand]);

if (hSrcBand &&
!GDALIsValueExactAs(psOptions->padfSrcNoDataReal[iBand],
GDALGetRasterDataType(hSrcBand)))
{
nCountInvalidSrcNoDataReal++;
}
}
if (nCountInvalidSrcNoDataReal == psOptions->nBandCount)
{
CPLFree(psOptions->padfSrcNoDataReal);
psOptions->padfSrcNoDataReal = nullptr;
CPLFree(psOptions->padfSrcNoDataImag);
psOptions->padfSrcNoDataImag = nullptr;
}
}

for (int iBand = 0; iBand < psOptions->nBandCount; iBand++)
{
if (psOptions->hDstDS != nullptr)
Expand Down
32 changes: 12 additions & 20 deletions alg/gdalwarpoperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,22 +832,6 @@ void GDALDestroyWarpOperation(GDALWarpOperationH hOperation)
/* CollectChunkList() */
/************************************************************************/

static int OrderWarpChunk(const void *_a, const void *_b)
{
const GDALWarpChunk *a = static_cast<const GDALWarpChunk *>(_a);
const GDALWarpChunk *b = static_cast<const GDALWarpChunk *>(_b);
if (a->dy < b->dy)
return -1;
else if (a->dy > b->dy)
return 1;
else if (a->dx < b->dx)
return -1;
else if (a->dx > b->dx)
return 1;
else
return 0;
}

void GDALWarpOperation::CollectChunkList(int nDstXOff, int nDstYOff,
int nDstXSize, int nDstYSize)

Expand All @@ -859,10 +843,18 @@ void GDALWarpOperation::CollectChunkList(int nDstXOff, int nDstYOff,
CollectChunkListInternal(nDstXOff, nDstYOff, nDstXSize, nDstYSize);

// Sort chunks from top to bottom, and for equal y, from left to right.
// TODO(schwehr): Use std::sort.
if (pasChunkList)
qsort(pasChunkList, nChunkListCount, sizeof(GDALWarpChunk),
OrderWarpChunk);
if (nChunkListCount > 1)
{
std::sort(pasChunkList, pasChunkList + nChunkListCount,
[](const GDALWarpChunk &a, const GDALWarpChunk &b)
{
if (a.dy < b.dy)
return true;
if (a.dy > b.dy)
return false;
return a.dx < b.dx;
});
}

/* -------------------------------------------------------------------- */
/* Find the global source window. */
Expand Down
Loading

0 comments on commit 324b3cd

Please sign in to comment.