Skip to content

Commit

Permalink
Revert "Add missing overview resampling algorithms" (#1463)
Browse files Browse the repository at this point in the history
* Revert "Revert "Use InMemoryRaster to remove duplicate code." (#1461)"

This reverts commit 295e089.

* Revert "Note refactoring"

This reverts commit 11ad6fe.

* Revert "Use InMemoryRaster to remove duplicate code. (#1427)"

This reverts commit 9e1eb3b.

* Revert "Add missing overview resampling algorithms (#1458)"

This reverts commit 6c11627.
  • Loading branch information
sgillies committed Sep 13, 2018
1 parent 295e089 commit 443ab27
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 32 deletions.
13 changes: 0 additions & 13 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
Changes
=======

Next
----

Bug fixes:

- Add missing bilinear, cubic spline, lanczos resampling modes for overviews
(#1457).

Refactoring:

- Use of InMemoryRaster eliminates redundant code in the _warp module (#1427,
#816).

1.0.3.post1 (2018-09-07)
------------------------

Expand Down
2 changes: 1 addition & 1 deletion rasterio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def emit(self, record):


__all__ = ['band', 'open', 'pad', 'Env']
__version__ = "1.0.4"
__version__ = "1.0.3.post1"
__gdal_version__ = gdal_version()

# Rasterio attaches NullHandler to the 'rasterio' logger and its
Expand Down
3 changes: 0 additions & 3 deletions rasterio/_io.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1540,10 +1540,7 @@ cdef class DatasetWriterBase(DatasetReaderBase):
# (no corresponding member in the warp enum).
resampling_map = {
0: 'NEAREST',
1: 'BILINEAR',
2: 'CUBIC',
3: 'CUBICSPLINE',
4: 'LANCZOS',
5: 'AVERAGE',
6: 'MODE',
7: 'GAUSS'}
Expand Down
2 changes: 1 addition & 1 deletion rasterio/rio/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def build_handler(ctx, param, value):
is_flag=True, default=False)
@click.option('--resampling', help="Resampling algorithm.",
type=click.Choice(
[it.name for it in Resampling if it.value in [0, 1, 2, 3, 4, 5, 6, 7]]),
[it.name for it in Resampling if it.value in [0, 2, 5, 6, 7]]),
default='nearest', show_default=True)
@click.pass_context
def overview(ctx, input, build, ls, rebuild, resampling):
Expand Down
16 changes: 2 additions & 14 deletions tests/test_overviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import rasterio
from rasterio.enums import Resampling
from rasterio.env import GDALVersion

gdal_version = GDALVersion()

logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)


def test_count_overviews_zero(data):
Expand Down Expand Up @@ -40,18 +40,6 @@ def test_build_overviews_two(data):
assert src.overviews(2) == [2, 4]
assert src.overviews(3) == [2, 4]

@pytest.mark.xfail(
gdal_version < GDALVersion.parse('2.0'),
reason="Bilinear resampling not supported by GDAL < 2.0")
def test_build_overviews_bilinear(data):
inputfile = str(data.join('RGB.byte.tif'))
with rasterio.open(inputfile, 'r+') as src:
overview_factors = [2, 4]
src.build_overviews(overview_factors, resampling=Resampling.bilinear)
assert src.overviews(1) == [2, 4]
assert src.overviews(2) == [2, 4]
assert src.overviews(3) == [2, 4]


def test_build_overviews_average(data):
inputfile = str(data.join('RGB.byte.tif'))
Expand Down

0 comments on commit 443ab27

Please sign in to comment.