def test_profile_overlay(): with rasterio.open('tests/data/RGB.byte.tif') as src: kwds = src.profile kwds.update(**default_gtiff_profile()) assert kwds['tiled'] assert kwds['compress'] == 'lzw' assert kwds['count'] == 3
def test_profile_overlay(): with rasterio.open('tests/data/RGB.byte.tif') as src: kwds = src.meta kwds.update(**default_gtiff_profile()) assert kwds['tiled'] assert kwds['compress'] == 'lzw' assert kwds['count'] == 3
def test_update_vfs(tmpdir, mode): """VFS datasets can not be created or updated""" with pytest.raises(TypeError): rasterio.open( 'zip://{0}'.format(tmpdir), mode, **default_gtiff_profile( count=1, width=1, height=1))
def test_blockysize_guard(tmpdir): """blockysize can't be greater than image height.""" tiffname = str(tmpdir.join('foo.tif')) with pytest.raises(ValueError): _ = rasterio.open( tiffname, 'w', **default_gtiff_profile(count=1, width=256, height=128))
def test_open_with_profile(tmpdir): tiffname = str(tmpdir.join('foo.tif')) with rasterio.open(tiffname, 'w', **default_gtiff_profile(count=1, width=1, height=1)) as dst: data = dst.read() assert data.flatten().tolist() == [0]
def test_update_vfs(tmpdir, mode): """VFS datasets can not be created or updated""" with pytest.raises(TypeError): _ = rasterio.open( 'zip://{0}'.format(tmpdir), mode, **default_gtiff_profile( count=1, width=1, height=1))
def test_open_with_profile(tmpdir): tiffname = str(tmpdir.join('foo.tif')) with rasterio.open( tiffname, 'w', **default_gtiff_profile( count=1, width=256, height=256)) as dst: data = dst.read()
def test_open_with_profile(tmpdir): tiffname = str(tmpdir.join('foo.tif')) with rasterio.open( tiffname, 'w', **default_gtiff_profile( count=1, width=1, height=1)) as dst: data = dst.read() assert data.flatten().tolist() == [0]
def test_open_with_profile(tmpdir): tiffname = str(tmpdir.join('foo.tif')) with rasterio.open(tiffname, 'w', **default_gtiff_profile(count=1, width=256, height=256)) as dst: assert not dst.closed
def test_blockysize_guard(tmpdir): """blockysize can't be greater than image height.""" tiffname = str(tmpdir.join('foo.tif')) with pytest.raises(ValueError): _ = rasterio.open(tiffname, 'w', **default_gtiff_profile( count=1, width=256, height=128))