From ea1b381886f2850040f43516da0d3b344dddfe2d Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Mon, 17 Dec 2018 22:10:18 -0700 Subject: [PATCH 01/11] Update script to handle release candidates --- .travis.yml | 6 +++--- scripts/travis_gdal_install.sh | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a001ebbd..901520f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,14 +15,14 @@ env: - GDALVERSION="2.0.3" - GDALVERSION="2.1.4" - GDALVERSION="2.2.4" - - GDALVERSION="2.3.2" - - GDALVERSION="release/2.4" + - GDALVERSION="2.3.3" + - GDALVERSION="2.4.0rc1" - GDALVERSION="master" matrix: allow_failures: - env: GDALVERSION="master" - - env: GDALVERSION="release/2.4" + - env: GDALVERSION="2.4.0rc1" addons: apt: diff --git a/scripts/travis_gdal_install.sh b/scripts/travis_gdal_install.sh index 47867447..72824e64 100644 --- a/scripts/travis_gdal_install.sh +++ b/scripts/travis_gdal_install.sh @@ -80,7 +80,8 @@ fi if [ "$GDALVERSION" != "master" -a ! -d "$GDALINST/gdal-$GDALVERSION" ]; then cd $GDALBUILD - wget http://download.osgeo.org/gdal/$GDALVERSION/gdal-$GDALVERSION.tar.gz + gdal_dir=$(expr "$GDALVERSION" : '\([0-9]*.[0-9]*.[0-9]*\)') + wget http://download.osgeo.org/gdal/$gdal_dir/gdal-$GDALVERSION.tar.gz tar -xzf gdal-$GDALVERSION.tar.gz cd gdal-$GDALVERSION ./configure --prefix=$GDALINST/gdal-$GDALVERSION $GDALOPTS From a8f0f001b73e3e08eeefbc96f8b0a915f6ce9041 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Mon, 17 Dec 2018 22:26:06 -0700 Subject: [PATCH 02/11] Adjust for version name within tarball --- .travis.yml | 2 +- scripts/travis_gdal_install.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 901520f8..c6ed34bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ env: - GDALVERSION="2.0.3" - GDALVERSION="2.1.4" - GDALVERSION="2.2.4" - - GDALVERSION="2.3.3" + - GDALVERSION="2.3.2" - GDALVERSION="2.4.0rc1" - GDALVERSION="master" diff --git a/scripts/travis_gdal_install.sh b/scripts/travis_gdal_install.sh index 72824e64..9787cb49 100644 --- a/scripts/travis_gdal_install.sh +++ b/scripts/travis_gdal_install.sh @@ -80,10 +80,10 @@ fi if [ "$GDALVERSION" != "master" -a ! -d "$GDALINST/gdal-$GDALVERSION" ]; then cd $GDALBUILD - gdal_dir=$(expr "$GDALVERSION" : '\([0-9]*.[0-9]*.[0-9]*\)') - wget http://download.osgeo.org/gdal/$gdal_dir/gdal-$GDALVERSION.tar.gz + gdalver=$(expr "$GDALVERSION" : '\([0-9]*.[0-9]*.[0-9]*\)') + wget http://download.osgeo.org/gdal/$gdalver/gdal-$GDALVERSION.tar.gz tar -xzf gdal-$GDALVERSION.tar.gz - cd gdal-$GDALVERSION + cd gdal-$gdalver ./configure --prefix=$GDALINST/gdal-$GDALVERSION $GDALOPTS make -s -j 2 make install From ff04dd5c1aaa4c183d57edede19ab2d29138506f Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Tue, 18 Dec 2018 11:02:14 -0700 Subject: [PATCH 03/11] Add another test of nodata initialization --- tests/test_warp.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/test_warp.py b/tests/test_warp.py index 8c4253dc..d3ed3698 100644 --- a/tests/test_warp.py +++ b/tests/test_warp.py @@ -1,5 +1,6 @@ import json -import logging +"""rasterio.warp module tests""" + import sys import pytest @@ -28,7 +29,6 @@ from .conftest import requires_gdal22 gdal_version = GDALVersion.runtime() -logging.basicConfig(level=logging.DEBUG) DST_TRANSFORM = Affine(300.0, 0.0, -8789636.708, 0.0, -300.0, 2943560.235) @@ -1492,3 +1492,17 @@ def test_issue_1076(): resample=Resampling.nearest) assert not (newarr == fill_value).all() + + +def test_reproject_init_dest_nodata(): + """No pixels should transfer over""" + crs = CRS.from_epsg(4326) + transform = Affine.identity() + source = np.zeros((1, 100, 100)) + destination = np.ones((1, 100, 100)) + reproject( + source, destination, src_crs=crs, src_transform=transform, + dst_crs=crs, dst_transform=transform, + src_nodata=0, init_dest_nodata=False + ) + assert destination.all() From 87751c59ae9ad663a4a4e2ccbaaf969e23533d4d Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 20 Dec 2018 09:06:44 -0700 Subject: [PATCH 04/11] Bump 2.3.2 to 2.3.3 --- .travis.yml | 2 +- scripts/travis_gdal_install.sh | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index c6ed34bb..901520f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ env: - GDALVERSION="2.0.3" - GDALVERSION="2.1.4" - GDALVERSION="2.2.4" - - GDALVERSION="2.3.2" + - GDALVERSION="2.3.3" - GDALVERSION="2.4.0rc1" - GDALVERSION="master" diff --git a/scripts/travis_gdal_install.sh b/scripts/travis_gdal_install.sh index 9787cb49..c4d222b5 100644 --- a/scripts/travis_gdal_install.sh +++ b/scripts/travis_gdal_install.sh @@ -3,8 +3,7 @@ # originally contributed by @rbuffat to Toblerity/Fiona set -e -GDALOPTS=" --with-ogr \ - --with-geos \ +GDALOPTS=" --with-geos \ --with-expat \ --without-libtool \ --with-libz=internal \ @@ -37,12 +36,9 @@ GDALOPTS=" --with-ogr \ --without-odbc \ --with-curl \ --without-sqlite3 \ - --without-dwgdirect \ --without-idb \ --without-sde \ --without-perl \ - --without-php \ - --without-ruby \ --without-python \ --with-static-proj4=/usr/lib" From c9fdb033c5474b2f248220c572ca3072309746d6 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 20 Dec 2018 09:37:57 -0700 Subject: [PATCH 05/11] Quiet wget --- scripts/travis_gdal_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/travis_gdal_install.sh b/scripts/travis_gdal_install.sh index c4d222b5..e07b0231 100644 --- a/scripts/travis_gdal_install.sh +++ b/scripts/travis_gdal_install.sh @@ -77,7 +77,7 @@ fi if [ "$GDALVERSION" != "master" -a ! -d "$GDALINST/gdal-$GDALVERSION" ]; then cd $GDALBUILD gdalver=$(expr "$GDALVERSION" : '\([0-9]*.[0-9]*.[0-9]*\)') - wget http://download.osgeo.org/gdal/$gdalver/gdal-$GDALVERSION.tar.gz + wget -q http://download.osgeo.org/gdal/$gdalver/gdal-$GDALVERSION.tar.gz tar -xzf gdal-$GDALVERSION.tar.gz cd gdal-$gdalver ./configure --prefix=$GDALINST/gdal-$GDALVERSION $GDALOPTS From fe405a443586b4967bd90ad622440e7c1dd507bf Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 20 Dec 2018 09:39:49 -0700 Subject: [PATCH 06/11] travis_wait 20 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 901520f8..1b590f53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ before_script: # configure a headless display to test matplotlib before_install: - python -m pip install -U pip - python -m pip install wheel - - travis_wait . ./scripts/travis_gdal_install.sh + - travis_wait 20 ./scripts/travis_gdal_install.sh - export PATH=$GDALINST/gdal-$GDALVERSION/bin:$PATH - export LD_LIBRARY_PATH=$GDALINST/gdal-$GDALVERSION/lib:$LD_LIBRARY_PATH install: From b8eb39a2065090a9b8ee99f3079b8edac7a7b6c7 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 20 Dec 2018 09:43:22 -0700 Subject: [PATCH 07/11] Make script executable --- scripts/travis_gdal_install.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/travis_gdal_install.sh diff --git a/scripts/travis_gdal_install.sh b/scripts/travis_gdal_install.sh old mode 100644 new mode 100755 From 7065e525050e206f37b4ee8c474c7f69ebe397ae Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 20 Dec 2018 10:49:55 -0700 Subject: [PATCH 08/11] Conditional proj opt --- scripts/travis_gdal_install.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/travis_gdal_install.sh b/scripts/travis_gdal_install.sh index e07b0231..4f431c58 100755 --- a/scripts/travis_gdal_install.sh +++ b/scripts/travis_gdal_install.sh @@ -39,8 +39,13 @@ GDALOPTS=" --with-geos \ --without-idb \ --without-sde \ --without-perl \ - --without-python \ - --with-static-proj4=/usr/lib" + --without-python" + +if [ "${GDALVERSION::1}" = "1" ]; then + PROJOPT="--with-static-proj4=/usr/lib" +else + PROJOPT="--with-proj" +fi # Create build dir if not exists if [ ! -d "$GDALBUILD" ]; then @@ -68,7 +73,7 @@ if [ "$GDALVERSION" = "master" ]; then if test "$BUILD" = "yes"; then mkdir -p $GDALINST/gdal-$GDALVERSION cp newrev.txt $GDALINST/gdal-$GDALVERSION/rev.txt - ./configure --prefix=$GDALINST/gdal-$GDALVERSION $GDALOPTS + ./configure --prefix=$GDALINST/gdal-$GDALVERSION $GDALOPTS $PROJOPTS make -s -j 2 make install fi @@ -80,7 +85,7 @@ if [ "$GDALVERSION" != "master" -a ! -d "$GDALINST/gdal-$GDALVERSION" ]; then wget -q http://download.osgeo.org/gdal/$gdalver/gdal-$GDALVERSION.tar.gz tar -xzf gdal-$GDALVERSION.tar.gz cd gdal-$gdalver - ./configure --prefix=$GDALINST/gdal-$GDALVERSION $GDALOPTS + ./configure --prefix=$GDALINST/gdal-$GDALVERSION $GDALOPTS $PROJOPTS make -s -j 2 make install fi From 5289060fc53b32593f9a0f52e59bfb78aa0f54c5 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 20 Dec 2018 10:58:50 -0700 Subject: [PATCH 09/11] Bash syntax fix --- scripts/travis_gdal_install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/travis_gdal_install.sh b/scripts/travis_gdal_install.sh index 4f431c58..84bc92d9 100755 --- a/scripts/travis_gdal_install.sh +++ b/scripts/travis_gdal_install.sh @@ -42,9 +42,9 @@ GDALOPTS=" --with-geos \ --without-python" if [ "${GDALVERSION::1}" = "1" ]; then - PROJOPT="--with-static-proj4=/usr/lib" + PROJOPT="--with-static-proj4=/usr/lib"; else - PROJOPT="--with-proj" + PROJOPT="--with-proj"; fi # Create build dir if not exists From 63a31ec77b13ae5723964427deeec03ac55f6d0f Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Thu, 20 Dec 2018 11:02:13 -0700 Subject: [PATCH 10/11] Use bash --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1b590f53..448c8363 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ before_script: # configure a headless display to test matplotlib before_install: - python -m pip install -U pip - python -m pip install wheel - - travis_wait 20 ./scripts/travis_gdal_install.sh + - travis_wait 20 bash ./scripts/travis_gdal_install.sh - export PATH=$GDALINST/gdal-$GDALVERSION/bin:$PATH - export LD_LIBRARY_PATH=$GDALINST/gdal-$GDALVERSION/lib:$LD_LIBRARY_PATH install: From e7172a3dbc2254210bfc5e1952dee0d438361804 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Fri, 21 Dec 2018 09:54:13 -0700 Subject: [PATCH 11/11] Make 2.4.0 final --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 448c8363..bcc2182e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,13 +16,13 @@ env: - GDALVERSION="2.1.4" - GDALVERSION="2.2.4" - GDALVERSION="2.3.3" - - GDALVERSION="2.4.0rc1" + - GDALVERSION="2.4.0" - GDALVERSION="master" matrix: allow_failures: - env: GDALVERSION="master" - - env: GDALVERSION="2.4.0rc1" + - env: GDALVERSION="2.4.0" addons: apt: