Skip to content

Commit

Permalink
Merge branch 'OSGeo:master' into i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
yoichigmf authored Sep 11, 2024
2 parents dbb50ed + b3b8d79 commit 1d008eb
Show file tree
Hide file tree
Showing 429 changed files with 11,509 additions and 5,093 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/alpine_numpy2/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ RUN apk add \
zlib-dev \
zstd-dev

# Commenting out those packages to be sure to test numpy 2.0.0rc1
# Commenting out those packages to be sure to test numpy 2.0.0
# py3-numpy \
# py3-numpy-dev \
# py3-pyarrow \
Expand All @@ -77,6 +77,6 @@ RUN apk add \
RUN mv /usr/lib/python3.12/site-packages/pyarrow /usr/lib/python3.12/site-packages/pyarrow.disabled

COPY requirements.txt /tmp/
RUN python3 -m pip install --break-system-packages numpy==2.0.0rc1
RUN python3 -m pip install --break-system-packages numpy==2.0.0
RUN python3 -m pip install --break-system-packages -U -r /tmp/requirements.txt

2 changes: 1 addition & 1 deletion .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
fuzz-seconds: 600
dry-run: false
- name: Upload Crash
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/cmake_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ jobs:
- name: Install pdfium
run: |
wget -q https://github.com/rouault/pdfium_build_gdal_3_9/releases/download/pdfium_6309_v1/install-ubuntu2004-rev6309.tar.gz \
&& tar -xzf install-ubuntu2004-rev6309.tar.gz \
wget -q https://github.com/rouault/pdfium_build_gdal_3_10/releases/download/pdfium_6677_v1/install-ubuntu2004-rev6677.tar.gz \
&& tar -xzf install-ubuntu2004-rev6677.tar.gz \
&& sudo chown -R root:root install \
&& sudo mv install/lib/* /usr/lib/ \
&& sudo mv install/include/* /usr/include/ \
&& sudo rm -rf install-ubuntu2004-rev6309.tar.gz install \
&& sudo rm -rf install-ubuntu2004-rev6677.tar.gz install \
&& sudo apt-get update -y \
&& sudo apt-get install -y --fix-missing --no-install-recommends liblcms2-dev
- name: Configure ccache
Expand Down Expand Up @@ -315,7 +315,7 @@ jobs:
- name: Checkout GDAL
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install development packages
uses: msys2/setup-msys2@5df0ca6cbf14efcd08f8d5bd5e049a3cc8e07fd2 # v2.24.0
uses: msys2/setup-msys2@ddf331adaebd714795f1042345e6ca57bd66cea8 # v2.24.1
with:
msystem: MINGW64
update: true
Expand All @@ -326,7 +326,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 @@ -430,16 +430,16 @@ 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: |
cmake --version
- name: Install pdfium
shell: bash -l {0}
run: |
curl -LOs https://github.com/rouault/pdfium_build_gdal_3_9/releases/download/pdfium_6309_v1/install-win10-vs2019-x64-rev6309.zip
unzip install-win10-vs2019-x64-rev6309.zip
curl -LOs https://github.com/rouault/pdfium_build_gdal_3_10/releases/download/pdfium_6677_v1/install-win10-vs2019-x64-rev6677.zip
unzip install-win10-vs2019-x64-rev6677.zip
mv install install-pdfium
- name: Remove conflicting libraries
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,25 @@ 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:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

doxygen:
Expand Down Expand Up @@ -146,7 +160,7 @@ jobs:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
with:
python-version: 3.8
- name: Install lint tool
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
# We do that after running CMake to avoid CodeQL to trigger during CMake time,
# in particular during HDF5 detection which is terribly slow (https://github.com/OSGeo/gdal/issues/9549)
- name: Initialize CodeQL
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -127,6 +127,6 @@ jobs:
cmake --build build -j$(nproc)
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
source ../ci/travis/conda/compile.sh
working-directory: ./gdal-feedstock

- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: ${{ matrix.platform }}-conda-package
path: ./gdal-feedstock/packages/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete_untagged_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if: github.repository == 'OSGeo/gdal'
steps:
- name: Delete all containers from gdal-deps without tags
uses: Chizkiyahu/delete-untagged-ghcr-action@e8c780ca2d589797e657691fc16bffe066714890 # v4.0.0
uses: Chizkiyahu/delete-untagged-ghcr-action@b302990b6c629f3b272a31f3c3a268e1f7d0ffae # v4.0.1
with:
token: ${{ secrets.PAT_TOKEN_DELETE_UNTAGGED_CONTAINERS }}
repository_owner: ${{ github.repository_owner }}
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
4 changes: 2 additions & 2 deletions .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,14 @@ jobs:
docker push ${CONTAINER_NAME_FULL}
- name: Upload coverage artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: ${{ matrix.id == 'coverage' }}
with:
name: coverage_index.html
path: build-${{ matrix.id }}/coverage_html/index.html

- name: Upload coverage artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
if: ${{ matrix.id == 'coverage' }}
with:
name: HTML
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15
uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
with:
sarif_file: results.sarif
6 changes: 3 additions & 3 deletions .github/workflows/ubuntu_20.04/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ RUN mkdir geos \
&& rm -rf geos

# Install pdfium
RUN wget -q https://github.com/rouault/pdfium_build_gdal_3_9/releases/download/pdfium_6309_v1/install-ubuntu2004-rev6309.tar.gz \
&& tar -xzf install-ubuntu2004-rev6309.tar.gz \
RUN wget -q https://github.com/rouault/pdfium_build_gdal_3_10/releases/download/pdfium_6677_v1/install-ubuntu2004-rev6677.tar.gz \
&& tar -xzf install-ubuntu2004-rev6677.tar.gz \
&& chown -R root:root install \
&& mv install/lib/* /usr/lib/ \
&& mv install/include/* /usr/include/ \
&& rm -rf install-ubuntu2004-rev6309.tar.gz install
&& rm -rf install-ubuntu2004-rev6677.tar.gz install

# HANA: client side
# Install hdbsql tool
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
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
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
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
52 changes: 51 additions & 1 deletion alg/contour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "ogr_srs_api.h"
#include "ogr_geometry.h"

#include <climits>
#include <limits>

static CPLErr OGRPolygonContourWriter(double dfLevelMin, double dfLevelMax,
Expand Down Expand Up @@ -109,10 +110,27 @@ static CPLErr OGRPolygonContourWriter(double dfLevelMin, double dfLevelMax,

OGR_F_SetGeometryDirectly(hFeat, hGeom);

const OGRErr eErr =
OGRErr eErr =
OGR_L_CreateFeature(static_cast<OGRLayerH>(poInfo->hLayer), hFeat);
OGR_F_Destroy(hFeat);

if (eErr == OGRERR_NONE && poInfo->nTransactionCommitInterval > 0)
{
if (++poInfo->nWrittenFeatureCountSinceLastCommit ==
poInfo->nTransactionCommitInterval)
{
poInfo->nWrittenFeatureCountSinceLastCommit = 0;
// CPLDebug("CONTOUR", "Flush transaction");
eErr =
OGR_L_CommitTransaction(static_cast<OGRLayerH>(poInfo->hLayer));
if (eErr == OGRERR_NONE)
{
eErr = OGR_L_StartTransaction(
static_cast<OGRLayerH>(poInfo->hLayer));
}
}
}

return eErr == OGRERR_NONE ? CE_None : CE_Failure;
}

Expand Down Expand Up @@ -549,6 +567,13 @@ mode.
* If YES, contour polygons will be created, rather than polygon lines.
*
*
* COMMIT_INTERVAL=num
*
* (GDAL >= 3.10) Interval in number of features at which transactions must be
* flushed. The default value of 0 means that no transactions are opened.
* A negative value means a single transaction. The function takes care of
* issuing the starting transaction and committing the final one.
*
* @return CE_None on success or CE_Failure if an error occurs.
*/
CPLErr GDALContourGenerateEx(GDALRasterBandH hBand, void *hLayer,
Expand Down Expand Up @@ -672,6 +697,20 @@ CPLErr GDALContourGenerateEx(GDALRasterBandH hBand, void *hLayer,
if (hSrcDS != nullptr)
GDALGetGeoTransform(hSrcDS, oCWI.adfGeoTransform);
oCWI.nNextID = 0;
oCWI.nWrittenFeatureCountSinceLastCommit = 0;
oCWI.nTransactionCommitInterval =
CPLAtoGIntBig(CSLFetchNameValueDef(options, "COMMIT_INTERVAL", "0"));

if (oCWI.nTransactionCommitInterval < 0)
oCWI.nTransactionCommitInterval = std::numeric_limits<GIntBig>::max();
if (oCWI.nTransactionCommitInterval > 0)
{
if (OGR_L_StartTransaction(static_cast<OGRLayerH>(hLayer)) !=
OGRERR_NONE)
{
oCWI.nTransactionCommitInterval = 0;
}
}

int bSuccessMin = FALSE;
double dfMinimum = GDALGetRasterMinimum(hBand, &bSuccessMin);
Expand Down Expand Up @@ -819,6 +858,17 @@ CPLErr GDALContourGenerateEx(GDALRasterBandH hBand, void *hLayer,
CPLError(CE_Failure, CPLE_AppDefined, "%s", e.what());
return CE_Failure;
}

if (oCWI.nTransactionCommitInterval > 0)
{
// CPLDebug("CONTOUR", "Flush transaction");
if (OGR_L_CommitTransaction(static_cast<OGRLayerH>(hLayer)) !=
OGRERR_NONE)
{
ok = false;
}
}

return ok ? CE_None : CE_Failure;
}

Expand Down
3 changes: 3 additions & 0 deletions alg/gdal_alg.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ typedef struct
int nElevFieldMax;
int nIDField;
int nNextID;

GIntBig nWrittenFeatureCountSinceLastCommit;
GIntBig nTransactionCommitInterval;
} OGRContourWriterInfo;

CPLErr CPL_DLL OGRContourWriter(double, int, double *, double *, void *pInfo);
Expand Down
8 changes: 4 additions & 4 deletions alg/gdal_rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,9 @@ static void *GDALCreateSimilarRPCTransformer(void *hTransformArg,

char **papszOptions = nullptr;
papszOptions = CSLSetNameValue(papszOptions, "RPC_HEIGHT",
CPLSPrintf("%.18g", psInfo->dfHeightOffset));
CPLSPrintf("%.17g", psInfo->dfHeightOffset));
papszOptions = CSLSetNameValue(papszOptions, "RPC_HEIGHT_SCALE",
CPLSPrintf("%.18g", psInfo->dfHeightScale));
CPLSPrintf("%.17g", psInfo->dfHeightScale));
if (psInfo->pszDEMPath != nullptr)
{
papszOptions =
Expand All @@ -529,7 +529,7 @@ static void *GDALCreateSimilarRPCTransformer(void *hTransformArg,
if (psInfo->bHasDEMMissingValue)
papszOptions =
CSLSetNameValue(papszOptions, "RPC_DEM_MISSING_VALUE",
CPLSPrintf("%.18g", psInfo->dfDEMMissingValue));
CPLSPrintf("%.17g", psInfo->dfDEMMissingValue));
papszOptions =
CSLSetNameValue(papszOptions, "RPC_DEM_APPLY_VDATUM_SHIFT",
(psInfo->bApplyDEMVDatumShift) ? "TRUE" : "FALSE");
Expand Down Expand Up @@ -2032,7 +2032,7 @@ CPLXMLNode *GDALSerializeRPCTransformer(void *pTransformArg)
{
CPLCreateXMLElementAndValue(
psTree, "DEMMissingValue",
CPLSPrintf("%.18g", psInfo->dfDEMMissingValue));
CPLSPrintf("%.17g", psInfo->dfDEMMissingValue));
}

CPLCreateXMLElementAndValue(psTree, "DEMApplyVDatumShift",
Expand Down
Loading

0 comments on commit 1d008eb

Please sign in to comment.