Exemple #1
0
def test_rgb_msk_int():
    with rasterio.open('/tmp/rgb_msk_internal.tif') as src:
        assert np.array_equal(read_mask(src), msk)
Exemple #2
0
def test_rgba_msk():
    with rasterio.open('/tmp/rgba_msk.tif') as src:
        # mask takes precendent over alpha
        assert np.array_equal(read_mask(src), msk)
Exemple #3
0
def test_rgba_ndv():
    with rasterio.open('/tmp/rgba_ndv.tif') as src:
        assert np.array_equal(read_mask(src), alp)
Exemple #4
0
def test_rgb_msk():
    with rasterio.open('/tmp/rgb_msk.tif') as src:
        assert np.array_equal(read_mask(src), msk)
        # each band's mask is also equal
        for bmask in src.read_masks():
            assert np.array_equal(bmask, msk)
Exemple #5
0
def test_rgba_ndv():
    with rasterio.open('/tmp/rgba_ndv.tif') as src:
        with pytest.warns(NodataShadowWarning):
            assert np.array_equal(read_mask(src), alp)
Exemple #6
0
def test_rgba_msk():
    with rasterio.open('/tmp/rgba_msk.tif') as src:
        # mask takes precendent over alpha
        assert np.array_equal(read_mask(src), msk)
Exemple #7
0
def test_rgb_msk_int():
    with rasterio.open('/tmp/rgb_msk_internal.tif') as src:
        assert np.array_equal(read_mask(src), msk)
Exemple #8
0
def test_rgb_msk():
    with rasterio.open('/tmp/rgb_msk.tif') as src:
        assert np.array_equal(read_mask(src), msk)
        # each band's mask is also equal
        for bmask in src.read_masks():
            assert np.array_equal(bmask, msk)
Exemple #9
0
def test_rgba_ndv():
    with rasterio.open('/tmp/rgba_ndv.tif') as src:
        assert np.array_equal(read_mask(src), alp)