Skip to content

Commit

Permalink
test for right-edge data loss
Browse files Browse the repository at this point in the history
  • Loading branch information
perrygeo committed Mar 16, 2016
1 parent d037a15 commit 46de77f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Binary file added tests/data/world.byte.tif
Binary file not shown.
15 changes: 15 additions & 0 deletions tests/test_rio_warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,18 @@ def test_warp_reproject_like(runner, tmpdir):
assert numpy.allclose([0.001, 0.001], [output.affine.a, -output.affine.e])
assert output.width == 10
assert output.height == 10


def test_warp_reproject_nolostdata(runner, tmpdir):
srcname = 'tests/data/world.byte.tif'
outputname = str(tmpdir.join('test.tif'))
result = runner.invoke(warp.warp, [srcname, outputname,
'--dst-crs', 'EPSG:3857'])
assert result.exit_code == 0
assert os.path.exists(outputname)

with rasterio.open(outputname) as output:
arr = output.read()
# 50 column swath on the right edge should have some ones (gdalwarped has 7223)
assert arr[0, :, -50:].sum() > 7000
assert output.crs == {'init': 'epsg:3857'}

0 comments on commit 46de77f

Please sign in to comment.