Flood Detection with Google Earth Engine
A ee-fastapi is a simple FastAPI web application for performing flood detection using Google Earth Engine in the backend. The module src/model.py was adapted and translated to Python from Radar-based Flood Mapping. If you want to cite the methodology, takes a look at the bibliography available here.
Install Docker Compose
Install the EarthEngine Python API. You must have an active Earth Engine account (the credentials are copied to the app through volumes)
Run the command
docker-compose up
and point your browser to
0.0.0.0:80
to start work
ee-fastapi use ready-to-use data freely available in the Earth Engine Data Catalog. ee-fastapi use the following public dataset:
Flood range dates, a hand-selected ROI, and the flood threshold are sent from the front-end to the back-end using fetch. The users control the response through two buttons: display and download. The display button will attach XYZ map tile resources with the results to the OpenLayer map. These tiles are obtained after running the model and the ee.data.getMapId method. On the other hand, the download button will download the flood area in a GeoPackage vector format.
It was my first project using OpenLayer, and I can say that I did not miss Leaflet at all!. In my opinion, OpenLayers has much more advantages over Leaflet. Here are some reasons from the point of view of a novice Web GIS user:
Google Earth Engine has everything: tons of publicly available datasets, a great well-documented API, and high-performance computing.
Fetch API does not need to be installed as a dependency. It utilizes a modern JS syntax and is based on promise rather than callbacks.