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:
- Sentinel-1 GRD: C-band Synthetic Aperture Radar: A composite after and before the flood. Main resource.
- MERIT DEM: Multi-Error-Removed Improved-Terrain DEM: To avoid areas with high slope.
- JRC Global Surface Water Metadata, v.1.2: To avoid water body areas.
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:
- OpenLayer counts with a complex API. There is no reason to load external plugins for simple tasks like in Leaflet.
- Great documentation and thousand of examples.
- Better map projection support
- I found the OpenLayer API more intuitive.
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.
- Name: Cesar Luis Aybar Camacho
- Program: Copernicus Master in Digital Earth – CDE
- Student ID: s1078735
- Course: Geo-application Development