The sentinel2_water_extraction Jupyter Notebook was developed to extract water from Sentinel-2 imagery.
Below are the instructions to get the Notebook up and running
- Linux (tested on Ubuntu 22.04) or macOS (tested on version 12, Monterey)
- Python 3.8, 3.9, or 3.10
- GDAL 3.4
Either clone or download the Jupyter Notebook
Clone this repository to your computer
git clone git@github.com:linz/emergency-management.git
Alternatively, for those not familiar with git, download the repository. This can be downloaded via the code menu in the root of this repository (see below)
The following commands will install the dependencies for just this project:
pip install --upgrade pip
pip install --upgrade poetry
poetry install --only=main --no-root
Once you have the code locally, it can be executed to extract water
Open the terminal and navigate to the notebook directory
cd <path where downloaded to>/emergency-management/flooding/sentinel2_water_extraction
Start the notebook
$ poetry run jupyter notebook sentinel2_water_extraction.ipynb
Open the Jupyter Notebook by clicking on sentinel2_water_extraction.ipynb (see
image below)
Follow the steps in the Notebook to extract water polygons.
If encountering an SSL cert error, try exporting a reference to
ca-certificates.crt
e.g export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt