Member-only story

Create a water mask from Sentinel-2 satellite imagery using the Scene Classification Layer (SCL)

GeoSense ✅
4 min readMay 22, 2023

--

Create water mask using Scene Classification Layer (Sentinel 2)

Previous related article: Understanding Sentinel-2 L2A Scene Classification Map with Python Codes

To create a water mask from Sentinel-2 satellite imagery using the Scene Classification Layer (SCL), you can follow these steps:

  1. Obtain Sentinel-2 imagery: Download the Sentinel-2 satellite imagery for your area of interest from a reliable source such as the Copernicus Open Access Hub (https://scihub.copernicus.eu/).
  2. Extract the Scene Classification Layer (SCL) 20m resolution: The SCL provides information about land cover and scene classification. It contains various classes, including water. Extract the SCL band from the preprocessed imagery.
  3. Interpret the SCL values: The SCL band assigns integer values to different land cover classes. The specific value for water may vary depending on the dataset version and processing level. Typically, a value of 6 indicates water pixels.
  4. Create a water mask: Based on the interpreted SCL values, you can create a binary water mask. Assign a value of 1 to pixels classified as water and 0 to non-water pixels. You can use software libraries like NumPy or raster processing tools to perform this step.
  5. Refine the water mask (optional): Depending on the quality and accuracy of the SCL results, you may need to refine the water mask further. This can involve additional processing steps such as morphological operations (e.g., erosion, dilation) or filtering based on spatial and contextual information.
  6. Export and visualize the water mask: Once you have created the water mask, you can export it to a suitable file format such as GeoTIFF or PNG. Use GIS software or image processing tools to visualize the water mask on top of the original satellite imagery or other base maps.

--

--

GeoSense ✅
GeoSense ✅

Written by GeoSense ✅

🌏 Remote sensing | 🛰️ Geographic Information Systems (GIS) | ℹ️ https://www.tnmthai.com/medium

Responses (1)

Write a response