From a1b1147b92e8054a5991d394ea84f5951427ff24 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Nov 14 2022 17:17:54 +0000 Subject: Backport fixes for GDAL-3.6.0 compatibility --- diff --git a/55cd34e06b422f58bf3bd5d2148d4d236e15c969.patch b/55cd34e06b422f58bf3bd5d2148d4d236e15c969.patch new file mode 100644 index 0000000..fd979b3 --- /dev/null +++ b/55cd34e06b422f58bf3bd5d2148d4d236e15c969.patch @@ -0,0 +1,25 @@ +From 55cd34e06b422f58bf3bd5d2148d4d236e15c969 Mon Sep 17 00:00:00 2001 +From: snowman2 +Date: Mon, 7 Nov 2022 22:35:43 -0600 +Subject: [PATCH] BUG: ensure default driver for tif to be GTiff + +--- + rasterio/_base.pyx | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/rasterio/_base.pyx b/rasterio/_base.pyx +index 483f26a53..51d1e56f0 100644 +--- a/rasterio/_base.pyx ++++ b/rasterio/_base.pyx +@@ -148,6 +148,11 @@ def _raster_driver_extensions(): + + for extension in extensions.split(): + driver_extensions[extension] = drivername ++ ++ # ensure default driver for tif to be GTiff instead of COG ++ driver_extensions.update( ++ {'tif': 'GTiff', 'tiff': 'GTiff'} ++ ) + return driver_extensions + + diff --git a/cdb7d3922e8b5039b731c5cf433d1395080580be.patch b/cdb7d3922e8b5039b731c5cf433d1395080580be.patch new file mode 100644 index 0000000..f4f5218 --- /dev/null +++ b/cdb7d3922e8b5039b731c5cf433d1395080580be.patch @@ -0,0 +1,32 @@ +From cdb7d3922e8b5039b731c5cf433d1395080580be Mon Sep 17 00:00:00 2001 +From: snowman2 +Date: Wed, 9 Nov 2022 20:49:55 -0600 +Subject: [PATCH] TST: add expected values to test_reproject_resampling_alpha & + test_reproject_resampling for GDAL 3.6 + +--- + tests/test_warp.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_warp.py b/tests/test_warp.py +index bc86e14d5..69217c7c6 100644 +--- a/tests/test_warp.py ++++ b/tests/test_warp.py +@@ -1208,7 +1208,7 @@ def test_reproject_resampling(path_rgb_byte_tif, method): + Resampling.med: [437194], + Resampling.q1: [436397], + Resampling.q3: [438948], +- Resampling.sum: [439118], ++ Resampling.sum: [439118, 439142], # 439142 for GDAL 3.6+ + Resampling.rms: [439385], + } + +@@ -1301,7 +1301,7 @@ def test_reproject_resampling_alpha(method): + Resampling.med: [437194], + Resampling.q1: [436397], + Resampling.q3: [438948], +- Resampling.sum: [439118], ++ Resampling.sum: [439118, 439142], # 439142 for GDAL 3.6+ + Resampling.rms: [439385], + } + diff --git a/python-rasterio.spec b/python-rasterio.spec index 4aab2f9..d74aa2b 100644 --- a/python-rasterio.spec +++ b/python-rasterio.spec @@ -12,6 +12,9 @@ Source0: https://github.com/mapbox/rasterio/archive/%{version}/%{srcname} Patch: 0001-Loosen-up-build-requirements.patch # https://github.com/rasterio/rasterio/pull/2619 Patch: 0002-Don-t-used-fixed-port-for-test-server.patch +# Backport fixes for GDAL-3.6.0 test failures +Patch: https://github.com/rasterio/rasterio/pull/2634/commits/55cd34e06b422f58bf3bd5d2148d4d236e15c969.patch +Patch: https://github.com/rasterio/rasterio/pull/2641/commits/cdb7d3922e8b5039b731c5cf433d1395080580be.patch BuildRequires: gcc-c++ BuildRequires: gdal >= 1.11