The sentinel2_water_extraction Jupyter Notebook was developed to extract water from Sentinel-2 optical imagery.
Below are the instructions to get the notebook up and running.
If you just want the latest contents:
- Download the repository
- Unpack the zip file using a file explorer or
unzip emergency-management-tools-master.zip
on the command line
If you would like the full repository history, for example to do some
development yourself, clone this repository with
git clone [email protected]:linz/emergency-management-tools.git
If you are running Linux, macOS, or a Windows machine with WSL, this is the easiest setup. The only dependency is the Nix package manager. Please select your platform and follow the instructions.
Once Nix is installed,
cd [emergency-management-tools path]/flooding/sentinel2_water_extraction
and
run nix-shell
to install all the dependencies. This could take a long time the
first time it runs.
If you can't use Nix, you will need the following. For each prerequisite, the automatically tested version is included.
- One of these operating systems:
- Linux (tested on Ubuntu 22.04, Jammy Jellyfish and 24.04, Noble Numbat)
- macOS (tested on version 12, Monterey)
- Windows (tested on Windows Server 2022)
- Python (tested with 3.9 and 3.11)
- Poetry (tested with 1.8.3)
- GDAL (tested with 3.6.4)
Once you have all of the above,
cd [emergency-management-tools path]/flooding/sentinel2_water_extraction
and
install Python packages for this project with
poetry install --only=main --no-root
. Finally run poetry shell
to make the
Python packages available.
Start the notebook with jupyter notebook sentinel2_water_extraction.ipynb
.
This will open the notebook in a browser.
Follow the instructions in the notebook to execute it and 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