diff --git a/.github/workflows/asan/build.sh b/.github/workflows/asan/build.sh index 20385b49bc34..340e22e6b704 100755 --- a/.github/workflows/asan/build.sh +++ b/.github/workflows/asan/build.sh @@ -23,6 +23,7 @@ cmake ${GDAL_SOURCE_DIR:=..} \ -DUSE_CCACHE=ON \ -DGDAL_USE_GEOTIFF_INTERNAL=ON \ -DGDAL_USE_TIFF_INTERNAL=ON \ + -DGDAL_ENABLE_DRIVER_PDF_PLUGIN=ON \ -DGDAL_USE_LIBKML=OFF -DOGR_ENABLE_DRIVER_LIBKML=OFF \ -DFileGDB_ROOT=/usr/local/FileGDB_API make -j$NPROC diff --git a/.github/workflows/asan/test.sh b/.github/workflows/asan/test.sh index ffbfbb0878d0..b51a96ef8fcc 100755 --- a/.github/workflows/asan/test.sh +++ b/.github/workflows/asan/test.sh @@ -16,6 +16,14 @@ export PYTHONMALLOC=malloc gdalinfo autotest/gcore/data/byte.tif python3 -c "from osgeo import gdal; print('yes')" +# Check fix for https://github.com/rasterio/rasterio/issues/3250 +mv ${GDAL_DRIVER_PATH}/gdal_PDF.so ${GDAL_DRIVER_PATH}/gdal_PDF.so.disabled +echo "from osgeo import gdal" > register_many_times.py +echo "for i in range(1000):" >> register_many_times.py +echo " gdal.AllRegister()" >> register_many_times.py +python3 register_many_times.py +mv ${GDAL_DRIVER_PATH}/gdal_PDF.so.disabled ${GDAL_DRIVER_PATH}/gdal_PDF.so + cd autotest # Run each module in its own pytest process. diff --git a/.github/workflows/cmake_builds.yml b/.github/workflows/cmake_builds.yml index 28f7dbb7cf4c..c05a672b7f54 100644 --- a/.github/workflows/cmake_builds.yml +++ b/.github/workflows/cmake_builds.yml @@ -319,7 +319,7 @@ jobs: - name: Checkout GDAL uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Install development packages - uses: msys2/setup-msys2@ddf331adaebd714795f1042345e6ca57bd66cea8 # v2.24.1 + uses: msys2/setup-msys2@c52d1fa9c7492275e60fe763540fb601f5f232a1 # v2.25.0 with: msystem: MINGW64 update: true @@ -418,7 +418,7 @@ jobs: shell: pwsh run: | echo "JAVA_HOME=$env:JAVA_HOME_11_X64" >> %GITHUB_ENV% - - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 + - uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 with: activate-environment: gdalenv miniforge-version: latest @@ -525,7 +525,7 @@ jobs: git config --global core.autocrlf false - name: Checkout GDAL uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 + - uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 with: activate-environment: gdalenv miniforge-version: latest @@ -625,26 +625,9 @@ jobs: rm -rf /opt/homebrew/lib/node_modules # conflicts with node@18 from brew brew update brew outdated - # Attempt at fixing: - # => Pouring pkgconf--2.3.0_1.arm64_sonoma.bottle.tar.gz - # Error: The `brew link` step did not complete successfully - # The formula built, but is not symlinked into /opt/homebrew - # Could not symlink bin/pkg-config - # Target /opt/homebrew/bin/pkg-config - # is a symlink belonging to pkg-config@0.29.2. You can unlink it: - # brew unlink pkg-config@0.29.2 - # - # To force the link and overwrite all conflicting files: - # brew link --overwrite pkgconf - # - # To list all files that would be deleted: - # brew link --overwrite pkgconf --dry-run - # - # Possible conflicting files are: - # /opt/homebrew/bin/pkg-config -> /opt/homebrew/Cellar/pkg-config@0.29.2/0.29.2_3/bin/pkg-config - # /opt/homebrew/share/aclocal/pkg.m4 -> /opt/homebrew/Cellar/pkg-config@0.29.2/0.29.2_3/share/aclocal/pkg.m4 - # /opt/homebrew/share/man/man1/pkg-config.1 -> /opt/homebrew/Cellar/pkg-config@0.29.2/0.29.2_3/share/man/man1/pkg-config.1 - rm -f /opt/homebrew/bin/pkg-config /opt/homebrew/share/aclocal/pkg.m4 /opt/homebrew/share/man/man1/pkg-config.1 + mv /opt/homebrew/bin/pkg-config /opt/homebrew/bin/pkg-config.old + mv /opt/homebrew/share/aclocal/pkg.m4 /opt/homebrew/share/aclocal/pkg.m4.old + mv /opt/homebrew/share/man/man1/pkg-config.1 /opt/homebrew/share/man/man1/pkg-config.1.old brew install --overwrite python@3.11 python@3.12 brew install postgresql || brew link postgresql brew install pkg-config freexl libxml2 libspatialite geos proj libgeotiff openjpeg giflib libaec postgis poppler doxygen unixodbc jpeg-turbo aom jpeg-xl libheif libarchive libkml boost @@ -654,6 +637,9 @@ jobs: brew uninstall --ignore-dependencies gdal # Workaround for https://github.com/Homebrew/homebrew-core/pull/170959#issuecomment-2379606442 sed -i .bak 's/hdf5_hl;hdf5;/hdf5_hl-shared;hdf5-shared;/g' "$(brew --prefix netcdf)/lib/cmake/netCDF/netCDFTargets.cmake" + mv /opt/homebrew/bin/pkg-config.old /opt/homebrew/bin/pkg-config + mv /opt/homebrew/share/aclocal/pkg.m4.old /opt/homebrew/share/aclocal/pkg.m4 + mv /opt/homebrew/share/man/man1/pkg-config.1.old /opt/homebrew/share/man/man1/pkg-config.1 - name: Configure ccache run: | echo CCACHE_BASEDIR=$PWD >> ${GITHUB_ENV} @@ -710,7 +696,7 @@ jobs: git config --global core.autocrlf false - name: Checkout GDAL uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 + - uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 with: activate-environment: gdalenv python-version: 3.9 diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index 3b2fbf0ee127..629a7d81d6dc 100644 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -220,3 +220,19 @@ jobs: xmllint --schema ./frmts/nitf/data/nitf_spec.xsd ./frmts/nitf/data/nitf_spec.xml --noout xmllint --schema ./ogr/ogrsf_frmts/vdv/data/vdv452.xsd ./ogr/ogrsf_frmts/vdv/data/vdv452.xml --noout xmllint --schema ./ogr/ogrsf_frmts/gmlas/data/gmlasconf.xsd ./ogr/ogrsf_frmts/gmlas/data/gmlasconf.xml --noout + + check-config-options: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - name: Set up Python + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + with: + python-version: 3.8 + - name: Check cmakelist + run: | + python scripts/collect_config_options.py + git diff + git diff --quiet || (echo "You need to run scripts/collect_config_options to update port/cpl_known_config_options.h" && /bin/false) + diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f26c7e499044..4c3712e9dba6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -109,7 +109,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@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 + uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -129,6 +129,6 @@ jobs: cmake --build build -j$(nproc) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 + uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 4ef81cea9244..73d59f93e556 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -50,7 +50,7 @@ jobs: path: ~/conda_pkgs_dir key: ${{ runner.os }}-${{ steps.get-date.outputs.today }}-conda-${{ env.CACHE_NUMBER }} - - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 + - uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 with: miniforge-version: latest use-mamba: true diff --git a/.github/workflows/delete_untagged_containers.yml b/.github/workflows/delete_untagged_containers.yml index e37a0012c1c4..5b4faeb90ed9 100644 --- a/.github/workflows/delete_untagged_containers.yml +++ b/.github/workflows/delete_untagged_containers.yml @@ -19,7 +19,7 @@ jobs: if: github.repository == 'OSGeo/gdal' steps: - name: Delete all containers from gdal-deps without tags - uses: Chizkiyahu/delete-untagged-ghcr-action@b302990b6c629f3b272a31f3c3a268e1f7d0ffae # v4.0.1 + uses: Chizkiyahu/delete-untagged-ghcr-action@1c77a06b7f80ad4beb82b85919003831d47277d1 # v5.0.0 with: token: ${{ secrets.PAT_TOKEN_DELETE_UNTAGGED_CONTAINERS }} repository_owner: ${{ github.repository_owner }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7b34b00db0f2..576546e1c709 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -24,25 +24,31 @@ jobs: fail-fast: false matrix: include: - - name: alpine-small - arch: linux/amd64 + - name: alpine-small-amd64 + image_name: alpine-small + arch: amd64 - - name: alpine-normal - arch: linux/amd64 + - name: alpine-normal-amd64 + image_name: alpine-small + arch: amd64 - - name: ubuntu-small - arch: linux/amd64 + - name: ubuntu-small-amd64 + image_name: ubuntu-small + arch: amd64 - - name: ubuntu-small - arch: linux/arm64 + - name: ubuntu-small-arm64 + image_name: ubuntu-small + arch: arm64 - - name: ubuntu-full - arch: linux/amd64 + - name: ubuntu-full-amd64-proprietary-sdks + image_name: ubuntu-full + arch: amd64 - - name: ubuntu-full - arch: linux/arm64 + - name: ubuntu-full-arm64 + image_name: ubuntu-full + arch: arm64 - name: ${{ matrix.name }}-${{ matrix.arch }} + name: ${{ matrix.name }} runs-on: ubuntu-latest @@ -54,5 +60,11 @@ jobs: shell: bash -l {0} run: | docker run --rm --privileged linuxkit/binfmt:v0.8 - cd docker/${{ matrix.name }} - ./build.sh --platform ${{ matrix.arch }} + cd docker/${{ matrix.image_name }} + if test "${{ matrix.name }}" = "ubuntu-full-amd64-proprietary-sdks"; then + ./build.sh --platform linux/${{ matrix.arch }} --with-oracle --with-mrsid --with-ecw + else + ./build.sh --platform linux/${{ matrix.arch }} + fi + docker run --rm ghcr.io/osgeo/gdal:${{ matrix.image_name }}-latest-${{ matrix.arch }} gdalinfo --formats + docker run --rm ghcr.io/osgeo/gdal:${{ matrix.image_name }}-latest-${{ matrix.arch }} ogrinfo --formats diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml index 72807eda42c0..678873756a39 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/linux_build.yml @@ -140,6 +140,13 @@ jobs: build_script: build.sh os: ubuntu-22.04 + - name: Ubuntu 24.04, s390x + id: s390x + container: s390x + build_script: build.sh + test_script: test.sh + os: ubuntu-22.04 + name: ${{ matrix.name }} runs-on: ${{ matrix.os }} @@ -183,6 +190,11 @@ jobs: if: env.CONTAINER_REGISTRY == 'ghcr.io' run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + - name: Enable Docker qemu + shell: bash -l {0} + run: | + docker run --rm --privileged linuxkit/binfmt:v0.8 + # Pull build environment in forks or pull requests, unless [skip cache] is included in the commit message - name: Pull build environment if: "(github.repository_owner != 'OSGeo' || github.event_name == 'pull_request') && !contains(github.event.head_commit.message, '[skip cache]')" diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 31f680caaa15..41cde23f8338 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -29,7 +29,7 @@ jobs: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 + - uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0 with: channels: conda-forge auto-update-conda: true diff --git a/.github/workflows/s390x/Dockerfile.ci b/.github/workflows/s390x/Dockerfile.ci new file mode 100644 index 000000000000..7e60290072fa --- /dev/null +++ b/.github/workflows/s390x/Dockerfile.ci @@ -0,0 +1,83 @@ +FROM ubuntu:24.04 + +ENV DEBIAN_FRONTEND=noninteractive +ENV TARGET_ARCH=s390x +ENV GCC_ARCH=s390x +ENV APT_ARCH_SUFFIX=:s390x + +RUN rm -f /etc/apt/sources.list /etc/apt/sources.list.d/ubuntu.sources \ + && echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble main restricted universe" >> /etc/apt/sources.list \ + && echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble-updates main restricted universe" >> /etc/apt/sources.list \ + && echo "deb [arch=amd64] http://us.archive.ubuntu.com/ubuntu/ noble-backports main restricted universe" >> /etc/apt/sources.list \ + && echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu noble-security main restricted universe" >> /etc/apt/sources.list \ + && echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe" >> /etc/apt/sources.list \ + && echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ noble-updates main restricted universe" >> /etc/apt/sources.list \ + && echo "deb [arch=${TARGET_ARCH}] http://ports.ubuntu.com/ubuntu-ports/ noble-security main restricted universe" >> /etc/apt/sources.list \ + && dpkg --add-architecture ${TARGET_ARCH} \ + && apt-get update -y \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y g++-13-${GCC_ARCH}-linux-gnu \ + && ln -s ${GCC_ARCH}-linux-gnu-gcc-13 /usr/bin/${GCC_ARCH}-linux-gnu-gcc \ + && ln -s ${GCC_ARCH}-linux-gnu-g++-13 /usr/bin/${GCC_ARCH}-linux-gnu-g++ + +ENV CC=${GCC_ARCH}-linux-gnu-gcc-13 +ENV CXX=${GCC_ARCH}-linux-gnu-g++-13 + +RUN apt-get update && \ + apt-get install -y --allow-unauthenticated \ + bash \ + ccache \ + cmake \ + curl \ + ninja-build \ + libavif-dev${APT_ARCH_SUFFIX} \ + libblosc-dev${APT_ARCH_SUFFIX} \ + libboost-dev${APT_ARCH_SUFFIX} \ + libcairo2-dev${APT_ARCH_SUFFIX} \ + libcfitsio-dev${APT_ARCH_SUFFIX} \ + libcrypto++-dev${APT_ARCH_SUFFIX} \ + libcurl4-gnutls-dev${APT_ARCH_SUFFIX} \ + libexpat-dev${APT_ARCH_SUFFIX} \ + libfcgi-dev${APT_ARCH_SUFFIX} \ + libfyba-dev${APT_ARCH_SUFFIX} \ + libfreexl-dev${APT_ARCH_SUFFIX} \ + libgeos-dev${APT_ARCH_SUFFIX} \ + libgeotiff-dev${APT_ARCH_SUFFIX} \ + libgif-dev${APT_ARCH_SUFFIX} \ + libhdf4-alt-dev${APT_ARCH_SUFFIX} \ + libhdf5-serial-dev${APT_ARCH_SUFFIX} \ + libheif-dev${APT_ARCH_SUFFIX} \ + libjpeg-dev${APT_ARCH_SUFFIX} \ + libjxl-dev${APT_ARCH_SUFFIX} \ + libkml-dev${APT_ARCH_SUFFIX} \ + liblz4-dev${APT_ARCH_SUFFIX} \ + liblzma-dev${APT_ARCH_SUFFIX} \ + libmysqlclient-dev${APT_ARCH_SUFFIX} \ + libnetcdf-dev${APT_ARCH_SUFFIX} \ + libogdi-dev${APT_ARCH_SUFFIX} \ + libopenexr-dev${APT_ARCH_SUFFIX} \ + libopenjp2-7-dev${APT_ARCH_SUFFIX} \ + libpcre3-dev${APT_ARCH_SUFFIX} \ + libpng-dev${APT_ARCH_SUFFIX} \ + libpoppler-dev${APT_ARCH_SUFFIX} \ + libpoppler-private-dev${APT_ARCH_SUFFIX} \ + libpq-dev${APT_ARCH_SUFFIX} \ + libproj-dev${APT_ARCH_SUFFIX} \ + librasterlite2-dev${APT_ARCH_SUFFIX} \ + libspatialite-dev${APT_ARCH_SUFFIX} \ + libssl-dev${APT_ARCH_SUFFIX} \ + libwebp-dev${APT_ARCH_SUFFIX} \ + libxerces-c-dev${APT_ARCH_SUFFIX} \ + libxml2-dev${APT_ARCH_SUFFIX} \ + libxslt-dev${APT_ARCH_SUFFIX} \ + libzstd-dev${APT_ARCH_SUFFIX} \ + python3-dev${APT_ARCH_SUFFIX} \ + python3-numpy${APT_ARCH_SUFFIX} \ + python3-setuptools${APT_ARCH_SUFFIX} \ + python3-pip \ + swig \ + unixodbc-dev${APT_ARCH_SUFFIX} \ + wget \ + zip + +COPY requirements.txt /tmp/ +RUN PYTHON_CMD=python3 && $PYTHON_CMD -m pip install -U --break-system-packages -r /tmp/requirements.txt diff --git a/.github/workflows/s390x/build.sh b/.github/workflows/s390x/build.sh new file mode 100755 index 000000000000..53b8be40bf7a --- /dev/null +++ b/.github/workflows/s390x/build.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -eu + +CMAKE_ARGS=( + "-GNinja" \ + "-DUSE_CCACHE=ON" \ + "-DCMAKE_BUILD_TYPE=RelWithDebInfo" \ + "-DCMAKE_INSTALL_PREFIX=/usr" \ + "-DGDAL_USE_TIFF_INTERNAL=ON" \ + "-DGDAL_USE_GEOTIFF_INTERNAL=ON" \ + "-DBUILD_CSHARP_BINDINGS=OFF" \ + "-DBUILD_JAVA_BINDINGS=OFF" +) + +cmake ${GDAL_SOURCE_DIR:=..} \ + "${CMAKE_ARGS[@]}" + +ninja + diff --git a/.github/workflows/s390x/test.sh b/.github/workflows/s390x/test.sh new file mode 100755 index 000000000000..c247eadeae6f --- /dev/null +++ b/.github/workflows/s390x/test.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -eu + +source ${GDAL_SOURCE_DIR:=..}/scripts/setdevenv.sh + +autotest/cpp/gdal_unit_test --gtest_filter=-test_cpl.CPLSM_signed:test_cpl.CPLSpawn:test_cpl.CPLUTF8ForceToASCII + +pytest autotest/alg +pytest autotest/gcore -k "not transformer and not virtualmem and not test_vrt_protocol_netcdf_component_name and not test_vsicrypt_3" diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index b1342e321fab..522cdbad400b 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -71,6 +71,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0 + uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 with: sarif_file: results.sarif diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aeba53308bb2..460236f83428 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -67,6 +67,7 @@ repos: ogr/ogrsf_frmts/flatgeobuf/flatbuffers/| ogr/ogrsf_frmts/pmtiles/pmtiles/| ogr/ogrsf_frmts/ods/ods_formula_parser.cpp| + ogr/ogrsf_frmts/ods/ods_formula_parser.hpp| ogr/ogrsf_frmts/sqlite/sqlite_rtree_bulk_load| ogr/swq_parser.cpp| ogr/swq_parser.hpp| diff --git a/alg/contour.cpp b/alg/contour.cpp index 9c74574b1a95..e2081cbb7121 100644 --- a/alg/contour.cpp +++ b/alg/contour.cpp @@ -710,7 +710,7 @@ CPLErr GDALContourGenerateEx(GDALRasterBandH hBand, void *hLayer, } } - bool ok = false; + bool ok = true; try { @@ -880,6 +880,11 @@ CPLErr GDALContourGenerateEx(GDALRasterBandH hBand, void *hLayer, } } + if (ok) + { + pfnProgress(1.0, "", pProgressArg); + } + return ok ? CE_None : CE_Failure; } diff --git a/alg/internal_libqhull/poly_r.c b/alg/internal_libqhull/poly_r.c index b7e09b54fc8d..4a034131f201 100644 --- a/alg/internal_libqhull/poly_r.c +++ b/alg/internal_libqhull/poly_r.c @@ -1180,9 +1180,9 @@ int qh_pointid(qhT *qh, pointT *point) { /* coverity[divide_arg] */ id= offset / qh->hull_dim; } else { - id = qh_setindex(qh->other_points, point); - if (id >= 0) { - id += qh->num_points; + const int idx = qh_setindex(qh->other_points, point); + if (idx >= 0) { + id = (ptr_intT)idx + qh->num_points; } else { return qh_IDunknown; } diff --git a/apps/commonutils.cpp b/apps/commonutils.cpp index 3c5e3b29c7a8..664fce1ee545 100644 --- a/apps/commonutils.cpp +++ b/apps/commonutils.cpp @@ -60,13 +60,42 @@ void EarlySetConfigOptions(int argc, char **argv) // OGRRegisterAll(), but we can't call GDALGeneralCmdLineProcessor() or // OGRGeneralCmdLineProcessor(), because it needs the drivers to be // registered for the --format or --formats options. + + // Start with --debug, so that "my_command --config UNKNOWN_CONFIG_OPTION --debug on" + // detects and warns about a unknown config option. for (int i = 1; i < argc; i++) { - if (EQUAL(argv[i], "--config") && i + 2 < argc) + if (EQUAL(argv[i], "--config") && i + 1 < argc) { - CPLSetConfigOption(argv[i + 1], argv[i + 2]); + const char *pszArg = argv[i + 1]; + if (strchr(pszArg, '=') != nullptr) + { + char *pszKey = nullptr; + const char *pszValue = CPLParseNameValue(pszArg, &pszKey); + if (pszKey && EQUAL(pszKey, "CPL_DEBUG") && pszValue) + { + CPLSetConfigOption(pszKey, pszValue); + } + CPLFree(pszKey); + ++i; + } + else + { + if (i + 2 >= argc) + { + CPLError(CE_Failure, CPLE_AppDefined, + "--config option given without a key and value " + "argument."); + return; + } - i += 2; + if (EQUAL(argv[i + 1], "CPL_DEBUG")) + { + CPLSetConfigOption(argv[i + 1], argv[i + 2]); + } + + i += 2; + } } else if (EQUAL(argv[i], "--debug") && i + 1 < argc) { @@ -74,6 +103,41 @@ void EarlySetConfigOptions(int argc, char **argv) i += 1; } } + for (int i = 1; i < argc; i++) + { + if (EQUAL(argv[i], "--config") && i + 1 < argc) + { + const char *pszArg = argv[i + 1]; + if (strchr(pszArg, '=') != nullptr) + { + char *pszKey = nullptr; + const char *pszValue = CPLParseNameValue(pszArg, &pszKey); + if (pszKey && !EQUAL(pszKey, "CPL_DEBUG") && pszValue) + { + CPLSetConfigOption(pszKey, pszValue); + } + CPLFree(pszKey); + ++i; + } + else + { + if (i + 2 >= argc) + { + CPLError(CE_Failure, CPLE_AppDefined, + "--config option given without a key and value " + "argument."); + return; + } + + if (!EQUAL(argv[i + 1], "CPL_DEBUG")) + { + CPLSetConfigOption(argv[i + 1], argv[i + 2]); + } + + i += 2; + } + } + } } /************************************************************************/ diff --git a/apps/commonutils.h b/apps/commonutils.h index 4365877b6d79..453c858f3bf1 100644 --- a/apps/commonutils.h +++ b/apps/commonutils.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Utilities * Purpose: Common utility routines diff --git a/apps/gdal_utils.h b/apps/gdal_utils.h index 063534a3db96..27df34d21d03 100644 --- a/apps/gdal_utils.h +++ b/apps/gdal_utils.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Utilities * Purpose: GDAL Utilities Public Declarations. diff --git a/apps/gdal_utils_priv.h b/apps/gdal_utils_priv.h index 460656b62f8d..357fa08e065d 100644 --- a/apps/gdal_utils_priv.h +++ b/apps/gdal_utils_priv.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Utilities * Purpose: GDAL Utilities Private Declarations. diff --git a/apps/gdalwarp_lib.cpp b/apps/gdalwarp_lib.cpp index 737a161f96b7..1c623cdc4bde 100644 --- a/apps/gdalwarp_lib.cpp +++ b/apps/gdalwarp_lib.cpp @@ -4712,6 +4712,19 @@ static GDALDatasetH GDALWarpCreateOutput( aosCreateOptions.FetchNameValue("PHOTOMETRIC") == nullptr) { aosCreateOptions.SetNameValue("PHOTOMETRIC", "RGB"); + + // Preserve potential ALPHA=PREMULTIPLIED from source alpha band + const char *pszAlpha; + if (aosCreateOptions.FetchNameValue("ALPHA") == nullptr && + apeColorInterpretations.size() == 4 && + apeColorInterpretations[3] == GCI_AlphaBand && + GDALGetRasterCount(pahSrcDS[0]) == 4 && + (pszAlpha = + GDALGetMetadataItem(GDALGetRasterBand(pahSrcDS[0], 4), + "ALPHA", "IMAGE_STRUCTURE"))) + { + aosCreateOptions.SetNameValue("ALPHA", pszAlpha); + } } /* The GTiff driver now supports writing band color interpretation */ diff --git a/apps/ogr2ogr_lib.cpp b/apps/ogr2ogr_lib.cpp index 7d3dcf16e52d..91154edcba1d 100644 --- a/apps/ogr2ogr_lib.cpp +++ b/apps/ogr2ogr_lib.cpp @@ -4651,6 +4651,8 @@ SetupTargetLayer::Setup(OGRLayer *poSrcLayer, const char *pszNewLayerName, oCoordPrec.dfMResolution = psOptions->dfMRes; } + auto poSrcDriver = m_poSrcDS->GetDriver(); + // Force FID column as 64 bit if the source feature has a 64 bit FID, // the target driver supports 64 bit FID and the user didn't set it // manually. @@ -4693,9 +4695,8 @@ SetupTargetLayer::Setup(OGRLayer *poSrcLayer, const char *pszNewLayerName, } // Detect scenario of converting from GPX to a format like GPKG // Cf https://github.com/OSGeo/gdal/issues/9225 - else if (!bPreserveFID && !m_bUnsetFid && !bAppend && - m_poSrcDS->GetDriver() && - EQUAL(m_poSrcDS->GetDriver()->GetDescription(), "GPX") && + else if (!bPreserveFID && !m_bUnsetFid && !bAppend && poSrcDriver && + EQUAL(poSrcDriver->GetDescription(), "GPX") && pszDestCreationOptions && (strstr(pszDestCreationOptions, "='FID'") != nullptr || strstr(pszDestCreationOptions, "=\"FID\"") != nullptr) && @@ -4787,6 +4788,23 @@ SetupTargetLayer::Setup(OGRLayer *poSrcLayer, const char *pszNewLayerName, } } + // Use case of https://github.com/OSGeo/gdal/issues/11057#issuecomment-2495479779 + // Conversion from GPKG to OCI. + // OCI distinguishes between TIMESTAMP and TIMESTAMP WITH TIME ZONE + // GeoPackage is supposed to have DateTime in UTC, so we set + // TIMESTAMP_WITH_TIME_ZONE=YES + if (poSrcDriver && pszDestCreationOptions && + strstr(pszDestCreationOptions, "TIMESTAMP_WITH_TIME_ZONE") && + CSLFetchNameValue(m_papszLCO, "TIMESTAMP_WITH_TIME_ZONE") == + nullptr && + EQUAL(poSrcDriver->GetDescription(), "GPKG")) + { + papszLCOTemp = CSLSetNameValue(papszLCOTemp, + "TIMESTAMP_WITH_TIME_ZONE", "YES"); + CPLDebug("GDALVectorTranslate", + "Setting TIMESTAMP_WITH_TIME_ZONE=YES"); + } + OGRGeomFieldDefn oGeomFieldDefn( osGeomFieldName.c_str(), static_cast(eGCreateLayerType)); @@ -4982,7 +5000,9 @@ SetupTargetLayer::Setup(OGRLayer *poSrcLayer, const char *pszNewLayerName, bool bError = false; OGRArrowArrayStream streamSrc; + const bool bUseWriteArrowBatch = + !EQUAL(m_poDstDS->GetDriver()->GetDescription(), "OCI") && CanUseWriteArrowBatch(poSrcLayer, poDstLayer, bJustCreatedLayer, psOptions, bPreserveFID, bError, streamSrc); if (bError) diff --git a/autotest/alg/applyverticalshiftgrid.py b/autotest/alg/applyverticalshiftgrid.py index 2d9cae11cc3d..95d8dc8d326a 100755 --- a/autotest/alg/applyverticalshiftgrid.py +++ b/autotest/alg/applyverticalshiftgrid.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GDALApplyVerticalShiftGrid algorithm. diff --git a/autotest/alg/contour.py b/autotest/alg/contour.py index ef0493f67284..e8714920fba5 100755 --- a/autotest/alg/contour.py +++ b/autotest/alg/contour.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: ContourGenerate() testing @@ -446,3 +445,28 @@ def test_contour_min_value_is_multiple_of_interval(tmp_vsimem): f = lyr.GetNextFeature() assert f["ELEV"] == 3 ogrtest.check_feature_geometry(f, "LINESTRING (1.5 0.0,1.5 0.5,1.5 1.5,1.5 2.0)") + + +############################################################################### +# Test scenario of https://github.com/OSGeo/gdal/issues/11340 + + +def test_contour_constant_raster_value(tmp_vsimem): + + ogr_ds = ogr.GetDriverByName("Memory").CreateDataSource("") + lyr = ogr_ds.CreateLayer("contour", geom_type=ogr.wkbLineString) + lyr.CreateField(ogr.FieldDefn("ID", ogr.OFTInteger)) + lyr.CreateField(ogr.FieldDefn("ELEV", ogr.OFTReal)) + + src_ds = gdal.GetDriverByName("MEM").Create("", 1, 1) + assert ( + gdal.ContourGenerateEx( + src_ds.GetRasterBand(1), + lyr, + options=["LEVEL_INTERVAL=10", "ID_FIELD=0", "ELEV_FIELD=1"], + ) + == gdal.CE_None + ) + + f = lyr.GetNextFeature() + assert f is None diff --git a/autotest/alg/cutline.py b/autotest/alg/cutline.py index 7187b8964803..fb060617f66c 100755 --- a/autotest/alg/cutline.py +++ b/autotest/alg/cutline.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test the image reprojection functions. Try to test as many diff --git a/autotest/alg/dither.py b/autotest/alg/dither.py index 14c960e78cf9..e8b7e4adac0c 100755 --- a/autotest/alg/dither.py +++ b/autotest/alg/dither.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test gdal.ComputeMedianCutPCT() and gdal.DitherRGB2PCT() diff --git a/autotest/alg/fillnodata.py b/autotest/alg/fillnodata.py index 801469114a8f..caf59c14cf41 100755 --- a/autotest/alg/fillnodata.py +++ b/autotest/alg/fillnodata.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: GDALFillNoData() testing diff --git a/autotest/alg/los.py b/autotest/alg/los.py index b4ae6ae66d08..57b7ca275bf8 100644 --- a/autotest/alg/los.py +++ b/autotest/alg/los.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test gdal.LineOfSightVisible algorithm. diff --git a/autotest/alg/polygonize.py b/autotest/alg/polygonize.py index e0bee334af59..f3f71ddd1cc8 100755 --- a/autotest/alg/polygonize.py +++ b/autotest/alg/polygonize.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Polygonize() algorithm. diff --git a/autotest/alg/proximity.py b/autotest/alg/proximity.py index a26c94e45e06..9bc4bd9e2186 100755 --- a/autotest/alg/proximity.py +++ b/autotest/alg/proximity.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ComputeProximity() algorithm. diff --git a/autotest/alg/rasterize.py b/autotest/alg/rasterize.py index 6d5a7c624cca..6a666c797370 100755 --- a/autotest/alg/rasterize.py +++ b/autotest/alg/rasterize.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test RasterizeLayer() and related calls. diff --git a/autotest/alg/reproject.py b/autotest/alg/reproject.py index 98527a04280d..86dc9b95171a 100755 --- a/autotest/alg/reproject.py +++ b/autotest/alg/reproject.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ReprojectImage() algorithm. diff --git a/autotest/alg/sieve.py b/autotest/alg/sieve.py index 069158047b28..260a92dd980b 100755 --- a/autotest/alg/sieve.py +++ b/autotest/alg/sieve.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test SieveFilter() algorithm. diff --git a/autotest/alg/transformgeoloc.py b/autotest/alg/transformgeoloc.py index c8035ddfe16b..4e280c8b28fe 100755 --- a/autotest/alg/transformgeoloc.py +++ b/autotest/alg/transformgeoloc.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test TransformGeoloc algorithm. diff --git a/autotest/alg/warp.py b/autotest/alg/warp.py index 7d78c845a219..1ef52f7cdcac 100755 --- a/autotest/alg/warp.py +++ b/autotest/alg/warp.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test the image reprojection functions. Try to test as many diff --git a/autotest/benchmark/conftest.py b/autotest/benchmark/conftest.py index 9a95f2d2ebfb..1b3b0f39d50d 100755 --- a/autotest/benchmark/conftest.py +++ b/autotest/benchmark/conftest.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Benchmarking diff --git a/autotest/benchmark/test_gdalwarp.py b/autotest/benchmark/test_gdalwarp.py index 4b86fed8b1c2..e550c4a8a401 100755 --- a/autotest/benchmark/test_gdalwarp.py +++ b/autotest/benchmark/test_gdalwarp.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Benchmarking of gdalwarp diff --git a/autotest/benchmark/test_gtiff.py b/autotest/benchmark/test_gtiff.py index 7eeb1ad96d0f..e9813fa9b1be 100755 --- a/autotest/benchmark/test_gtiff.py +++ b/autotest/benchmark/test_gtiff.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Benchmarking of GeoTIFF driver diff --git a/autotest/benchmark/test_ogr2ogr.py b/autotest/benchmark/test_ogr2ogr.py index c221855c73ca..0e9b1b08c824 100755 --- a/autotest/benchmark/test_ogr2ogr.py +++ b/autotest/benchmark/test_ogr2ogr.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Benchmarking of ogr2ogr diff --git a/autotest/benchmark/test_ogr_gpkg.py b/autotest/benchmark/test_ogr_gpkg.py index 8e347e245dcb..9cbbb6cc80c9 100755 --- a/autotest/benchmark/test_ogr_gpkg.py +++ b/autotest/benchmark/test_ogr_gpkg.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Benchmarking of GeoPackage driver diff --git a/autotest/cpp/bug1488.cpp b/autotest/cpp/bug1488.cpp index 704e5025dfac..137625aff365 100644 --- a/autotest/cpp/bug1488.cpp +++ b/autotest/cpp/bug1488.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Core * Purpose: Test fix for https://github.com/OSGeo/gdal/issues/1488 (concurrency diff --git a/autotest/cpp/test_alg.cpp b/autotest/cpp/test_alg.cpp index b3fa1706d580..2e09c9fa8ab2 100644 --- a/autotest/cpp/test_alg.cpp +++ b/autotest/cpp/test_alg.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL algorithms * Purpose: Test alg diff --git a/autotest/cpp/test_cpl.cpp b/autotest/cpp/test_cpl.cpp index ba43804e23b4..111510f688ad 100644 --- a/autotest/cpp/test_cpl.cpp +++ b/autotest/cpp/test_cpl.cpp @@ -1293,16 +1293,26 @@ TEST_F(test_cpl, CPLExpandTilde) CPLSetConfigOption("HOME", nullptr); } -TEST_F(test_cpl, CPLString_constructors) +TEST_F(test_cpl, CPLDeclareKnownConfigOption) { - // CPLString(std::string) constructor - ASSERT_STREQ(CPLString(std::string("abc")).c_str(), "abc"); - - // CPLString(const char*) constructor - ASSERT_STREQ(CPLString("abc").c_str(), "abc"); + CPLConfigOptionSetter oDebugSetter("CPL_DEBUG", "ON", false); + { + CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler); + CPLErrorReset(); + CPLConfigOptionSetter oDeclaredConfigOptionSetter("UNDECLARED_OPTION", + "FOO", false); + EXPECT_STREQ(CPLGetLastErrorMsg(), + "Unknown configuration option 'UNDECLARED_OPTION'."); + } + { + CPLDeclareKnownConfigOption("DECLARED_OPTION", nullptr); - // CPLString(const char*, n) constructor - ASSERT_STREQ(CPLString("abc", 1).c_str(), "a"); + CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler); + CPLErrorReset(); + CPLConfigOptionSetter oDeclaredConfigOptionSetter("DECLARED_OPTION", + "FOO", false); + EXPECT_STREQ(CPLGetLastErrorMsg(), ""); + } } TEST_F(test_cpl, CPLErrorSetState) diff --git a/autotest/cpp/test_deferred_plugin.cpp b/autotest/cpp/test_deferred_plugin.cpp index d9f83f0be95a..052b8ceed0bb 100644 --- a/autotest/cpp/test_deferred_plugin.cpp +++ b/autotest/cpp/test_deferred_plugin.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL * Purpose: Test deferred plugin loading diff --git a/autotest/cpp/test_marching_squares_contour.cpp b/autotest/cpp/test_marching_squares_contour.cpp index 47718ed67787..3a00a79da087 100644 --- a/autotest/cpp/test_marching_squares_contour.cpp +++ b/autotest/cpp/test_marching_squares_contour.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL algorithms * Purpose: Tests for the marching squares algorithm diff --git a/autotest/cpp/test_marching_squares_polygon.cpp b/autotest/cpp/test_marching_squares_polygon.cpp index 3b1edf6d36cf..72d62d1580fe 100644 --- a/autotest/cpp/test_marching_squares_polygon.cpp +++ b/autotest/cpp/test_marching_squares_polygon.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL algorithms * Purpose: Tests for the marching squares algorithm diff --git a/autotest/cpp/test_marching_squares_square.cpp b/autotest/cpp/test_marching_squares_square.cpp index c1ffec9eef72..0c84dd3bdec2 100644 --- a/autotest/cpp/test_marching_squares_square.cpp +++ b/autotest/cpp/test_marching_squares_square.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL algorithms * Purpose: Tests for the marching squares algorithm diff --git a/autotest/cpp/test_marching_squares_tile.cpp b/autotest/cpp/test_marching_squares_tile.cpp index 3151593e20c7..7c94a5fc997c 100644 --- a/autotest/cpp/test_marching_squares_tile.cpp +++ b/autotest/cpp/test_marching_squares_tile.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL algorithms * Purpose: Tests for the marching squares algorithm diff --git a/autotest/cpp/test_ogr.cpp b/autotest/cpp/test_ogr.cpp index c6eb9cc28e66..e748568ad8c0 100644 --- a/autotest/cpp/test_ogr.cpp +++ b/autotest/cpp/test_ogr.cpp @@ -4538,4 +4538,37 @@ TEST_F(test_ogr, GetArrowStream_DateTime_As_String) stream.release(&stream); } +// Test OGRFeatureDefn::GetFieldSubTypeByName() +TEST_F(test_ogr, OGRFieldDefnGetFieldSubTypeByName) +{ + for (int i = 0; i < OFSTMaxSubType; i++) + { + const char *pszName = + OGRFieldDefn::GetFieldSubTypeName(static_cast(i)); + if (pszName != nullptr) + { + EXPECT_EQ(OGRFieldDefn::GetFieldSubTypeByName(pszName), i); + } + } +} + +// Test OGRFeatureDefn::GetFieldTypeByName() +TEST_F(test_ogr, OGRFieldDefnGetFieldTypeByName) +{ + for (int i = 0; i < OFTMaxType; i++) + { + // deprecated types + if (i == OFTWideString || i == OFTWideStringList) + { + continue; + } + const char *pszName = + OGRFieldDefn::GetFieldTypeName(static_cast(i)); + if (pszName != nullptr) + { + EXPECT_EQ(OGRFieldDefn::GetFieldTypeByName(pszName), i); + } + } +} + } // namespace diff --git a/autotest/cpp/test_osr_set_proj_search_paths.cpp b/autotest/cpp/test_osr_set_proj_search_paths.cpp index 7a41c072130d..b5c68a6fd56d 100644 --- a/autotest/cpp/test_osr_set_proj_search_paths.cpp +++ b/autotest/cpp/test_osr_set_proj_search_paths.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Core * Purpose: Test OSRSetPROJSearchPaths() diff --git a/autotest/cpp/test_triangulation.cpp b/autotest/cpp/test_triangulation.cpp index 0241c2df11b6..ecc82d7ad5b0 100644 --- a/autotest/cpp/test_triangulation.cpp +++ b/autotest/cpp/test_triangulation.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL algorithms * Purpose: Test Delaunay triangulation diff --git a/autotest/cpp/testblockcache.cpp b/autotest/cpp/testblockcache.cpp index 2f0459375294..e426d07eb223 100644 --- a/autotest/cpp/testblockcache.cpp +++ b/autotest/cpp/testblockcache.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Core * Purpose: Test block cache under multi-threading diff --git a/autotest/cpp/testblockcachelimits.cpp b/autotest/cpp/testblockcachelimits.cpp index 6531c2cd6a1b..446bfbeed502 100644 --- a/autotest/cpp/testblockcachelimits.cpp +++ b/autotest/cpp/testblockcachelimits.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Core * Purpose: Test block cache under multi-threading diff --git a/autotest/cpp/testblockcachewrite.cpp b/autotest/cpp/testblockcachewrite.cpp index e6141ca9dc3b..2a0cef3a79dc 100644 --- a/autotest/cpp/testblockcachewrite.cpp +++ b/autotest/cpp/testblockcachewrite.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Core * Purpose: Test block cache & writing behaviour under multi-threading diff --git a/autotest/cpp/testclosedondestroydm.cpp b/autotest/cpp/testclosedondestroydm.cpp index efc7e056456c..62ee755c96bd 100644 --- a/autotest/cpp/testclosedondestroydm.cpp +++ b/autotest/cpp/testclosedondestroydm.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Core * Purpose: Test block cache & writing behaviour under multi-threading diff --git a/autotest/cpp/testcopywords.cpp b/autotest/cpp/testcopywords.cpp index f69947ba942c..2fbdcdd3f50b 100644 --- a/autotest/cpp/testcopywords.cpp +++ b/autotest/cpp/testcopywords.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Core * Purpose: Test GDALCopyWords(). diff --git a/autotest/cpp/testdestroy.cpp b/autotest/cpp/testdestroy.cpp index 823413681538..f07232ecbb0e 100644 --- a/autotest/cpp/testdestroy.cpp +++ b/autotest/cpp/testdestroy.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Core * Purpose: Test GDALDestroy(). diff --git a/autotest/cpp/testlog.cpp b/autotest/cpp/testlog.cpp index 0f03b458f432..aa9534a64d52 100644 --- a/autotest/cpp/testlog.cpp +++ b/autotest/cpp/testlog.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL * Purpose: Test CPL_LOG diff --git a/autotest/cpp/testthreadcond.cpp b/autotest/cpp/testthreadcond.cpp index 557b404510d9..9e2a2ccb6c6c 100644 --- a/autotest/cpp/testthreadcond.cpp +++ b/autotest/cpp/testthreadcond.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL Core * Purpose: Test thread API diff --git a/autotest/cpp/testvirtualmem.cpp b/autotest/cpp/testvirtualmem.cpp index e9f30dc55b5b..e073fb45e1d1 100644 --- a/autotest/cpp/testvirtualmem.cpp +++ b/autotest/cpp/testvirtualmem.cpp @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL algorithms * Purpose: Test Delaunay triangulation diff --git a/autotest/gcore/asyncreader.py b/autotest/gcore/asyncreader.py index f8e42235490f..103024e78301 100755 --- a/autotest/gcore/asyncreader.py +++ b/autotest/gcore/asyncreader.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test AsyncReader interface diff --git a/autotest/gcore/basic_test.py b/autotest/gcore/basic_test.py index aad4af0b5abc..cf5263ea3bc5 100755 --- a/autotest/gcore/basic_test.py +++ b/autotest/gcore/basic_test.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic GDAL open diff --git a/autotest/gcore/basic_test_subprocess.py b/autotest/gcore/basic_test_subprocess.py index 254a29e4c354..31533351bbcc 100755 --- a/autotest/gcore/basic_test_subprocess.py +++ b/autotest/gcore/basic_test_subprocess.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic GDAL open diff --git a/autotest/gcore/bmp_read.py b/autotest/gcore/bmp_read.py index 96088185a675..28d76800a075 100755 --- a/autotest/gcore/bmp_read.py +++ b/autotest/gcore/bmp_read.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic read support for a all datatypes from a BMP file. diff --git a/autotest/gcore/bmp_write.py b/autotest/gcore/bmp_write.py index 95a8b6fda00c..14cf8e0232dd 100755 --- a/autotest/gcore/bmp_write.py +++ b/autotest/gcore/bmp_write.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for Microsoft Bitmap (.bmp) diff --git a/autotest/gcore/cog.py b/autotest/gcore/cog.py index c65989e7cdcc..8056e244caed 100755 --- a/autotest/gcore/cog.py +++ b/autotest/gcore/cog.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: COG driver testing @@ -1962,3 +1961,32 @@ def test_cog_write_check_golden_file(tmp_path, src_filename, creation_options): ) assert os.stat(src_filename).st_size == os.stat(out_filename).st_size assert open(src_filename, "rb").read() == open(out_filename, "rb").read() + + +############################################################################### + + +def test_cog_preserve_ALPHA_PREMULTIPLIED_on_copy(tmp_vsimem): + + src_filename = str(tmp_vsimem / "src.tif") + src_ds = gdal.GetDriverByName("GTiff").Create( + src_filename, 1, 1, 4, options=["ALPHA=PREMULTIPLIED", "PROFILE=BASELINE"] + ) + src_ds.SetGeoTransform([500000, 1, 0, 4500000, 0, -1]) + srs = osr.SpatialReference() + srs.ImportFromEPSG(32631) + src_ds.SetProjection(srs.ExportToWkt()) + + out_filename = str(tmp_vsimem / "out.tif") + gdal.GetDriverByName("COG").CreateCopy( + out_filename, + src_ds, + options=[ + "TILING_SCHEME=GoogleMapsCompatible", + ], + ) + with gdal.Open(out_filename) as ds: + assert ( + ds.GetRasterBand(4).GetMetadataItem("ALPHA", "IMAGE_STRUCTURE") + == "PREMULTIPLIED" + ) diff --git a/autotest/gcore/colortable.py b/autotest/gcore/colortable.py index 6390d38260bf..c03a65d8bcfe 100755 --- a/autotest/gcore/colortable.py +++ b/autotest/gcore/colortable.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test functioning of the GDALColorTable. Mostly this tests diff --git a/autotest/gcore/envi_read.py b/autotest/gcore/envi_read.py index 44ab971b0317..5f947d4819ed 100755 --- a/autotest/gcore/envi_read.py +++ b/autotest/gcore/envi_read.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic read support for a all datatypes from an ENVI file. diff --git a/autotest/gcore/gdal_stats.py b/autotest/gcore/gdal_stats.py index 369eac85dab6..e438e077bf70 100755 --- a/autotest/gcore/gdal_stats.py +++ b/autotest/gcore/gdal_stats.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test core numeric operations and statistics calculations diff --git a/autotest/gcore/geoloc.py b/autotest/gcore/geoloc.py index 8bdd0cde4d6e..eb5460b2587b 100755 --- a/autotest/gcore/geoloc.py +++ b/autotest/gcore/geoloc.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Geolocation warper. diff --git a/autotest/gcore/gtiff_subdatasetinfo.py b/autotest/gcore/gtiff_subdatasetinfo.py index 53c56042c5bb..f45e643dd008 100644 --- a/autotest/gcore/gtiff_subdatasetinfo.py +++ b/autotest/gcore/gtiff_subdatasetinfo.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GetSubdatasetInfo API on GeoTIFF. diff --git a/autotest/gcore/gtiff_write.py b/autotest/gcore/gtiff_write.py index 7908c404d8ec..b53f9ee93763 100755 --- a/autotest/gcore/gtiff_write.py +++ b/autotest/gcore/gtiff_write.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for GTiff driver. diff --git a/autotest/gcore/hdf4_read.py b/autotest/gcore/hdf4_read.py index 54204dd346b7..fd0a86f5aa7c 100755 --- a/autotest/gcore/hdf4_read.py +++ b/autotest/gcore/hdf4_read.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic read support for a all datatypes from a HDF file. @@ -365,26 +364,26 @@ def test_hdf4_read_online_8(): # 5 MB gdaltest.download_or_skip( - "https://e4ftl01.cr.usgs.gov/MOLT/MOD13Q1.006/2006.06.10/MOD13Q1.A2006161.h34v09.006.2015161173716.hdf", - "MOD13Q1.A2006161.h34v09.006.2015161173716.hdf", + "https://e4ftl01.cr.usgs.gov/MOLT/MOD13Q1.061/2006.06.10/MOD13Q1.A2006161.h34v09.061.2020265043931.hdf", + "MOD13Q1.A2006161.h34v09.061.2020265043931.hdf", ) tst = gdaltest.GDALTest( "HDF4Image", - "HDF4_EOS:EOS_GRID:tmp/cache/MOD13Q1.A2006161.h34v09.006.2015161173716.hdf:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days NDVI", + "HDF4_EOS:EOS_GRID:tmp/cache/MOD13Q1.A2006161.h34v09.061.2020265043931.hdf:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days NDVI", 1, - 44174, + 45111, filename_absolute=1, ) tst.testOpen() ds = gdal.Open( - "HDF4_EOS:EOS_GRID:tmp/cache/MOD13Q1.A2006161.h34v09.006.2015161173716.hdf:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days NDVI" + "HDF4_EOS:EOS_GRID:tmp/cache/MOD13Q1.A2006161.h34v09.061.2020265043931.hdf:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days NDVI" ) cs = ds.GetRasterBand(1).Checksum() - assert cs == 44174, "did not get expected checksum" + assert cs == 45111, "did not get expected checksum" if "GetBlockSize" in dir(gdal.Band): (blockx, blocky) = ds.GetRasterBand(1).GetBlockSize() diff --git a/autotest/gcore/hdf4_write.py b/autotest/gcore/hdf4_write.py index 49e92aa39e6c..3761ff1ada7e 100755 --- a/autotest/gcore/hdf4_write.py +++ b/autotest/gcore/hdf4_write.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for HDF4 driver. diff --git a/autotest/gcore/hdf4multidim.py b/autotest/gcore/hdf4multidim.py index c8185b49432d..68c5732624e1 100644 --- a/autotest/gcore/hdf4multidim.py +++ b/autotest/gcore/hdf4multidim.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test multidimensional support in HDF4 driver diff --git a/autotest/gcore/hfa_read.py b/autotest/gcore/hfa_read.py index 46b5c6a4d29b..2b55853a5d7d 100755 --- a/autotest/gcore/hfa_read.py +++ b/autotest/gcore/hfa_read.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic read support for all datatypes from a HFA file. diff --git a/autotest/gcore/hfa_rfc40.py b/autotest/gcore/hfa_rfc40.py index 452fba977b2a..1ddcf2bf34bc 100755 --- a/autotest/gcore/hfa_rfc40.py +++ b/autotest/gcore/hfa_rfc40.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Tests Raster Attribute Table support in the HFA driver and in diff --git a/autotest/gcore/hfa_srs.py b/autotest/gcore/hfa_srs.py index 64b00d85ff2b..0f5f55fdc35b 100755 --- a/autotest/gcore/hfa_srs.py +++ b/autotest/gcore/hfa_srs.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write round-tripping of SRS for HFA/Imagine format. diff --git a/autotest/gcore/hfa_write.py b/autotest/gcore/hfa_write.py index 5ab4cc6ee4db..4ebcc7314245 100755 --- a/autotest/gcore/hfa_write.py +++ b/autotest/gcore/hfa_write.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for Erdas Imagine (.img) HFA driver. diff --git a/autotest/gcore/identify.py b/autotest/gcore/identify.py index f6b6d555c205..c042b5941b3d 100755 --- a/autotest/gcore/identify.py +++ b/autotest/gcore/identify.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test functioning of the IdentifyDriver functionality. diff --git a/autotest/gcore/interpolateatpoint.py b/autotest/gcore/interpolateatpoint.py index 767a144e54dd..d3ee6add3249 100755 --- a/autotest/gcore/interpolateatpoint.py +++ b/autotest/gcore/interpolateatpoint.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test InterpolateAtPoint functionality diff --git a/autotest/gcore/mask.py b/autotest/gcore/mask.py index 9e53178fedc9..999da3cb1589 100755 --- a/autotest/gcore/mask.py +++ b/autotest/gcore/mask.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test RFC 15 "mask band" default functionality (nodata/alpha/etc) diff --git a/autotest/gcore/minixml.py b/autotest/gcore/minixml.py index 449506553d8b..2d1b98881140 100755 --- a/autotest/gcore/minixml.py +++ b/autotest/gcore/minixml.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Minixml services from Python. diff --git a/autotest/gcore/misc.py b/autotest/gcore/misc.py index 2c4b1d70c1a3..5d0cc0395344 100755 --- a/autotest/gcore/misc.py +++ b/autotest/gcore/misc.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Various test of GDAL core. diff --git a/autotest/gcore/multidim.py b/autotest/gcore/multidim.py index 3c038588aa33..0cf75f777868 100644 --- a/autotest/gcore/multidim.py +++ b/autotest/gcore/multidim.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test non-driver specific multidimensional support diff --git a/autotest/gcore/nodatamaskband.py b/autotest/gcore/nodatamaskband.py index 3bf93f101f9d..8cfe3c5945f3 100755 --- a/autotest/gcore/nodatamaskband.py +++ b/autotest/gcore/nodatamaskband.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GDALNoDataMaskBand diff --git a/autotest/gcore/numpy_rw.py b/autotest/gcore/numpy_rw.py index ac3d388478d9..666146fbe8dc 100755 --- a/autotest/gcore/numpy_rw.py +++ b/autotest/gcore/numpy_rw.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic integration with numpy. diff --git a/autotest/gcore/numpy_rw_multidim.py b/autotest/gcore/numpy_rw_multidim.py index 5b2d558a9467..d5e90dce3c42 100755 --- a/autotest/gcore/numpy_rw_multidim.py +++ b/autotest/gcore/numpy_rw_multidim.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test multidimensional support with numpy diff --git a/autotest/gcore/overviewds.py b/autotest/gcore/overviewds.py index acb19f34ba01..71030afa11c9 100755 --- a/autotest/gcore/overviewds.py +++ b/autotest/gcore/overviewds.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GDALOverviewDataset diff --git a/autotest/gcore/pam.py b/autotest/gcore/pam.py index 110daffaef3f..7ad0489f7ac5 100755 --- a/autotest/gcore/pam.py +++ b/autotest/gcore/pam.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test functioning of the PAM metadata support. diff --git a/autotest/gcore/pamproxydb.py b/autotest/gcore/pamproxydb.py index 6a791b592882..fffaded9ae9a 100755 --- a/autotest/gcore/pamproxydb.py +++ b/autotest/gcore/pamproxydb.py @@ -1,6 +1,5 @@ #!/usr/bin/env python ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test functioning of the ProxyDB PAM metadata support diff --git a/autotest/gcore/pixfun.py b/autotest/gcore/pixfun.py index dfb528788134..06f030af380d 100755 --- a/autotest/gcore/pixfun.py +++ b/autotest/gcore/pixfun.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test pixel functions support. diff --git a/autotest/gcore/pnm_read.py b/autotest/gcore/pnm_read.py index c2e0570ba4a4..4fcfbfca0184 100755 --- a/autotest/gcore/pnm_read.py +++ b/autotest/gcore/pnm_read.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic read support for a all datatypes from a PNM file. diff --git a/autotest/gcore/pnm_write.py b/autotest/gcore/pnm_write.py index 0bc4a319ff65..8f2d106c4647 100755 --- a/autotest/gcore/pnm_write.py +++ b/autotest/gcore/pnm_write.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for portable anymap file format diff --git a/autotest/gcore/rasterio.py b/autotest/gcore/rasterio.py index c0e8d3ee95ed..ccc474ca1db2 100755 --- a/autotest/gcore/rasterio.py +++ b/autotest/gcore/rasterio.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test default implementation of GDALRasterBand::IRasterIO diff --git a/autotest/gcore/rat.py b/autotest/gcore/rat.py index d6ec55609915..271caf86ca37 100755 --- a/autotest/gcore/rat.py +++ b/autotest/gcore/rat.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test RasterAttributeTables services from Python. diff --git a/autotest/gcore/relationship.py b/autotest/gcore/relationship.py index 15906ad4dd0e..1f614d887035 100755 --- a/autotest/gcore/relationship.py +++ b/autotest/gcore/relationship.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GDALRelationship diff --git a/autotest/gcore/rfc30.py b/autotest/gcore/rfc30.py index 12c9324930f7..dbea026d6900 100755 --- a/autotest/gcore/rfc30.py +++ b/autotest/gcore/rfc30.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test RFC 30 (UTF filename handling) support. diff --git a/autotest/gcore/test_driver_metadata.py b/autotest/gcore/test_driver_metadata.py index 7f1bee6eb8a1..d36628be4055 100644 --- a/autotest/gcore/test_driver_metadata.py +++ b/autotest/gcore/test_driver_metadata.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test driver metadata diff --git a/autotest/gcore/testnonboundtoswig.py b/autotest/gcore/testnonboundtoswig.py index 53f7c0c53953..a92e14a7b6d5 100755 --- a/autotest/gcore/testnonboundtoswig.py +++ b/autotest/gcore/testnonboundtoswig.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GDAL functions not bound SWIG with ctypes diff --git a/autotest/gcore/thread_test.py b/autotest/gcore/thread_test.py index fb2f32c3a776..764b6ee26918 100755 --- a/autotest/gcore/thread_test.py +++ b/autotest/gcore/thread_test.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Python threading diff --git a/autotest/gcore/tiff_ovr.py b/autotest/gcore/tiff_ovr.py index 990b3d84aa5d..323fd5423e69 100755 --- a/autotest/gcore/tiff_ovr.py +++ b/autotest/gcore/tiff_ovr.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Overview Support (mostly a GeoTIFF issue). diff --git a/autotest/gcore/tiff_read.py b/autotest/gcore/tiff_read.py index 150276bd0b79..de908a0b4657 100755 --- a/autotest/gcore/tiff_read.py +++ b/autotest/gcore/tiff_read.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic read support for a all datatypes from a TIFF file. diff --git a/autotest/gcore/tiff_read_subifds.py b/autotest/gcore/tiff_read_subifds.py index 8aec882e5177..2b0eba5abf95 100755 --- a/autotest/gcore/tiff_read_subifds.py +++ b/autotest/gcore/tiff_read_subifds.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic read support for tiff files using overviews in subifds diff --git a/autotest/gcore/tiff_srs.py b/autotest/gcore/tiff_srs.py index f4069357001d..2a035b4c0503 100755 --- a/autotest/gcore/tiff_srs.py +++ b/autotest/gcore/tiff_srs.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write round-tripping of SRS for GeoTIFF format. diff --git a/autotest/gcore/tiff_write.py b/autotest/gcore/tiff_write.py index 3e2c8d9de67b..92158526b77f 100755 --- a/autotest/gcore/tiff_write.py +++ b/autotest/gcore/tiff_write.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for GeoTIFF format. @@ -949,7 +948,7 @@ def test_tiff_write_20(): ############################################################################### -# Test RGBA images with TIFFTAG_EXTRASAMPLES=EXTRASAMPLE_ASSOCALPHA +# Test RGBA images with TIFFTAG_EXTRASAMPLES=EXTRASAMPLE_UNASSOCALPHA def test_tiff_write_21(): @@ -11928,3 +11927,30 @@ def test_tiff_write_check_golden_file(tmp_path, src_filename, creation_options): ) assert os.stat(src_filename).st_size == os.stat(out_filename).st_size assert open(src_filename, "rb").read() == open(out_filename, "rb").read() + + +############################################################################### +# Test preserving ALPHA=PREMULTIPLIED on copy + + +def test_tiff_write_preserve_ALPHA_PREMULTIPLIED_on_copy(tmp_path): + + src_filename = str(tmp_path / "src.tif") + out_filename = str(tmp_path / "out.tif") + gdal.GetDriverByName("GTiff").Create( + src_filename, 1, 1, 4, options=["ALPHA=PREMULTIPLIED", "PROFILE=BASELINE"] + ) + assert gdal.VSIStatL(src_filename + ".aux.xml") is None + with gdal.Open(src_filename) as src_ds: + assert ( + src_ds.GetRasterBand(4).GetMetadataItem("ALPHA", "IMAGE_STRUCTURE") + == "PREMULTIPLIED" + ) + gdal.GetDriverByName("GTiff").CreateCopy( + out_filename, src_ds, options=["PROFILE=BASELINE"] + ) + with gdal.Open(out_filename) as out_ds: + assert ( + out_ds.GetRasterBand(4).GetMetadataItem("ALPHA", "IMAGE_STRUCTURE") + == "PREMULTIPLIED" + ) diff --git a/autotest/gcore/transformer.py b/autotest/gcore/transformer.py index 28d4b9acaac2..45e25e627bae 100644 --- a/autotest/gcore/transformer.py +++ b/autotest/gcore/transformer.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test the GenImgProjTransformer capabilities. diff --git a/autotest/gcore/virtualmem.py b/autotest/gcore/virtualmem.py index 3de02dd1e3aa..ffa947a506bf 100755 --- a/autotest/gcore/virtualmem.py +++ b/autotest/gcore/virtualmem.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GDALVirtualMem interface diff --git a/autotest/gcore/vrt_read.py b/autotest/gcore/vrt_read.py index 3503a55c21d8..4f24787e176e 100755 --- a/autotest/gcore/vrt_read.py +++ b/autotest/gcore/vrt_read.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic read support for a all datatypes from a VRT file. diff --git a/autotest/gcore/vrtmisc.py b/autotest/gcore/vrtmisc.py index 52bd757867d0..32b8d891c749 100755 --- a/autotest/gcore/vrtmisc.py +++ b/autotest/gcore/vrtmisc.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Misc tests of VRT driver diff --git a/autotest/gcore/vsi7z.py b/autotest/gcore/vsi7z.py index 105332cbbbf9..6f2693fa5e2b 100755 --- a/autotest/gcore/vsi7z.py +++ b/autotest/gcore/vsi7z.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsi7z/ diff --git a/autotest/gcore/vsiadls.py b/autotest/gcore/vsiadls.py index cc61c8f38c6d..57fea1d59525 100755 --- a/autotest/gcore/vsiadls.py +++ b/autotest/gcore/vsiadls.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsiadls diff --git a/autotest/gcore/vsiadls_real_instance.py b/autotest/gcore/vsiadls_real_instance.py index d61996a3edfc..8f5d2e02e83c 100755 --- a/autotest/gcore/vsiadls_real_instance.py +++ b/autotest/gcore/vsiadls_real_instance.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsiadls diff --git a/autotest/gcore/vsiaz.py b/autotest/gcore/vsiaz.py index 348f794b44dd..0fe0b56c7a7a 100755 --- a/autotest/gcore/vsiaz.py +++ b/autotest/gcore/vsiaz.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsiaz @@ -381,6 +380,109 @@ def test_vsiaz_fake_readdir(): assert gdal.VSIStatL("/vsiaz/mycontainer1", gdal.VSI_STAT_CACHE_ONLY) is not None +############################################################################### +# Test ReadDir() when first response has no blobs but a non-empty NextMarker + + +def test_vsiaz_fake_readdir_no_blobs_in_first_request(): + + if gdaltest.webserver_port == 0: + pytest.skip() + + gdal.VSICurlClearCache() + + handler = webserver.SequentialHandler() + handler.add( + "GET", + "/azure/blob/myaccount/az_fake_bucket2?comp=list&delimiter=%2F&prefix=a_dir%20with_space%2F&restype=container", + 200, + {"Content-type": "application/xml"}, + """ + + a_dir with_space/ + + bla + + """, + ) + handler.add( + "GET", + "/azure/blob/myaccount/az_fake_bucket2?comp=list&delimiter=%2F&marker=bla&prefix=a_dir%20with_space%2F&restype=container", + 200, + {"Content-type": "application/xml"}, + """ + + a_dir with_space/ + + + a_dir with_space/resource4.bin + + 16 Oct 2016 12:34:56 + 456789 + + + + a_dir with_space/subdir/ + + + + """, + ) + + with webserver.install_http_handler(handler): + dir_contents = gdal.ReadDir("/vsiaz/az_fake_bucket2/a_dir with_space") + assert dir_contents == ["resource4.bin", "subdir"] + + +############################################################################### +# + + +@gdaltest.enable_exceptions() +def test_vsiaz_fake_readdir_protection_again_infinite_looping(): + + if gdaltest.webserver_port == 0: + pytest.skip() + + gdal.VSICurlClearCache() + + handler = webserver.SequentialHandler() + handler.add( + "GET", + "/azure/blob/myaccount/az_fake_bucket2?comp=list&delimiter=%2F&prefix=a_dir%20with_space%2F&restype=container", + 200, + {"Content-type": "application/xml"}, + """ + + a_dir with_space/ + + bla0 + + """, + ) + for i in range(10): + handler.add( + "GET", + f"/azure/blob/myaccount/az_fake_bucket2?comp=list&delimiter=%2F&marker=bla{i}&prefix=a_dir%20with_space%2F&restype=container", + 200, + {"Content-type": "application/xml"}, + f""" + + a_dir with_space/ + + bla{i+1} + + """, + ) + + with webserver.install_http_handler(handler): + with pytest.raises( + Exception, + match="More than 10 consecutive List Blob requests returning no blobs", + ): + gdal.ReadDir("/vsiaz/az_fake_bucket2/a_dir with_space") + + ############################################################################### # Test AZURE_STORAGE_SAS_TOKEN option with fake server diff --git a/autotest/gcore/vsiaz_real_instance_auto.py b/autotest/gcore/vsiaz_real_instance_auto.py index 43d88e4f5067..9e92cae56fa1 100644 --- a/autotest/gcore/vsiaz_real_instance_auto.py +++ b/autotest/gcore/vsiaz_real_instance_auto.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsiaz diff --git a/autotest/gcore/vsiaz_real_instance_manual.py b/autotest/gcore/vsiaz_real_instance_manual.py index b29fb576db60..eb97536117e6 100644 --- a/autotest/gcore/vsiaz_real_instance_manual.py +++ b/autotest/gcore/vsiaz_real_instance_manual.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsiaz diff --git a/autotest/gcore/vsicached.py b/autotest/gcore/vsicached.py index b526493c5506..f7bb9050f501 100755 --- a/autotest/gcore/vsicached.py +++ b/autotest/gcore/vsicached.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsicached? diff --git a/autotest/gcore/vsicrypt.py b/autotest/gcore/vsicrypt.py index 6ac558599173..057f386dcf2e 100755 --- a/autotest/gcore/vsicrypt.py +++ b/autotest/gcore/vsicrypt.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsicrypt/ diff --git a/autotest/gcore/vsicurl.py b/autotest/gcore/vsicurl.py index 305641d1d1ca..3e8c9df5cd0e 100755 --- a/autotest/gcore/vsicurl.py +++ b/autotest/gcore/vsicurl.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsicurl diff --git a/autotest/gcore/vsicurl_streaming.py b/autotest/gcore/vsicurl_streaming.py index d3ded6ed2d3a..bf1a892a1ef7 100755 --- a/autotest/gcore/vsicurl_streaming.py +++ b/autotest/gcore/vsicurl_streaming.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsicurl_streaming diff --git a/autotest/gcore/vsifile.py b/autotest/gcore/vsifile.py index 12b69d9eaca7..5cdd483e39e7 100755 --- a/autotest/gcore/vsifile.py +++ b/autotest/gcore/vsifile.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test VSI file primitives diff --git a/autotest/gcore/vsigs.py b/autotest/gcore/vsigs.py index dd78ab9cffc2..52d6f1b5522b 100755 --- a/autotest/gcore/vsigs.py +++ b/autotest/gcore/vsigs.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsigs diff --git a/autotest/gcore/vsihdfs.py b/autotest/gcore/vsihdfs.py index 755477082728..b47a77e58894 100755 --- a/autotest/gcore/vsihdfs.py +++ b/autotest/gcore/vsihdfs.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test VSI file primitives diff --git a/autotest/gcore/vsioss.py b/autotest/gcore/vsioss.py index 7dda14517f16..d037ab953e6d 100755 --- a/autotest/gcore/vsioss.py +++ b/autotest/gcore/vsioss.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsioss diff --git a/autotest/gcore/vsipathspecificoption.py b/autotest/gcore/vsipathspecificoption.py index 9b1182bdf529..d7ea5b3f26bf 100755 --- a/autotest/gcore/vsipathspecificoption.py +++ b/autotest/gcore/vsipathspecificoption.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test VSI path specific options diff --git a/autotest/gcore/vsirar.py b/autotest/gcore/vsirar.py index 6710b95848df..8c3ffd3df489 100755 --- a/autotest/gcore/vsirar.py +++ b/autotest/gcore/vsirar.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsirar/ diff --git a/autotest/gcore/vsis3.py b/autotest/gcore/vsis3.py index 77cbbee6a6ef..28d30e0d2fec 100755 --- a/autotest/gcore/vsis3.py +++ b/autotest/gcore/vsis3.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsis3 diff --git a/autotest/gcore/vsistdin.py b/autotest/gcore/vsistdin.py index d7c0b6780d1f..546baae496b3 100755 --- a/autotest/gcore/vsistdin.py +++ b/autotest/gcore/vsistdin.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsistdin/ diff --git a/autotest/gcore/vsiswift.py b/autotest/gcore/vsiswift.py index 8b239cc1fddd..81b6de90eac6 100755 --- a/autotest/gcore/vsiswift.py +++ b/autotest/gcore/vsiswift.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsiswift diff --git a/autotest/gcore/vsiwebhdfs.py b/autotest/gcore/vsiwebhdfs.py index 28403e113e3a..808812bcc4c1 100755 --- a/autotest/gcore/vsiwebhdfs.py +++ b/autotest/gcore/vsiwebhdfs.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsiwebhdfs diff --git a/autotest/gcore/vsizip.py b/autotest/gcore/vsizip.py index 8942fc4f42ff..4a3f66b854dd 100755 --- a/autotest/gcore/vsizip.py +++ b/autotest/gcore/vsizip.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test /vsizip/vsimem/ diff --git a/autotest/gdrivers/aaigrid.py b/autotest/gdrivers/aaigrid.py index 77fbf5e935a8..669641e713dd 100755 --- a/autotest/gdrivers/aaigrid.py +++ b/autotest/gdrivers/aaigrid.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Arc/Info ASCII Grid support. diff --git a/autotest/gdrivers/ace2.py b/autotest/gdrivers/ace2.py index ad3a194ff6d2..202fab7f30ff 100755 --- a/autotest/gdrivers/ace2.py +++ b/autotest/gdrivers/ace2.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ACE2 driver diff --git a/autotest/gdrivers/adrg.py b/autotest/gdrivers/adrg.py index 3fe1ead3e2b4..b373759cbce4 100755 --- a/autotest/gdrivers/adrg.py +++ b/autotest/gdrivers/adrg.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for ADRG driver. diff --git a/autotest/gdrivers/aigrid.py b/autotest/gdrivers/aigrid.py index c68ef8545abd..227739f1a142 100755 --- a/autotest/gdrivers/aigrid.py +++ b/autotest/gdrivers/aigrid.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for AIGRID driver. diff --git a/autotest/gdrivers/avif.py b/autotest/gdrivers/avif.py index 2f92941beda3..4a382606fbe8 100644 --- a/autotest/gdrivers/avif.py +++ b/autotest/gdrivers/avif.py @@ -282,6 +282,9 @@ def test_avif_geoheif_wkt2(): assert ds.GetGeoTransform() == pytest.approx( [691000.0, 0.1, 0.0, 6090000.0, 0.0, -0.1] ) + assert ds.GetSpatialRef() is not None + assert ds.GetSpatialRef().GetAuthorityName(None) == "EPSG" + assert ds.GetSpatialRef().GetAuthorityCode(None) == "28355" assert ds.GetGCPCount() == 1 gcp = ds.GetGCPs()[0] assert ( @@ -313,6 +316,10 @@ def test_avif_geoheif_uri(): assert ds.GetGeoTransform() == pytest.approx( [691051.2, 0.1, 0.0, 6090000.0, 0.0, -0.1] ) + assert ds.GetSpatialRef() is not None + assert ds.GetSpatialRef().GetAuthorityName(None) == "EPSG" + assert ds.GetSpatialRef().GetAuthorityCode(None) == "32755" + assert ds.GetGCPCount() == 1 gcp = ds.GetGCPs()[0] assert ( @@ -340,6 +347,10 @@ def test_avif_geoheif_curie(): == 'CCBY "Jacobs Group (Australia) Pty Ltd and Australian Capital Territory"' ) assert ds.GetMetadataItem("TAGS", "DESCRIPTION_en-AU") == "copyright" + assert ds.GetSpatialRef() is not None + assert ds.GetSpatialRef().GetAuthorityName(None) == "EPSG" + assert ds.GetSpatialRef().GetAuthorityCode(None) == "32755" + assert ds.GetGeoTransform() is not None assert ds.GetGeoTransform() == pytest.approx( [691051.2, 0.1, 0.0, 6090000.0, 0.0, -0.1] diff --git a/autotest/gdrivers/avif_heif.py b/autotest/gdrivers/avif_heif.py index 6ae194c919de..dc04b3754c81 100755 --- a/autotest/gdrivers/avif_heif.py +++ b/autotest/gdrivers/avif_heif.py @@ -61,9 +61,9 @@ def _has_geoheif_support(): assert ds.GetGeoTransform() == pytest.approx( [691000.0, 0.1, 0.0, 6090000.0, 0.0, -0.1] ) - print() - print("GCPs from avif_heif: ", ds.GetGCPCount()) - print() + assert ds.GetSpatialRef() is not None + assert ds.GetSpatialRef().GetAuthorityName(None) == "EPSG" + assert ds.GetSpatialRef().GetAuthorityCode(None) == "28355" assert ds.GetGCPCount() == 1 gcp = ds.GetGCPs()[0] assert ( diff --git a/autotest/gdrivers/bag.py b/autotest/gdrivers/bag.py index 4a4adfdf3cfc..9c99ed32fac7 100755 --- a/autotest/gdrivers/bag.py +++ b/autotest/gdrivers/bag.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for BAG driver. diff --git a/autotest/gdrivers/basisu.py b/autotest/gdrivers/basisu.py index 2d5c28d5b125..4e56084fb9bf 100755 --- a/autotest/gdrivers/basisu.py +++ b/autotest/gdrivers/basisu.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test BASISU driver diff --git a/autotest/gdrivers/blx.py b/autotest/gdrivers/blx.py index f84c4caffb06..2edc448e43ef 100755 --- a/autotest/gdrivers/blx.py +++ b/autotest/gdrivers/blx.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test BLX support. diff --git a/autotest/gdrivers/bsb.py b/autotest/gdrivers/bsb.py index b62d129311d6..af3acd80075e 100755 --- a/autotest/gdrivers/bsb.py +++ b/autotest/gdrivers/bsb.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: BSB Testing. diff --git a/autotest/gdrivers/bt.py b/autotest/gdrivers/bt.py index 8a7233a4bf27..2aba56e14f9a 100755 --- a/autotest/gdrivers/bt.py +++ b/autotest/gdrivers/bt.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for BT driver. diff --git a/autotest/gdrivers/byn.py b/autotest/gdrivers/byn.py index 39edc2e85463..3027fb12a724 100755 --- a/autotest/gdrivers/byn.py +++ b/autotest/gdrivers/byn.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: National Resources Canada - Vertical Datum Transformation # Purpose: Test read/write functionality for BYN driver. diff --git a/autotest/gdrivers/cals.py b/autotest/gdrivers/cals.py index b562d23b3d00..197e2ee7f3ed 100755 --- a/autotest/gdrivers/cals.py +++ b/autotest/gdrivers/cals.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test CALS driver diff --git a/autotest/gdrivers/ceos.py b/autotest/gdrivers/ceos.py index 57446e45b8d6..d83d4ceedb62 100755 --- a/autotest/gdrivers/ceos.py +++ b/autotest/gdrivers/ceos.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test conventional CEOS driver. diff --git a/autotest/gdrivers/cpg.py b/autotest/gdrivers/cpg.py index 2efca291d71c..0571ea29189e 100755 --- a/autotest/gdrivers/cpg.py +++ b/autotest/gdrivers/cpg.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test CPG driver diff --git a/autotest/gdrivers/ctg.py b/autotest/gdrivers/ctg.py index 611b232d2361..556beddd257b 100755 --- a/autotest/gdrivers/ctg.py +++ b/autotest/gdrivers/ctg.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test CTG driver diff --git a/autotest/gdrivers/daas.py b/autotest/gdrivers/daas.py index c2abeb58d32c..a1f6e7ef91b1 100755 --- a/autotest/gdrivers/daas.py +++ b/autotest/gdrivers/daas.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: DAAS driver test suite. diff --git a/autotest/gdrivers/daas_real_instance.py b/autotest/gdrivers/daas_real_instance.py index ffa99a86f464..5fd83a8807aa 100755 --- a/autotest/gdrivers/daas_real_instance.py +++ b/autotest/gdrivers/daas_real_instance.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: DAAS driver test suite. diff --git a/autotest/gdrivers/data/bag/generate_test_georef_metadata.py b/autotest/gdrivers/data/bag/generate_test_georef_metadata.py index 03ac88cf9bed..72f0edd9c551 100755 --- a/autotest/gdrivers/data/bag/generate_test_georef_metadata.py +++ b/autotest/gdrivers/data/bag/generate_test_georef_metadata.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Generate test files diff --git a/autotest/gdrivers/data/bag/generate_test_interpolated.py b/autotest/gdrivers/data/bag/generate_test_interpolated.py index 09af6bb9e4e8..dc8866994e89 100755 --- a/autotest/gdrivers/data/bag/generate_test_interpolated.py +++ b/autotest/gdrivers/data/bag/generate_test_interpolated.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Generate test_interpolated.bag diff --git a/autotest/gdrivers/data/esric/Layers/_alllayers/L01/R0000C0000.bundle b/autotest/gdrivers/data/esric/Layers.tar similarity index 96% rename from autotest/gdrivers/data/esric/Layers/_alllayers/L01/R0000C0000.bundle rename to autotest/gdrivers/data/esric/Layers.tar index b6faba1597b4..625d080cf715 100644 Binary files a/autotest/gdrivers/data/esric/Layers/_alllayers/L01/R0000C0000.bundle and b/autotest/gdrivers/data/esric/Layers.tar differ diff --git a/autotest/gdrivers/data/esric/Layers/conf.cdi b/autotest/gdrivers/data/esric/Layers/conf.cdi deleted file mode 100644 index fe0b8358939e..000000000000 --- a/autotest/gdrivers/data/esric/Layers/conf.cdi +++ /dev/null @@ -1,7 +0,0 @@ - - - -20037507.229594339 - -20037507.229594339 - 20037507.229594339 - 20037507.229594339 - diff --git a/autotest/gdrivers/data/esric/Layers/conf.xml b/autotest/gdrivers/data/esric/Layers/conf.xml deleted file mode 100644 index dd1cbd9f11d6..000000000000 --- a/autotest/gdrivers/data/esric/Layers/conf.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0],AUTHORITY["EPSG",3857]] - -22041257.77387803 - -32799975.422359161 - 142878261.42550784 - -100000 - 10000 - -100000 - 10000 - 0.001 - 0.0002 - 0.0002 - true - 3857 - - - -20037508.342787001 - 20037508.342787001 - - - 20037508.342787001 - -20037508.342787001 - - 256 - 256 - 96 - - - 0 - 591657527.591555 - 156543.03392800014 - - - 1 - 295828763.79577702 - 78271.516963999937 - - - 2 - 147914381.89788899 - 39135.758482000092 - - - 3 - 73957190.948944002 - 19567.879240999919 - - - - - MIXED - 75 - false - - - esriMapCacheStorageModeCompactV2 - 128 - - diff --git a/autotest/gdrivers/data/gti/sentinel2_stac_geoparquet.geojson b/autotest/gdrivers/data/gti/sentinel2_stac_geoparquet.geojson new file mode 100644 index 000000000000..40048d297f81 --- /dev/null +++ b/autotest/gdrivers/data/gti/sentinel2_stac_geoparquet.geojson @@ -0,0 +1,7 @@ +{ +"type": "FeatureCollection", +"name": "sentinel2_stac_geoparquet", +"features": [ +{ "type": "Feature", "properties": { "type": "Feature", "stac_version": "1.1.0", "assets.rededge3.href": "https://e84-earth-search-sentinel-data.s3.us-west-2.amazonaws.com/sentinel-2-c1-l2a/12/S/VD/2023/12/S2A_T12SVD_20231213T181818_L2A/B07.tif", "assets.rededge3.title": "Red Edge 3 - 20m", "assets.rededge3.type": "image/tiff; application=geotiff; profile=cloud-optimized", "assets.rededge3.roles": [ "data", "reflectance" ], "assets.rededge3.eo:bands": [ { "name": "B07", "common_name": "rededge", "center_wavelength": 0.783, "full_width_half_max": 0.028 } ], "assets.rededge3.gsd": 20.0, "assets.rededge3.proj:shape": [ 5490, 5490 ], "assets.rededge3.proj:transform": [ 20, 0, 399960, 0, -20, 3900000 ], "assets.rededge3.raster:bands": [ { "nodata": 0, "data_type": "uint16", "spatial_resolution": 20, "scale": 0.0001, "offset": -0.1 } ], "assets.rededge3.file:checksum": "1220f2623a57da9b09fe8253c2dc9a6377227041e86d192715c6d753638cb0977d99", "assets.rededge3.file:size": 53583888, "proj:epsg": 32612, }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -112.099469246340007, 35.238074627405702 ], [ -112.086441301193005, 34.249018117524301 ], [ -111.171637815685003, 34.254252630787903 ], [ -110.892875963752005, 35.136386493702297 ], [ -110.892735914686995, 35.243021163215097 ], [ -112.099469246340007, 35.238074627405702 ] ] ] } } +] +} diff --git a/autotest/gdrivers/data/netcdf/var_with_geoloc_array_but_no_coordinates_attr.nc b/autotest/gdrivers/data/netcdf/var_with_geoloc_array_but_no_coordinates_attr.nc new file mode 100644 index 000000000000..c5a6f2571dfb Binary files /dev/null and b/autotest/gdrivers/data/netcdf/var_with_geoloc_array_but_no_coordinates_attr.nc differ diff --git a/autotest/gdrivers/data/s102/generate_test.py b/autotest/gdrivers/data/s102/generate_test.py index d00b5c1581e4..836c9964b671 100755 --- a/autotest/gdrivers/data/s102/generate_test.py +++ b/autotest/gdrivers/data/s102/generate_test.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Generate test_s102.h5 diff --git a/autotest/gdrivers/data/s104/generate_test.py b/autotest/gdrivers/data/s104/generate_test.py index 8104232cde1b..0eea62d391e3 100755 --- a/autotest/gdrivers/data/s104/generate_test.py +++ b/autotest/gdrivers/data/s104/generate_test.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Generate test_s104.h5 diff --git a/autotest/gdrivers/data/s111/generate_test.py b/autotest/gdrivers/data/s111/generate_test.py index f7c13aa27e88..7481898bd33e 100755 --- a/autotest/gdrivers/data/s111/generate_test.py +++ b/autotest/gdrivers/data/s111/generate_test.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Generate test_s111.h5 diff --git a/autotest/gdrivers/data/vrt/arraysource_array_constant.vrt b/autotest/gdrivers/data/vrt/arraysource_array_constant.vrt new file mode 100644 index 000000000000..fda51041d605 --- /dev/null +++ b/autotest/gdrivers/data/vrt/arraysource_array_constant.vrt @@ -0,0 +1,13 @@ + + + real + + + Float64 + + + 10 + + + + diff --git a/autotest/gdrivers/data/wmts/WMTSCapabilities_THEMIS_NightIR_ControlledMosaics_100m_v2_oct2018.xml b/autotest/gdrivers/data/wmts/WMTSCapabilities_THEMIS_NightIR_ControlledMosaics_100m_v2_oct2018.xml new file mode 100644 index 000000000000..3dceeaa00d2b --- /dev/null +++ b/autotest/gdrivers/data/wmts/WMTSCapabilities_THEMIS_NightIR_ControlledMosaics_100m_v2_oct2018.xml @@ -0,0 +1,102 @@ + + + + + THEMIS_NightIR_ControlledMosaics_100m_v2_oct2018 + OGC WMTS + 1.0.0 + + + + + + + + + RESTful + + + + + + + + + + + + + + RESTful + + + + + + + + + + + + THEMIS_NightIR_ControlledMosaics_100m_v2_oct2018 + THEMIS_NightIR_ControlledMosaics_100m_v2_oct2018 + + -179.9999997 -65.0006576 + 179.9998849 65.0007535 + + + -179.9999997 -65.0006576 + 179.9998849 65.0007535 + + + + image/png + + default028mm + + + + + default + The tile matrix set that has scale values calculated based on the dpi defined by OGC specification (dpi assumes 0.28mm as the physical distance of a pixel). + default028mm + urn:ogc:def:crs:EPSG::104905 + 02.7922763629807472E+08-180.0 90.02562562.01.0 +11.3961381814903736E+08-180.0 90.02562564.02.0 +26.9806909074518681E+07-180.0 90.02562568.04.0 +33.4903454537259340E+07-180.0 90.025625616.08.0 +41.7451727268629670E+07-180.0 90.025625632.016.0 +58.7258636343148351E+06-180.0 90.025625664.032.0 +64.3629318171574175E+06-180.0 90.0256256128.064.0 +72.1814659085787088E+06-180.0 90.0256256256.0128.0 +81.0907329542893544E+06-180.0 90.0256256512.0256.0 +95.4536647714467719E+05-180.0 90.02562561024.0512.0 + + + + + + + diff --git a/autotest/gdrivers/data/zarr/generate_test_files.py b/autotest/gdrivers/data/zarr/generate_test_files.py index 416d2d78d727..73d41ce15ce0 100644 --- a/autotest/gdrivers/data/zarr/generate_test_files.py +++ b/autotest/gdrivers/data/zarr/generate_test_files.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Zarr driver diff --git a/autotest/gdrivers/dds.py b/autotest/gdrivers/dds.py index 35771deeceb1..d2161a0465c3 100644 --- a/autotest/gdrivers/dds.py +++ b/autotest/gdrivers/dds.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test DDS driver diff --git a/autotest/gdrivers/derived.py b/autotest/gdrivers/derived.py index 9d67fe14d896..d9450aa5a810 100755 --- a/autotest/gdrivers/derived.py +++ b/autotest/gdrivers/derived.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test derived driver diff --git a/autotest/gdrivers/dimap.py b/autotest/gdrivers/dimap.py index 6e3378512ac3..e282c3cb7b46 100755 --- a/autotest/gdrivers/dimap.py +++ b/autotest/gdrivers/dimap.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test SPOT DIMAP driver. diff --git a/autotest/gdrivers/dipex.py b/autotest/gdrivers/dipex.py index 7ee22a86a99a..b1f36662580a 100755 --- a/autotest/gdrivers/dipex.py +++ b/autotest/gdrivers/dipex.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test DIPEx driver diff --git a/autotest/gdrivers/doq1.py b/autotest/gdrivers/doq1.py index 248e7210f9fb..84f9a0764088 100755 --- a/autotest/gdrivers/doq1.py +++ b/autotest/gdrivers/doq1.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test DOQ1 driver diff --git a/autotest/gdrivers/doq2.py b/autotest/gdrivers/doq2.py index f838f6cfcaac..9976a49859f8 100755 --- a/autotest/gdrivers/doq2.py +++ b/autotest/gdrivers/doq2.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for DOQ2 driver. diff --git a/autotest/gdrivers/dted.py b/autotest/gdrivers/dted.py index a18a034247f4..deec68ce3e82 100755 --- a/autotest/gdrivers/dted.py +++ b/autotest/gdrivers/dted.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test DTED support. diff --git a/autotest/gdrivers/ecrgtoc.py b/autotest/gdrivers/ecrgtoc.py index 8ada6bd9a73e..bc6a3e910e57 100755 --- a/autotest/gdrivers/ecrgtoc.py +++ b/autotest/gdrivers/ecrgtoc.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for ECRGTOC driver. diff --git a/autotest/gdrivers/ecw.py b/autotest/gdrivers/ecw.py index 2ef47be51da9..0eaac23100a0 100755 --- a/autotest/gdrivers/ecw.py +++ b/autotest/gdrivers/ecw.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for ECW driver. diff --git a/autotest/gdrivers/eedai.py b/autotest/gdrivers/eedai.py index 6e94c5352403..5aa72bdd9295 100755 --- a/autotest/gdrivers/eedai.py +++ b/autotest/gdrivers/eedai.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Earth Engine Data API Images driver test suite. diff --git a/autotest/gdrivers/ehdr.py b/autotest/gdrivers/ehdr.py index d5687c8f08c0..f9d5dfdfe075 100755 --- a/autotest/gdrivers/ehdr.py +++ b/autotest/gdrivers/ehdr.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test EHdr format driver. diff --git a/autotest/gdrivers/eir.py b/autotest/gdrivers/eir.py index e6bce73bcf58..4758a2558e13 100755 --- a/autotest/gdrivers/eir.py +++ b/autotest/gdrivers/eir.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test EIR driver diff --git a/autotest/gdrivers/elas.py b/autotest/gdrivers/elas.py index 7bba07b144fc..baff705655a6 100755 --- a/autotest/gdrivers/elas.py +++ b/autotest/gdrivers/elas.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ELAS driver diff --git a/autotest/gdrivers/envi.py b/autotest/gdrivers/envi.py index d415c1e2cb57..0b6b22349d03 100755 --- a/autotest/gdrivers/envi.py +++ b/autotest/gdrivers/envi.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ENVI format driver. diff --git a/autotest/gdrivers/envisat.py b/autotest/gdrivers/envisat.py index 768cb241be2e..ac4e8b369d52 100755 --- a/autotest/gdrivers/envisat.py +++ b/autotest/gdrivers/envisat.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for ENVISAT driver. diff --git a/autotest/gdrivers/ers.py b/autotest/gdrivers/ers.py index 0bfd6abf93f8..595629a67140 100755 --- a/autotest/gdrivers/ers.py +++ b/autotest/gdrivers/ers.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ERS format driver. diff --git a/autotest/gdrivers/esric.py b/autotest/gdrivers/esric.py index 32f075e8f81a..7f43994d7ddc 100755 --- a/autotest/gdrivers/esric.py +++ b/autotest/gdrivers/esric.py @@ -24,7 +24,7 @@ @pytest.fixture() def esric_ds(): - ds = gdal.Open("data/esric/Layers/conf.xml") + ds = gdal.Open("/vsitar/data/esric/Layers.tar/Layers/conf.xml") assert ds is not None, "open failed" return ds diff --git a/autotest/gdrivers/exr.py b/autotest/gdrivers/exr.py index 37b2e0ed1ecf..6593cb052b97 100644 --- a/autotest/gdrivers/exr.py +++ b/autotest/gdrivers/exr.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test EXR driver diff --git a/autotest/gdrivers/fast.py b/autotest/gdrivers/fast.py index bcfbf9a1c705..b77ccbbaaec3 100755 --- a/autotest/gdrivers/fast.py +++ b/autotest/gdrivers/fast.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test EOSAT FAST Format support. diff --git a/autotest/gdrivers/fit.py b/autotest/gdrivers/fit.py index 404c0f74c8fe..654f8cf19732 100755 --- a/autotest/gdrivers/fit.py +++ b/autotest/gdrivers/fit.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for FIT driver. diff --git a/autotest/gdrivers/fits.py b/autotest/gdrivers/fits.py index ca18ee7372c3..f4feafdb3de3 100755 --- a/autotest/gdrivers/fits.py +++ b/autotest/gdrivers/fits.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for FITS driver. diff --git a/autotest/gdrivers/gdalhttp.py b/autotest/gdrivers/gdalhttp.py index 40231a90e658..2bad4875f302 100755 --- a/autotest/gdrivers/gdalhttp.py +++ b/autotest/gdrivers/gdalhttp.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test HTTP Driver. diff --git a/autotest/gdrivers/genbin.py b/autotest/gdrivers/genbin.py index 732ac3e8b2fa..4bc1d8d267e7 100755 --- a/autotest/gdrivers/genbin.py +++ b/autotest/gdrivers/genbin.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Generic Binary format driver. diff --git a/autotest/gdrivers/generate_fits.py b/autotest/gdrivers/generate_fits.py index 9001f7d00b93..30e95b3088e9 100644 --- a/autotest/gdrivers/generate_fits.py +++ b/autotest/gdrivers/generate_fits.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Generate FITS samples diff --git a/autotest/gdrivers/georaster.py b/autotest/gdrivers/georaster.py index db5956f5f007..4217eee6f168 100755 --- a/autotest/gdrivers/georaster.py +++ b/autotest/gdrivers/georaster.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: GeoRaster Testing. diff --git a/autotest/gdrivers/gff.py b/autotest/gdrivers/gff.py index 71b903c8882f..3f83a2a70f82 100755 --- a/autotest/gdrivers/gff.py +++ b/autotest/gdrivers/gff.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GFF driver diff --git a/autotest/gdrivers/gif.py b/autotest/gdrivers/gif.py index 32288405d39a..6fa0e25b2252 100755 --- a/autotest/gdrivers/gif.py +++ b/autotest/gdrivers/gif.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for GIF driver. diff --git a/autotest/gdrivers/gpkg.py b/autotest/gdrivers/gpkg.py index 7896951a17ec..f791c8369568 100755 --- a/autotest/gdrivers/gpkg.py +++ b/autotest/gdrivers/gpkg.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GeoPackage raster functionality. diff --git a/autotest/gdrivers/grassasciigrid.py b/autotest/gdrivers/grassasciigrid.py index 320b45adc8a8..718dab85f892 100755 --- a/autotest/gdrivers/grassasciigrid.py +++ b/autotest/gdrivers/grassasciigrid.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GRASS ASCII Grid support. diff --git a/autotest/gdrivers/grib.py b/autotest/gdrivers/grib.py index f8a0c12002fd..2631cc1ee68e 100755 --- a/autotest/gdrivers/grib.py +++ b/autotest/gdrivers/grib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GRIB driver. diff --git a/autotest/gdrivers/gribmultidim.py b/autotest/gdrivers/gribmultidim.py index be55bec53338..b16e317a976f 100755 --- a/autotest/gdrivers/gribmultidim.py +++ b/autotest/gdrivers/gribmultidim.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test multidimensional support in GRIB driver diff --git a/autotest/gdrivers/gsc.py b/autotest/gdrivers/gsc.py index 82e8b4a6a22f..c362288cbfd6 100755 --- a/autotest/gdrivers/gsc.py +++ b/autotest/gdrivers/gsc.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GSC driver diff --git a/autotest/gdrivers/gsg.py b/autotest/gdrivers/gsg.py index 4af7a31f4b55..8773e5e1b671 100755 --- a/autotest/gdrivers/gsg.py +++ b/autotest/gdrivers/gsg.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Golden Software ASCII and binary grid format. diff --git a/autotest/gdrivers/gta.py b/autotest/gdrivers/gta.py index cef89095a7c0..35d1db54288d 100755 --- a/autotest/gdrivers/gta.py +++ b/autotest/gdrivers/gta.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GTA driver diff --git a/autotest/gdrivers/gti.py b/autotest/gdrivers/gti.py index c9691ebd0574..e046df171b95 100755 --- a/autotest/gdrivers/gti.py +++ b/autotest/gdrivers/gti.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GDALTileIndexDataset support. @@ -2985,3 +2984,37 @@ def test_gti_stac_geoparquet(): "Blue", "NIR (near-infrared)", ] + + +############################################################################### + + +@pytest.mark.require_curl() +@pytest.mark.require_driver("GeoJSON") +def test_gti_stac_geoparquet_sentinel2(): + + url = "https://e84-earth-search-sentinel-data.s3.us-west-2.amazonaws.com/sentinel-2-c1-l2a/12/S/VD/2023/12/S2A_T12SVD_20231213T181818_L2A/B07.tif" + + conn = gdaltest.gdalurlopen(url, timeout=4) + if conn is None: + pytest.skip("cannot open URL") + + ds = gdal.Open("GTI:data/gti/sentinel2_stac_geoparquet.geojson") + assert ds.RasterXSize == 5556 + assert ds.RasterYSize == 5540 + assert ds.GetSpatialRef().GetAuthorityCode(None) == "32612" + assert ds.GetGeoTransform() == pytest.approx( + (398760.0, 20.0, 0.0, 3900560.0, 0.0, -20.0), rel=1e-5 + ) + assert ds.RasterCount == 1 + band = ds.GetRasterBand(1) + assert band.DataType == gdal.GDT_UInt16 + assert band.GetNoDataValue() == 0 + assert band.GetColorInterpretation() == gdal.GCI_RedEdgeBand + assert band.GetDescription() == "B07" + assert band.GetOffset() == -0.1 + assert band.GetScale() == 0.0001 + assert band.GetMetadata_Dict("IMAGERY") == { + "CENTRAL_WAVELENGTH_UM": "0.783", + "FWHM_UM": "0.028", + } diff --git a/autotest/gdrivers/gxf.py b/autotest/gdrivers/gxf.py index d1657b6d0d99..458fe466b744 100755 --- a/autotest/gdrivers/gxf.py +++ b/autotest/gdrivers/gxf.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for GXF driver. diff --git a/autotest/gdrivers/hdf5.py b/autotest/gdrivers/hdf5.py index 48b0eede7fac..fc5628621cb8 100755 --- a/autotest/gdrivers/hdf5.py +++ b/autotest/gdrivers/hdf5.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for HDF5 driver. diff --git a/autotest/gdrivers/hdf5multidim.py b/autotest/gdrivers/hdf5multidim.py index 2a2280a615b6..7dcc5e6889b8 100755 --- a/autotest/gdrivers/hdf5multidim.py +++ b/autotest/gdrivers/hdf5multidim.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test multidimensional support in HDF5 driver diff --git a/autotest/gdrivers/heif.py b/autotest/gdrivers/heif.py index dc67b401c843..bdc30d604b6b 100644 --- a/autotest/gdrivers/heif.py +++ b/autotest/gdrivers/heif.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test HEIF driver @@ -707,6 +706,9 @@ def test_heif_geoheif_curie(): == 'CCBY "Jacobs Group (Australia) Pty Ltd and Australian Capital Territory"' ) assert ds.GetMetadataItem("TAGS", "DESCRIPTION_en-AU") == "copyright" + assert ds.GetSpatialRef() is not None + assert ds.GetSpatialRef().GetAuthorityName(None) == "EPSG" + assert ds.GetSpatialRef().GetAuthorityCode(None) == "32755" assert ds.GetGeoTransform() is not None assert ds.GetGeoTransform() == pytest.approx( [691051.2, 0.1, 0.0, 6090000.0, 0.0, -0.1] @@ -720,3 +722,37 @@ def test_heif_geoheif_curie(): and gcp.GCPY == pytest.approx(6090000.0, abs=1e-5) and gcp.GCPZ == pytest.approx(0, abs=1e-5) ) + + +@pytest.mark.skipif( + not _has_geoheif_support(), + reason="this libheif does not support opaque properties like geoheif", +) +def test_heif_geoheif_curie_order(): + ds = gdal.Open("data/heif/geo_curi.heif") + assert ds + assert ds.RasterCount == 3 + assert ds.RasterXSize == 256 + assert ds.RasterYSize == 64 + assert ds.GetMetadataItem("NAME", "DESCRIPTION_en-AU") == "Copyright Statement" + assert ( + ds.GetMetadataItem("DESCRIPTION", "DESCRIPTION_en-AU") + == 'CCBY "Jacobs Group (Australia) Pty Ltd and Australian Capital Territory"' + ) + assert ds.GetMetadataItem("TAGS", "DESCRIPTION_en-AU") == "copyright" + assert ds.GetGeoTransform() is not None + assert ds.GetGeoTransform() == pytest.approx( + [691051.2, 0.1, 0.0, 6090000.0, 0.0, -0.1] + ) + assert ds.GetSpatialRef() is not None + assert ds.GetSpatialRef().GetAuthorityName(None) == "EPSG" + assert ds.GetSpatialRef().GetAuthorityCode(None) == "32755" + assert ds.GetGCPCount() == 1 + gcp = ds.GetGCPs()[0] + assert ( + gcp.GCPPixel == pytest.approx(0, abs=1e-5) + and gcp.GCPLine == pytest.approx(0, abs=1e-5) + and gcp.GCPX == pytest.approx(691051.2, abs=1e-5) + and gcp.GCPY == pytest.approx(6090000.0, abs=1e-5) + and gcp.GCPZ == pytest.approx(0, abs=1e-5) + ) diff --git a/autotest/gdrivers/hf2.py b/autotest/gdrivers/hf2.py index 6499a65c83db..e0a86d811376 100755 --- a/autotest/gdrivers/hf2.py +++ b/autotest/gdrivers/hf2.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for HF2 driver. diff --git a/autotest/gdrivers/hfa.py b/autotest/gdrivers/hfa.py index 3b72e082dcc2..eb9d83343816 100755 --- a/autotest/gdrivers/hfa.py +++ b/autotest/gdrivers/hfa.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test some functions of HFA driver. Most testing in ../gcore/hfa_* diff --git a/autotest/gdrivers/idrisi.py b/autotest/gdrivers/idrisi.py index 28be6e5fd407..5dfce5da35bd 100755 --- a/autotest/gdrivers/idrisi.py +++ b/autotest/gdrivers/idrisi.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for RST/Idrisi driver. diff --git a/autotest/gdrivers/ilwis.py b/autotest/gdrivers/ilwis.py index fccb9d336167..e31ebde7f9c4 100755 --- a/autotest/gdrivers/ilwis.py +++ b/autotest/gdrivers/ilwis.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ILWIS format driver. diff --git a/autotest/gdrivers/iris.py b/autotest/gdrivers/iris.py index 09da26c8f18b..2a4f9a7019c1 100755 --- a/autotest/gdrivers/iris.py +++ b/autotest/gdrivers/iris.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test IRIS driver diff --git a/autotest/gdrivers/isce.py b/autotest/gdrivers/isce.py index 45f5255edede..2aaa7d20c9c7 100755 --- a/autotest/gdrivers/isce.py +++ b/autotest/gdrivers/isce.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ISCE format driver. diff --git a/autotest/gdrivers/isg.py b/autotest/gdrivers/isg.py index 0b76a16303e8..8fe793ab48e4 100755 --- a/autotest/gdrivers/isg.py +++ b/autotest/gdrivers/isg.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ISG support. diff --git a/autotest/gdrivers/isis.py b/autotest/gdrivers/isis.py index 798b5a0f3392..f39b4e724125 100755 --- a/autotest/gdrivers/isis.py +++ b/autotest/gdrivers/isis.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ISIS3 formats. diff --git a/autotest/gdrivers/isis2.py b/autotest/gdrivers/isis2.py index 8adb883f2f46..94657211d39b 100755 --- a/autotest/gdrivers/isis2.py +++ b/autotest/gdrivers/isis2.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for ISIS2 driver. diff --git a/autotest/gdrivers/jdem.py b/autotest/gdrivers/jdem.py index 4cd6f4702c09..a04600f1629c 100755 --- a/autotest/gdrivers/jdem.py +++ b/autotest/gdrivers/jdem.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test JDEM driver diff --git a/autotest/gdrivers/jp2kak.py b/autotest/gdrivers/jp2kak.py index 21549b715484..891726aab1e6 100755 --- a/autotest/gdrivers/jp2kak.py +++ b/autotest/gdrivers/jp2kak.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for JP2KAK JPEG2000 driver. diff --git a/autotest/gdrivers/jp2metadata.py b/autotest/gdrivers/jp2metadata.py index a981c3138dec..302b53b91b61 100755 --- a/autotest/gdrivers/jp2metadata.py +++ b/autotest/gdrivers/jp2metadata.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test JP2 metadata support. diff --git a/autotest/gdrivers/jp2openjpeg.py b/autotest/gdrivers/jp2openjpeg.py index 1aa3439bba66..e3b8e20dbbdf 100755 --- a/autotest/gdrivers/jp2openjpeg.py +++ b/autotest/gdrivers/jp2openjpeg.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for JP2OpenJPEG driver. diff --git a/autotest/gdrivers/jpeg.py b/autotest/gdrivers/jpeg.py index 1afece500db4..b04c358b321c 100755 --- a/autotest/gdrivers/jpeg.py +++ b/autotest/gdrivers/jpeg.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test JPEG format driver. diff --git a/autotest/gdrivers/jpeg_profile.py b/autotest/gdrivers/jpeg_profile.py index b2678b324659..5e34d5700a7b 100755 --- a/autotest/gdrivers/jpeg_profile.py +++ b/autotest/gdrivers/jpeg_profile.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic support for ICC profile in JPEG file. diff --git a/autotest/gdrivers/jpegxl.py b/autotest/gdrivers/jpegxl.py index e02a40992155..4c324eada3c5 100755 --- a/autotest/gdrivers/jpegxl.py +++ b/autotest/gdrivers/jpegxl.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for JPEGXL driver. diff --git a/autotest/gdrivers/kmlsuperoverlay.py b/autotest/gdrivers/kmlsuperoverlay.py index 4f71b22d539f..2b799113416f 100755 --- a/autotest/gdrivers/kmlsuperoverlay.py +++ b/autotest/gdrivers/kmlsuperoverlay.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test write functionality for KMLSUPEROVERLAY driver. diff --git a/autotest/gdrivers/kro.py b/autotest/gdrivers/kro.py index fe10bd74bbf1..05c3d1b1c94b 100755 --- a/autotest/gdrivers/kro.py +++ b/autotest/gdrivers/kro.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Even Rouault, diff --git a/autotest/gdrivers/ktx2.py b/autotest/gdrivers/ktx2.py index 2162d942a88d..15b19e215c33 100755 --- a/autotest/gdrivers/ktx2.py +++ b/autotest/gdrivers/ktx2.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test KTX2 driver diff --git a/autotest/gdrivers/l1b.py b/autotest/gdrivers/l1b.py index fcc6dca84cc4..c039b3e76c5e 100755 --- a/autotest/gdrivers/l1b.py +++ b/autotest/gdrivers/l1b.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for L1B driver. diff --git a/autotest/gdrivers/lan.py b/autotest/gdrivers/lan.py index af971d9433eb..9fd6d16bce40 100755 --- a/autotest/gdrivers/lan.py +++ b/autotest/gdrivers/lan.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test LAN driver diff --git a/autotest/gdrivers/lcp.py b/autotest/gdrivers/lcp.py index 20a72dcabaaf..1ce6ea65e92e 100755 --- a/autotest/gdrivers/lcp.py +++ b/autotest/gdrivers/lcp.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for LCP driver. diff --git a/autotest/gdrivers/leveller.py b/autotest/gdrivers/leveller.py index 800d5a58938c..8ab9a11683e0 100755 --- a/autotest/gdrivers/leveller.py +++ b/autotest/gdrivers/leveller.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Leveller driver support. diff --git a/autotest/gdrivers/loslas.py b/autotest/gdrivers/loslas.py index 306521139612..68828b19e2d2 100755 --- a/autotest/gdrivers/loslas.py +++ b/autotest/gdrivers/loslas.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: LOS/LAS Testing. diff --git a/autotest/gdrivers/mbtiles.py b/autotest/gdrivers/mbtiles.py index 50f0b3feb64e..0b0484de2db2 100755 --- a/autotest/gdrivers/mbtiles.py +++ b/autotest/gdrivers/mbtiles.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for MBTiles driver. diff --git a/autotest/gdrivers/mem.py b/autotest/gdrivers/mem.py index 878155dda27b..28eb05409655 100755 --- a/autotest/gdrivers/mem.py +++ b/autotest/gdrivers/mem.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test MEM format driver. diff --git a/autotest/gdrivers/memmultidim.py b/autotest/gdrivers/memmultidim.py index a1b33c5a5ecc..3d9fa42ec75b 100755 --- a/autotest/gdrivers/memmultidim.py +++ b/autotest/gdrivers/memmultidim.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test multidimensional support in MEM driver diff --git a/autotest/gdrivers/mff.py b/autotest/gdrivers/mff.py index f2db3f9d3daa..b7d3202fccd8 100755 --- a/autotest/gdrivers/mff.py +++ b/autotest/gdrivers/mff.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test MFF driver diff --git a/autotest/gdrivers/mff2.py b/autotest/gdrivers/mff2.py index 534cc844ee20..f6c096387438 100755 --- a/autotest/gdrivers/mff2.py +++ b/autotest/gdrivers/mff2.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test MFF2 driver diff --git a/autotest/gdrivers/mrf.py b/autotest/gdrivers/mrf.py index 7cbe7b6376db..35320035fe45 100755 --- a/autotest/gdrivers/mrf.py +++ b/autotest/gdrivers/mrf.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for MRF driver. diff --git a/autotest/gdrivers/mrsid.py b/autotest/gdrivers/mrsid.py index a1c887b31357..c6a94e28562e 100755 --- a/autotest/gdrivers/mrsid.py +++ b/autotest/gdrivers/mrsid.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for MrSID driver. diff --git a/autotest/gdrivers/ndf.py b/autotest/gdrivers/ndf.py index e31bba57a01d..93ca5729e9f2 100755 --- a/autotest/gdrivers/ndf.py +++ b/autotest/gdrivers/ndf.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test NLAPS/NDF driver. diff --git a/autotest/gdrivers/netcdf.py b/autotest/gdrivers/netcdf.py index 6622974f49b4..3dbd8a76c7d6 100755 --- a/autotest/gdrivers/netcdf.py +++ b/autotest/gdrivers/netcdf.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test NetCDF driver support. @@ -6616,3 +6615,22 @@ def test_netcdf_write_check_golden_file( ) assert os.stat(golden_file).st_size == os.stat(out_filename).st_size assert open(golden_file, "rb").read() == open(out_filename, "rb").read() + + +############################################################################### +# Test we identify a geolocation array for a variable that lacks a +# "coordinates" attribute, but that has side "lon" and "lat" 2D variables +# whose dimensions are the same as the last 2 ones of the variable of interest + + +def test_netcdf_var_with_geoloc_array_but_no_coordinates_attr(): + + ds = gdal.Open( + "NETCDF:data/netcdf/var_with_geoloc_array_but_no_coordinates_attr.nc:NO2" + ) + got_md = ds.GetMetadata("GEOLOCATION") + assert got_md + assert ( + got_md["X_DATASET"] + == 'NETCDF:"data/netcdf/var_with_geoloc_array_but_no_coordinates_attr.nc":lon' + ) diff --git a/autotest/gdrivers/netcdf_cf.py b/autotest/gdrivers/netcdf_cf.py index 7e60718ed431..8432b6ef7408 100755 --- a/autotest/gdrivers/netcdf_cf.py +++ b/autotest/gdrivers/netcdf_cf.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test NetCDF driver support. diff --git a/autotest/gdrivers/netcdf_multidim.py b/autotest/gdrivers/netcdf_multidim.py index 253cb99b7197..9a953fe91974 100755 --- a/autotest/gdrivers/netcdf_multidim.py +++ b/autotest/gdrivers/netcdf_multidim.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test multidimensional support in netCDF driver @@ -4157,3 +4156,30 @@ def check_metadata(): assert os.path.exists(pam_filename) os.unlink(pam_filename) + + +############################################################################### + + +@gdaltest.enable_exceptions() +@pytest.mark.require_proj(9) +def test_netcdf_multidim_WGS84_and_EGM96_height(tmp_path): + + tmp_filename = str(tmp_path / "out.nc") + with gdal.GetDriverByName("netCDF").Create(tmp_filename, 3, 3) as ds: + srs = osr.SpatialReference() + srs.SetAxisMappingStrategy(osr.OAMS_TRADITIONAL_GIS_ORDER) + srs.ImportFromEPSG(9707) + ds.SetSpatialRef(srs) + ds.SetGeoTransform([2, 1, 0, 49, 0, -1]) + with gdal.Open(tmp_filename) as ds: + srs = ds.GetSpatialRef() + assert srs.GetAuthorityCode(None) == "9707" + # We currently report a 3rd axis, which is dubious + assert srs.GetDataAxisToSRSAxisMapping()[0:2] == [2, 1] + with gdal.OpenEx(tmp_filename, gdal.OF_MULTIDIM_RASTER) as ds: + rg = ds.GetRootGroup() + ar = rg.OpenMDArray("Band1") + srs = ar.GetSpatialRef() + assert srs.GetAuthorityCode(None) == "9707" + assert srs.GetDataAxisToSRSAxisMapping() == [1, 2] diff --git a/autotest/gdrivers/netcdf_multidim_pamproxydb.py b/autotest/gdrivers/netcdf_multidim_pamproxydb.py index f2884ab73c6d..43d9ef3fec81 100755 --- a/autotest/gdrivers/netcdf_multidim_pamproxydb.py +++ b/autotest/gdrivers/netcdf_multidim_pamproxydb.py @@ -1,6 +1,5 @@ #!/usr/bin/env python ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test multidimensional support in netCDF driver diff --git a/autotest/gdrivers/ngsgeoid.py b/autotest/gdrivers/ngsgeoid.py index 31cc41ef3b7f..f7cd59b0c2f2 100755 --- a/autotest/gdrivers/ngsgeoid.py +++ b/autotest/gdrivers/ngsgeoid.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for NGSGEOID driver. diff --git a/autotest/gdrivers/ngw.py b/autotest/gdrivers/ngw.py index 71c3a8b76dd5..86cb45df2647 100755 --- a/autotest/gdrivers/ngw.py +++ b/autotest/gdrivers/ngw.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test NGW support. diff --git a/autotest/gdrivers/nitf.py b/autotest/gdrivers/nitf.py index 0efaf689b8f4..bf84bf230cd4 100755 --- a/autotest/gdrivers/nitf.py +++ b/autotest/gdrivers/nitf.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for NITF driver. diff --git a/autotest/gdrivers/noaa_b.py b/autotest/gdrivers/noaa_b.py index 464bc69e3a41..820bf2ed6ddb 100755 --- a/autotest/gdrivers/noaa_b.py +++ b/autotest/gdrivers/noaa_b.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test functionality of NOAA_B driver. diff --git a/autotest/gdrivers/nsidcbin.py b/autotest/gdrivers/nsidcbin.py index 3818289f94be..7d1fa8652981 100644 --- a/autotest/gdrivers/nsidcbin.py +++ b/autotest/gdrivers/nsidcbin.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test NSIDCbin format driver. diff --git a/autotest/gdrivers/ntv2.py b/autotest/gdrivers/ntv2.py index fc98584b6d0a..8f930746c3a9 100755 --- a/autotest/gdrivers/ntv2.py +++ b/autotest/gdrivers/ntv2.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: NTv2 Testing. diff --git a/autotest/gdrivers/nwt_grc.py b/autotest/gdrivers/nwt_grc.py index 72f9d2aeb8f5..8efc5e163170 100755 --- a/autotest/gdrivers/nwt_grc.py +++ b/autotest/gdrivers/nwt_grc.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Northwood GRC driver diff --git a/autotest/gdrivers/nwt_grd.py b/autotest/gdrivers/nwt_grd.py index 40e3cafae287..79e57877cffe 100755 --- a/autotest/gdrivers/nwt_grd.py +++ b/autotest/gdrivers/nwt_grd.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Northwood GRD driver diff --git a/autotest/gdrivers/ogcapi.py b/autotest/gdrivers/ogcapi.py index 4edd36cbff41..34d9162dccca 100644 --- a/autotest/gdrivers/ogcapi.py +++ b/autotest/gdrivers/ogcapi.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: OGCAPI driver testing. diff --git a/autotest/gdrivers/ozi.py b/autotest/gdrivers/ozi.py index 59af83a14160..fbf5034d7634 100755 --- a/autotest/gdrivers/ozi.py +++ b/autotest/gdrivers/ozi.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: OZI Testing. diff --git a/autotest/gdrivers/paux.py b/autotest/gdrivers/paux.py index 4f9f62647ee9..eb27fa7edc22 100755 --- a/autotest/gdrivers/paux.py +++ b/autotest/gdrivers/paux.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for PAux driver. diff --git a/autotest/gdrivers/pcidsk.py b/autotest/gdrivers/pcidsk.py index 37a5524e8214..3edaa46f78e6 100755 --- a/autotest/gdrivers/pcidsk.py +++ b/autotest/gdrivers/pcidsk.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for PCIDSK driver. diff --git a/autotest/gdrivers/pcraster.py b/autotest/gdrivers/pcraster.py index 753c36854648..f387128dfcd6 100755 --- a/autotest/gdrivers/pcraster.py +++ b/autotest/gdrivers/pcraster.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test PCRaster driver support. diff --git a/autotest/gdrivers/pdf.py b/autotest/gdrivers/pdf.py index 7b74e9b5384c..6239ea6b8bf1 100755 --- a/autotest/gdrivers/pdf.py +++ b/autotest/gdrivers/pdf.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: PDF Testing. diff --git a/autotest/gdrivers/pds.py b/autotest/gdrivers/pds.py index 9bc9b5d40f37..4c14235457f2 100755 --- a/autotest/gdrivers/pds.py +++ b/autotest/gdrivers/pds.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for PDS driver. diff --git a/autotest/gdrivers/pds4.py b/autotest/gdrivers/pds4.py index dcf31e28ca28..ae4434459d1b 100755 --- a/autotest/gdrivers/pds4.py +++ b/autotest/gdrivers/pds4.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test PDS4 format diff --git a/autotest/gdrivers/plmosaic.py b/autotest/gdrivers/plmosaic.py index 3c7edb225155..51ae26d24543 100755 --- a/autotest/gdrivers/plmosaic.py +++ b/autotest/gdrivers/plmosaic.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: PlanetLabs mosaic driver test suite. diff --git a/autotest/gdrivers/png.py b/autotest/gdrivers/png.py index 4136217e6e4f..7260ec251484 100755 --- a/autotest/gdrivers/png.py +++ b/autotest/gdrivers/png.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for PNG driver. diff --git a/autotest/gdrivers/png_profile.py b/autotest/gdrivers/png_profile.py index d48f406b0d5a..ba13d9bf1528 100755 --- a/autotest/gdrivers/png_profile.py +++ b/autotest/gdrivers/png_profile.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic support for ICC profile in PNG file. diff --git a/autotest/gdrivers/pnm.py b/autotest/gdrivers/pnm.py index c1119c8260bf..ca73c80d06b6 100755 --- a/autotest/gdrivers/pnm.py +++ b/autotest/gdrivers/pnm.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: PNM (Portable Anyware Map) Testing. diff --git a/autotest/gdrivers/postgisraster.py b/autotest/gdrivers/postgisraster.py index ae8d53c2e244..553ea229e68e 100755 --- a/autotest/gdrivers/postgisraster.py +++ b/autotest/gdrivers/postgisraster.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: PostGISRaster Testing. diff --git a/autotest/gdrivers/r.py b/autotest/gdrivers/r.py index 831872ab2784..ec02766b8abe 100755 --- a/autotest/gdrivers/r.py +++ b/autotest/gdrivers/r.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test R driver support. diff --git a/autotest/gdrivers/rasterlite.py b/autotest/gdrivers/rasterlite.py index c9083dd72a93..2f9f8d1ce5aa 100755 --- a/autotest/gdrivers/rasterlite.py +++ b/autotest/gdrivers/rasterlite.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for Rasterlite driver. diff --git a/autotest/gdrivers/rcm.py b/autotest/gdrivers/rcm.py index 556e446bddbe..b39dfc1a5d76 100755 --- a/autotest/gdrivers/rcm.py +++ b/autotest/gdrivers/rcm.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test RCM driver diff --git a/autotest/gdrivers/rik.py b/autotest/gdrivers/rik.py index 4e6d00ce89cf..26150be40556 100755 --- a/autotest/gdrivers/rik.py +++ b/autotest/gdrivers/rik.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: RIK Testing. diff --git a/autotest/gdrivers/rl2.py b/autotest/gdrivers/rl2.py index b21743ee4036..48f02e75eb0d 100755 --- a/autotest/gdrivers/rl2.py +++ b/autotest/gdrivers/rl2.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for SQLite RasterLite2 driver. diff --git a/autotest/gdrivers/rmf.py b/autotest/gdrivers/rmf.py index ac73d5a85dcb..bc1aed810491 100755 --- a/autotest/gdrivers/rmf.py +++ b/autotest/gdrivers/rmf.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Raster Matrix Format used in GISes "Panorama"/"Integratsia". diff --git a/autotest/gdrivers/roipac.py b/autotest/gdrivers/roipac.py index 29e5b925e60d..d30b07a2468f 100755 --- a/autotest/gdrivers/roipac.py +++ b/autotest/gdrivers/roipac.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ROI_PAC format driver. diff --git a/autotest/gdrivers/rpftoc.py b/autotest/gdrivers/rpftoc.py index b77d085a33a0..f13af13a24d3 100755 --- a/autotest/gdrivers/rpftoc.py +++ b/autotest/gdrivers/rpftoc.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for RPFTOC driver. diff --git a/autotest/gdrivers/rraster.py b/autotest/gdrivers/rraster.py index 87ecff82741e..1c7ad96d5347 100755 --- a/autotest/gdrivers/rraster.py +++ b/autotest/gdrivers/rraster.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test RRASTER format driver. diff --git a/autotest/gdrivers/rs2.py b/autotest/gdrivers/rs2.py index fa034343d36f..5b30ac22e656 100755 --- a/autotest/gdrivers/rs2.py +++ b/autotest/gdrivers/rs2.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test RS2 driver diff --git a/autotest/gdrivers/s102.py b/autotest/gdrivers/s102.py index 171f40cfa44a..e7734048a868 100755 --- a/autotest/gdrivers/s102.py +++ b/autotest/gdrivers/s102.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for S102 driver. diff --git a/autotest/gdrivers/s104.py b/autotest/gdrivers/s104.py index ca05884f2858..c0e6ea63989d 100755 --- a/autotest/gdrivers/s104.py +++ b/autotest/gdrivers/s104.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for S104 driver. diff --git a/autotest/gdrivers/s111.py b/autotest/gdrivers/s111.py index 95d9e2dae3bd..ac572537cd68 100755 --- a/autotest/gdrivers/s111.py +++ b/autotest/gdrivers/s111.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for S111 driver. diff --git a/autotest/gdrivers/safe.py b/autotest/gdrivers/safe.py index df2656e19c30..3f228e407a12 100755 --- a/autotest/gdrivers/safe.py +++ b/autotest/gdrivers/safe.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test SAFE driver diff --git a/autotest/gdrivers/saga.py b/autotest/gdrivers/saga.py index 9e8811871d1f..866303fce7e0 100755 --- a/autotest/gdrivers/saga.py +++ b/autotest/gdrivers/saga.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test SAGA GIS Binary driver diff --git a/autotest/gdrivers/sar_ceos.py b/autotest/gdrivers/sar_ceos.py index 1f463ee77b72..8ff713c9e499 100755 --- a/autotest/gdrivers/sar_ceos.py +++ b/autotest/gdrivers/sar_ceos.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test SAR_CEOS driver. diff --git a/autotest/gdrivers/sdts.py b/autotest/gdrivers/sdts.py index 485613447c81..958c7bd212ea 100755 --- a/autotest/gdrivers/sdts.py +++ b/autotest/gdrivers/sdts.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for SDTS driver. diff --git a/autotest/gdrivers/sentinel2.py b/autotest/gdrivers/sentinel2.py index e72ae4ba2d8c..7b9f6dd4bb1f 100755 --- a/autotest/gdrivers/sentinel2.py +++ b/autotest/gdrivers/sentinel2.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Sentinel2 support. diff --git a/autotest/gdrivers/sgi.py b/autotest/gdrivers/sgi.py index 3ec03db2f091..5b4343e23f3c 100755 --- a/autotest/gdrivers/sgi.py +++ b/autotest/gdrivers/sgi.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: PNM (Portable Anyware Map) Testing. diff --git a/autotest/gdrivers/sigdem.py b/autotest/gdrivers/sigdem.py index d491eb7fcfbf..1a61e223f79e 100755 --- a/autotest/gdrivers/sigdem.py +++ b/autotest/gdrivers/sigdem.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Scaled Integer Gridded Elevation Model support. diff --git a/autotest/gdrivers/snodas.py b/autotest/gdrivers/snodas.py index 115d6c13153b..f58a8521e534 100755 --- a/autotest/gdrivers/snodas.py +++ b/autotest/gdrivers/snodas.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test SNODAS driver diff --git a/autotest/gdrivers/srp.py b/autotest/gdrivers/srp.py index bf186bb169d4..ebffbe654a24 100755 --- a/autotest/gdrivers/srp.py +++ b/autotest/gdrivers/srp.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for SRP driver. diff --git a/autotest/gdrivers/srtmhgt.py b/autotest/gdrivers/srtmhgt.py index 06eae960314c..35e8848dd0cd 100755 --- a/autotest/gdrivers/srtmhgt.py +++ b/autotest/gdrivers/srtmhgt.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test SRTMHGT support. diff --git a/autotest/gdrivers/stacit.py b/autotest/gdrivers/stacit.py index 8c14463ae675..eaec895eb94a 100755 --- a/autotest/gdrivers/stacit.py +++ b/autotest/gdrivers/stacit.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test STACIT driver diff --git a/autotest/gdrivers/stacta.py b/autotest/gdrivers/stacta.py index 7bce7f6e5054..0f157c34b410 100755 --- a/autotest/gdrivers/stacta.py +++ b/autotest/gdrivers/stacta.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test STACTA driver diff --git a/autotest/gdrivers/test_validate_jp2.py b/autotest/gdrivers/test_validate_jp2.py index b652701feda7..32fdfb6aa068 100755 --- a/autotest/gdrivers/test_validate_jp2.py +++ b/autotest/gdrivers/test_validate_jp2.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test validate_jp2 script diff --git a/autotest/gdrivers/tga.py b/autotest/gdrivers/tga.py index b09dfdd5f4e9..88204a099d72 100644 --- a/autotest/gdrivers/tga.py +++ b/autotest/gdrivers/tga.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test TGA driver diff --git a/autotest/gdrivers/tiff_profile.py b/autotest/gdrivers/tiff_profile.py index 5be3ef47aa88..2f3deff13cd8 100755 --- a/autotest/gdrivers/tiff_profile.py +++ b/autotest/gdrivers/tiff_profile.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic support for ICC profile in TIFF file. diff --git a/autotest/gdrivers/til.py b/autotest/gdrivers/til.py index 8c7fe3b2407b..831cb5852f3f 100755 --- a/autotest/gdrivers/til.py +++ b/autotest/gdrivers/til.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test TIL driver diff --git a/autotest/gdrivers/tiledb_multidim.py b/autotest/gdrivers/tiledb_multidim.py index 738ad873d0a9..6a6cfa69e818 100755 --- a/autotest/gdrivers/tiledb_multidim.py +++ b/autotest/gdrivers/tiledb_multidim.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write multidimensional functionality for TileDB format. diff --git a/autotest/gdrivers/tiledb_read.py b/autotest/gdrivers/tiledb_read.py index 13f11e010777..fa27edca2f9e 100755 --- a/autotest/gdrivers/tiledb_read.py +++ b/autotest/gdrivers/tiledb_read.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic read support for all datatypes from a TileDB array. diff --git a/autotest/gdrivers/tiledb_write.py b/autotest/gdrivers/tiledb_write.py index 31107fd4b0c8..c75a73b0095d 100755 --- a/autotest/gdrivers/tiledb_write.py +++ b/autotest/gdrivers/tiledb_write.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for GeoTIFF format. diff --git a/autotest/gdrivers/usgsdem.py b/autotest/gdrivers/usgsdem.py index 72737b7b5852..87494d5dc63d 100755 --- a/autotest/gdrivers/usgsdem.py +++ b/autotest/gdrivers/usgsdem.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for USGSDEM driver. diff --git a/autotest/gdrivers/vicar.py b/autotest/gdrivers/vicar.py index 0ed10e2d1ad8..505cbe74e26f 100755 --- a/autotest/gdrivers/vicar.py +++ b/autotest/gdrivers/vicar.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for PDS driver. diff --git a/autotest/gdrivers/vrtderived.py b/autotest/gdrivers/vrtderived.py index a5b5a39368ac..0a07de55c24c 100755 --- a/autotest/gdrivers/vrtderived.py +++ b/autotest/gdrivers/vrtderived.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test AddBand() with VRTDerivedRasterBand. diff --git a/autotest/gdrivers/vrtfilt.py b/autotest/gdrivers/vrtfilt.py index fa1d9879936d..5b33941c98f4 100755 --- a/autotest/gdrivers/vrtfilt.py +++ b/autotest/gdrivers/vrtfilt.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test VRT driver based filtering. diff --git a/autotest/gdrivers/vrtlut.py b/autotest/gdrivers/vrtlut.py index ce7f80fed916..9781914725ff 100755 --- a/autotest/gdrivers/vrtlut.py +++ b/autotest/gdrivers/vrtlut.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test LUT translation in VRT driver diff --git a/autotest/gdrivers/vrtmask.py b/autotest/gdrivers/vrtmask.py index 3a5b7cfc8101..7b80b8824ca0 100755 --- a/autotest/gdrivers/vrtmask.py +++ b/autotest/gdrivers/vrtmask.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test mask bands in VRT driver diff --git a/autotest/gdrivers/vrtmultidim.py b/autotest/gdrivers/vrtmultidim.py index b05271c1b18f..4bb746e576e0 100755 --- a/autotest/gdrivers/vrtmultidim.py +++ b/autotest/gdrivers/vrtmultidim.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test multidimensional support in VRT driver @@ -1421,6 +1420,12 @@ def test_vrtmultidim_arraysource_array(): assert ds.GetRasterBand(1).Checksum() == 4855 +def test_vrtmultidim_arraysource_array_constant(): + + ds = gdal.Open("data/vrt/arraysource_array_constant.vrt") + assert ds.GetRasterBand(1).ComputeRasterMinMax() == (10, 10) + + @pytest.mark.require_driver("netCDF") def test_vrtmultidim_arraysource_derivedarray_view(): diff --git a/autotest/gdrivers/vrtovr.py b/autotest/gdrivers/vrtovr.py index 89382fd65bf7..91f5a21dbad6 100755 --- a/autotest/gdrivers/vrtovr.py +++ b/autotest/gdrivers/vrtovr.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test overviews support in VRT driver diff --git a/autotest/gdrivers/vrtpansharpen.py b/autotest/gdrivers/vrtpansharpen.py index 6df41becf6c4..f5022e682b62 100755 --- a/autotest/gdrivers/vrtpansharpen.py +++ b/autotest/gdrivers/vrtpansharpen.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test VRTPansharpenedDataset support. diff --git a/autotest/gdrivers/vrtrawlink.py b/autotest/gdrivers/vrtrawlink.py index a8d1d226b05f..bed093c423d1 100755 --- a/autotest/gdrivers/vrtrawlink.py +++ b/autotest/gdrivers/vrtrawlink.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test VRTRawRasterBand support. diff --git a/autotest/gdrivers/vrtwarp.py b/autotest/gdrivers/vrtwarp.py index 5532084e1fbd..b5f424d3b42b 100755 --- a/autotest/gdrivers/vrtwarp.py +++ b/autotest/gdrivers/vrtwarp.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test VRTWarpedDataset support. diff --git a/autotest/gdrivers/wcs.py b/autotest/gdrivers/wcs.py index aff6ea11e8d1..a758925bc374 100755 --- a/autotest/gdrivers/wcs.py +++ b/autotest/gdrivers/wcs.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test WCS client support. diff --git a/autotest/gdrivers/webp.py b/autotest/gdrivers/webp.py index 1e67cca72500..0067dd408f3b 100755 --- a/autotest/gdrivers/webp.py +++ b/autotest/gdrivers/webp.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test WEBP driver diff --git a/autotest/gdrivers/wms.py b/autotest/gdrivers/wms.py index dee274fdabd6..6049ebd13fc1 100755 --- a/autotest/gdrivers/wms.py +++ b/autotest/gdrivers/wms.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test WMS client support. diff --git a/autotest/gdrivers/wmts.py b/autotest/gdrivers/wmts.py index f0e7b985157b..ee8ffa7e1a36 100755 --- a/autotest/gdrivers/wmts.py +++ b/autotest/gdrivers/wmts.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: WMTS driver test suite. @@ -2002,3 +2001,32 @@ def test_wmts_force_opening_no_match(): drv = gdal.IdentifyDriverEx("data/byte.tif", allowed_drivers=["WMTS"]) assert drv is None + + +############################################################################### +# Test bug fix for https://github.com/OSGeo/gdal/issues/11387 + + +@pytest.mark.require_proj(9) +@gdaltest.enable_exceptions() +def test_wmts_read_esri_code_disguised_as_epsg_and_wrong_axis_order(): + + with gdaltest.error_handler(): + with gdal.Open( + "data/wmts/WMTSCapabilities_THEMIS_NightIR_ControlledMosaics_100m_v2_oct2018.xml" + ) as ds: + assert gdal.GetLastErrorMsg().startswith( + "Auto-correcting wrongly swapped TileMatrix.TopLeftCorner coordinates" + ) + assert ds.GetSpatialRef().GetAuthorityName(None) == "ESRI" + assert ds.GetSpatialRef().GetAuthorityCode(None) == "104905" + assert ds.GetGeoTransform() == pytest.approx( + ( + -180.0, + 0.0013717509172233527, + 0.0, + 65.00121128452162, + 0.0, + -0.0013717509172233527, + ) + ) diff --git a/autotest/gdrivers/xmp.py b/autotest/gdrivers/xmp.py index 4196f201209b..2fbefc678000 100755 --- a/autotest/gdrivers/xmp.py +++ b/autotest/gdrivers/xmp.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test XMP metadata reading. diff --git a/autotest/gdrivers/xpm.py b/autotest/gdrivers/xpm.py index 514b28dd09db..ae67f81158ba 100755 --- a/autotest/gdrivers/xpm.py +++ b/autotest/gdrivers/xpm.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for XPM driver. diff --git a/autotest/gdrivers/xyz.py b/autotest/gdrivers/xyz.py index ac63ff4284fe..0f1cc36c935c 100755 --- a/autotest/gdrivers/xyz.py +++ b/autotest/gdrivers/xyz.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for XYZ driver. diff --git a/autotest/gdrivers/zarr_driver.py b/autotest/gdrivers/zarr_driver.py index 7d118e00c4d0..caed01d26f2e 100644 --- a/autotest/gdrivers/zarr_driver.py +++ b/autotest/gdrivers/zarr_driver.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Zarr driver @@ -819,15 +818,21 @@ def test_zarr_read_crs(crs_member): assert rg ar = rg.OpenMDArray(rg.GetMDArrayNames()[0]) srs = ar.GetSpatialRef() - if ( - not (osr.GetPROJVersionMajor() > 6 or osr.GetPROJVersionMinor() >= 2) - and crs_member == "projjson" - ): - assert srs is None - else: - assert srs is not None - assert srs.GetAuthorityCode(None) == "4326" - assert len(ar.GetAttributes()) == 0 + assert srs is not None + assert srs.GetAuthorityCode(None) == "4326" + # Mapping is 1, 2 since the slowest varying axis in multidim + # mode is the lines, which matches latitude as the first axis of the CRS. + assert srs.GetDataAxisToSRSAxisMapping() == [1, 2] + assert len(ar.GetAttributes()) == 0 + + # Open as classic CRS + ds = gdal.Open("/vsimem/test.zarr") + srs = ds.GetSpatialRef() + assert srs.GetAuthorityCode(None) == "4326" + # Inverted mapping in classic raster mode compared to multidim mode, + # because the first "axis" in our data model is columns. + assert srs.GetDataAxisToSRSAxisMapping() == [2, 1] + finally: gdal.RmdirRecursive("/vsimem/test.zarr") @@ -3470,7 +3475,8 @@ def set_crs(): assert ar crs = osr.SpatialReference() crs.ImportFromEPSG(4326) - crs.SetAxisMappingStrategy(osr.OAMS_TRADITIONAL_GIS_ORDER) + # lat first + crs.SetDataAxisToSRSAxisMapping([1, 2]) crs.SetCoordinateEpoch(2021.2) assert ar.SetSpatialRef(crs) == gdal.CE_None @@ -3497,7 +3503,7 @@ def check_crs(): crs = ar.GetSpatialRef() assert crs is not None assert crs.GetAuthorityCode(None) == "4326" - assert crs.GetDataAxisToSRSAxisMapping() == [2, 1] + assert crs.GetDataAxisToSRSAxisMapping() == [1, 2] assert crs.GetCoordinateEpoch() == 2021.2 check_crs() @@ -3506,6 +3512,8 @@ def check_crs_classic_dataset(): ds = gdal.Open("/vsimem/test.zarr") crs = ds.GetSpatialRef() assert crs is not None + assert crs.GetAuthorityCode(None) == "4326" + assert crs.GetDataAxisToSRSAxisMapping() == [2, 1] check_crs_classic_dataset() @@ -5506,10 +5514,9 @@ def test_zarr_read_cf1(): ds = gdal.Open("data/zarr/byte_cf1.zarr") assert ds - assert ( - ds.GetSpatialRef().ExportToProj4() - == "+proj=utm +zone=11 +ellps=clrk66 +units=m +no_defs" - ) + srs = ds.GetSpatialRef() + assert srs.ExportToProj4() == "+proj=utm +zone=11 +ellps=clrk66 +units=m +no_defs" + assert srs.GetDataAxisToSRSAxisMapping() == [1, 2] ############################################################################### @@ -5526,6 +5533,40 @@ def test_zarr_read_cf1_zarrv3(): ) +############################################################################### + + +@gdaltest.enable_exceptions() +@pytest.mark.require_proj(9) +def test_zarr_write_WGS84_and_EGM96_height(tmp_vsimem): + + tmp_filename = str(tmp_vsimem / "out.zarr") + with gdal.GetDriverByName("Zarr").Create(tmp_filename, 1, 1) as ds: + srs = osr.SpatialReference() + srs.ImportFromEPSG(9707) + ds.SetSpatialRef(srs) + with gdal.Open(tmp_filename) as ds: + srs = ds.GetSpatialRef() + assert srs.GetAuthorityCode(None) == "9707" + assert srs.GetDataAxisToSRSAxisMapping() == [2, 1] + + +############################################################################### + + +@gdaltest.enable_exceptions() +def test_zarr_write_UTM31N_and_EGM96_height(tmp_vsimem): + + tmp_filename = str(tmp_vsimem / "out.zarr") + with gdal.GetDriverByName("Zarr").Create(tmp_filename, 1, 1) as ds: + srs = osr.SpatialReference() + srs.SetFromUserInput("EPSG:32631+5773") + ds.SetSpatialRef(srs) + with gdal.Open(tmp_filename) as ds: + srs = ds.GetSpatialRef() + assert srs.GetDataAxisToSRSAxisMapping() == [1, 2] + + ############################################################################### # Test bug fix for https://github.com/OSGeo/gdal/issues/11016 diff --git a/autotest/gdrivers/zmap.py b/autotest/gdrivers/zmap.py index 8edf855053bc..1d4ed057b915 100755 --- a/autotest/gdrivers/zmap.py +++ b/autotest/gdrivers/zmap.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for ZMap driver. diff --git a/autotest/generate_parquet_test_file.py b/autotest/generate_parquet_test_file.py index 3f8b723de818..5a038b2a1b63 100644 --- a/autotest/generate_parquet_test_file.py +++ b/autotest/generate_parquet_test_file.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR Parquet driver. diff --git a/autotest/gnm/gnm_test.py b/autotest/gnm/gnm_test.py index f82cbaf71270..d3bddcb6846c 100755 --- a/autotest/gnm/gnm_test.py +++ b/autotest/gnm/gnm_test.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic GNMGdalNetwork class functionality. diff --git a/autotest/ogc_cite_testing/kml_generate_test_files.py b/autotest/ogc_cite_testing/kml_generate_test_files.py index f18ee7c6f9ca..095f35540316 100755 --- a/autotest/ogc_cite_testing/kml_generate_test_files.py +++ b/autotest/ogc_cite_testing/kml_generate_test_files.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Generate test files that can be used to exercise the points tested diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000001.gdbtable b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000001.gdbtable new file mode 100644 index 000000000000..b8df547eda91 Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000001.gdbtable differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000001.gdbtablx b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000001.gdbtablx new file mode 100644 index 000000000000..8327f75cb45c Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000001.gdbtablx differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000002.gdbtable b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000002.gdbtable new file mode 100644 index 000000000000..06f10eaf022b Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000002.gdbtable differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000002.gdbtablx b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000002.gdbtablx new file mode 100644 index 000000000000..b17fb6b96e25 Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000002.gdbtablx differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000003.gdbtable b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000003.gdbtable new file mode 100644 index 000000000000..00c610703fc6 Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000003.gdbtable differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000003.gdbtablx b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000003.gdbtablx new file mode 100644 index 000000000000..aa8412769fe3 Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000003.gdbtablx differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000004.gdbtable b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000004.gdbtable new file mode 100644 index 000000000000..9d1da5583650 Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000004.gdbtable differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000004.gdbtablx b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000004.gdbtablx new file mode 100644 index 000000000000..6a69871ab4e6 Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000004.gdbtablx differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000005.gdbtable b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000005.gdbtable new file mode 100644 index 000000000000..75dac36be0a4 Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000005.gdbtable differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000005.gdbtablx b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000005.gdbtablx new file mode 100644 index 000000000000..a9e25586862f Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000005.gdbtablx differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000006.gdbtable b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000006.gdbtable new file mode 100644 index 000000000000..87825c3173e2 Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000006.gdbtable differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000006.gdbtablx b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000006.gdbtablx new file mode 100644 index 000000000000..ab7baaec612b Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000006.gdbtablx differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000007.gdbtable b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000007.gdbtable new file mode 100644 index 000000000000..29fcd156792c Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000007.gdbtable differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000007.gdbtablx b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000007.gdbtablx new file mode 100644 index 000000000000..f639905039c5 Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000007.gdbtablx differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000009.gdbindexes b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000009.gdbindexes new file mode 100644 index 000000000000..6b351b6ac2bb Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000009.gdbindexes differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000009.gdbtable b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000009.gdbtable new file mode 100644 index 000000000000..eafc4284e360 Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000009.gdbtable differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000009.gdbtablx b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000009.gdbtablx new file mode 100644 index 000000000000..2cae1126c73f Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/a00000009.gdbtablx differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/gdb b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/gdb new file mode 100644 index 000000000000..506f9c628294 Binary files /dev/null and b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/gdb differ diff --git a/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/timestamps b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/timestamps new file mode 100644 index 000000000000..05d2b9440ec0 --- /dev/null +++ b/autotest/ogr/data/filegdb/corrupted_gdbindexes.gdb/timestamps @@ -0,0 +1 @@ +ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ \ No newline at end of file diff --git a/autotest/ogr/data/gml/aixm_ElevatedCurve.xml b/autotest/ogr/data/gml/aixm_ElevatedCurve.xml new file mode 100644 index 000000000000..aca2575ddb1c --- /dev/null +++ b/autotest/ogr/data/gml/aixm_ElevatedCurve.xml @@ -0,0 +1,113 @@ + + + + + + foo + + + + + 2000-01-01T00:00:00Z + + + + BASELINE + 1 + + + 2000-01-01T00:00:00Z + + + + DESIGNATOR + TWY + + + + + 49 2 50 3 + + + + + + + + + + + + + bar + + + + + 2000-01-01T00:00:00Z + + + + BASELINE + 1 + 0 + + + 2000-01-01T00:00:00Z + + + + NAME + WINDMILL_FARMS + YES + YES + + + + + + 75 + 30 + WINDMILL_FARMS + GREEN + + + + + 45 2 46 3 + + + 50 + 75 + EGM_96 + 30 + + + + + RED + + + OTHER:FLASHING + + + + + + + markingICAOStandard + REMARK + + + marked=YES + + + + + + + + + + + diff --git a/autotest/ogr/data/gml/aixm_VerticalStructure_mix_point_and_line.xml b/autotest/ogr/data/gml/aixm_VerticalStructure_mix_point_and_line.xml new file mode 100644 index 000000000000..dce994eefb34 --- /dev/null +++ b/autotest/ogr/data/gml/aixm_VerticalStructure_mix_point_and_line.xml @@ -0,0 +1,79 @@ + + + + + foo + + + + + 2018-01-01T00:00:00 + + + + BASELINE + 1 + + + 2018-01-01T00:00:00 + + + + NO + + + + + + 49 2 + 10 + 0.1 + + + + + + + + + + + bar + + + + + 2018-01-01T00:00:00 + + + + BASELINE + 1 + + + 2018-01-01T00:00:00 + + + + NO + + + + DESIGNATOR + + + + + 45 2 46 3 + + + 0 + + + + + + + + + diff --git a/autotest/ogr/ogr_adbc.py b/autotest/ogr/ogr_adbc.py index 7a6f8b93c0e0..1429d4a1785f 100755 --- a/autotest/ogr/ogr_adbc.py +++ b/autotest/ogr/ogr_adbc.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR ADBC driver. diff --git a/autotest/ogr/ogr_aivector.py b/autotest/ogr/ogr_aivector.py index 32c194666cc9..fb3998bbd0b3 100755 --- a/autotest/ogr/ogr_aivector.py +++ b/autotest/ogr/ogr_aivector.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR AIVector driver. diff --git a/autotest/ogr/ogr_arrow.py b/autotest/ogr/ogr_arrow.py index 8ffbe0c11913..a1c532d0e4e1 100755 --- a/autotest/ogr/ogr_arrow.py +++ b/autotest/ogr/ogr_arrow.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test functionality for OGR Arrow driver. diff --git a/autotest/ogr/ogr_as_sqlite_extension.py b/autotest/ogr/ogr_as_sqlite_extension.py index 6efa4ccf0317..427dad4cab92 100755 --- a/autotest/ogr/ogr_as_sqlite_extension.py +++ b/autotest/ogr/ogr_as_sqlite_extension.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GDAL as a SQLite3 dynamically loaded extension diff --git a/autotest/ogr/ogr_avc.py b/autotest/ogr/ogr_avc.py index cd2bcd0aaaf7..eced12b367c7 100755 --- a/autotest/ogr/ogr_avc.py +++ b/autotest/ogr/ogr_avc.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR AVCE00 and AVCBin drivers diff --git a/autotest/ogr/ogr_basic_test.py b/autotest/ogr/ogr_basic_test.py index 09703b7deaf5..ec91a3647f30 100755 --- a/autotest/ogr/ogr_basic_test.py +++ b/autotest/ogr/ogr_basic_test.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic OGR functionality against test shapefiles. diff --git a/autotest/ogr/ogr_carto.py b/autotest/ogr/ogr_carto.py index 30cf4d025291..ca10084c1a2b 100755 --- a/autotest/ogr/ogr_carto.py +++ b/autotest/ogr/ogr_carto.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Carto driver testing. diff --git a/autotest/ogr/ogr_csv.py b/autotest/ogr/ogr_csv.py index 0ab07472aed8..ef22bab214c9 100755 --- a/autotest/ogr/ogr_csv.py +++ b/autotest/ogr/ogr_csv.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR CSV driver functionality. diff --git a/autotest/ogr/ogr_csw.py b/autotest/ogr/ogr_csw.py index 715b75f12be5..52ff8e9e7a85 100755 --- a/autotest/ogr/ogr_csw.py +++ b/autotest/ogr/ogr_csw.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: CSW driver testing. diff --git a/autotest/ogr/ogr_db2_hack.py b/autotest/ogr/ogr_db2_hack.py index 154a1cab5030..a3da39717f12 100755 --- a/autotest/ogr/ogr_db2_hack.py +++ b/autotest/ogr/ogr_db2_hack.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test DB2 V7.2 WKB support. DB2 7.2 had a corrupt WKB format diff --git a/autotest/ogr/ogr_dgn.py b/autotest/ogr/ogr_dgn.py index 5cf724fc168c..0c7675a4d404 100755 --- a/autotest/ogr/ogr_dgn.py +++ b/autotest/ogr/ogr_dgn.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Some DGN Driver features. diff --git a/autotest/ogr/ogr_dgnv8.py b/autotest/ogr/ogr_dgnv8.py index aa3c9c61cf46..beab608593c4 100755 --- a/autotest/ogr/ogr_dgnv8.py +++ b/autotest/ogr/ogr_dgnv8.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test DGNv8 Driver. diff --git a/autotest/ogr/ogr_dwg.py b/autotest/ogr/ogr_dwg.py index 17df5abb4921..11a5c0478ba2 100755 --- a/autotest/ogr/ogr_dwg.py +++ b/autotest/ogr/ogr_dwg.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test DWG Driver. diff --git a/autotest/ogr/ogr_dxf.py b/autotest/ogr/ogr_dxf.py index a7570c3fe3c0..16cd74c362f8 100644 --- a/autotest/ogr/ogr_dxf.py +++ b/autotest/ogr/ogr_dxf.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR DXF driver functionality. @@ -18,7 +17,7 @@ import ogrtest import pytest -from osgeo import gdal, ogr +from osgeo import gdal, ogr, osr ############################################################################### @@ -4021,3 +4020,107 @@ def test_ogr_dxf_read_closed_polyline_with_bulge(): f = lyr.GetNextFeature() g = f.GetGeometryRef() assert g.GetGeometryType() == ogr.wkbPolygon + + +############################################################################### + + +def test_ogr_dxf_write_INSUNITS(tmp_vsimem): + + filename = str(tmp_vsimem / "out.dxf") + + with ogr.GetDriverByName("DXF").CreateDataSource( + filename, options=["INSUNITS=METERS"] + ) as ds: + pass + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$INSUNITS", "DXF_HEADER_VARIABLES") == "6" + + with ogr.GetDriverByName("DXF").CreateDataSource( + filename, options=["INSUNITS=21"] + ) as ds: + pass + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$INSUNITS", "DXF_HEADER_VARIABLES") == "21" + + with gdal.quiet_errors(): + with gdal.GetDriverByName("DXF").Create( + filename, 0, 0, 0, gdal.GDT_Unknown, options=["INSUNITS=INVALID"] + ) as ds: + pass + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$INSUNITS", "DXF_HEADER_VARIABLES") == " 1" + + with ogr.GetDriverByName("DXF").CreateDataSource(filename) as ds: + srs = osr.SpatialReference() + srs.ImportFromEPSG(32631) + ds.CreateLayer("test", srs=srs) + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$INSUNITS", "DXF_HEADER_VARIABLES") == "6" + + with ogr.GetDriverByName("DXF").CreateDataSource(filename) as ds: + srs = osr.SpatialReference() + srs.ImportFromProj4("+proj=merc +units=ft") + ds.CreateLayer("test", srs=srs) + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$INSUNITS", "DXF_HEADER_VARIABLES") == "2" + + with ogr.GetDriverByName("DXF").CreateDataSource(filename) as ds: + srs = osr.SpatialReference() + srs.ImportFromProj4("+proj=merc +units=us-ft") + ds.CreateLayer("test", srs=srs) + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$INSUNITS", "DXF_HEADER_VARIABLES") == "21" + + # No CRS + with ogr.GetDriverByName("DXF").CreateDataSource(filename) as ds: + pass + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$INSUNITS", "DXF_HEADER_VARIABLES") == " 1" + + # Not a projected CRS + with ogr.GetDriverByName("DXF").CreateDataSource(filename) as ds: + srs = osr.SpatialReference() + srs.ImportFromEPSG(4326) + ds.CreateLayer("test", srs=srs) + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$INSUNITS", "DXF_HEADER_VARIABLES") == " 1" + + # Unknown linear units + with gdal.quiet_errors(): + with ogr.GetDriverByName("DXF").CreateDataSource(filename) as ds: + srs = osr.SpatialReference() + srs.ImportFromProj4("+proj=merc +to_meter=2") + ds.CreateLayer("test", srs=srs) + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$INSUNITS", "DXF_HEADER_VARIABLES") == " 1" + + +############################################################################### + + +def test_ogr_dxf_write_MEASUREMENT(tmp_vsimem): + + filename = str(tmp_vsimem / "out.dxf") + + with ogr.GetDriverByName("DXF").CreateDataSource( + filename, options=["MEASUREMENT=METRIC"] + ) as ds: + pass + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$MEASUREMENT", "DXF_HEADER_VARIABLES") == "1" + + with ogr.GetDriverByName("DXF").CreateDataSource( + filename, options=["MEASUREMENT=1"] + ) as ds: + pass + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$MEASUREMENT", "DXF_HEADER_VARIABLES") == "1" + + with gdal.quiet_errors(): + with ogr.GetDriverByName("DXF").CreateDataSource( + filename, options=["MEASUREMENT=INVALID"] + ) as ds: + pass + with ogr.Open(filename) as ds: + assert ds.GetMetadataItem("$MEASUREMENT", "DXF_HEADER_VARIABLES") == " 0" diff --git a/autotest/ogr/ogr_edigeo.py b/autotest/ogr/ogr_edigeo.py index 66b42e578c1d..3dfc9434a864 100755 --- a/autotest/ogr/ogr_edigeo.py +++ b/autotest/ogr/ogr_edigeo.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR EDIGEO driver. diff --git a/autotest/ogr/ogr_eeda.py b/autotest/ogr/ogr_eeda.py index a08ce389d481..b1f0ecb6fc9f 100755 --- a/autotest/ogr/ogr_eeda.py +++ b/autotest/ogr/ogr_eeda.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Earth Engine Data API driver test suite. diff --git a/autotest/ogr/ogr_elasticsearch.py b/autotest/ogr/ogr_elasticsearch.py index c6f22e9b4fbe..319cce9fc427 100755 --- a/autotest/ogr/ogr_elasticsearch.py +++ b/autotest/ogr/ogr_elasticsearch.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Elasticsearch driver testing (with fake server) diff --git a/autotest/ogr/ogr_esrijson.py b/autotest/ogr/ogr_esrijson.py index fd11a2ce5dc4..e5b682ffe50e 100755 --- a/autotest/ogr/ogr_esrijson.py +++ b/autotest/ogr/ogr_esrijson.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: ESRIJson driver test suite. diff --git a/autotest/ogr/ogr_factory.py b/autotest/ogr/ogr_factory.py index 6de4499166d2..6ed4f3070aec 100755 --- a/autotest/ogr/ogr_factory.py +++ b/autotest/ogr/ogr_factory.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test some geometry factory methods, like arc stroking. diff --git a/autotest/ogr/ogr_fgdb.py b/autotest/ogr/ogr_fgdb.py index efdafd567434..ae63385d6cfa 100755 --- a/autotest/ogr/ogr_fgdb.py +++ b/autotest/ogr/ogr_fgdb.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: FGDB driver testing. diff --git a/autotest/ogr/ogr_fgdb_stress_test.py b/autotest/ogr/ogr_fgdb_stress_test.py index e72a6e87cab1..a5758c19de6f 100755 --- a/autotest/ogr/ogr_fgdb_stress_test.py +++ b/autotest/ogr/ogr_fgdb_stress_test.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: FGDB driver stress testing of CreateFeature() with user set FID diff --git a/autotest/ogr/ogr_fielddomain.py b/autotest/ogr/ogr_fielddomain.py index 8994bf5d7779..5a748ccbf8f8 100755 --- a/autotest/ogr/ogr_fielddomain.py +++ b/autotest/ogr/ogr_fielddomain.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGRFieldDomain diff --git a/autotest/ogr/ogr_flatgeobuf.py b/autotest/ogr/ogr_flatgeobuf.py index 6e68443010ea..5d770f64501a 100644 --- a/autotest/ogr/ogr_flatgeobuf.py +++ b/autotest/ogr/ogr_flatgeobuf.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: FlatGeobuf driver test suite. diff --git a/autotest/ogr/ogr_geoconcept.py b/autotest/ogr/ogr_geoconcept.py index 32df14e4e900..efac45717588 100755 --- a/autotest/ogr/ogr_geoconcept.py +++ b/autotest/ogr/ogr_geoconcept.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR Geoconcept driver functionality. diff --git a/autotest/ogr/ogr_geojson.py b/autotest/ogr/ogr_geojson.py index d80279983b3b..2850abb0be6d 100755 --- a/autotest/ogr/ogr_geojson.py +++ b/autotest/ogr/ogr_geojson.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: GeoJSON driver test suite. @@ -4209,6 +4208,131 @@ def test_ogr_geojson_read_from_http(): webserver.server_stop(webserver_process, webserver_port) +############################################################################### +# Test reading http:// resource with GDAL_HTTP_HEADERS config option set + + +@pytest.mark.require_curl() +def test_ogr_geojson_read_from_http_with_GDAL_HTTP_HEADERS(): + + import webserver + + (webserver_process, webserver_port) = webserver.launch( + handler=webserver.DispatcherHttpHandler + ) + if webserver_port == 0: + pytest.skip() + + response = """{"type": "FeatureCollection", "features":[ + {"type": "Feature", "geometry": {"type":"Point","coordinates":[1,2]}, "properties": null}]}""" + + handler = webserver.SequentialHandler() + handler.add( + "GET", + "/foo", + 200, + {}, + response, + expected_headers={ + "foo": "bar", + "bar": "baz", + "Accept": "text/plain, application/json", + }, + ) + + try: + with webserver.install_http_handler(handler): + with gdaltest.config_option("GDAL_HTTP_HEADERS", "foo: bar\r\nbar: baz"): + ds = ogr.Open("http://localhost:%d/foo" % webserver_port) + assert ds is not None + lyr = ds.GetLayer(0) + assert lyr.GetFeatureCount() == 1 + finally: + webserver.server_stop(webserver_process, webserver_port) + + +############################################################################### +# Test reading http:// resource with GDAL_HTTP_HEADERS config option set + + +@pytest.mark.require_curl() +def test_ogr_geojson_read_from_http_with_GDAL_HTTP_HEADERS_Accept(): + + import webserver + + (webserver_process, webserver_port) = webserver.launch( + handler=webserver.DispatcherHttpHandler + ) + if webserver_port == 0: + pytest.skip() + + response = """{"type": "FeatureCollection", "features":[ + {"type": "Feature", "geometry": {"type":"Point","coordinates":[1,2]}, "properties": null}]}""" + + handler = webserver.SequentialHandler() + handler.add( + "GET", + "/foo", + 200, + {}, + response, + expected_headers={"Accept": "application/json, foo/bar"}, + ) + + try: + with webserver.install_http_handler(handler): + with gdaltest.config_option( + "GDAL_HTTP_HEADERS", "Accept: application/json, foo/bar" + ): + ds = ogr.Open("http://localhost:%d/foo" % webserver_port) + assert ds is not None + lyr = ds.GetLayer(0) + assert lyr.GetFeatureCount() == 1 + finally: + webserver.server_stop(webserver_process, webserver_port) + + +############################################################################### +# Test reading http:// resource with GDAL_HTTP_HEADERS config option set + + +@pytest.mark.require_curl() +def test_ogr_geojson_read_from_http_with_GDAL_HTTP_HEADERS_overriding_Accept(): + + import webserver + + (webserver_process, webserver_port) = webserver.launch( + handler=webserver.DispatcherHttpHandler + ) + if webserver_port == 0: + pytest.skip() + + response = """{"type": "FeatureCollection", "features":[ + {"type": "Feature", "geometry": {"type":"Point","coordinates":[1,2]}, "properties": null}]}""" + + handler = webserver.SequentialHandler() + handler.add( + "GET", + "/foo", + 200, + {}, + response, + expected_headers={"foo": "bar", "bar": "baz", "Accept": "application/json"}, + ) + + try: + with webserver.install_http_handler(handler): + with gdaltest.config_option( + "GDAL_HTTP_HEADERS", "foo: bar,bar: baz,Accept: application/json" + ): + ds = ogr.Open("http://localhost:%d/foo" % webserver_port) + assert ds is not None + lyr = ds.GetLayer(0) + assert lyr.GetFeatureCount() == 1 + finally: + webserver.server_stop(webserver_process, webserver_port) + + ############################################################################### # Test ogr2ogr -nln with a input dataset being a GeoJSON file with a name diff --git a/autotest/ogr/ogr_geojsonseq.py b/autotest/ogr/ogr_geojsonseq.py index c041f1735b06..f3114a40853a 100755 --- a/autotest/ogr/ogr_geojsonseq.py +++ b/autotest/ogr/ogr_geojsonseq.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGRGeoJSONSeq driver. diff --git a/autotest/ogr/ogr_geom.py b/autotest/ogr/ogr_geom.py index 67911355b88c..94e8b65314e9 100755 --- a/autotest/ogr/ogr_geom.py +++ b/autotest/ogr/ogr_geom.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Misc. OGRGeometry operations. @@ -931,21 +930,21 @@ def test_ogr_geom_segmentize_issue_1341(): geom = ogr.CreateGeometryFromWkt("LINESTRING(0 0,10 0)") geom.Segmentize(0.399999999999) - assert geom.ExportToWkt() == expected_geom + ogrtest.check_feature_geometry(geom, expected_geom) geom.Segmentize(0.399999999999) - assert geom.ExportToWkt() == expected_geom + ogrtest.check_feature_geometry(geom, expected_geom) geom = ogr.CreateGeometryFromWkt("LINESTRING(0 0,10 0)") geom.Segmentize(0.4) - assert geom.ExportToWkt() == expected_geom + ogrtest.check_feature_geometry(geom, expected_geom) geom.Segmentize(0.4) - assert geom.ExportToWkt() == expected_geom + ogrtest.check_feature_geometry(geom, expected_geom) geom = ogr.CreateGeometryFromWkt("LINESTRING(0 0,10 0)") geom.Segmentize(0.400000000001) - assert geom.ExportToWkt() == expected_geom + ogrtest.check_feature_geometry(geom, expected_geom) geom.Segmentize(0.400000000001) - assert geom.ExportToWkt() == expected_geom + ogrtest.check_feature_geometry(geom, expected_geom) ############################################################################### diff --git a/autotest/ogr/ogr_geos.py b/autotest/ogr/ogr_geos.py index fee81566d24f..a071fc0cc536 100755 --- a/autotest/ogr/ogr_geos.py +++ b/autotest/ogr/ogr_geos.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GEOS integration in OGR - geometric operations. diff --git a/autotest/ogr/ogr_gml.py b/autotest/ogr/ogr_gml.py index da3a16c808e6..80878d6e8059 100755 --- a/autotest/ogr/ogr_gml.py +++ b/autotest/ogr/ogr_gml.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: GML driver testing. @@ -14,6 +13,7 @@ # SPDX-License-Identifier: MIT ############################################################################### +import json import os import shutil import sys @@ -3912,6 +3912,58 @@ def test_ogr_gml_aixm_elevated_surface(tmp_path): ds = None +############################################################################### +# Read AIXM ElevatedCurve + + +def test_ogr_gml_aixm_elevated_curve(tmp_path): + + shutil.copy("data/gml/aixm_ElevatedCurve.xml", tmp_path) + + ds = ogr.Open(tmp_path / "aixm_ElevatedCurve.xml") + lyr = ds.GetLayer("GuidanceLine") + feat = lyr.GetNextFeature() + geom = feat.GetGeometryRef() + got_wkt = geom.ExportToWkt() + assert got_wkt == "LINESTRING (2 49,3 50)" + + lyr = ds.GetLayer("VerticalStructure") + feat = lyr.GetNextFeature() + geom = feat.GetGeometryRef() + got_wkt = geom.ExportToWkt() + assert got_wkt == "LINESTRING (2 45,3 46)" + assert feat["elevation"] == 75 + assert feat["elevation_uom"] == "M" + assert feat["verticalDatum"] == "EGM_96" + assert feat["verticalAccuracy"] == 30 + assert feat["verticalAccuracy_uom"] == "M" + + +############################################################################### +# Read AIXM VerticalStructure mixing ElevatedPoint and ElevatedCurve + + +def test_ogr_gml_aixm_vertical_structure_mix_point_and_line(tmp_path): + + shutil.copy("data/gml/aixm_VerticalStructure_mix_point_and_line.xml", tmp_path) + + ds = ogr.Open(tmp_path / "aixm_VerticalStructure_mix_point_and_line.xml") + lyr = ds.GetLayer("VerticalStructure") + feat = lyr.GetNextFeature() + geom = feat.GetGeometryRef() + got_wkt = geom.ExportToWkt() + assert got_wkt == "POINT (2 49)" + assert feat["elevation"] == 10 + assert feat["elevation_uom"] == "M" + assert feat["verticalAccuracy"] == 0.1 + + feat = lyr.GetNextFeature() + geom = feat.GetGeometryRef() + got_wkt = geom.ExportToWkt() + assert got_wkt == "LINESTRING (2 45,3 46)" + assert feat["elevation"] == 0 + + ############################################################################### # Test support for XML comment srsName="" in .xsd @@ -4644,3 +4696,258 @@ def test_ogr_gml_force_opening(tmp_vsimem): with gdal.config_option("NAS_GFS_TEMPLATE", ""): ds = gdal.OpenEx(filename, allowed_drivers=["GML"]) assert ds.GetDriver().GetDescription() == "GML" + + +############################################################################### +# Test field type override open option schema +# + + +@pytest.mark.parametrize("is_path", [False, True]) +@pytest.mark.parametrize( + "open_options, with_xsd, expected_field_types, expected_field_names, expected_warning", + [ + ([], True, [ogr.OFTString, ogr.OFTReal, ogr.OFTInteger, ogr.OFTString], [], ""), + ( + [], + False, + [ogr.OFTString, ogr.OFTReal, ogr.OFTInteger, ogr.OFTInteger], + [], + "", + ), + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "test_point", "fields": [{ "name": "str", "type": "Real" }]}]}' + ], + False, + [ogr.OFTString, ogr.OFTReal, ogr.OFTInteger, ogr.OFTReal], + [], + "", + ), + # Case insensitivity test + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "test_point", "fields": [{ "name": "str", "type": "Real" }]}]}' + ], + False, + [ogr.OFTString, ogr.OFTReal, ogr.OFTInteger, ogr.OFTReal], + [], + "", + ), + # Test override XSD + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "test_point", "fields": [{ "name": "str", "type": "Real" }]}]}' + ], + True, + [ogr.OFTString, ogr.OFTReal, ogr.OFTInteger, ogr.OFTReal], + [], + "", + ), + # Test with a field that does not exist + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "test_point", "fields": [{ "name": "xxxx", "type": "Real" }]}]}' + ], + True, + [], + [], + "Field xxxx not found in layer test_point", + ), + # Test with type wich is not recognized + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "test_point", "fields": [{ "name": "str", "type": "xxxx" }, {"name": "dbl", "type": "String" }]}]}' + ], + True, + [], + [], + "Unsupported field type: xxxx for field str", + ), + # Test with layer name + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "xxxx", "fields": [{ "name": "str", "type": "Real" }]}]}' + ], + True, + [], + [], + "Layer xxxx not found", + ), + # Test with layer name that does not exist + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "xxxx", "fields": [{ "name": "str", "type": "Real" }]}]}' + ], + True, + [], + [], + "Layer xxxx not found", + ), + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "test_point", "fields": [{ "name": "str", "type": "Real" }]},{"name": "xxxx", "fields": [{ "name": "str", "type": "Real" }]}]}' + ], + True, + [], + [], + "Layer xxxx not found", + ), + # Test field newName + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "test_point", "fields": [{ "name": "str", "newName": "new_str" }]}]}' + ], + True, + [ogr.OFTString, ogr.OFTReal, ogr.OFTInteger, ogr.OFTString], + ["fid", "dbl", "int", "new_str"], + "", + ), + # Test change subType + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "test_point", "fields": [{ "name": "str", "subType": "UUID" }]}]}' + ], + True, + [ogr.OFTString, ogr.OFTReal, ogr.OFTInteger, (ogr.OFTString, ogr.OFSTUUID)], + ["fid", "dbl", "int", "str"], + "", + ), + # Test "full" schemaType + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "test_point", "schemaType": "Full", "fields": [{ "name": "dbl"}, { "name": "str", "type": "String", "newName": "new_str", "subType": "UUID" }]}]}' + ], + True, + [ogr.OFTString, ogr.OFTReal, (ogr.OFTString, ogr.OFSTUUID)], + ["fid", "dbl", "new_str"], + "", + ), + # Test width and precision override + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "test_point", "fields": [{ "name": "int", "width": 7, "precision": 3 }]}]}' + ], + True, + [ogr.OFTString, ogr.OFTReal, ogr.OFTInteger, ogr.OFTString], + [], + "", + ), + # Test boolean and short integer subtype + ( + [ + r'OGR_SCHEMA={"layers": [{"name": "test_point", "fields": [{ "name": "int", "subType": "Boolean" }, { "name": "dbl", "type": "Integer", "subType": "Int16" }]}]}' + ], + True, + [ + ogr.OFTString, + (ogr.OFTInteger, ogr.OFSTInt16), + (ogr.OFTInteger, ogr.OFSTBoolean), + ogr.OFTString, + ], + ["fid", "dbl", "int", "str"], + "", + ), + ], +) +def test_ogr_gml_type_override( + tmp_path, + is_path, + open_options, + with_xsd, + expected_field_types, + expected_field_names, + expected_warning, +): + + shutil.copy("data/gml/test_point.gml", tmp_path) + + if with_xsd: + shutil.copy("data/gml/test_point.xsd", tmp_path) + + gdal.ErrorReset() + + try: + schema = open_options[0].split("=")[1] + open_options = open_options[1:] + except IndexError: + schema = None + is_path = False + + with gdal.quiet_errors(): + + if is_path: + schema_path = tmp_path / "ogr_schema.json" + with open(schema_path, "w+") as f: + f.write(schema) + open_options.append("OGR_SCHEMA=" + str(schema_path)) + elif schema: + open_options.append("OGR_SCHEMA=" + schema) + else: + open_options = [] + + # Validate the JSON schema + if not expected_warning and schema: + schema = json.loads(schema) + gdaltest.validate_json(schema, "ogr_fields_override.schema.json") + + # Check error if expected_field_types is empty + if not expected_field_types: + ds = gdal.OpenEx( + tmp_path / "test_point.gml", + gdal.OF_VECTOR | gdal.OF_READONLY, + open_options=open_options, + allowed_drivers=["GML"], + ) + assert ( + gdal.GetLastErrorMsg().find(expected_warning) != -1 + ), f"Warning {expected_warning} not found, got {gdal.GetLastErrorMsg()} instead" + assert ds is None + else: + + with gdal.OpenEx( + tmp_path / "test_point.gml", + gdal.OF_VECTOR | gdal.OF_READONLY, + open_options=open_options, + allowed_drivers=["GML"], + ) as gml_ds: + + assert gml_ds.GetLayerCount() == 1, "wrong number of layers" + + lyr = gml_ds.GetLayerByName("test_point") + + feat = lyr.GetNextFeature() + + if len(expected_field_names) == 0: + expected_field_names = ("fid", "dbl", "int", "str") + + # Check field types fid, dbl, int, str + for i in range(len(expected_field_names)): + try: + expected_type, expected_subtype = expected_field_types[i] + assert feat.GetFieldDefnRef(i).GetType() == expected_type + assert feat.GetFieldDefnRef(i).GetSubType() == expected_subtype + except TypeError: + expected_type = expected_field_types[i] + assert feat.GetFieldDefnRef(i).GetType() == expected_type + + # Test width and precision override + if len(open_options) > 0 and "precision" in open_options[0]: + assert feat.GetFieldDefnRef(2).GetWidth() == 7 + assert feat.GetFieldDefnRef(2).GetPrecision() == 3 + + # Check feature content + assert feat.GetFieldAsString("fid") == "F0" + assert feat.GetFieldAsDouble("dbl") == 1.0 + if len(expected_field_names) > 0: + if "int" in expected_field_names: + assert feat.GetFieldAsInteger("int") == 1 + if "str" in expected_field_names: + assert feat.GetFieldAsString("str") == "1" + if "new_str" in expected_field_names: + assert feat.GetFieldAsString("new_str") == "1" + + if expected_warning: + assert ( + gdal.GetLastErrorMsg().find(expected_warning) != -1 + ), f"Warning {expected_warning} not found, got {gdal.GetLastErrorMsg()} instead" diff --git a/autotest/ogr/ogr_gml_fgd_read.py b/autotest/ogr/ogr_gml_fgd_read.py index 3c1f305d5ad4..51087481b64a 100755 --- a/autotest/ogr/ogr_gml_fgd_read.py +++ b/autotest/ogr/ogr_gml_fgd_read.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: GML Reading Driver for Japanese FGD GML v4 testing. diff --git a/autotest/ogr/ogr_gml_geom.py b/autotest/ogr/ogr_gml_geom.py index 2343e8f7bf3b..cb36dad469b6 100755 --- a/autotest/ogr/ogr_gml_geom.py +++ b/autotest/ogr/ogr_gml_geom.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic OGR translation of WKT and WKB geometries. diff --git a/autotest/ogr/ogr_gmlas.py b/autotest/ogr/ogr_gmlas.py index 5f333300d3d9..44afdf241d1a 100755 --- a/autotest/ogr/ogr_gmlas.py +++ b/autotest/ogr/ogr_gmlas.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: GMLAS driver testing. diff --git a/autotest/ogr/ogr_gmt.py b/autotest/ogr/ogr_gmt.py index 5d178a2be551..0d0124f6811e 100755 --- a/autotest/ogr/ogr_gmt.py +++ b/autotest/ogr/ogr_gmt.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR GMT driver functionality. diff --git a/autotest/ogr/ogr_gpkg.py b/autotest/ogr/ogr_gpkg.py index 3953b21c169f..8eabbf0d4550 100755 --- a/autotest/ogr/ogr_gpkg.py +++ b/autotest/ogr/ogr_gpkg.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GeoPackage driver functionality. diff --git a/autotest/ogr/ogr_gpsbabel.py b/autotest/ogr/ogr_gpsbabel.py index 4b5ce9f5bf57..88db09946b7c 100755 --- a/autotest/ogr/ogr_gpsbabel.py +++ b/autotest/ogr/ogr_gpsbabel.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR GPSBabel driver. diff --git a/autotest/ogr/ogr_gpx.py b/autotest/ogr/ogr_gpx.py index 457f262c80e2..5e8c5a4deebf 100755 --- a/autotest/ogr/ogr_gpx.py +++ b/autotest/ogr/ogr_gpx.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test GPX driver functionality. diff --git a/autotest/ogr/ogr_gtfs.py b/autotest/ogr/ogr_gtfs.py index 17856c0875ea..f48a78ab460a 100755 --- a/autotest/ogr/ogr_gtfs.py +++ b/autotest/ogr/ogr_gtfs.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: GTFS driver testing diff --git a/autotest/ogr/ogr_hana.py b/autotest/ogr/ogr_hana.py index 16b4de256a25..4ef318c6e2ab 100644 --- a/autotest/ogr/ogr_hana.py +++ b/autotest/ogr/ogr_hana.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test SAP HANA driver functionality. diff --git a/autotest/ogr/ogr_idrisi.py b/autotest/ogr/ogr_idrisi.py index 4e65ad3cf60d..25863fab768e 100755 --- a/autotest/ogr/ogr_idrisi.py +++ b/autotest/ogr/ogr_idrisi.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR Idrisi driver. diff --git a/autotest/ogr/ogr_ili.py b/autotest/ogr/ogr_ili.py index 1be3348f3772..9321132503db 100755 --- a/autotest/ogr/ogr_ili.py +++ b/autotest/ogr/ogr_ili.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Interlis driver testing. diff --git a/autotest/ogr/ogr_index_test.py b/autotest/ogr/ogr_index_test.py index 6b8fa6f5b10b..c2cd3e5bbb50 100755 --- a/autotest/ogr/ogr_index_test.py +++ b/autotest/ogr/ogr_index_test.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR INDEX support. diff --git a/autotest/ogr/ogr_jml.py b/autotest/ogr/ogr_jml.py index 13da36faf116..a6c93f3390bb 100755 --- a/autotest/ogr/ogr_jml.py +++ b/autotest/ogr/ogr_jml.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test JML driver functionality. diff --git a/autotest/ogr/ogr_join_test.py b/autotest/ogr/ogr_join_test.py index d2bea80434de..07a84031cea5 100755 --- a/autotest/ogr/ogr_join_test.py +++ b/autotest/ogr/ogr_join_test.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR JOIN support. diff --git a/autotest/ogr/ogr_jsonfg.py b/autotest/ogr/ogr_jsonfg.py index 4c23584e2eea..16286c94cf76 100755 --- a/autotest/ogr/ogr_jsonfg.py +++ b/autotest/ogr/ogr_jsonfg.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test functionality for OGR JSONFG driver. diff --git a/autotest/ogr/ogr_kml.py b/autotest/ogr/ogr_kml.py index 957d93cb35f7..fa6d952d24a5 100755 --- a/autotest/ogr/ogr_kml.py +++ b/autotest/ogr/ogr_kml.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: KML Driver testing. diff --git a/autotest/ogr/ogr_libkml.py b/autotest/ogr/ogr_libkml.py index 52ece2b7786f..e0880763d8e5 100755 --- a/autotest/ogr/ogr_libkml.py +++ b/autotest/ogr/ogr_libkml.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: LIBKML Driver testing. diff --git a/autotest/ogr/ogr_lvbag.py b/autotest/ogr/ogr_lvbag.py index c72cfb621e8b..912edd8c927f 100644 --- a/autotest/ogr/ogr_lvbag.py +++ b/autotest/ogr/ogr_lvbag.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test LVBAG driver functionality. diff --git a/autotest/ogr/ogr_mapml.py b/autotest/ogr/ogr_mapml.py index 50038cf2ab6b..eb51e55c5806 100755 --- a/autotest/ogr/ogr_mapml.py +++ b/autotest/ogr/ogr_mapml.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR MapML driver functionality. diff --git a/autotest/ogr/ogr_mem.py b/autotest/ogr/ogr_mem.py index 90017246ab9d..ff9a5130cedc 100755 --- a/autotest/ogr/ogr_mem.py +++ b/autotest/ogr/ogr_mem.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR Memory driver functionality. diff --git a/autotest/ogr/ogr_miramon_vector.py b/autotest/ogr/ogr_miramon_vector.py index 2f69a8158c26..3cfebb9b3ba6 100644 --- a/autotest/ogr/ogr_miramon_vector.py +++ b/autotest/ogr/ogr_miramon_vector.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR MiraMon vector driver. diff --git a/autotest/ogr/ogr_mitab.py b/autotest/ogr/ogr_mitab.py index c692563b6809..09a6969378ff 100755 --- a/autotest/ogr/ogr_mitab.py +++ b/autotest/ogr/ogr_mitab.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: MapInfo driver testing. diff --git a/autotest/ogr/ogr_mongodbv3.py b/autotest/ogr/ogr_mongodbv3.py index 0c932ce0601f..a8088e0bf8fd 100755 --- a/autotest/ogr/ogr_mongodbv3.py +++ b/autotest/ogr/ogr_mongodbv3.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: MongoDBv3 driver testing. diff --git a/autotest/ogr/ogr_mssqlspatial.py b/autotest/ogr/ogr_mssqlspatial.py index 914c6f8e2093..4c5629005e1a 100755 --- a/autotest/ogr/ogr_mssqlspatial.py +++ b/autotest/ogr/ogr_mssqlspatial.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test MSSQLSpatial driver functionality. diff --git a/autotest/ogr/ogr_mvt.py b/autotest/ogr/ogr_mvt.py index 92ec8d2c9666..ce652b661c0a 100755 --- a/autotest/ogr/ogr_mvt.py +++ b/autotest/ogr/ogr_mvt.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR MVT driver functionality. @@ -1221,7 +1220,9 @@ def test_ogr_mvt_write_mbtiles(): @pytest.mark.require_driver("SQLite") @pytest.mark.require_geos -def test_ogr_mvt_write_limitations_max_size(): +@pytest.mark.parametrize("implicit_limitation", [True, False]) +@gdaltest.enable_exceptions() +def test_ogr_mvt_write_limitations_max_size(implicit_limitation, tmp_path): src_ds = gdal.GetDriverByName("Memory").Create("", 0, 0, 0, gdal.GDT_Unknown) lyr = src_ds.CreateLayer("mylayer") @@ -1245,10 +1246,22 @@ def test_ogr_mvt_write_limitations_max_size(): out_ds = gdal.VectorTranslate( "/vsimem/out.mbtiles", src_ds, - datasetCreationOptions=["MAX_SIZE=100", "SIMPLIFICATION=1"], + datasetCreationOptions=[ + "@MAX_SIZE_FOR_TEST=101" if implicit_limitation else "MAX_SIZE=101", + "SIMPLIFICATION=1", + ], ) assert out_ds is not None - out_ds = None + gdal.ErrorReset() + with gdal.quiet_errors(): + out_ds.Close() + if implicit_limitation: + assert ( + gdal.GetLastErrorMsg() + == "At least one tile exceeded the default maximum tile size of 101 bytes and was encoded at lower resolution" + ) + else: + assert gdal.GetLastErrorMsg() == "" out_ds = ogr.Open("/vsimem/out.mbtiles") assert out_ds is not None @@ -1442,7 +1455,9 @@ def test_ogr_mvt_write_limitations_max_size_polygon(): @pytest.mark.require_driver("SQLite") @pytest.mark.require_geos -def test_ogr_mvt_write_limitations_max_features(): +@pytest.mark.parametrize("implicit_limitation", [True, False]) +@gdaltest.enable_exceptions() +def test_ogr_mvt_write_limitations_max_features(implicit_limitation): src_ds = gdal.GetDriverByName("Memory").Create("", 0, 0, 0, gdal.GDT_Unknown) lyr = src_ds.CreateLayer("mylayer") @@ -1463,10 +1478,21 @@ def test_ogr_mvt_write_limitations_max_features(): "/vsimem/out.mbtiles", src_ds, format="MVT", - datasetCreationOptions=["MAX_FEATURES=1"], + datasetCreationOptions=[ + "@MAX_FEATURES_FOR_TEST=1" if implicit_limitation else "MAX_FEATURES=1" + ], ) assert out_ds is not None - out_ds = None + gdal.ErrorReset() + with gdal.quiet_errors(): + out_ds.Close() + if implicit_limitation: + assert ( + gdal.GetLastErrorMsg() + == "At least one tile exceeded the default maximum number of features per tile (1) and was truncated to satisfy it." + ) + else: + assert gdal.GetLastErrorMsg() == "" out_ds = ogr.Open("/vsimem/out.mbtiles") assert out_ds is not None diff --git a/autotest/ogr/ogr_mysql.py b/autotest/ogr/ogr_mysql.py index d490c69b736c..b00a6a3a336a 100755 --- a/autotest/ogr/ogr_mysql.py +++ b/autotest/ogr/ogr_mysql.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test MySQL driver functionality. diff --git a/autotest/ogr/ogr_nas.py b/autotest/ogr/ogr_nas.py index 07fc94749fd3..778c47f68177 100755 --- a/autotest/ogr/ogr_nas.py +++ b/autotest/ogr/ogr_nas.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: NAS Reading Driver testing. diff --git a/autotest/ogr/ogr_ntf.py b/autotest/ogr/ogr_ntf.py index fdc1c5589915..0ed29c805724 100755 --- a/autotest/ogr/ogr_ntf.py +++ b/autotest/ogr/ogr_ntf.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR NTF driver. diff --git a/autotest/ogr/ogr_oapif.py b/autotest/ogr/ogr_oapif.py index 6f62b21c13a4..8159efad971f 100755 --- a/autotest/ogr/ogr_oapif.py +++ b/autotest/ogr/ogr_oapif.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: OAPIF driver testing. diff --git a/autotest/ogr/ogr_oci.py b/autotest/ogr/ogr_oci.py index 02e3683cbea4..0bd52a827166 100755 --- a/autotest/ogr/ogr_oci.py +++ b/autotest/ogr/ogr_oci.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Oracle OCI driver functionality. @@ -70,6 +69,7 @@ def setup_tests(): gdaltest.oci_ds.ExecuteSQL("DELLAYER:test_GEOMETRYCOLLECTION") gdaltest.oci_ds.ExecuteSQL("DELLAYER:test_NONE") gdaltest.oci_ds.ExecuteSQL("DELLAYER:testdate") + gdaltest.oci_ds.ExecuteSQL("DELLAYER:testdate_with_tz") gdaltest.oci_ds.ExecuteSQL("DELLAYER:ogr_oci_20") gdaltest.oci_ds.ExecuteSQL("DELLAYER:ogr_oci_20bis") gdaltest.oci_ds.ExecuteSQL("DELLAYER:ogr_oci_21") @@ -724,7 +724,7 @@ def test_ogr_oci_18(): # Test date / datetime -def test_ogr_oci_19(): +def test_ogr_oci_datetime_no_tz(): lyr = gdaltest.oci_ds.CreateLayer("testdate", geom_type=ogr.wkbNone) lyr.CreateField(ogr.FieldDefn("MYDATE", ogr.OFTDate)) @@ -736,6 +736,9 @@ def test_ogr_oci_19(): feat = ogr.Feature(lyr.GetLayerDefn()) feat.SetField("MYDATETIME", "2015/02/03 11:33:44.12345") lyr.CreateFeature(feat) + feat = ogr.Feature(lyr.GetLayerDefn()) + feat.SetField("MYDATETIME", "2015/02/03 11:33:44.12345+0530") # Timezone lost + lyr.CreateFeature(feat) lyr.SyncToDisk() with gdaltest.oci_ds.ExecuteSQL( @@ -743,11 +746,55 @@ def test_ogr_oci_19(): ) as sql_lyr: assert sql_lyr.GetLayerDefn().GetFieldDefn(0).GetType() == ogr.OFTDate assert sql_lyr.GetLayerDefn().GetFieldDefn(1).GetType() == ogr.OFTDateTime + assert sql_lyr.GetLayerDefn().GetFieldDefn(1).GetTZFlag() == ogr.TZFLAG_UNKNOWN f = sql_lyr.GetNextFeature() assert f.GetField(0) == "2015/02/03" assert f.GetField(1) == "2015/02/03 11:33:44" f = sql_lyr.GetNextFeature() assert f.GetField(1) == "2015/02/03 11:33:44.123" + f = sql_lyr.GetNextFeature() + assert f.GetField(1) == "2015/02/03 11:33:44.123" # Timezone lost + + +############################################################################### +# Test date / datetime with time zone + + +def test_ogr_oci_datetime_with_tz(): + + lyr = gdaltest.oci_ds.CreateLayer( + "testdate_with_tz", + geom_type=ogr.wkbNone, + options=["TIMESTAMP_WITH_TIME_ZONE=YES"], + ) + lyr.CreateField(ogr.FieldDefn("MYDATETIME", ogr.OFTDateTime)) + feat = ogr.Feature(lyr.GetLayerDefn()) + feat.SetField("MYDATETIME", "2015/02/03 11:33:44.567+0530") + lyr.CreateFeature(feat) + feat = ogr.Feature(lyr.GetLayerDefn()) + feat.SetField("MYDATETIME", "2015/02/03 11:33:44-0530") + lyr.CreateFeature(feat) + feat = ogr.Feature(lyr.GetLayerDefn()) + feat.SetField("MYDATETIME", "2015/02/03 11:33:44+00") + lyr.CreateFeature(feat) + feat = ogr.Feature(lyr.GetLayerDefn()) + feat.SetField("MYDATETIME", "2015/02/03 11:33:44") # UTC assumed... + lyr.CreateFeature(feat) + lyr.SyncToDisk() + + with gdaltest.oci_ds.ExecuteSQL( + "SELECT MYDATETIME FROM testdate_with_tz" + ) as sql_lyr: + assert sql_lyr.GetLayerDefn().GetFieldDefn(0).GetType() == ogr.OFTDateTime + assert sql_lyr.GetLayerDefn().GetFieldDefn(0).GetTZFlag() == ogr.TZFLAG_MIXED_TZ + f = sql_lyr.GetNextFeature() + assert f.GetField(0) == "2015/02/03 11:33:44.567+0530" + f = sql_lyr.GetNextFeature() + assert f.GetField(0) == "2015/02/03 11:33:44-0530" + f = sql_lyr.GetNextFeature() + assert f.GetField(0) == "2015/02/03 11:33:44+00" + f = sql_lyr.GetNextFeature() + assert f.GetField(0) == "2015/02/03 11:33:44+00" # UTC assumed... ############################################################################### diff --git a/autotest/ogr/ogr_odbc.py b/autotest/ogr/ogr_odbc.py index ebd0745ce184..6e5d274f9f5a 100755 --- a/autotest/ogr/ogr_odbc.py +++ b/autotest/ogr/ogr_odbc.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR ODBC driver. diff --git a/autotest/ogr/ogr_ods.py b/autotest/ogr/ogr_ods.py index 491665b09783..3beadd813382 100755 --- a/autotest/ogr/ogr_ods.py +++ b/autotest/ogr/ogr_ods.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR ODS driver. diff --git a/autotest/ogr/ogr_ogdi.py b/autotest/ogr/ogr_ogdi.py index 3d9accf1d891..9e8883b7d866 100755 --- a/autotest/ogr/ogr_ogdi.py +++ b/autotest/ogr/ogr_ogdi.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR OGDI driver. diff --git a/autotest/ogr/ogr_ogrtest.py b/autotest/ogr/ogr_ogrtest.py index f30057122f61..98a4b8ab197f 100644 --- a/autotest/ogr/ogr_ogrtest.py +++ b/autotest/ogr/ogr_ogrtest.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Tests of ogrtest utility functions diff --git a/autotest/ogr/ogr_openfilegdb.py b/autotest/ogr/ogr_openfilegdb.py index 34abc6d8c257..e93bb7789f95 100755 --- a/autotest/ogr/ogr_openfilegdb.py +++ b/autotest/ogr/ogr_openfilegdb.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: OpenFileGDB driver testing. @@ -2943,3 +2942,19 @@ def test_ogr_openfilegdb_arc_interior_point_bug_line(): f, "MULTILINESTRING ((37252520.1717 7431529.9154,38549084.9654 758964.7573))", ) + + +############################################################################### +# Test https://github.com/OSGeo/gdal/issues/11295 where .gdbindexes contains +# entry with unusual (corrupted ? disabled?) entries + + +def test_ogr_openfilegdb_weird_gdbindexes(): + + # File a00000009.gdbindexes has been replaced by file a00000029.gdbindexes + # from attachment of https://github.com/OSGeo/gdal/issues/11295#issuecomment-2491158506 + with ogr.Open("data/filegdb/corrupted_gdbindexes.gdb") as ds: + lyr = ds.GetLayer(0) + lyr.SetAttributeFilter("id = '1'") + f = lyr.GetNextFeature() + assert f diff --git a/autotest/ogr/ogr_openfilegdb_write.py b/autotest/ogr/ogr_openfilegdb_write.py index d2b0486267a4..d0916bf3ad23 100755 --- a/autotest/ogr/ogr_openfilegdb_write.py +++ b/autotest/ogr/ogr_openfilegdb_write.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: OpenFileGDB driver testing (write side) diff --git a/autotest/ogr/ogr_osm.py b/autotest/ogr/ogr_osm.py index 70f664fc5b28..b692bbc481c3 100755 --- a/autotest/ogr/ogr_osm.py +++ b/autotest/ogr/ogr_osm.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR OSM driver. diff --git a/autotest/ogr/ogr_parquet.py b/autotest/ogr/ogr_parquet.py index 9fddd67b926e..0f8f58e15574 100755 --- a/autotest/ogr/ogr_parquet.py +++ b/autotest/ogr/ogr_parquet.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for OGR Parquet driver. @@ -3355,6 +3354,27 @@ def test_ogr_parquet_bbox_float32_but_no_covering_in_metadata(use_dataset): ############################################################################### +@gdaltest.enable_exceptions() +@pytest.mark.require_curl +def test_ogr_parquet_overture_from_azure(): + + if not _has_arrow_dataset(): + pytest.skip("Test requires build with ArrowDataset") + + url = "https://overturemapswestus2.blob.core.windows.net/release?comp=list&delimiter=%2F&prefix=2024-11-13.0%2Ftheme%3Ddivisions%2Ftype%3Ddivision_area%2F&restype=container" + if gdaltest.gdalurlopen(url, timeout=5) is None: + pytest.skip(reason=f"{url} is down") + + with ogr.Open( + "PARQUET:/vsicurl/https://overturemapswestus2.blob.core.windows.net/release/2024-11-13.0/theme=divisions/type=division_area" + ) as ds: + lyr = ds.GetLayer(0) + assert lyr.GetFeatureCount() > 0 + + +############################################################################### + + @gdaltest.enable_exceptions() def test_ogr_parquet_write_arrow(tmp_vsimem): @@ -4100,6 +4120,7 @@ def test_ogr_parquet_ignored_fields_bounding_box_column_arrow_dataset(tmp_path): @gdaltest.enable_exceptions() +@pytest.mark.require_driver("ARROW") def test_ogr_parquet_vsi_arrow_file_system(): version = int( diff --git a/autotest/ogr/ogr_pcidsk.py b/autotest/ogr/ogr_pcidsk.py index 2f225ca5d02d..2c43c8d14718 100755 --- a/autotest/ogr/ogr_pcidsk.py +++ b/autotest/ogr/ogr_pcidsk.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test PCIDSK driver functionality. diff --git a/autotest/ogr/ogr_pdf.py b/autotest/ogr/ogr_pdf.py index 9be31d4db7bd..2bfb7d9bc168 100755 --- a/autotest/ogr/ogr_pdf.py +++ b/autotest/ogr/ogr_pdf.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR PDF driver. diff --git a/autotest/ogr/ogr_pds.py b/autotest/ogr/ogr_pds.py index 341886c301b9..af54059a7ed4 100755 --- a/autotest/ogr/ogr_pds.py +++ b/autotest/ogr/ogr_pds.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR PDS driver. diff --git a/autotest/ogr/ogr_pds4.py b/autotest/ogr/ogr_pds4.py index 900ccf2db52c..25aa00fc83c8 100755 --- a/autotest/ogr/ogr_pds4.py +++ b/autotest/ogr/ogr_pds4.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test PDS4 format diff --git a/autotest/ogr/ogr_pg.py b/autotest/ogr/ogr_pg.py index 4efceeff0d1e..3a0c24c2bb88 100755 --- a/autotest/ogr/ogr_pg.py +++ b/autotest/ogr/ogr_pg.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test PostGIS driver functionality. @@ -6204,6 +6203,7 @@ def test_ogr_pg_ogr2ogr_with_multiple_dotted_table_name(pg_ds): ############################################################################### # Test scenario of https://lists.osgeo.org/pipermail/gdal-dev/2024-October/059608.html +# and bugfix of https://github.com/OSGeo/gdal/issues/11386 @only_without_postgis @@ -6220,6 +6220,7 @@ def test_ogr_pg_empty_search_path(pg_ds): with pg_ds.ExecuteSQL("SELECT CURRENT_USER") as lyr: f = lyr.GetNextFeature() current_user = f.GetField(0) + pg_ds.ExecuteSQL(f"ALTER ROLE {current_user} SET search_path = ''") try: ds = reconnect(pg_ds, update=1) @@ -6227,7 +6228,25 @@ def test_ogr_pg_empty_search_path(pg_ds): with ds.ExecuteSQL("SHOW search_path") as sql_lyr: f = sql_lyr.GetNextFeature() new_search_path = f.GetField(0) - assert new_search_path == "test_ogr_pg_empty_search_path_no_postgis, public" + assert ( + new_search_path + == 'test_ogr_pg_empty_search_path_no_postgis, "", public' + ) + + finally: + ds.ExecuteSQL(f"ALTER ROLE {current_user} SET search_path = {old_search_path}") + + pg_ds.ExecuteSQL(f"ALTER ROLE {current_user} SET search_path = '', '$user'") + try: + ds = reconnect(pg_ds, update=1) + + with ds.ExecuteSQL("SHOW search_path") as sql_lyr: + f = sql_lyr.GetNextFeature() + new_search_path = f.GetField(0) + assert ( + new_search_path + == 'test_ogr_pg_empty_search_path_no_postgis, "", "$user", public' + ) finally: ds.ExecuteSQL(f"ALTER ROLE {current_user} SET search_path = {old_search_path}") diff --git a/autotest/ogr/ogr_pgdump.py b/autotest/ogr/ogr_pgdump.py index 1472b05f5aa3..e97071951547 100755 --- a/autotest/ogr/ogr_pgdump.py +++ b/autotest/ogr/ogr_pgdump.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR PGDump driver. diff --git a/autotest/ogr/ogr_pgeo.py b/autotest/ogr/ogr_pgeo.py index a1dfcfa7af60..4d399b428051 100755 --- a/autotest/ogr/ogr_pgeo.py +++ b/autotest/ogr/ogr_pgeo.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR PGEO driver. diff --git a/autotest/ogr/ogr_plscenes.py b/autotest/ogr/ogr_plscenes.py index aae005636025..178f26b98556 100755 --- a/autotest/ogr/ogr_plscenes.py +++ b/autotest/ogr/ogr_plscenes.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: PlanetLabs scene driver test suite. diff --git a/autotest/ogr/ogr_pmtiles.py b/autotest/ogr/ogr_pmtiles.py index 242a85124d9d..1e0689150794 100755 --- a/autotest/ogr/ogr_pmtiles.py +++ b/autotest/ogr/ogr_pmtiles.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test PMTiles driver vector functionality. diff --git a/autotest/ogr/ogr_pythondrivers.py b/autotest/ogr/ogr_pythondrivers.py index 8d173c2f3271..f8e27026c572 100644 --- a/autotest/ogr/ogr_pythondrivers.py +++ b/autotest/ogr/ogr_pythondrivers.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Python drivers diff --git a/autotest/ogr/ogr_refcount.py b/autotest/ogr/ogr_refcount.py index d76c0304ee4b..3e11f0561863 100755 --- a/autotest/ogr/ogr_refcount.py +++ b/autotest/ogr/ogr_refcount.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test "shared" open, and various refcount based stuff. diff --git a/autotest/ogr/ogr_rfc30.py b/autotest/ogr/ogr_rfc30.py index 7efb6f955cb2..532481839c56 100755 --- a/autotest/ogr/ogr_rfc30.py +++ b/autotest/ogr/ogr_rfc30.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test RFC 30 (UTF filename handling) support. diff --git a/autotest/ogr/ogr_rfc35.py b/autotest/ogr/ogr_rfc35.py index 2688e1199088..0c9adfec95c8 100755 --- a/autotest/ogr/ogr_rfc35.py +++ b/autotest/ogr/ogr_rfc35.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test RFC35 for several drivers diff --git a/autotest/ogr/ogr_rfc41.py b/autotest/ogr/ogr_rfc41.py index 9e8cccbd9c19..65aab747f6d2 100755 --- a/autotest/ogr/ogr_rfc41.py +++ b/autotest/ogr/ogr_rfc41.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test RFC41 diff --git a/autotest/ogr/ogr_s57.py b/autotest/ogr/ogr_s57.py index 40f461a3800e..4f0364bad25b 100755 --- a/autotest/ogr/ogr_s57.py +++ b/autotest/ogr/ogr_s57.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR S-57 driver functionality. diff --git a/autotest/ogr/ogr_sdts.py b/autotest/ogr/ogr_sdts.py index 97a18a0c6bf2..3fd0bd4bd838 100755 --- a/autotest/ogr/ogr_sdts.py +++ b/autotest/ogr/ogr_sdts.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR SDTS driver functionality. diff --git a/autotest/ogr/ogr_shape.py b/autotest/ogr/ogr_shape.py index d777a11e41bc..0df5c2359e33 100755 --- a/autotest/ogr/ogr_shape.py +++ b/autotest/ogr/ogr_shape.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Shapefile driver testing. diff --git a/autotest/ogr/ogr_shape_qix.py b/autotest/ogr/ogr_shape_qix.py index 6ed720fec125..ae6829102d52 100755 --- a/autotest/ogr/ogr_shape_qix.py +++ b/autotest/ogr/ogr_shape_qix.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test shapefile spatial index mechanism (.qix files). This can serve diff --git a/autotest/ogr/ogr_shape_sbn.py b/autotest/ogr/ogr_shape_sbn.py index 152af2f39818..6c47ed3b21f1 100755 --- a/autotest/ogr/ogr_shape_sbn.py +++ b/autotest/ogr/ogr_shape_sbn.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ESRI shapefile spatial index mechanism (.sbn files). This can serve diff --git a/autotest/ogr/ogr_sosi.py b/autotest/ogr/ogr_sosi.py index 572059c1b753..a171de541a45 100755 --- a/autotest/ogr/ogr_sosi.py +++ b/autotest/ogr/ogr_sosi.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR SOSI driver. diff --git a/autotest/ogr/ogr_sql_rfc28.py b/autotest/ogr/ogr_sql_rfc28.py index 4405220bfb17..9ae9c57b7681 100755 --- a/autotest/ogr/ogr_sql_rfc28.py +++ b/autotest/ogr/ogr_sql_rfc28.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR SQL capabilities added as part of RFC 28 implementation. diff --git a/autotest/ogr/ogr_sql_sqlite.py b/autotest/ogr/ogr_sql_sqlite.py index b6b1bafb2ead..63130f113f5b 100755 --- a/autotest/ogr/ogr_sql_sqlite.py +++ b/autotest/ogr/ogr_sql_sqlite.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: SQLite SQL dialect testing. diff --git a/autotest/ogr/ogr_sql_test.py b/autotest/ogr/ogr_sql_test.py index fe517750e5d3..2d0e5505263c 100755 --- a/autotest/ogr/ogr_sql_test.py +++ b/autotest/ogr/ogr_sql_test.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test various OGR SQL support options. diff --git a/autotest/ogr/ogr_sqlite.py b/autotest/ogr/ogr_sqlite.py index 0d5d22526c2c..9bbd8382f69c 100755 --- a/autotest/ogr/ogr_sqlite.py +++ b/autotest/ogr/ogr_sqlite.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test SQLite driver functionality. diff --git a/autotest/ogr/ogr_style.py b/autotest/ogr/ogr_style.py index 982df084a2be..6b8c390f03f4 100755 --- a/autotest/ogr/ogr_style.py +++ b/autotest/ogr/ogr_style.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Style testing. diff --git a/autotest/ogr/ogr_svg.py b/autotest/ogr/ogr_svg.py index 7d564b3d28fa..34f4d48ea6f5 100755 --- a/autotest/ogr/ogr_svg.py +++ b/autotest/ogr/ogr_svg.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test SVG driver functionality. diff --git a/autotest/ogr/ogr_tiger.py b/autotest/ogr/ogr_tiger.py index 636896ccf980..e24371d11087 100755 --- a/autotest/ogr/ogr_tiger.py +++ b/autotest/ogr/ogr_tiger.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR TIGER driver. diff --git a/autotest/ogr/ogr_tiledb.py b/autotest/ogr/ogr_tiledb.py index 067f9e35906c..b4cb4826e994 100644 --- a/autotest/ogr/ogr_tiledb.py +++ b/autotest/ogr/ogr_tiledb.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test TileDB driver vector functionality. diff --git a/autotest/ogr/ogr_topojson.py b/autotest/ogr/ogr_topojson.py index 9dc502868aee..a83f23e5c6fa 100755 --- a/autotest/ogr/ogr_topojson.py +++ b/autotest/ogr/ogr_topojson.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: TopJSON driver test suite. diff --git a/autotest/ogr/ogr_vdv.py b/autotest/ogr/ogr_vdv.py index aa0a277f2b96..57b9f9a85daa 100755 --- a/autotest/ogr/ogr_vdv.py +++ b/autotest/ogr/ogr_vdv.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR VDV driver. diff --git a/autotest/ogr/ogr_vfk.py b/autotest/ogr/ogr_vfk.py index 73a2ffc24e63..f7d316cbbbcd 100755 --- a/autotest/ogr/ogr_vfk.py +++ b/autotest/ogr/ogr_vfk.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR VFK driver functionality. diff --git a/autotest/ogr/ogr_virtualogr.py b/autotest/ogr/ogr_virtualogr.py index 91a4fdebc03c..22530d9772ac 100755 --- a/autotest/ogr/ogr_virtualogr.py +++ b/autotest/ogr/ogr_virtualogr.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: VirtualOGR testing diff --git a/autotest/ogr/ogr_vrt.py b/autotest/ogr/ogr_vrt.py index 43e8c612a548..8c46606b026a 100755 --- a/autotest/ogr/ogr_vrt.py +++ b/autotest/ogr/ogr_vrt.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGR VRT driver functionality. diff --git a/autotest/ogr/ogr_wfs.py b/autotest/ogr/ogr_wfs.py index 2908533afd09..8bf514f18ac0 100755 --- a/autotest/ogr/ogr_wfs.py +++ b/autotest/ogr/ogr_wfs.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: WFS driver testing. diff --git a/autotest/ogr/ogr_wkbwkt_geom.py b/autotest/ogr/ogr_wkbwkt_geom.py index 0033a03433b6..0eea9e119530 100755 --- a/autotest/ogr/ogr_wkbwkt_geom.py +++ b/autotest/ogr/ogr_wkbwkt_geom.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic OGR translation of WKT and WKB geometries. diff --git a/autotest/ogr/ogr_wktempty.py b/autotest/ogr/ogr_wktempty.py index 3047cbd63b75..508dcef5d845 100755 --- a/autotest/ogr/ogr_wktempty.py +++ b/autotest/ogr/ogr_wktempty.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test support for the various "EMPTY" WKT geometry representations. diff --git a/autotest/ogr/ogr_xls.py b/autotest/ogr/ogr_xls.py index fd61c88fcad8..88597a5ab2b3 100755 --- a/autotest/ogr/ogr_xls.py +++ b/autotest/ogr/ogr_xls.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR XLS driver. diff --git a/autotest/ogr/ogr_xlsx.py b/autotest/ogr/ogr_xlsx.py index a4b8cc287935..611f20368ffe 100755 --- a/autotest/ogr/ogr_xlsx.py +++ b/autotest/ogr/ogr_xlsx.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test read functionality for OGR XLSX driver. diff --git a/autotest/ogr/ograpispy.py b/autotest/ogr/ograpispy.py index f1d77deb337c..f432b754d0bc 100755 --- a/autotest/ogr/ograpispy.py +++ b/autotest/ogr/ograpispy.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OGRAPISPY diff --git a/autotest/osr/osr_basic.py b/autotest/osr/osr_basic.py index c14da1d0b007..af8ea798ead7 100755 --- a/autotest/osr/osr_basic.py +++ b/autotest/osr/osr_basic.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Basic tests of OGRSpatialReference (OSR) operation, not including diff --git a/autotest/osr/osr_basic_subprocess.py b/autotest/osr/osr_basic_subprocess.py index 9c7712ad5b4d..ee0589ddc2cc 100755 --- a/autotest/osr/osr_basic_subprocess.py +++ b/autotest/osr/osr_basic_subprocess.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test unsafe OSR operations diff --git a/autotest/osr/osr_cf1.py b/autotest/osr/osr_cf1.py index 8c672d26c553..84aa164a1382 100755 --- a/autotest/osr/osr_cf1.py +++ b/autotest/osr/osr_cf1.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test CF1 spatial reference implementation. diff --git a/autotest/osr/osr_compd.py b/autotest/osr/osr_compd.py index 854ebb783873..6cac426b1eee 100755 --- a/autotest/osr/osr_compd.py +++ b/autotest/osr/osr_compd.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test COMPD_CS support. diff --git a/autotest/osr/osr_ct.py b/autotest/osr/osr_ct.py index a12c3675b768..89363f23935c 100755 --- a/autotest/osr/osr_ct.py +++ b/autotest/osr/osr_ct.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test coordinate transformations. diff --git a/autotest/osr/osr_ct_proj.py b/autotest/osr/osr_ct_proj.py index ae896689ad03..68fe515a6a08 100755 --- a/autotest/osr/osr_ct_proj.py +++ b/autotest/osr/osr_ct_proj.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test reprojection of points of many different projections. diff --git a/autotest/osr/osr_epsg.py b/autotest/osr/osr_epsg.py index 0053cc91eec5..ea9a3585becc 100755 --- a/autotest/osr/osr_epsg.py +++ b/autotest/osr/osr_epsg.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test aspects of EPSG code lookup. @@ -545,3 +544,31 @@ def test_osr_epsg_EPSGTreatsAsLatLong_for_CompoundCRS(): srs = osr.SpatialReference() srs.ImportFromEPSG(6697) assert srs.EPSGTreatsAsLatLong() == 1 + + +############################################################################### +# Test importing a ESRI code as a EPSG code + + +@pytest.mark.require_proj(9) +def test_osr_epsg_import_esri_code(): + + srs = osr.SpatialReference() + with gdal.quiet_errors(): + srs.ImportFromEPSG(104905) + + assert srs.GetAuthorityName(None) == "ESRI" + assert srs.GetAuthorityCode(None) == "104905" + + +############################################################################### +# Test importing a non-existent ESRI code presented as a EPSG code + + +def test_osr_epsg_import_invalid_code_that_might_have_been_esri(): + + srs = osr.SpatialReference() + with pytest.raises( + Exception, match="PROJ: proj_create_from_database: crs not found" + ): + srs.ImportFromEPSG(987654) diff --git a/autotest/osr/osr_erm.py b/autotest/osr/osr_erm.py index 3e5403e828cc..9ea0afa02899 100755 --- a/autotest/osr/osr_erm.py +++ b/autotest/osr/osr_erm.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test ERMapper spatial reference implementation. diff --git a/autotest/osr/osr_esri.py b/autotest/osr/osr_esri.py index b439340bbb46..404708fd3344 100755 --- a/autotest/osr/osr_esri.py +++ b/autotest/osr/osr_esri.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test some ESRI specific translation issues. diff --git a/autotest/osr/osr_micoordsys.py b/autotest/osr/osr_micoordsys.py index b79827fc8286..93c59109d0f5 100755 --- a/autotest/osr/osr_micoordsys.py +++ b/autotest/osr/osr_micoordsys.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test some MITAB specific translation issues. diff --git a/autotest/osr/osr_ozi.py b/autotest/osr/osr_ozi.py index 356f1bcaf6fd..c721bf391cd4 100755 --- a/autotest/osr/osr_ozi.py +++ b/autotest/osr/osr_ozi.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OZI projection and datum support diff --git a/autotest/osr/osr_pci.py b/autotest/osr/osr_pci.py index 117ca0392234..f23113d7521f 100755 --- a/autotest/osr/osr_pci.py +++ b/autotest/osr/osr_pci.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test some PCI specific translation issues. diff --git a/autotest/osr/osr_pm.py b/autotest/osr/osr_pm.py index 513bdff9bee8..4d04e29fec71 100755 --- a/autotest/osr/osr_pm.py +++ b/autotest/osr/osr_pm.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test some prime meridian related issues with EPSG translation diff --git a/autotest/osr/osr_proj4.py b/autotest/osr/osr_proj4.py index 50932e4ec749..ca5a6d44cf95 100755 --- a/autotest/osr/osr_proj4.py +++ b/autotest/osr/osr_proj4.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test some PROJ.4 specific translation issues. diff --git a/autotest/osr/osr_url.py b/autotest/osr/osr_url.py index 17dc87c5f06d..7bce453f5bc9 100755 --- a/autotest/osr/osr_url.py +++ b/autotest/osr/osr_url.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test some URL specific translation issues. diff --git a/autotest/osr/osr_usgs.py b/autotest/osr/osr_usgs.py index 582886cfdf59..ff2c6bd52d88 100755 --- a/autotest/osr/osr_usgs.py +++ b/autotest/osr/osr_usgs.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test some USGS specific translation issues. diff --git a/autotest/osr/osr_validate.py b/autotest/osr/osr_validate.py index 73a5f3c2020b..fc4e92eeb8d9 100755 --- a/autotest/osr/osr_validate.py +++ b/autotest/osr/osr_validate.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test (error cases of) OSRValidate diff --git a/autotest/osr/osr_xml.py b/autotest/osr/osr_xml.py index 9822297909f4..88ca91240f4d 100755 --- a/autotest/osr/osr_xml.py +++ b/autotest/osr/osr_xml.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test OSR XML import/export diff --git a/autotest/postinstall/test_cpp/test_cpp.cpp b/autotest/postinstall/test_cpp/test_cpp.cpp index b928a03b9205..173daa14f6f2 100644 --- a/autotest/postinstall/test_cpp/test_cpp.cpp +++ b/autotest/postinstall/test_cpp/test_cpp.cpp @@ -9,6 +9,7 @@ #endif #include #include +#include int main(int argc, char **argv) { @@ -16,5 +17,13 @@ int main(int argc, char **argv) OGRGeometryFactory::createFromWkt("POINT(1 2)", nullptr, &poGeom); OGRGeometryFactory::destroyGeometry(poGeom); std::cout << GDALVersionInfo("RELEASE_NAME") << std::endl; + + // Check fix for https://github.com/OSGeo/gdal/issues/11311 + OGRSpatialReference oSRS; + int nEntries = 0; + int *panMatchCondidence = nullptr; + oSRS.FindMatches(nullptr, &nEntries, &panMatchCondidence); + CPLFree(panMatchCondidence); + return (0); } diff --git a/autotest/pymod/gdaltest.py b/autotest/pymod/gdaltest.py index 2a119424df1b..3c6625889723 100755 --- a/autotest/pymod/gdaltest.py +++ b/autotest/pymod/gdaltest.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Python Library supporting GDAL/OGR Test Suite diff --git a/autotest/pymod/ogrtest.py b/autotest/pymod/ogrtest.py index fae366bc013e..a7696b0e2b8f 100755 --- a/autotest/pymod/ogrtest.py +++ b/autotest/pymod/ogrtest.py @@ -1,5 +1,4 @@ ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Support functions for OGR tests. diff --git a/autotest/pymod/test_cli_utilities.py b/autotest/pymod/test_cli_utilities.py index 57864cab5ed0..4565c1899f29 100755 --- a/autotest/pymod/test_cli_utilities.py +++ b/autotest/pymod/test_cli_utilities.py @@ -1,6 +1,5 @@ #!/usr/bin/env python ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Helper functions for testing CLI utilities diff --git a/autotest/pymod/test_py_scripts.py b/autotest/pymod/test_py_scripts.py index 21a4aa99c95b..bf6fa76bd054 100755 --- a/autotest/pymod/test_py_scripts.py +++ b/autotest/pymod/test_py_scripts.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Helper functions for testing python utilities diff --git a/autotest/pymod/uffd.py b/autotest/pymod/uffd.py index 74ee71341de2..81a3eb3c5aeb 100755 --- a/autotest/pymod/uffd.py +++ b/autotest/pymod/uffd.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Python Library supporting GDAL/OGR Test Suite diff --git a/autotest/pymod/webserver.py b/autotest/pymod/webserver.py index e619a097c6c6..d702fcbe7d02 100755 --- a/autotest/pymod/webserver.py +++ b/autotest/pymod/webserver.py @@ -1,6 +1,5 @@ #!/usr/bin/env python ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Fake HTTP server diff --git a/autotest/pyscripts/gdal2tiles/test_add_alpha_band_to_string_vrt.py b/autotest/pyscripts/gdal2tiles/test_add_alpha_band_to_string_vrt.py index 913658e522c4..f5a31711a630 100644 --- a/autotest/pyscripts/gdal2tiles/test_add_alpha_band_to_string_vrt.py +++ b/autotest/pyscripts/gdal2tiles/test_add_alpha_band_to_string_vrt.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal2tiles.py testing diff --git a/autotest/pyscripts/gdal2tiles/test_add_gdal_warp_options_to_string.py b/autotest/pyscripts/gdal2tiles/test_add_gdal_warp_options_to_string.py index be4e762bbcba..523572e9bc75 100644 --- a/autotest/pyscripts/gdal2tiles/test_add_gdal_warp_options_to_string.py +++ b/autotest/pyscripts/gdal2tiles/test_add_gdal_warp_options_to_string.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal2tiles.py testing diff --git a/autotest/pyscripts/gdal2tiles/test_logger.py b/autotest/pyscripts/gdal2tiles/test_logger.py index ca32fd84d68b..fbfad0f0af74 100644 --- a/autotest/pyscripts/gdal2tiles/test_logger.py +++ b/autotest/pyscripts/gdal2tiles/test_logger.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal2tiles.py testing diff --git a/autotest/pyscripts/gdal2tiles/test_nb_data_bands.py b/autotest/pyscripts/gdal2tiles/test_nb_data_bands.py index 21db8db7fd20..00fa4901b173 100644 --- a/autotest/pyscripts/gdal2tiles/test_nb_data_bands.py +++ b/autotest/pyscripts/gdal2tiles/test_nb_data_bands.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal2tiles.py testing diff --git a/autotest/pyscripts/gdal2tiles/test_option_parser.py b/autotest/pyscripts/gdal2tiles/test_option_parser.py index f6fecc232197..b2c4b9138694 100644 --- a/autotest/pyscripts/gdal2tiles/test_option_parser.py +++ b/autotest/pyscripts/gdal2tiles/test_option_parser.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal2tiles.py testing diff --git a/autotest/pyscripts/gdal2tiles/test_reproject_dataset.py b/autotest/pyscripts/gdal2tiles/test_reproject_dataset.py index 43318166be37..e475f3467d8b 100644 --- a/autotest/pyscripts/gdal2tiles/test_reproject_dataset.py +++ b/autotest/pyscripts/gdal2tiles/test_reproject_dataset.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal2tiles.py testing diff --git a/autotest/pyscripts/gdal2tiles/test_setup_input_srs.py b/autotest/pyscripts/gdal2tiles/test_setup_input_srs.py index a8905b403e98..5eaa852c5915 100644 --- a/autotest/pyscripts/gdal2tiles/test_setup_input_srs.py +++ b/autotest/pyscripts/gdal2tiles/test_setup_input_srs.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal2tiles.py testing diff --git a/autotest/pyscripts/gdal2tiles/test_setup_no_data_value.py b/autotest/pyscripts/gdal2tiles/test_setup_no_data_value.py index c41a07e8c860..27fa1e39ba9c 100644 --- a/autotest/pyscripts/gdal2tiles/test_setup_no_data_value.py +++ b/autotest/pyscripts/gdal2tiles/test_setup_no_data_value.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal2tiles.py testing diff --git a/autotest/pyscripts/gdal2tiles/test_update_alpha_value_for_non_alpha_inputs.py b/autotest/pyscripts/gdal2tiles/test_update_alpha_value_for_non_alpha_inputs.py index 29ea02992966..fac268b69a5c 100644 --- a/autotest/pyscripts/gdal2tiles/test_update_alpha_value_for_non_alpha_inputs.py +++ b/autotest/pyscripts/gdal2tiles/test_update_alpha_value_for_non_alpha_inputs.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal2tiles.py testing diff --git a/autotest/pyscripts/gdal2tiles/test_vsimem.py b/autotest/pyscripts/gdal2tiles/test_vsimem.py index f09b3825e2fc..fbd6ab42c297 100644 --- a/autotest/pyscripts/gdal2tiles/test_vsimem.py +++ b/autotest/pyscripts/gdal2tiles/test_vsimem.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal2tiles.py testing diff --git a/autotest/pyscripts/test_gdal2tiles.py b/autotest/pyscripts/test_gdal2tiles.py index e4012ce41468..786b1711d27b 100755 --- a/autotest/pyscripts/test_gdal2tiles.py +++ b/autotest/pyscripts/test_gdal2tiles.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal2tiles.py testing @@ -49,6 +48,9 @@ def script_path(): def test_gdal2tiles_help(script_path): + if gdaltest.is_travis_branch("sanitize"): + pytest.skip("fails on sanitize for unknown reason") + assert "ERROR" not in test_py_scripts.run_py_script( script_path, "gdal2tiles", "--help" ) @@ -60,6 +62,9 @@ def test_gdal2tiles_help(script_path): def test_gdal2tiles_version(script_path): + if gdaltest.is_travis_branch("sanitize"): + pytest.skip("fails on sanitize for unknown reason") + assert "ERROR" not in test_py_scripts.run_py_script( script_path, "gdal2tiles", "--version" ) diff --git a/autotest/pyscripts/test_gdal_edit.py b/autotest/pyscripts/test_gdal_edit.py index 8f5adbda27a7..8f89a28b388d 100755 --- a/autotest/pyscripts/test_gdal_edit.py +++ b/autotest/pyscripts/test_gdal_edit.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_edit.py testing diff --git a/autotest/pyscripts/test_gdal_fillnodata.py b/autotest/pyscripts/test_gdal_fillnodata.py index b24323242393..c32b0b21d06e 100755 --- a/autotest/pyscripts/test_gdal_fillnodata.py +++ b/autotest/pyscripts/test_gdal_fillnodata.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_fillnodata.py testing diff --git a/autotest/pyscripts/test_gdal_ls_py.py b/autotest/pyscripts/test_gdal_ls_py.py index 54b03771de05..7b8ffc0535b5 100755 --- a/autotest/pyscripts/test_gdal_ls_py.py +++ b/autotest/pyscripts/test_gdal_ls_py.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_ls.py testing diff --git a/autotest/pyscripts/test_gdal_merge.py b/autotest/pyscripts/test_gdal_merge.py index ab39d60ea2f3..ac5e9815fdb2 100755 --- a/autotest/pyscripts/test_gdal_merge.py +++ b/autotest/pyscripts/test_gdal_merge.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_merge.py testing diff --git a/autotest/pyscripts/test_gdal_pansharpen.py b/autotest/pyscripts/test_gdal_pansharpen.py index 584f9d9b81ea..44835137ec97 100755 --- a/autotest/pyscripts/test_gdal_pansharpen.py +++ b/autotest/pyscripts/test_gdal_pansharpen.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_pansharpen testing diff --git a/autotest/pyscripts/test_gdal_polygonize.py b/autotest/pyscripts/test_gdal_polygonize.py index 4319d29aa739..a995419dd2e9 100755 --- a/autotest/pyscripts/test_gdal_polygonize.py +++ b/autotest/pyscripts/test_gdal_polygonize.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test gdal_polygonize.py script diff --git a/autotest/pyscripts/test_gdal_proximity.py b/autotest/pyscripts/test_gdal_proximity.py index a09ce5a4e461..6459bf291653 100755 --- a/autotest/pyscripts/test_gdal_proximity.py +++ b/autotest/pyscripts/test_gdal_proximity.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test gdal_proximity.py script diff --git a/autotest/pyscripts/test_gdal_retile.py b/autotest/pyscripts/test_gdal_retile.py index 25c1359862d3..49acd9a6978a 100755 --- a/autotest/pyscripts/test_gdal_retile.py +++ b/autotest/pyscripts/test_gdal_retile.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_retile.py testing diff --git a/autotest/pyscripts/test_gdal_sieve.py b/autotest/pyscripts/test_gdal_sieve.py index e61699f159dc..329440abbf0e 100755 --- a/autotest/pyscripts/test_gdal_sieve.py +++ b/autotest/pyscripts/test_gdal_sieve.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test gdal_sieve.py utility diff --git a/autotest/pyscripts/test_gdalattachpct.py b/autotest/pyscripts/test_gdalattachpct.py index 6954b55444f3..dbff30cd91cd 100755 --- a/autotest/pyscripts/test_gdalattachpct.py +++ b/autotest/pyscripts/test_gdalattachpct.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdalattachpct.py testing diff --git a/autotest/pyscripts/test_gdalbuildvrtofvrt.py b/autotest/pyscripts/test_gdalbuildvrtofvrt.py index db3001f3a618..7fb89c84cbd9 100755 --- a/autotest/pyscripts/test_gdalbuildvrtofvrt.py +++ b/autotest/pyscripts/test_gdalbuildvrtofvrt.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdalbuildvrtofvrt.py testing diff --git a/autotest/pyscripts/test_gdalcompare.py b/autotest/pyscripts/test_gdalcompare.py index 1a021580202a..6a569f5b3c5e 100644 --- a/autotest/pyscripts/test_gdalcompare.py +++ b/autotest/pyscripts/test_gdalcompare.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdalcompare.py testing diff --git a/autotest/pyscripts/test_gdalinfo_py.py b/autotest/pyscripts/test_gdalinfo_py.py index b5527c71d371..5e98041ef412 100755 --- a/autotest/pyscripts/test_gdalinfo_py.py +++ b/autotest/pyscripts/test_gdalinfo_py.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdalinfo.py testing diff --git a/autotest/pyscripts/test_gdallocationinfo_py.py b/autotest/pyscripts/test_gdallocationinfo_py.py index 3ca9312ece20..cd71f9182988 100644 --- a/autotest/pyscripts/test_gdallocationinfo_py.py +++ b/autotest/pyscripts/test_gdallocationinfo_py.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdallocationinfo.py testing diff --git a/autotest/pyscripts/test_gdalmove.py b/autotest/pyscripts/test_gdalmove.py index 84080916d47f..274862b7e6ab 100755 --- a/autotest/pyscripts/test_gdalmove.py +++ b/autotest/pyscripts/test_gdalmove.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdalmove testing diff --git a/autotest/pyscripts/test_ogr_layer_algebra.py b/autotest/pyscripts/test_ogr_layer_algebra.py index 2a16fc5412ef..af93265fde84 100644 --- a/autotest/pyscripts/test_ogr_layer_algebra.py +++ b/autotest/pyscripts/test_ogr_layer_algebra.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: To test the functionality of ogr_layer_algebra script @@ -12,6 +11,7 @@ # SPDX-License-Identifier: MIT ############################################################################### +import gdaltest import ogrtest import pytest import test_py_scripts @@ -38,6 +38,9 @@ def script_path(): def test_ogr_layer_algebra_help(script_path): + if gdaltest.is_travis_branch("sanitize"): + pytest.skip("fails on sanitize for unknown reason") + assert "ERROR" not in test_py_scripts.run_py_script( script_path, "ogr_layer_algebra", "--help" ) @@ -49,6 +52,9 @@ def test_ogr_layer_algebra_help(script_path): def test_ogr_layer_algebra_version(script_path): + if gdaltest.is_travis_branch("sanitize"): + pytest.skip("fails on sanitize for unknown reason") + assert "ERROR" not in test_py_scripts.run_py_script( script_path, "ogr_layer_algebra", "--version" ) diff --git a/autotest/pyscripts/test_ogrinfo_py.py b/autotest/pyscripts/test_ogrinfo_py.py index 7be7d6546465..998bfcb242d0 100755 --- a/autotest/pyscripts/test_ogrinfo_py.py +++ b/autotest/pyscripts/test_ogrinfo_py.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: ogrinfo.py testing diff --git a/autotest/pyscripts/test_ogrmerge.py b/autotest/pyscripts/test_ogrmerge.py index e6600485e86c..f153e11e4f5c 100755 --- a/autotest/pyscripts/test_ogrmerge.py +++ b/autotest/pyscripts/test_ogrmerge.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: ogrmerge.py testing @@ -14,6 +13,7 @@ import sys +import gdaltest import pytest import test_py_scripts from test_py_scripts import samples_path @@ -40,6 +40,9 @@ def script_path(): def test_ogrmerge_help(script_path): + if gdaltest.is_travis_branch("sanitize"): + pytest.skip("fails on sanitize for unknown reason") + assert "ERROR" not in test_py_scripts.run_py_script( script_path, "ogrmerge", "--help" ) @@ -51,6 +54,9 @@ def test_ogrmerge_help(script_path): def test_ogrmerge_version(script_path): + if gdaltest.is_travis_branch("sanitize"): + pytest.skip("fails on sanitize for unknown reason") + assert "ERROR" not in test_py_scripts.run_py_script( script_path, "ogrmerge", "--version" ) diff --git a/autotest/pyscripts/test_pct.py b/autotest/pyscripts/test_pct.py index c549685ea5ff..1378d280f5a1 100755 --- a/autotest/pyscripts/test_pct.py +++ b/autotest/pyscripts/test_pct.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: rgb2pct.py and pct2rgb.py testing diff --git a/autotest/pyscripts/test_validate_geoparquet.py b/autotest/pyscripts/test_validate_geoparquet.py index b29c6b70cc2c..a4ecd5571a3b 100755 --- a/autotest/pyscripts/test_validate_geoparquet.py +++ b/autotest/pyscripts/test_validate_geoparquet.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: validate_geoparquet testing diff --git a/autotest/slow_tests/raster.py b/autotest/slow_tests/raster.py index e6927afa5ff8..6712ee0e455e 100644 --- a/autotest/slow_tests/raster.py +++ b/autotest/slow_tests/raster.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Raster testing diff --git a/autotest/test_random_tiff.py b/autotest/test_random_tiff.py index 8115fa3b27da..f40a1c8d1bb0 100755 --- a/autotest/test_random_tiff.py +++ b/autotest/test_random_tiff.py @@ -1,6 +1,5 @@ #!/usr/bin/env python ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test "random" TIFF files diff --git a/autotest/utilities/test_gdal_contour.py b/autotest/utilities/test_gdal_contour.py index c46f277afa2e..538096b63b28 100755 --- a/autotest/utilities/test_gdal_contour.py +++ b/autotest/utilities/test_gdal_contour.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_contour testing diff --git a/autotest/utilities/test_gdal_create.py b/autotest/utilities/test_gdal_create.py index 7e50e54df7f8..db6a0c71a00a 100755 --- a/autotest/utilities/test_gdal_create.py +++ b/autotest/utilities/test_gdal_create.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_create testing diff --git a/autotest/utilities/test_gdal_footprint.py b/autotest/utilities/test_gdal_footprint.py index bb24662d55f4..e5885e66ef9e 100755 --- a/autotest/utilities/test_gdal_footprint.py +++ b/autotest/utilities/test_gdal_footprint.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_footprint testing diff --git a/autotest/utilities/test_gdal_footprint_lib.py b/autotest/utilities/test_gdal_footprint_lib.py index 2b80576444c4..48f85f73e551 100755 --- a/autotest/utilities/test_gdal_footprint_lib.py +++ b/autotest/utilities/test_gdal_footprint_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_footprint testing diff --git a/autotest/utilities/test_gdal_grid.py b/autotest/utilities/test_gdal_grid.py index 48ebb0a0a9d7..ed732ce60be6 100755 --- a/autotest/utilities/test_gdal_grid.py +++ b/autotest/utilities/test_gdal_grid.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_grid testing diff --git a/autotest/utilities/test_gdal_grid_lib.py b/autotest/utilities/test_gdal_grid_lib.py index 2c25a4a18258..0e9222015b16 100755 --- a/autotest/utilities/test_gdal_grid_lib.py +++ b/autotest/utilities/test_gdal_grid_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_grid testing diff --git a/autotest/utilities/test_gdal_rasterize.py b/autotest/utilities/test_gdal_rasterize.py index bb81108e3e4b..8a015a30ec6c 100755 --- a/autotest/utilities/test_gdal_rasterize.py +++ b/autotest/utilities/test_gdal_rasterize.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_rasterize testing diff --git a/autotest/utilities/test_gdal_rasterize_lib.py b/autotest/utilities/test_gdal_rasterize_lib.py index bc44636d5fc2..ff508a9e2390 100755 --- a/autotest/utilities/test_gdal_rasterize_lib.py +++ b/autotest/utilities/test_gdal_rasterize_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_rasterize testing diff --git a/autotest/utilities/test_gdal_translate.py b/autotest/utilities/test_gdal_translate.py index 6d21dfc75720..ba8905d167d3 100755 --- a/autotest/utilities/test_gdal_translate.py +++ b/autotest/utilities/test_gdal_translate.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_translate testing diff --git a/autotest/utilities/test_gdal_translate_lib.py b/autotest/utilities/test_gdal_translate_lib.py index 6d58bf601e0c..21fdd873cca2 100755 --- a/autotest/utilities/test_gdal_translate_lib.py +++ b/autotest/utilities/test_gdal_translate_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: test librarified gdal_translate diff --git a/autotest/utilities/test_gdal_viewshed.py b/autotest/utilities/test_gdal_viewshed.py index 945ae886727d..6cb72171e5b5 100755 --- a/autotest/utilities/test_gdal_viewshed.py +++ b/autotest/utilities/test_gdal_viewshed.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdal_viewshed testing diff --git a/autotest/utilities/test_gdaladdo.py b/autotest/utilities/test_gdaladdo.py index b55a16dc61c7..d8d8821a8f4c 100755 --- a/autotest/utilities/test_gdaladdo.py +++ b/autotest/utilities/test_gdaladdo.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdaladdo testing diff --git a/autotest/utilities/test_gdalbuildvrt.py b/autotest/utilities/test_gdalbuildvrt.py index 42e6b33aed7b..3994b5cd9caa 100755 --- a/autotest/utilities/test_gdalbuildvrt.py +++ b/autotest/utilities/test_gdalbuildvrt.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdalbuildvrt testing diff --git a/autotest/utilities/test_gdalbuildvrt_lib.py b/autotest/utilities/test_gdalbuildvrt_lib.py index 1b1b9b0a67d1..8645f6bbdcd9 100755 --- a/autotest/utilities/test_gdalbuildvrt_lib.py +++ b/autotest/utilities/test_gdalbuildvrt_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: test librarified gdalbuildvrt diff --git a/autotest/utilities/test_gdaldem.py b/autotest/utilities/test_gdaldem.py index 1c934c8f272a..d250cd4baa1e 100755 --- a/autotest/utilities/test_gdaldem.py +++ b/autotest/utilities/test_gdaldem.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdaldem testing diff --git a/autotest/utilities/test_gdaldem_lib.py b/autotest/utilities/test_gdaldem_lib.py index f7254e2280e5..e348592f2ca2 100755 --- a/autotest/utilities/test_gdaldem_lib.py +++ b/autotest/utilities/test_gdaldem_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdaldem testing diff --git a/autotest/utilities/test_gdalinfo.py b/autotest/utilities/test_gdalinfo.py index 744f1bdb34e1..9e0447302d48 100755 --- a/autotest/utilities/test_gdalinfo.py +++ b/autotest/utilities/test_gdalinfo.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdalinfo testing diff --git a/autotest/utilities/test_gdalinfo_lib.py b/autotest/utilities/test_gdalinfo_lib.py index 8333b30d1c02..b067abc97bd6 100755 --- a/autotest/utilities/test_gdalinfo_lib.py +++ b/autotest/utilities/test_gdalinfo_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: test librarified gdalinfo diff --git a/autotest/utilities/test_gdallocationinfo.py b/autotest/utilities/test_gdallocationinfo.py index 4e75959308a3..8ebebf2b471b 100755 --- a/autotest/utilities/test_gdallocationinfo.py +++ b/autotest/utilities/test_gdallocationinfo.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdallocationinfo testing diff --git a/autotest/utilities/test_gdalmanage.py b/autotest/utilities/test_gdalmanage.py index dbf4ed454a09..ec18d8945bdc 100644 --- a/autotest/utilities/test_gdalmanage.py +++ b/autotest/utilities/test_gdalmanage.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdalmanage testing diff --git a/autotest/utilities/test_gdalmdiminfo.py b/autotest/utilities/test_gdalmdiminfo.py index 65567314d562..6fd2cfb6eb84 100755 --- a/autotest/utilities/test_gdalmdiminfo.py +++ b/autotest/utilities/test_gdalmdiminfo.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdalmdiminfo testing diff --git a/autotest/utilities/test_gdalmdiminfo_lib.py b/autotest/utilities/test_gdalmdiminfo_lib.py index 2a159b72f4c1..bcd3c6add848 100755 --- a/autotest/utilities/test_gdalmdiminfo_lib.py +++ b/autotest/utilities/test_gdalmdiminfo_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: test librarified gdalmdiminfo diff --git a/autotest/utilities/test_gdalmdimtranslate.py b/autotest/utilities/test_gdalmdimtranslate.py index d6aedd37fbff..bdd19ea2fde4 100755 --- a/autotest/utilities/test_gdalmdimtranslate.py +++ b/autotest/utilities/test_gdalmdimtranslate.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: test command line gdalmdimtranslate diff --git a/autotest/utilities/test_gdalmdimtranslate_lib.py b/autotest/utilities/test_gdalmdimtranslate_lib.py index acd81ff4312a..c036e5ff2393 100755 --- a/autotest/utilities/test_gdalmdimtranslate_lib.py +++ b/autotest/utilities/test_gdalmdimtranslate_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: test librarified gdalmdimtranslate diff --git a/autotest/utilities/test_gdalsrsinfo.py b/autotest/utilities/test_gdalsrsinfo.py index fcc82d958368..c1fd91560ea1 100755 --- a/autotest/utilities/test_gdalsrsinfo.py +++ b/autotest/utilities/test_gdalsrsinfo.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdalsrsinfo testing diff --git a/autotest/utilities/test_gdaltindex.py b/autotest/utilities/test_gdaltindex.py index a3eab02708dc..35a3d499c3d7 100755 --- a/autotest/utilities/test_gdaltindex.py +++ b/autotest/utilities/test_gdaltindex.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdaltindex testing diff --git a/autotest/utilities/test_gdaltindex_lib.py b/autotest/utilities/test_gdaltindex_lib.py index 505093b0d2f7..c7ddd3d8bd25 100644 --- a/autotest/utilities/test_gdaltindex_lib.py +++ b/autotest/utilities/test_gdaltindex_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Library version of gdaltindex testing diff --git a/autotest/utilities/test_gdaltransform.py b/autotest/utilities/test_gdaltransform.py index 34a163b7855e..24ab3dc13408 100755 --- a/autotest/utilities/test_gdaltransform.py +++ b/autotest/utilities/test_gdaltransform.py @@ -1,6 +1,5 @@ #!/usr/bin/env pytest ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdaltransform testing diff --git a/autotest/utilities/test_gdalwarp.py b/autotest/utilities/test_gdalwarp.py index 6c499ab8fd66..7ccda69a57a0 100755 --- a/autotest/utilities/test_gdalwarp.py +++ b/autotest/utilities/test_gdalwarp.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: gdalwarp testing diff --git a/autotest/utilities/test_gdalwarp_lib.py b/autotest/utilities/test_gdalwarp_lib.py index b3d0363ca362..29d12991e966 100755 --- a/autotest/utilities/test_gdalwarp_lib.py +++ b/autotest/utilities/test_gdalwarp_lib.py @@ -1,7 +1,6 @@ # ve!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: test librarified gdalwarp diff --git a/autotest/utilities/test_gnmutils.py b/autotest/utilities/test_gnmutils.py index e8e27a6eec84..ecbfa2bc57a7 100755 --- a/autotest/utilities/test_gnmutils.py +++ b/autotest/utilities/test_gnmutils.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test basic GNMGdalNetwork class functionality. diff --git a/autotest/utilities/test_nearblack.py b/autotest/utilities/test_nearblack.py index 0b44ad3ae37b..c423a9d22879 100755 --- a/autotest/utilities/test_nearblack.py +++ b/autotest/utilities/test_nearblack.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: nearblack testing diff --git a/autotest/utilities/test_nearblack_lib.py b/autotest/utilities/test_nearblack_lib.py index 8d23b24da7b3..1dc6c98219ff 100755 --- a/autotest/utilities/test_nearblack_lib.py +++ b/autotest/utilities/test_nearblack_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: nearblack testing diff --git a/autotest/utilities/test_ogr2ogr.py b/autotest/utilities/test_ogr2ogr.py index 791fddcf0b00..a214fa9b39fe 100755 --- a/autotest/utilities/test_ogr2ogr.py +++ b/autotest/utilities/test_ogr2ogr.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: ogr2ogr testing diff --git a/autotest/utilities/test_ogr2ogr_lib.py b/autotest/utilities/test_ogr2ogr_lib.py index ca6b776b524c..96c9a7e26782 100755 --- a/autotest/utilities/test_ogr2ogr_lib.py +++ b/autotest/utilities/test_ogr2ogr_lib.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: librarified ogr2ogr testing diff --git a/autotest/utilities/test_ogrinfo.py b/autotest/utilities/test_ogrinfo.py index 25fcda0584a3..bdb9d089cc28 100755 --- a/autotest/utilities/test_ogrinfo.py +++ b/autotest/utilities/test_ogrinfo.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: ogrinfo testing diff --git a/autotest/utilities/test_ogrtindex.py b/autotest/utilities/test_ogrtindex.py index 4c35a9d4d184..c962a0856eb3 100755 --- a/autotest/utilities/test_ogrtindex.py +++ b/autotest/utilities/test_ogrtindex.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: ogrtindex testing diff --git a/autotest/utilities/test_sozip.py b/autotest/utilities/test_sozip.py index c94b18457903..6c8765e96ffe 100755 --- a/autotest/utilities/test_sozip.py +++ b/autotest/utilities/test_sozip.py @@ -1,7 +1,6 @@ #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### -# $Id$ # # Project: GDAL/OGR Test Suite # Purpose: sozip testing diff --git a/doc/images/community/survey_2024/documentation_needs.svg b/doc/images/community/survey_2024/documentation_needs.svg new file mode 100644 index 000000000000..cb05350fb5d0 --- /dev/null +++ b/doc/images/community/survey_2024/documentation_needs.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Installation +Python +Other +Format options +Data format peculiarities +Developer API usage +Workflows +Examples + + + + + + + + + + + +0 +100 +200 +Number of respondents +Topic +Where does GDAL need more documentation? + + diff --git a/doc/images/community/survey_2024/easy_to_install_gdal.svg b/doc/images/community/survey_2024/easy_to_install_gdal.svg new file mode 100644 index 000000000000..4d5294ea339a --- /dev/null +++ b/doc/images/community/survey_2024/easy_to_install_gdal.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +100 +200 +300 + + + + + + + +Yes +No +Yes, but not with the options I need +It is easy to install GDAL +Respondents + + diff --git a/doc/images/community/survey_2024/easy_to_install_gdal_os.svg b/doc/images/community/survey_2024/easy_to_install_gdal_os.svg new file mode 100644 index 000000000000..979de09057f9 --- /dev/null +++ b/doc/images/community/survey_2024/easy_to_install_gdal_os.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Linux + + + + + + + + + + +OSX + + + + + + + + + + +Windows + + + + + +No +Yes +Yes, but not with +the options I need + + + +No +Yes +Yes, but not with +the options I need + + + +No +Yes +Yes, but not with +the options I need +0 +50 +100 +150 + + + + +Operating System +Respondents +Is it easy to install GDAL? + + diff --git a/doc/images/community/survey_2024/gdal_challenge.svg b/doc/images/community/survey_2024/gdal_challenge.svg new file mode 100644 index 000000000000..8a1b0989fe7b --- /dev/null +++ b/doc/images/community/survey_2024/gdal_challenge.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Finding examples +Understanding features +Installation +Constructing workflows +Other +Coordinate systems +Formats + + + + + + + + + + + + + +0 +25 +50 +75 +100 +125 +Number of respondents +Topic +My most difficult GDAL usage challenge is... + + diff --git a/doc/images/community/survey_2024/gdal_easier_to_use.svg b/doc/images/community/survey_2024/gdal_easier_to_use.svg new file mode 100644 index 000000000000..0a1d84f57e84 --- /dev/null +++ b/doc/images/community/survey_2024/gdal_easier_to_use.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +cli +doc +examples +gui +install +mac +options +python +tutorial +windows + + + + + + + + + + + + + +0 +10 +20 +Percent of responses +Keyword +What could make GDAL easier to use? + + diff --git a/doc/images/community/survey_2024/gdal_help_source.svg b/doc/images/community/survey_2024/gdal_help_source.svg new file mode 100644 index 000000000000..16226095cf49 --- /dev/null +++ b/doc/images/community/survey_2024/gdal_help_source.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +gdal.org +Search engine +StackOverflow +Chatbot +GitHub +Source code +Mailing list +GDAL/OGR Cookbook +Python/R package docstrings +Frank +Telegram group + + + + + + + + + + + + + + +0 +100 +200 +Number of Respondents +Source +The first place I look for GDAL help is... + + diff --git a/doc/images/community/survey_2024/local_or_cloud_read.svg b/doc/images/community/survey_2024/local_or_cloud_read.svg new file mode 100644 index 000000000000..8f193bdb3276 --- /dev/null +++ b/doc/images/community/survey_2024/local_or_cloud_read.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Local file systems +Cloud (s3, gcs, az) +Network file systems +Memory +HPC (Lustre, HDFS, IPFS, etc) +Other + + + + + + + + + + + +0 +100 +200 +300 +400 +Number of Respondents +Source +I read most data with GDAL from... + + diff --git a/doc/images/community/survey_2024/local_or_cloud_write.svg b/doc/images/community/survey_2024/local_or_cloud_write.svg new file mode 100644 index 000000000000..cb90b03702a2 --- /dev/null +++ b/doc/images/community/survey_2024/local_or_cloud_write.svg @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Local file systems +Network file systems +Cloud (s3, gcs, az) +Memory +Database +HPC (Lustre, HDFS, IPFS, etc) +Other + + + + + + + + + + + + +0 +100 +200 +300 +400 +Number of Respondents +Location +I write most data with GDAL to... + + diff --git a/doc/images/community/survey_2024/maintenance_program_activities.svg b/doc/images/community/survey_2024/maintenance_program_activities.svg new file mode 100644 index 000000000000..3f9578e8dbd6 --- /dev/null +++ b/doc/images/community/survey_2024/maintenance_program_activities.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +VSI enhancements +Python bindings improvements +Documentation improvements +Dependency enhancements +(PROJ, GEOS, libgeotiff, libtiff) +Build system refactor +(CMake, plugin loading, etc. + + + + + + + + + + +0 +10 +20 +30 +40 +Percent of responses +Activity +Which maintenance program-funded activity +improved your usability of GDAL? + + diff --git a/doc/images/community/survey_2024/maintenance_program_areas_of_focus.svg b/doc/images/community/survey_2024/maintenance_program_areas_of_focus.svg new file mode 100644 index 000000000000..18f9a45d8654 --- /dev/null +++ b/doc/images/community/survey_2024/maintenance_program_areas_of_focus.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Performance +Format compatibility +Integration with other software +Command line +Command line compatibility +VSI features +Backward compatibility +More formats +Static builds +Compiler compatibility +Deprecation of unused drivers + + + + + + + + + + + + + + + +0 +1 +2 +3 +Average priority +Area of focus +Maintenance program priority rankings + + diff --git a/doc/images/community/survey_2024/operating_system.svg b/doc/images/community/survey_2024/operating_system.svg new file mode 100644 index 000000000000..b5398e97b7e6 --- /dev/null +++ b/doc/images/community/survey_2024/operating_system.svg @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Linux +Windows +OSX +Other +FreeBSD + + + + + + + + + +0 +100 +200 +300 +Number of Respondents +Operating System +The operating system I execute GDAL on most is... + + diff --git a/doc/images/community/survey_2024/raster_data_formats.svg b/doc/images/community/survey_2024/raster_data_formats.svg new file mode 100644 index 000000000000..a7f2c1a031a2 --- /dev/null +++ b/doc/images/community/survey_2024/raster_data_formats.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +GeoTIFF / COG +HDF/NetCDF +Other +GeoPackage +Rendered tilesets +JPEG/JPEG2000 +ECW +ENVI +KEA + + + + + + + + + + + + +0 +200 +400 +Number of Respondents +Format +Most common raster format usage + + diff --git a/doc/images/community/survey_2024/vector_data_formats.svg b/doc/images/community/survey_2024/vector_data_formats.svg new file mode 100644 index 000000000000..1cc610d52b58 --- /dev/null +++ b/doc/images/community/survey_2024/vector_data_formats.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +GeoPackage +Shapefile +GeoJSON +PostGIS +(Geo)Parquet +Other +Esri FileGeodatabase +FlatGeobuf +GML + + + + + + + + + + + + + + +0 +50 +100 +150 +200 +Number of Respondents +Format +Most common vector format usage + + diff --git a/doc/images/community/survey_2024/way_gdal_used.svg b/doc/images/community/survey_2024/way_gdal_used.svg new file mode 100644 index 000000000000..926928f77f18 --- /dev/null +++ b/doc/images/community/survey_2024/way_gdal_used.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Command line +GDAL Python bindings + (from osgeo import gdal) +Python packages + (rasterio, fiona, geopandas, rioxarray, etc.) +R packages + (terra, gdalraster, stars, etc.) +Other +PostGIS +C/C++ +QGIS +Java bindings +C# bindings + + + + + + + + + + + + + + + +0 +50 +100 +150 +200 +Number of Respondents +Method +I use GDAL most often via... + + diff --git a/doc/images/community/survey_2024/where_gdal_obtained_linux.svg b/doc/images/community/survey_2024/where_gdal_obtained_linux.svg new file mode 100644 index 000000000000..2c97599f8ec3 --- /dev/null +++ b/doc/images/community/survey_2024/where_gdal_obtained_linux.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Standard unix distribution +Built from source +Homebrew +Docker images +OSGeo4W +QGIS +UbuntuGIS +Other +conda-forge / Anaconda +NuGet + + + + + + + + + + + + + +0 +50 +100 +Number of Respondents +Source +Primary operating system: Linux +I obtain GDAL from... + + diff --git a/doc/images/community/survey_2024/where_gdal_obtained_osx.svg b/doc/images/community/survey_2024/where_gdal_obtained_osx.svg new file mode 100644 index 000000000000..dc4940ebe5da --- /dev/null +++ b/doc/images/community/survey_2024/where_gdal_obtained_osx.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Homebrew +Standard unix distribution +Built from source +QGIS +Other + + + + + + + + + +0 +20 +40 +60 +Number of Respondents +Source +Primary operating system: OSX +I obtain GDAL from... + + diff --git a/doc/images/community/survey_2024/where_gdal_obtained_windows.svg b/doc/images/community/survey_2024/where_gdal_obtained_windows.svg new file mode 100644 index 000000000000..6410ae7be247 --- /dev/null +++ b/doc/images/community/survey_2024/where_gdal_obtained_windows.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +OSGeo4W +Homebrew +QGIS +GISInternals +Built from source +Other +conda-forge / Anaconda +Christoph Gohlke +Commercial software +CRAN +NuGet +Standard unix distribution + + + + + + + + + + + + + + + + +0 +25 +50 +75 +Number of Respondents +Source +Primary operating system: Windows +I obtain GDAL from... + + diff --git a/doc/images/community/survey_2024/years_experience.svg b/doc/images/community/survey_2024/years_experience.svg new file mode 100644 index 000000000000..814071492293 --- /dev/null +++ b/doc/images/community/survey_2024/years_experience.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 +100 +200 + + + + + + + +1 - 4 years +5 - 9 years +10 - 20+ years +I'm Frank Warmerdam +Level of experience +Number of respondents +Survey Respondents - Level of Experience + + diff --git a/doc/source/community/index.rst b/doc/source/community/index.rst index 2ebfa71939c3..bf72f2b13fe7 100644 --- a/doc/source/community/index.rst +++ b/doc/source/community/index.rst @@ -131,6 +131,17 @@ Past members: Note that discussion of proposals to the PSC take place on gdal-dev, and input from all subscribers is welcome. A :ref:`list of past RFC ` is available for review. +User survey ++++++++++++ + +Results of the :ref:`survey_2024` are available for review. + + +.. toctree:: + :hidden: + + user_survey_2024 + GDAL Service Providers ---------------------- diff --git a/doc/source/community/user_survey_2024.rst b/doc/source/community/user_survey_2024.rst new file mode 100644 index 000000000000..61e4adc6479b --- /dev/null +++ b/doc/source/community/user_survey_2024.rst @@ -0,0 +1,146 @@ +.. _survey_2024: + +2024 GDAL user survey +===================== + +In October 2024, The GDAL maintenance program created an open survey to collect +feedback on user's experience with GDAL and the direction of the maintenance +program. The survey was publicized on gdal.org, the gdal-dev mailing list, the +project GitHub page, and social media. From October 28 to November 21, the +survey received 602 responses. + +Who responded to the survey? +---------------------------- + +Survey respondents were generally very experienced users, with 79% of users +having spent 5 or more years working with GDAL. Surprisingly, two respondents +claimed to be Frank Warmerdam, who originated the project in 1998. More than +half (52%) have built GDAL from source, 29% subscribe to the gdal-dev mailing +list, and 29% have contributed to the project by submitting bug reports or pull +requests. The high experience level of respondents reflects the challenge of +reaching users who may use GDAL less often, through other software, or are not +connected to the project community via mailing lists or social media. + +.. image:: ../../images/community/survey_2024/years_experience.svg + +Operating system +^^^^^^^^^^^^^^^^ + +Most survey respondents use GDAL on Linux, followed by Windows and OS X. +Responses to "Other" included WSL2 and iOS. + +.. image:: ../../images/community/survey_2024/operating_system.svg + +Local or cloud? +^^^^^^^^^^^^^^^ + +Most survey respondents use GDAL primarily with local file systems. + +.. image:: ../../images/community/survey_2024/local_or_cloud_read.svg + +.. image:: ../../images/community/survey_2024/local_or_cloud_write.svg + +Data formats +^^^^^^^^^^^^ + +Among raster data formats, GeoTIFF commands an overwhelming majority of GDAL +usage: + +.. image:: ../../images/community/survey_2024/raster_data_formats.svg + +The most popular vector format was GeoPackage, followed by classics such as +Shapefile, GeoJSON, and PostGIS. GeoParquet, Esri FileGeodatabase, FlatGeobuf, +and GML each earned enough votes to remain out of the "Other" category. + +.. image:: ../../images/community/survey_2024/vector_data_formats.svg + +Installing GDAL +--------------- + +Survey respondents obtain GDAL from a variety of channels, depending on the +platform. On Linux, standard system packages are the most popular solution. +OSX users rely primarily on Homebrew; most Windows users user OSGeo4W. The +popularity of Homebrew among Windows users may indicate that GDAL is being used +through the Windows Subsystem for Linux (WSL). The reported usage of OSGeo4W by +Linux users is more difficult to explain. + +.. image:: ../../images/community/survey_2024/where_gdal_obtained_linux.svg + +.. image:: ../../images/community/survey_2024/where_gdal_obtained_osx.svg + +.. image:: ../../images/community/survey_2024/where_gdal_obtained_windows.svg + +As may be expected for a group of experienced users, most respondents reported +that GDAL is easy to install with the options they need. Still, installation +remains a difficulty for many users. + +.. image:: ../../images/community/survey_2024/easy_to_install_gdal.svg + +Installation difficulties were not associated with a particular operating +system. + +.. image:: ../../images/community/survey_2024/easy_to_install_gdal_os.svg + +How is GDAL used? +----------------- + +The greatest number of respondents reported using GDAL from Python, with a +roughly 50/50 split between the GDAL Python bindings and higher-level packages +such as shapely, rasterio, and geopandas. After Python, the greatest number of +respondents reported using the command line interface, followed by smaller +number of users working in R, PostGIS, and QGIS. + +.. image:: ../../images/community/survey_2024/way_gdal_used.svg + +Getting help with GDAL +---------------------- + +Most users use gdal.org (directly or via a search engine) as their starting +point when trying to get help with GDAL. + +.. image:: ../../images/community/survey_2024/gdal_help_source.svg + +Difficulties using GDAL +----------------------- + +Users did not identify a single area as a source of their challenges with GDAL. +However, the top responses of "finding examples" and "understanding features" +point to a shortage of documentation. + +.. image:: ../../images/community/survey_2024/gdal_challenge.svg + +Consistent with the above, respondents reported "examples", "workflows", and +"API usage" as high priorities for documentation efforts. + +.. image:: ../../images/community/survey_2024/documentation_needs.svg + +And "examples" and "doc" rank highly among open-ended responses to +"what could make GDAL easier to use?" + +.. image:: ../../images/community/survey_2024/gdal_easier_to_use.svg + +Maintenance program activities +------------------------------ + +Among activities undertaken by the maintenance program so far, respondents found +the most value in enhancements to GDAL's dependencies (such as PROJ, GEOS, and +libtiff), its Python bindings, and documentation. + +.. image:: ../../images/community/survey_2024/maintenance_program_activities.svg + +Asked about a variety of tasks the maintenance program could take on beyond +those listed above, respondents showed some enthusiasm for almost everything! +Still, high priorities were given to performance, improving format +capabilities, and improving the command line interface while preserving +backward compatibility. + +.. image:: ../../images/community/survey_2024/maintenance_program_areas_of_focus.svg + +Next steps +---------- + +The maintenance program will use these results to inform work over the coming +year. Some work has already been performed to `develop an improved +command-line interface `__ and `add a +mechanism for usage examples to be cross-referenced in the +documentation `__. diff --git a/doc/source/development/cmake.rst b/doc/source/development/cmake.rst index 23b26e5bd346..dd8be88c0a35 100644 --- a/doc/source/development/cmake.rst +++ b/doc/source/development/cmake.rst @@ -10,7 +10,7 @@ The recommended way to use the GDAL library 3.5 or higher in a CMake project is link to the imported library target ``GDAL::GDAL`` provided by the CMake configuration which comes with the library. Typical usage is: -.. code:: +.. code:: cmake find_package(GDAL CONFIG REQUIRED) @@ -26,10 +26,26 @@ the cache variable or environment variable ``CMAKE_PREFIX_PATH``. In particular, CMake will consult (and set) the cache variable ``GDAL_DIR``. +If a specific minor version is required, you can search for this via: + +.. code:: cmake + + find_package(GDAL 3.10 CONFIG REQUIRED) + +If more than one minor version is to be supported at the same time, +``${GDAL_VERSION}`` itself must be evaluated. + +.. code:: cmake + + find_package(GDAL CONFIG REQUIRED) + if(GDAL_VERSION VERSION_LESS "3.7" OR GDAL_VERSION VERSION_GREATER "3.9") + message(FATAL_ERROR "Required at least GDAL version 3.7 - 3.9, but found ${GDAL_VERSION}.") + endif() + Before GDAL 3.5, it is recommended to use `find module supplied with CMake `__. This also creates the ``GDAL::GDAL`` target. It requires CMake version 3.14. -.. code:: +.. code:: cmake cmake_minimum_required(VERSION 3.14) diff --git a/doc/source/drivers/raster/gti.rst b/doc/source/drivers/raster/gti.rst index f44f0b359b12..f169e2f82298 100644 --- a/doc/source/drivers/raster/gti.rst +++ b/doc/source/drivers/raster/gti.rst @@ -42,7 +42,7 @@ driver with the following main differences: * Contrary to the VRT driver, the GTI driver does not enable to alter characteristics of referenced tiles, such as their georeferencing, nodata value, etc. If such behavior is desired, the tiles must be for example wrapped - individually in a VRT file (or `vrt://` connection string) before being referenced + individually in a VRT file (or `vrt://` connection string) before being referenced in the GTI index. Connection strings @@ -444,6 +444,12 @@ also defined as layer metadata items or in the .gti XML file Resolution along Y axis in SRS units / pixel. +- .. oo:: SRS + :choices: + + Override/sets the Spatial Reference System in one of the formats supported + by :cpp:func:`OGRSpatialReference::SetFromUserInput`. + - .. oo:: MINX :choices: diff --git a/doc/source/drivers/vector/dxf.rst b/doc/source/drivers/vector/dxf.rst index 30b348621b34..f38a21cdbde8 100644 --- a/doc/source/drivers/vector/dxf.rst +++ b/doc/source/drivers/vector/dxf.rst @@ -405,6 +405,33 @@ The driver supports the following dataset creation options: Override the trailer file used - in place of trailer.dxf located in the GDAL_DATA directory. +- .. dsco:: FIRST_ENTITY + :choices: + + Identifier of first entity + +- .. dsco:: INSUNITS + :choices: AUTO, HEADER_VALUE, UNITLESS, INCHES, FEET, MILLIMETERS, CENTIMETERS, METERS, US_SURVEY_FEET + :default: AUTO + :since: 3.11 + + Drawing units for the model space + (`$INSUNITS `__ system variable). + The default ``AUTO`` mode first check if the written layer has a projected + CRS, and if so uses is linear units to determine the value of ``$INSUNITS``. + Otherwise it fallbacks to the value of the header template (``HEADER_VALUE`` mode), + which is ``INCHES``. + +- .. dsco:: MEASUREMENT + :choices: HEADER_VALUE, IMPERIAL, METRIC + :default: HEADER_VALUE + :since: 3.11 + + Whether the current drawing uses imperial or metric hatch pattern and linetype + (`$MEASUREMENT `__ system variable). + Defaults to the value of the header template, which is ``IMPERIAL``. + + The header and trailer templates can be complete DXF files. The driver will scan them and only extract the needed portions (portion before or after the ENTITIES section). @@ -474,16 +501,6 @@ It is assumed that patterns are using "g" (georeferenced) units for defining the line pattern. If not, the scaling of the DXF patterns is likely to be wrong - potentially very wrong. -Units -~~~~~ - -GDAL writes DXF files with measurement units set to "Imperial - Inches". -If you need to change the units, edit the -`$MEASUREMENT `__ -and -`$INSUNITS `__ -variables in the header template. - -------------- diff --git a/doc/source/drivers/vector/gml.rst b/doc/source/drivers/vector/gml.rst index 8486318ac09a..6d2cd2ccf908 100644 --- a/doc/source/drivers/vector/gml.rst +++ b/doc/source/drivers/vector/gml.rst @@ -644,6 +644,16 @@ The following open options are supported: Whether to use schema imports in XSD files so that the feature types corresponding to imported schema can be detected. +- .. oo:: OGR_SCHEMA + :choices: | + :since: 3.11.0 + + Partially or totally overrides the auto-detected schema to use for creating the layer. + The overrides are applied to the schema detected from the GML file or the `.xsd` or the `.gfs`` file if present. + The overrides are defined as a JSON list of field definitions. + This can be a filename, a URL or JSON string conformant with the `ogr_fields_override.schema.json schema `_ + + .. note:: When changing the value of most of the above options, it is recommended to diff --git a/doc/source/drivers/vector/oci.rst b/doc/source/drivers/vector/oci.rst index 764767c2c9d5..2c367b394faf 100644 --- a/doc/source/drivers/vector/oci.rst +++ b/doc/source/drivers/vector/oci.rst @@ -288,6 +288,17 @@ The following layer creation options are supported: name, it can be supplied with the GEOMETRY_NAME layer creation option. +- .. lco:: TIMESTAMP_WITH_TIME_ZONE + :choices: YES, NO + :default: NO + :since: 3.10.1 + + Whether DateTime fields should be created with TIMESTAMP WITH TIME ZONE + Oracle type (otherwise without timezone). + When creating a field, if it advertises a known or mixed time zone, + TIMESTAMP_WITH_TIME_ZONE will default to YES, otherwise it will default to + NO. + Layer Open Options ~~~~~~~~~~~~~~~~~~ diff --git a/doc/source/programs/gdal_sieve.rst b/doc/source/programs/gdal_sieve.rst index 824e1e823efd..812df7d60a52 100644 --- a/doc/source/programs/gdal_sieve.rst +++ b/doc/source/programs/gdal_sieve.rst @@ -36,4 +36,4 @@ Additional details on the algorithm are available in the :cpp:func:`GDALSieveFil .. note:: - gdal_retile is a Python utility, and is only available if GDAL Python bindings are available. + gdal_sieve is a Python utility, and is only available if GDAL Python bindings are available. diff --git a/doc/source/software_using_gdal.rst b/doc/source/software_using_gdal.rst index 217f107f5647..550939038fac 100644 --- a/doc/source/software_using_gdal.rst +++ b/doc/source/software_using_gdal.rst @@ -38,6 +38,7 @@ Free and open source - `Mapnik `_ C++/ Python mapping toolkit - `MapServer `_ A popular web mapping application with GDAL support. - `MapWindow `_ open source ActiveX control with GIS functionality. +- `Mergin Maps `_ Field data collection app built on top of QGIS with cloud sync. - `MultiSpec `_ Application for interactively analyzing multispectral/hyperspectral image data. - `NASA Ames Stereo Pipeline `_ Software for creating terrain models and ortho images from planetary stereo images. (Apache 2.0) - `NASA WorldWind `_ Multiplatform virtual globe library to quickly and easily create interactive visualizations of 3D globes, map and geographical information. diff --git a/doc/source/user/configoptions.rst b/doc/source/user/configoptions.rst index 3c9c4b7d8eaa..8c948bcb7cf5 100644 --- a/doc/source/user/configoptions.rst +++ b/doc/source/user/configoptions.rst @@ -68,6 +68,20 @@ they can be limited to only the current thread with For boolean options, the values YES, TRUE or ON can be used to turn the option on; NO, FALSE or OFF to turn it off. +How to detect if the passed configuration option is known to GDAL +----------------------------------------------------------------- + +By default GDAL will not warn if the name of the configuration option is unknown. +Starting with GDAL 3.11, if you set the :config:`CPL_DEBUG` configuration +option to ``ON`` (or any value that is not ``OFF``, ``FALSE``, ``NO``), a GDAL +warning will be emitted for unknown configuration options. + +.. code-block:: shell + + $ gdalinfo --config BAD_OPTION=TEST --debug on --version + Warning 1: CPLSetConfigOption() called with key=BAD_OPTION, which is unknown to GDAL + [...] + .. _gdal_configuration_file: diff --git a/doc/source/user/multithreading.rst b/doc/source/user/multithreading.rst index c4318bada342..62a118f36674 100644 --- a/doc/source/user/multithreading.rst +++ b/doc/source/user/multithreading.rst @@ -48,7 +48,7 @@ Thread-safe GDAL dataset instances for raster read-only use cases .. versionadded:: 3.10 -RFC 101 adds a new capability to open, or obtain, a thread-safe dataset from +:ref:`rfc-101` adds a new capability to open, or obtain, a thread-safe dataset from any dataset, but only for raster read-only use cases. At open time, this can be done by passing ``GDAL_OF_RASTER | GDAL_OF_THREAD_SAFE`` diff --git a/doc/source/user/ogr_feature_style.rst b/doc/source/user/ogr_feature_style.rst index 2f8d72e8a9b9..25d9d8db2b26 100644 --- a/doc/source/user/ogr_feature_style.rst +++ b/doc/source/user/ogr_feature_style.rst @@ -293,7 +293,7 @@ representation. Note again that all parameters are optional: list of ids so that an application never has to rely on understanding system-specific ids. - Here is the current list of OGR pen ids (this could grow time): + Here is the current list of OGR pen ids (this could grow in time): - ogr-pen-0: solid (the default when no id is provided) - ogr-pen-1: null pen (invisible) diff --git a/doc/source/user/virtual_file_systems.rst b/doc/source/user/virtual_file_systems.rst index e553ff39453e..9ee74bbc1ed6 100644 --- a/doc/source/user/virtual_file_systems.rst +++ b/doc/source/user/virtual_file_systems.rst @@ -382,6 +382,7 @@ Starting with GDAL 2.3, options can be passed in the filename with the following - retry_delay=number_in_seconds: default to 30. Setting this option overrides the behavior of the :config:`GDAL_HTTP_RETRY_DELAY` configuration option. - retry_codes=``ALL`` or comma-separated list of HTTP error codes. Setting this option overrides the behavior of the :config:`GDAL_HTTP_RETRY_CODES` configuration option. (GDAL >= 3.10) - list_dir=yes/no: whether an attempt to read the file list of the directory where the file is located should be done. Default to YES. +- empty_dir=yes/no: whether to disable directory listing and disable logic in drivers to probe for individual side-car files. Default to NO. - useragent=value: HTTP UserAgent header - referer=value: HTTP Referer header - cookie=value: HTTP Cookie header diff --git a/docker/README.md b/docker/README.md index 74d3a1d865a3..ff8835e0b8c8 100644 --- a/docker/README.md +++ b/docker/README.md @@ -151,3 +151,13 @@ Override the image and repository of the final image by setting the environment **Example** `TARGET_IMAGE="YOU_DOCKER_USERNAME/gdal" alpine-small/build.sh --release --gdal v3.2.0 --proj master` + +## Drivers based on proprietary software development kits + +For the `ubuntu-full` amd64 image, + +* The OCI and GeoRaster based drivers can be enabled by passing ``--with-oracle`` to util.sh +* The ECW and JP2ECW drivers can be enabled by passing ``--with-ecw`` to util.sh +* The MrSID driver can be enabled by passing ``--with-mrsid`` to util.sh + +Note: those are not enabled in the official images provided by the project. diff --git a/docker/ubuntu-full/Dockerfile b/docker/ubuntu-full/Dockerfile index 30f71c7941c5..e0d9383ac262 100644 --- a/docker/ubuntu-full/Dockerfile +++ b/docker/ubuntu-full/Dockerfile @@ -278,8 +278,7 @@ RUN --mount=type=cache,id=ubuntu-full-libopendrive,target=$HOME/.cache \ && rm -rf libOpenDRIVE-${OPENDRIVE_VERSION} \ ); fi -#Build File Geodatabase - +#Build File Geodatabase if WITH_FILEGDB=yes is passed ARG WITH_FILEGDB= RUN . /buildscripts/bh-set-envvars.sh \ && if echo "$WITH_FILEGDB" | grep -Eiq "^(y(es)?|1|true)$" ; then ( \ @@ -293,6 +292,57 @@ RUN . /buildscripts/bh-set-envvars.sh \ && rm -rf FileGDB_API-RHEL7-64gcc83.tar.gz \ ) ; fi +# Download Oracle InstantClient (proprietary) SDK if WITH_ORACLE=yes is passed +ARG WITH_ORACLE= +RUN . /buildscripts/bh-set-envvars.sh \ + && if test "$(uname -p)" = "x86_64"; then \ + if echo "$WITH_ORACLE" | grep -Eiq "^(y(es)?|1|true)$" ; then ( \ + wget https://download.oracle.com/otn_software/linux/instantclient/1923000/instantclient-basic-linux.x64-19.23.0.0.0dbru.zip \ + && wget https://download.oracle.com/otn_software/linux/instantclient/1923000/instantclient-sdk-linux.x64-19.23.0.0.0dbru.zip \ + && unzip -o instantclient-basic-linux.x64-19.23.0.0.0dbru.zip \ + && unzip -o instantclient-sdk-linux.x64-19.23.0.0.0dbru.zip \ + && rm -f instantclient-basic-linux.x64-19.23.0.0.0dbru.zip instantclient-sdk-linux.x64-19.23.0.0.0dbru.zip \ + && mv instantclient_19_23 /opt \ + && mkdir -p /build_thirdparty/opt \ + && cp -r /opt/instantclient_19_23 /build_thirdparty/opt \ + && (cd /opt/instantclient_19_23; for i in *.so*; do ln -s /opt/instantclient_19_23/$i /usr/lib/x86_64-linux-gnu; ln -s /opt/instantclient_19_23/$i /build_thirdparty/usr/lib/x86_64-linux-gnu; done) \ + ) ; fi \ + ; fi + +# Download ECW (proprietary) SDK if WITH_ECW=yes is passed +ARG WITH_ECW= +RUN . /buildscripts/bh-set-envvars.sh \ + && if test "$(uname -p)" = "x86_64"; then \ + if echo "$WITH_ECW" | grep -Eiq "^(y(es)?|1|true)$" ; then ( \ + wget https://github.com/rouault/libecwj2-3.3-builds/releases/download/v1/install-libecwj2-3.3-ubuntu-20.04.tar.gz \ + && tar xzf install-libecwj2-3.3-ubuntu-20.04.tar.gz \ + && rm -f install-libecwj2-3.3-ubuntu-20.04.tar.gz \ + && mkdir -p /build_thirdparty/opt \ + && cp -r /opt/libecwj2-3.3 /build_thirdparty/opt \ + && (cd /opt/libecwj2-3.3/lib; for i in *.so*; do ln -s /opt/libecwj2-3.3/lib/$i /usr/lib/x86_64-linux-gnu; ln -s /opt/libecwj2-3.3/lib/$i /build_thirdparty/usr/lib/x86_64-linux-gnu; done) \ + ) ; fi \ + ; fi + +# Download MrSID (proprietary) SDK if WITH_MRSID=yes is passed +ARG WITH_MRSID= +RUN . /buildscripts/bh-set-envvars.sh \ + && if test "$(uname -p)" = "x86_64"; then \ + if echo "$WITH_MRSID" | grep -Eiq "^(y(es)?|1|true)$" ; then ( \ + wget https://bin.extensis.com/download/developer/MrSID_DSDK-9.5.5.5244-rhel9.x86-64.gcc1131.zip \ + && unzip MrSID_DSDK-9.5.5.5244-rhel9.x86-64.gcc1131.zip \ + && mv MrSID_DSDK-9.5.5.5244-rhel9.x86-64.gcc1131 mrsid \ + && rm -f MrSID_DSDK-9.5.5.5244-rhel9.x86-64.gcc1131.zip \ + && mkdir -p /opt/Raster_DSDK/include \ + && mkdir -p /opt/Raster_DSDK/lib \ + && cp -r mrsid/Raster_DSDK/include/* /opt/Raster_DSDK/include \ + && cp -r mrsid/Raster_DSDK/lib/* /opt/Raster_DSDK/lib \ + && rm -rf mrsid \ + && mkdir -p /build_thirdparty/opt/Raster_DSDK/lib \ + && cp -r /opt/Raster_DSDK/lib /build_thirdparty/opt/Raster_DSDK \ + && (cd /opt/Raster_DSDK/lib; for i in *.so*; do ln -s /opt/Raster_DSDK/lib/$i /usr/lib/x86_64-linux-gnu; ln -s /opt/Raster_DSDK/lib/$i /build_thirdparty/usr/lib/x86_64-linux-gnu; done) \ + ) ; fi \ + ; fi + # Build libqb3 RUN --mount=type=cache,id=ubuntu-full-libqb3,target=$HOME/.cache \ . /buildscripts/bh-set-envvars.sh \ @@ -425,11 +475,17 @@ COPY ./bh-proj.sh /buildscripts/bh-proj.sh # We want 2 separate steps for incremental builds where grids are refreshed # only when the content of cdn.proj.org has changed, independently if PROJ master # itself has changed. +ARG WITH_PROJ_GRIDS=yes RUN --mount=type=cache,id=ubuntu-full-proj,target=$HOME/.cache \ - . /buildscripts/bh-set-envvars.sh \ - && DESTDIR=/build_tmp_proj /buildscripts/bh-proj.sh \ - && LD_LIBRARY_PATH=/build_tmp_proj/usr/local/lib /build_tmp_proj/usr/local/bin/projsync --target-dir /tmp/proj_grids --all \ - && rm -rf /build_tmp_proj + mkdir -p /tmp/proj_grids \ + && touch /tmp/proj_grids/proj_grids_not_included \ + && if echo "$WITH_PROJ_GRIDS" | grep -Eiq "^(y(es)?|1|true)$" ; then ( \ + . /buildscripts/bh-set-envvars.sh \ + && rm -f /tmp/proj_grids/proj_grids_not_included \ + && DESTDIR=/build_tmp_proj /buildscripts/bh-proj.sh \ + && LD_LIBRARY_PATH=/build_tmp_proj/usr/local/lib /build_tmp_proj/usr/local/bin/projsync --target-dir /tmp/proj_grids --all \ + && rm -rf /build_tmp_proj \ + ); fi # Build PROJ ARG PROJ_VERSION=master @@ -448,6 +504,8 @@ RUN --mount=type=cache,id=ubuntu-full-gdal,target=$HOME/.cache \ . /buildscripts/bh-set-envvars.sh \ && /buildscripts/bh-gdal.sh +RUN mkdir -p /build_thirdparty/opt + # Build final image FROM $TARGET_BASE_IMAGE AS runner @@ -526,9 +584,19 @@ RUN if test "$(uname -p)" = "x86_64"; then \ && rm -f libduckdb-linux-amd64.zip; \ fi +ARG WITH_ORACLE= +RUN if test "$(uname -p)" = "x86_64"; then \ + if echo "$WITH_ORACLE" | grep -Eiq "^(y(es)?|1|true)$" ; then ( \ + apt-get update \ + && apt-get install -y -V libaio1t64 \ + && ln -s libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 \ + ) ; fi \ + ; fi + # Attempt to order layers starting with less frequently varying ones COPY --from=builder /build_thirdparty/usr/ /usr/ +COPY --from=builder /build_thirdparty/opt/ /opt/ ARG PROJ_INSTALL_PREFIX=/usr/local COPY --from=builder /tmp/proj_grids/* ${PROJ_INSTALL_PREFIX}/share/proj/ diff --git a/docker/ubuntu-full/bh-gdal.sh b/docker/ubuntu-full/bh-gdal.sh index b4a7659463c6..57cbbe4af923 100755 --- a/docker/ubuntu-full/bh-gdal.sh +++ b/docker/ubuntu-full/bh-gdal.sh @@ -65,6 +65,17 @@ wget -q "https://github.com/${GDAL_REPOSITORY}/archive/${GDAL_VERSION}.tar.gz" \ export GDAL_CMAKE_EXTRA_OPTS="${GDAL_CMAKE_EXTRA_OPTS} -DFileGDB_ROOT:PATH=/usr/local/FileGDB_API -DFileGDB_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libFileGDBAPI.so" export LD_LIBRARY_PATH=/usr/local/FileGDB_API/lib:${LD_LIBRARY_PATH:-} fi + if test "$(uname -p)" = "x86_64"; then + if echo "$WITH_ORACLE" | grep -Eiq "^(y(es)?|1|true)$" ; then + export GDAL_CMAKE_EXTRA_OPTS="${GDAL_CMAKE_EXTRA_OPTS} -DOracle_ROOT=/opt/instantclient_19_23" + fi + if echo "$WITH_ECW" | grep -Eiq "^(y(es)?|1|true)$" ; then + export GDAL_CMAKE_EXTRA_OPTS="${GDAL_CMAKE_EXTRA_OPTS} -DECW_ROOT=/opt/libecwj2-3.3" + fi + if echo "$WITH_MRSID" | grep -Eiq "^(y(es)?|1|true)$" ; then + export GDAL_CMAKE_EXTRA_OPTS="${GDAL_CMAKE_EXTRA_OPTS} -DMRSID_ROOT=/opt/Raster_DSDK" + fi + fi echo "${GDAL_CMAKE_EXTRA_OPTS}" cmake .. \ -G Ninja \ diff --git a/docker/util.sh b/docker/util.sh index 7c604794c7f5..a4def1e6fc97 100755 --- a/docker/util.sh +++ b/docker/util.sh @@ -29,6 +29,9 @@ usage() echo "--docker-cache/--no-docker-cache: instruct Docker to build with/without using its cache. Defaults to no cache for release builds." echo "--no-rsync-daemon: do not use the rsync daemon to save build cache in home directory." echo "--with-debug-symbols/--without-debug-symbols. Whether to include debug symbols. Only applies to ubuntu-full, default is to include for non-release builds." + echo "--with-oracle: Whether to include Oracle Instant Client proprietary SDK" + echo "--with-ecw: Whether to include ECW proprietary SDK" + echo "--with-mrsid: Whether to include MrSID proprietary SDK" exit 1 } @@ -126,6 +129,21 @@ do shift ;; + --with-oracle) + WITH_ORACLE=yes + shift + ;; + + --with-ecw) + WITH_ECW=yes + shift + ;; + + --with-mrsid) + WITH_MRSID=yes + shift + ;; + # Unknown option *) echo "Unrecognized option: $1" @@ -221,6 +239,22 @@ BUILD_ARGS=( ) [ -z "${DOCKER_CACHE_PARAM}" ] || BUILD_ARGS+=("${DOCKER_CACHE_PARAM}") +if test "${WITH_ORACLE}" != ""; then + BUILD_ARGS+=("--build-arg" "WITH_ORACLE=${WITH_ORACLE}") +fi + +if test "${WITH_ECW}" != ""; then + BUILD_ARGS+=("--build-arg" "WITH_ECW=${WITH_ECW}") +fi + +if test "${WITH_MRSID}" != ""; then + BUILD_ARGS+=("--build-arg" "WITH_MRSID=${WITH_MRSID}") +fi + +if test "${WITH_PROJ_GRIDS}" != ""; then + BUILD_ARGS+=("--build-arg" "$WITH_PROJ_GRIDS=${WITH_PROJ_GRIDS}") +fi + if test "${RELEASE}" = "yes"; then BUILD_ARGS+=("--build-arg" "GDAL_BUILD_IS_RELEASE=YES") diff --git a/frmts/aaigrid/aaigriddataset.h b/frmts/aaigrid/aaigriddataset.h index 0cbf4dfdc2fa..67ec6d6c544a 100644 --- a/frmts/aaigrid/aaigriddataset.h +++ b/frmts/aaigrid/aaigriddataset.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL * Purpose: Implements Arc/Info ASCII Grid Format. diff --git a/frmts/aigrid/aigccitt.c b/frmts/aigrid/aigccitt.c index 81f18307be1b..a5e983ab7a45 100644 --- a/frmts/aigrid/aigccitt.c +++ b/frmts/aigrid/aigccitt.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: Arc/Info Binary Grid Translator * Purpose: Code for decoding CCITT RLE (G1) compressed data. diff --git a/frmts/aigrid/aigopen.c b/frmts/aigrid/aigopen.c index c3db7ba6dcf5..f61e2b5022a6 100644 --- a/frmts/aigrid/aigopen.c +++ b/frmts/aigrid/aigopen.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: Arc/Info Binary Grid Translator * Purpose: Grid file access cover API for non-GDAL use. diff --git a/frmts/aigrid/aigrid.h b/frmts/aigrid/aigrid.h index 1ef9da9792c9..f9efbfa2c8ea 100644 --- a/frmts/aigrid/aigrid.h +++ b/frmts/aigrid/aigrid.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: Arc/Info Binary Grid Translator * Purpose: Grid file access include file. diff --git a/frmts/aigrid/aitest.c b/frmts/aigrid/aitest.c index d14fe567205a..3217c0a91c41 100644 --- a/frmts/aigrid/aitest.c +++ b/frmts/aigrid/aitest.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: Arc/Info Binary Grid Translator * Purpose: Test mainline for examining AIGrid files. diff --git a/frmts/aigrid/gridlib.c b/frmts/aigrid/gridlib.c index f35bfcb4a6d0..fb1ae8a1be4f 100644 --- a/frmts/aigrid/gridlib.c +++ b/frmts/aigrid/gridlib.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: Arc/Info Binary Grid Translator * Purpose: Grid file reading code. diff --git a/frmts/bsb/bsb2raw.c b/frmts/bsb/bsb2raw.c index 9758b84d4913..6bc7e2922243 100644 --- a/frmts/bsb/bsb2raw.c +++ b/frmts/bsb/bsb2raw.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: BSB Reader * Purpose: Test program for dumping BSB to PPM raster format. diff --git a/frmts/bsb/bsb_read.c b/frmts/bsb/bsb_read.c index 8f437bde0fff..ede8061a0ab7 100644 --- a/frmts/bsb/bsb_read.c +++ b/frmts/bsb/bsb_read.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: BSB Reader * Purpose: Low level BSB Access API Implementation (non-GDAL). diff --git a/frmts/bsb/bsb_read.h b/frmts/bsb/bsb_read.h index 95e191853dfc..c660196ef53d 100644 --- a/frmts/bsb/bsb_read.h +++ b/frmts/bsb/bsb_read.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: BSB Reader * Purpose: non-GDAL BSB API Declarations diff --git a/frmts/ceos/ceosopen.c b/frmts/ceos/ceosopen.c index aa3c83d80d5d..68580b7eb096 100644 --- a/frmts/ceos/ceosopen.c +++ b/frmts/ceos/ceosopen.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: CEOS Translator * Purpose: Implementation of non-GDAL dependent CEOS support. diff --git a/frmts/ceos/ceosopen.h b/frmts/ceos/ceosopen.h index f1c8fde51a7e..40a76e0ab006 100644 --- a/frmts/ceos/ceosopen.h +++ b/frmts/ceos/ceosopen.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: CEOS Translator * Purpose: Public (C callable) interface for CEOS and related formats such diff --git a/frmts/ceos/ceostest.c b/frmts/ceos/ceostest.c index 6ad4726b1bf8..6a8350511e2d 100644 --- a/frmts/ceos/ceostest.c +++ b/frmts/ceos/ceostest.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: CEOS Translator * Purpose: Test mainline. diff --git a/frmts/ceos2/ceos.c b/frmts/ceos2/ceos.c index 5104882db32f..164600d0830f 100644 --- a/frmts/ceos2/ceos.c +++ b/frmts/ceos2/ceos.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: ASI CEOS Translator * Purpose: Core CEOS functions. diff --git a/frmts/ceos2/ceos.h b/frmts/ceos2/ceos.h index 54fd760396e8..c10a4057d186 100644 --- a/frmts/ceos2/ceos.h +++ b/frmts/ceos2/ceos.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: ASI CEOS Translator * Purpose: CEOS library prototypes diff --git a/frmts/ceos2/ceosrecipe.c b/frmts/ceos2/ceosrecipe.c index 82a0960f6c12..9babc5c2601a 100644 --- a/frmts/ceos2/ceosrecipe.c +++ b/frmts/ceos2/ceosrecipe.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: ASI CEOS Translator * Purpose: CEOS field layout recipes. diff --git a/frmts/ceos2/ceossar.c b/frmts/ceos2/ceossar.c index 405147b44089..e1c2c13b8d24 100644 --- a/frmts/ceos2/ceossar.c +++ b/frmts/ceos2/ceossar.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: ASI CEOS Translator * Purpose: Functions related to CeosSARVolume_t. diff --git a/frmts/ceos2/link.c b/frmts/ceos2/link.c index 769984cb23d6..05e399c03b28 100644 --- a/frmts/ceos2/link.c +++ b/frmts/ceos2/link.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: ASI CEOS Translator * Purpose: Link list function replacements. diff --git a/frmts/dted/dted_api.c b/frmts/dted/dted_api.c index 2cbe82c02506..7f94a426a393 100644 --- a/frmts/dted/dted_api.c +++ b/frmts/dted/dted_api.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: DTED Translator * Purpose: Implementation of DTED/CDED access functions. diff --git a/frmts/dted/dted_api.h b/frmts/dted/dted_api.h index 3d7d61793f4a..26427ba3cf0e 100644 --- a/frmts/dted/dted_api.h +++ b/frmts/dted/dted_api.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: DTED Translator * Purpose: Public (C callable) interface for DTED/CDED reading. diff --git a/frmts/dted/dted_create.c b/frmts/dted/dted_create.c index 47efd71fbc16..94225d27b754 100644 --- a/frmts/dted/dted_create.c +++ b/frmts/dted/dted_create.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: DTED Translator * Purpose: Implementation of DTEDCreate() portion of DTED API. diff --git a/frmts/dted/dted_ptstream.c b/frmts/dted/dted_ptstream.c index 6dbd11563652..0e722f0a49d4 100644 --- a/frmts/dted/dted_ptstream.c +++ b/frmts/dted/dted_ptstream.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: DTED Translator * Purpose: DTED Point Stream Writer. diff --git a/frmts/dted/dted_test.c b/frmts/dted/dted_test.c index 0ee60a4454f2..947a419fc9df 100644 --- a/frmts/dted/dted_test.c +++ b/frmts/dted/dted_test.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: DTED Translator * Purpose: Test mainline for DTED writer. diff --git a/frmts/ecw/gdal_ecw.h b/frmts/ecw/gdal_ecw.h index a6eed743c0bf..70ec8ec3464d 100644 --- a/frmts/ecw/gdal_ecw.h +++ b/frmts/ecw/gdal_ecw.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GDAL * Purpose: ECW (ERDAS Wavelet Compression Format) Driver Definitions diff --git a/frmts/ecw/lookup.py b/frmts/ecw/lookup.py index a8a3d1d7693f..fe794d4765c1 100644 --- a/frmts/ecw/lookup.py +++ b/frmts/ecw/lookup.py @@ -1,6 +1,4 @@ # ****************************************************************************** -# $Id$ -# # Project: GDAL ECW Driver # Purpose: Script to lookup ECW (GDT) coordinate systems and translate # into OGC WKT for storage in $GDAL_HOME/data/ecw_cs.wkt. diff --git a/frmts/envisat/EnvisatFile.c b/frmts/envisat/EnvisatFile.c index f1d5b4de5dc7..cac22675b3fb 100644 --- a/frmts/envisat/EnvisatFile.c +++ b/frmts/envisat/EnvisatFile.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: APP ENVISAT Support * Purpose: Low Level Envisat file access (read/write) API. diff --git a/frmts/envisat/EnvisatFile.h b/frmts/envisat/EnvisatFile.h index c4797377dc02..fcfeaffe9cc1 100644 --- a/frmts/envisat/EnvisatFile.h +++ b/frmts/envisat/EnvisatFile.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: APP ENVISAT Support * Purpose: Low Level Envisat file access (read/write) API. diff --git a/frmts/envisat/adsrange.hpp b/frmts/envisat/adsrange.hpp index 9dc8c96b9868..96410b8d8f7d 100644 --- a/frmts/envisat/adsrange.hpp +++ b/frmts/envisat/adsrange.hpp @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Project: APP ENVISAT Support * Purpose: Detect range of ADS records matching the MDS records * Author: Martin Paces, martin.paces@eox.at diff --git a/frmts/envisat/dumpgeo.c b/frmts/envisat/dumpgeo.c index e89adc345186..8cda98b6361e 100644 --- a/frmts/envisat/dumpgeo.c +++ b/frmts/envisat/dumpgeo.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: APP ENVISAT Support * Purpose: Test mainline for dumping ENVISAT format files. diff --git a/frmts/envisat/envisat_dump.c b/frmts/envisat/envisat_dump.c index 083fbd575eb6..851b9ae093d2 100644 --- a/frmts/envisat/envisat_dump.c +++ b/frmts/envisat/envisat_dump.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: APP ENVISAT Support * Purpose: Test mainline for dumping ENVISAT format files. diff --git a/frmts/envisat/records.c b/frmts/envisat/records.c index e2d50cefbff0..665053775355 100644 --- a/frmts/envisat/records.c +++ b/frmts/envisat/records.c @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: APP ENVISAT Support * Purpose: Low Level Envisat file access (read/write) API. diff --git a/frmts/envisat/records.h b/frmts/envisat/records.h index 3b12745239c9..a59e0db67fd9 100644 --- a/frmts/envisat/records.h +++ b/frmts/envisat/records.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: APP ENVISAT Support * Purpose: Low Level Envisat file access (read/write) API. diff --git a/frmts/envisat/timedelta.hpp b/frmts/envisat/timedelta.hpp index 4ecbc50b48c5..78f4ab6ab01f 100644 --- a/frmts/envisat/timedelta.hpp +++ b/frmts/envisat/timedelta.hpp @@ -1,6 +1,4 @@ /****************************************************************************** - * $Id$ - * * Project: APP ENVISAT Support * Purpose: time difference class for handling of Envisat MJD time * Author: Martin Paces, martin.paces@eox.at diff --git a/frmts/fit/fit.h b/frmts/fit/fit.h index 938725f62e3c..db52fe18ef41 100644 --- a/frmts/fit/fit.h +++ b/frmts/fit/fit.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: FIT Driver * Purpose: Implement FIT Support - not using the SGI iflFIT library. diff --git a/frmts/fit/gstEndian.h b/frmts/fit/gstEndian.h index 15fd3038de16..bc1fb813a25c 100644 --- a/frmts/fit/gstEndian.h +++ b/frmts/fit/gstEndian.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: FIT Driver * Purpose: Implement FIT Support - not using the SGI iflFIT library. diff --git a/frmts/fit/gstTypes.h b/frmts/fit/gstTypes.h index 02e5f82c30ea..4c2ce3b44a03 100644 --- a/frmts/fit/gstTypes.h +++ b/frmts/fit/gstTypes.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: FIT Driver * Purpose: Implement FIT Support - not using the SGI iflFIT library. diff --git a/frmts/gif/gifabstractdataset.h b/frmts/gif/gifabstractdataset.h index f8aeeeeaba24..9da42f0b608d 100644 --- a/frmts/gif/gifabstractdataset.h +++ b/frmts/gif/gifabstractdataset.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GIF Driver * Purpose: GIF Abstract Dataset diff --git a/frmts/grib/gribdataset.h b/frmts/grib/gribdataset.h index 0f48cbb14b2e..17be07f5e16d 100644 --- a/frmts/grib/gribdataset.h +++ b/frmts/grib/gribdataset.h @@ -1,5 +1,4 @@ /****************************************************************************** - * $Id$ * * Project: GRIB Driver * Purpose: GDALDataset driver for GRIB translator for read support diff --git a/frmts/gti/data/gdaltileindex.xsd b/frmts/gti/data/gdaltileindex.xsd index 9aad7a6b28e4..9289018c5f7e 100644 --- a/frmts/gti/data/gdaltileindex.xsd +++ b/frmts/gti/data/gdaltileindex.xsd @@ -1,8 +1,6 @@