diff --git a/tests/data/raster/data.py b/tests/data/raster/data.py index c6328b204..cc00aafef 100644 --- a/tests/data/raster/data.py +++ b/tests/data/raster/data.py @@ -31,7 +31,7 @@ def generate_test_data(fn: str) -> str: } with rasterio.open(fn, "w", **profile) as f: - f.write(np.random.randint(0, 2**32 - 1, size=(1, 4, 4))) + f.write(np.random.randint(0, 256, size=(1, 4, 4))) md5: str = calculate_md5(fn) return md5 diff --git a/tests/data/raster/test0.tif b/tests/data/raster/test0.tif index 83d75bbdc..84df1f7cb 100644 Binary files a/tests/data/raster/test0.tif and b/tests/data/raster/test0.tif differ diff --git a/tests/datasets/test_geo.py b/tests/datasets/test_geo.py index 0cc949664..2035e8523 100644 --- a/tests/datasets/test_geo.py +++ b/tests/datasets/test_geo.py @@ -193,6 +193,12 @@ class TestRasterDataset: with pytest.raises(FileNotFoundError, match="No RasterDataset data was found"): RasterDataset(str(tmp_path)) + def test_plot_with_cmap(self, custom_dtype_ds: RasterDataset) -> None: + custom_dtype_ds.cmap = {i: (0, 0, 0, 255) for i in range(256)} + custom_dtype_ds.is_image = False + x = custom_dtype_ds[custom_dtype_ds.bounds] + custom_dtype_ds.plot(x["mask"]) + class TestVectorDataset: @pytest.fixture