Пример #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)
Пример #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)
Пример #3
0
def test_rgba_ndv():
    with rasterio.open('/tmp/rgba_ndv.tif') as src:
        assert np.array_equal(read_mask(src), alp)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #9
0
def test_rgba_ndv():
    with rasterio.open('/tmp/rgba_ndv.tif') as src:
        assert np.array_equal(read_mask(src), alp)