예제 #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)