I want to analyze Corine Land Cover data. It is raster data in a .tif file. Currently, I am using rasterio
to handle the raster data.
Question: How can I plot only a single land use on a map? My goal is to plot every land use code in the study region on another map (e.g. only plot the urban area in the study region, then plot only cropland on another map).
I can plot the land use data for my study region with the following code, but I don't know how to plot only single land use codes.
import rasterio
from rasterio.plot import show
import numpy as np
# Open the land cover dataset using rasterio
land_cover_dataset_path = 'test_CLC.tif'
clc = rasterio.open(land_cover_dataset_path)
band = clc.read(1)
#plot raster data
show(band, cmap="tab20")
With landuses = np.unique(band).tolist()
I can extract all the existing land use codes in the study area.
I think I have to somehow "hide" all pixels which do not have the value of the investigated land use code. Please let me know if the question is not clear enough.