Towards Time Series Sensor Data to Accurately Map Flood Hazard and Assess Damages under Climate Change Using Google Earth Engine Cloud Platform and GIS – Case of the Cities of Tetouan and Casablanca (Morocco)

Climate change poses a major challenge in terms of urban planning management for the sake of a sustainable fu - ture. It is affecting the hydrological cycle around the world, leading to extreme weather conditions. Floods rank as the most frequent and widespread disaster in the world, they adversely affect inhabitants in terms of property dam - age and threat to human safety (and lives, in the worst cases). Uncontrolled urban sprawl also exacerbates floods by expanding impervious surfaces and affecting flow paths. Other factors that trigger flooding (apart from the rain - fall intensity) are human involvement in the main waterways, thereby significantly impacting the hydraulic flow characteristics, structural engineering breakdowns, compounded by potential deforestation. For the purpose of monitoring the aftermath of floods experienced by the cities of Casablanca and Tetouan (Morocco) respectively in January and March 2021 and estimating their damages, optical and radar satellite images derived from the Google Earth Engine (GEE) cloud platform were used along with the Geographic Information System (GIS). In this study, a novel technique for extracting flooded areas from high-resolution Synthetic Aperture Radar (SAR) time series images has been developed. A comparison was carried out subsequently between the time-series approach and other traditional approaches including radiometric thresholding method, spectral indices namely Normalized Dif - ference Water Index (NDWI) and Modified Normalized Difference Water Index (MNDWI) as well as Flood Water Index (FWI). Based on the above approach, the water levels were estimated and the damages were assessed and mapped, notably the number of people exposed to flood hazard and the amount of built-up areas and cropland af - fected. The results demonstrated that Casablanca city has witnessed a higher flood level than Tetouan city, putting a large number of people at risk and affecting a significant area of land use. The findings can also provide local authorities with a comprehensive view of flooding and enable them to make decisions on preparedness, mitigation, and adaptation to flood-related disasters.


INTRODUCTION
The global climate is changing faster than expected, and the effects are already plain to see. Extreme weather events are occurring more and more frequently around the world. Floods are the most common and widespread of all weather-related natural disasters, driven by multiple parameters tied to urban development amid climate change. Among them, unplanned urban sprawl coupled with human encroachment on the active flood channel, human meddling in main streams altering then the water run-off characteristics, structural failures (e.g., bridges, dams, etc.), intense urbanization and rapid growth with insufficient hydraulic structures leading to major Towards Time Series Sensor Data to Accurately Map Flood Hazard and Assess Damages under Climate Change Using Google Earth Engine Cloud Platform and GIS -Case of the Cities of Tetouan and Casablanca (Morocco) changes in land use and a broad impervious surface, in combination with potential overstraining urban sanitation systems under intense rainfall conditions.
In the 21 st century, floods have affected more people worldwide, than any other disaster. Morocco is no exception: urban floods and subsequent damages are frequently encountered. Early 2021 has been marked by heavy rainfall all over Morocco. Casablanca and Tetouan, in January and March respectively, were among the worst affected areas, with floods causing significant property damage and even human lives.
This study focuses on the assessment of flood risk in Casablanca and Tetouan (Morocco). Driven by demographic pressure, these cities are expanding, leading to changes in land use, affecting water systems (e.g., streams, rivers, wetlands, etc.), thus increasing the vulnerability of populations and structures to heavy rainfall and flooding. As well, the man-made and impervious surfaces (e.g., buildings, roads, paved non-permeable surfaces, etc.) further reduce infiltration and increase runoff, resulting in overloading and backflow of the drainage system and in considerable rapid runoff.
At the heart of this study have been two recent Earth Observation (EO) advances, able to both provide a low-cost flood map and observe phenomenon efficiently and accurately. The first is the free access to satellite data, which allows to map the disaster at a relatively high spatial and temporal resolution. Whilst, the second is the wider availability of cloud computing architectures to process EO data such as Google Earth Engine (GEE). It is designed to tackle the processing hurdles encountered by traditional satellite images processing methods.
In this study, an innovative flood mapping algorithm is presented, leveraging the power of cloud computing EO data to map the extension of flooded area and extract informative boundaries. A comparison was further carried out between the outcomes attained and that reached following traditional approaches, based on a single threshold or on combining two or more spectral bands to delineate water extent and sort it out from other features, including radiometric thresholding technique, NDWI, MNDWI and FWI. Based on flood map, the water levels were estimated in a combination with a recent Digital Elevation Model (DEM) provided by Jet Propulsion Laboratory (JPL) under GEE. The damages were also assessed, including the amount of both built-up areas and cropland affected by floods, and the number of people exposed to hazard, leveraging the products of Joint Research Center (JRC) and the European Space Agency (ESA).

GENERAL FRAMEWORK
The study areas selected were severely affected by floods in 2021 (Figure 1). At Casablanca city (between the parallels 33° 34' 23.197" north and meridian 7° 35' 23.436" west of Greenwich), residential areas turned into islands, most public transport was suspended, three four-to five-floor buildings collapsed and the roof of a traditional oven caved in, killing one and injuring four, according to local authorities. As for Tetouan (between the parallels 35° 35' 20.038" north and meridian 5° 21' 45.186" west of Greenwich), around 275 houses were waterlogged, 11 light cars were swept away, the outer of some facilities were collapsed and certain roads were entirely impassable while others witnessed very slow traffic for many hours.

MATERIALS AND METHODS
To carry out this study, a work methodology divided into three phases was implemented.

Map the extent of ooded areas
In the first phase, the flooded areas for both Casablanca and Tetouan cities (Morocco) have been mapped. To do so, the time-series approach has been developed. Our approach is based on calculating the ratio of a collection of Sentinel-1 images captured during the flood (Fig. 2b) to a set of Sentinel-1 images taken before the disaster (Fig. 2a), aiming at comparing images and detecting flooded areas. After filtering satellite imagery by parameters such as the instrument mode, the polarization, pass direction, spatial resolution and pre-flood/co-flood start and end dates, we clipped Radar Satellite images to the boundaries of the area of interest. The sensor settings entered were 'VH' polarization and 'descending' pass direction. The 'VH' polarization was chosen for flood mapping owing to the overestimation provided by 'VV' polarization. While 'VV' polarization is sensitive to vertical patterns, 'VH' polarization is more susceptible to land surface changes. Also, the 'descending' pass direction was adopted based on the availability of pre-flood SAR images. The filtered images are then smoothed by a low-pass filter to reduce the noise and to produce clearer images. The present work is using SAR data that can break through haze and clouds, but it contains speckle noise, so it has to be reduced to enhance the quality of images. A speckle filter with a smoothing radius of 50 meters was performed during preprocessing to minimize the effect of granular noise. After masking out the existing water areas for more than 10 months per year using JRC Global Surface Water dataset and the steepest areas with over 5% slope based on Shuttle Radar Topography Mission (SRTM) digital elevation model, for detection of the flooded areas, the co-flood mosaics were then divided by the pre-flood mosaics using a threshold of 1.25. The threshold value is recommended by United Nations Spider program and is selected by trial and error and can be updated in case of high rate of false positive or false negative values. The pixels with a ratio higher than 1.25 are then considered as flooded areas. Hence, the binary raster layer is generated, attributing 1 to all pixel values above 1.25 (flooded pixels) and 0 otherwise (non-flooded pixels). The area of the flood extent is also estimated, by summing all pixels representing inundated areas and converting the outcome into hectares.
Always in SAR image processing, image segmentation, on the other hand, is one of the fundamental techniques for image processing, understanding and characterization. Among all segmentation techniques, the radiometric thresholding is actually based on the principle of choosing a single threshold from the radiometry histogram of a speckle-free SAR image. This technique allows to extract typical features from image, corresponding to different peaks in the histogram. Identifying water in the filtered image is based on determining the threshold that separates waterreflective pixels from non-water-reflective pixels. The histogram exhibits one or more peaks (Figure 3) of different magnitudes (i.e., depending on data), whereby low backscatter values correspond to water and high values to "no water".
Apart from radar, satellites also carry optical sensors, which provide a different kind of image, so that useful information about the flood event can be extracted under clear weather conditions. Given the very distinct reflectance of water, it is relatively easy to sort it out from other types of land cover by using optical images. After initial preprocessing (i.e., radiometric and atmospheric corrections) performed on Sentinel-2 images, NDWI (Eq. 1) and MNDWI (Eq. 2) were applied to delineate water from non-water features.
The selection of these bands is conducted to maximize the high reflectance of water body in the green band and minimize its low reflectance of SWIR. While NIR and SWIR combined improve the accuracy of retrieving vegetation water content and reflect liquid water content of vegetation canopies. MNDWI was successfully introduced to overcome the shortcomings of NDWI and to better discern water bodies above all in regions where built-up areas take over the background. Despite this, MNDWI-based water detection, and even radiometric thresholding, has some drawbacks, including hand removal of non-flooded pixels (i.e., perennial and permanent water bodies).
Flood Water Index or FWI (Eq. 3) is a spectral index intended for extracting solely the flood extent in red-green-blue or "RGB" composite imagery. It is based on the difference between DNs (Digital Numbers) of the red, green and blue bands (Br, Bg, Bb respectively).
FWI can be considered as a strong tool to extract visible floodwater from RGB data, mostly flooded areas in shaded and wooded areas over and above visible floodwater in dense urban areas, whereby the floodwater class has higher positive values than the other land cover classes (i.e., impervious surfaces and dry soils), whereas lower values refer to vegetation and shaded areas (Zhang, Y., and Crawford, P., 2020).

Estimate the depth of ood waters
In the second phase, the depth of flood waters has been derived. Here, both informative boundaries of the flooded areas and a recent DEM have been integrated. In GEE, JPL has made available to users the Shuttle Radar Topography Mission (SRTM) digital elevation data with a spatial resolution of approximately 30 meters that has been implemented in this step. Once the Area Of Interest (AOI) layer has been successfully generated and then, imbedded alongside the flooded areas layer and the DEM, a subset of the DEM was constructed by using the AOI layer and the flooded areas (if it is a raster layer, else it must be converted) were also re-projected in the same projection system as DEM. Furthermore, the Global Surface Water Dataset, provided by JRC, has been added ( Figure 4) and subsequently subsetted by the AOI layer given that it provides information on global water dynamics by gathering both intraand inter-annual variability and changes and that it allowed us to mask out regular water bodies. To minimize the impact of outliers on both extent of flooded areas and DEM, the modified z-score and a median filter with a 3×3 kernel were applied for outlier detection and filling. Roa-Pascuali, L. et al. stated that the median filter is largely used for its ability to smooth away noise and preserve edges. In the same line, Ajil Jassim, F. mentioned that the median filter, based on replacing a pixel by the median value of selected neighborhood, has proven to be effective in filtering outliers, and in eliminating impulse noise without disturbing the signal changes.
Finally, the local flood elevation for each grid cell within the flooded domain was allocated based on the nearest adjacent grid cell and the newly allocated flooded grid cells received elevation values, thus the depth of flood waters was computed by subtracting the local elevation from the topographic elevation (DEM) at each grid cell of the flooded area.

Map and estimate ood damage
In the third phase, the damages have been  flood extent raster to the same coordinate system as the population data from which a subset is created to fit the extent of the study area. Subsequently, an intersection between the two layers is then processed and displayed as a new raster layer. The number of exposed people is thus calculated by aggregating all the pixel values of the exposed population layer and converting the pixel sum into an integer to get a meaningful number of people.
For cropland extraction to the study areas, the ESA WorldCover 2021 product with high spatial resolution of 10 meters was used (Fig. 6). It is the first global land cover product based on both Sentinel-1 and Sentinel-2 data, so it provides high-resolution, accurate and timely land cover information. The map band consists of 11 classes. The "Cropland Class 40" of the map band is then extracted and overlapped with the flood extent layer, which has been re-projected to the same coordinate system as the map layer.
To compute the area of affected cropland, a new raster layer is generated where the area in m 2 for each pixel is then calculated. The area information is then derived by summing up all the pixels and is converted into hectares. The same workflow was followed to extract the built-up areas affected by flooding, using the ESA World-Cover 10 m 2021 product. The "Built-up Class 50" of the band "Map" is retrieved to evaluate the potentially affected urban areas.

Flood hazard mapping
To extract the flood inundation areas for study areas, we used five approaches, each of which has its own advantages and drawbacks that we will discuss below.
The flooded areas extracted by using approaches based on optical satellites images (i.e., NDWI, MNDWI and FWI), are not obviously discernible due to the unavailability of satellite images on the D-Day, or the cloud cover that invades almost the entire territory during the flood event. One of the disadvantages of optical images as they are subject to daylight and weather conditions. Given this, the acquisition of high-quality data is often greatly affected by the presence of recurrent cloud cover during floods, as visible and infrared wavelengths cannot penetrate clouds. Cloud filtering is therefore required to filter out clouds and shadows from multispectral images and get a meaningful classification (Figure 7).
Red color refers to flood waters. Due to the surface agitation generated by wind or swells, currents, buoyancy or temperature (fresh water, salt water, upwelling), etc., the sea may appear in red color (Figure 8), meanwhile the beaches generally have a negative NDWI, given that a cloud mask has already been applied to eliminate any possible confusion with flood waters (i.e., the reflectances are similar in some bands). Thus, this NDWIbased method demonstrates that the 2021 flooded areas for Tetouan city (Figure 7) occurred predominantly in Oum Kaltoum housing estate and the industrial zone. As for Casablanca city (Figure 8), due to the unavailability of Sentinel 2 satellite imagery during the flood period, it was not possible to extract and identify the flooded areas.
When compared with MNDWI index, it not only allows the extraction of flooded areas (in case of very high spatial resolution optical satellites images free of cloud cover), but also permanent waters and their overflows ( Figure 9). Also, MNDWI-based method better discriminates water bodies from other land use types (i.e., built-up areas, vegetation and soil) than NDWI index, since water pixels have a higher value than surrounding pixels over the MNDWI images. Thus, the MND-WI significantly enhances the recognition of water and other patterns of land use but cannot effectively remove cloud shadow and noise in different areas for Sentinel 2. This leaves some problems with classification outcome, including confusion between cloud and water pixels. Consequently, cloud filtering is required (Figure 9).
As opposed to MNDWI, FWI-based method applied RGB imagery to extract the extent of flooding on priority ( Figure 11). The spectral difference index is also reliant on the availability of high-spatial resolution satellite imagery to provide accurate details of the visible floodwater pattern. A common problem with all optical satellite images is related to massive clouds that obscure the vision of optical sensors during flood events. Other potential issue that may be encountered by using this approach involves possible confusion between wet soil and flood waters owing to their high spectral similarities.
To overcome cloud conditions frequently confronted when dealing with optical imagery, radar imagery has been implemented. Actually, Fig. 7. Cloud filtering for NDWI of Tetouan city (Morocco) radar sensors can acquire data both day and night and regardless of weather conditions. Thus, radar systems enable continuous and regular monitoring and mapping of flood risk areas. The detection of flooded areas by radiometric thresholding method capitalizes on radar images to the fullest. But it does not enable to efficiently extract flooded areas in concentrated built-up areas as the radar is blind in such areas and there is a likelihood of confusing the shadows of buildings with water. Also, relying on a single threshold can lead to misclassification of pixels because it all depends on the thresholding selected to separate all water from other types of land use. Along with inundated areas, pixels reflecting permanent water bodies and their overflows as well as the ones situated in stressed areas (i.e., steep slopes or wooded areas) can be retrieved, requiring a time-consuming manual removal of such pixels. The figures 12 and 13 demonstrate the flooded areas achieved by applying radiometric thresholding method for the cities of Casablanca and Tetouan (Morocco).
The radiometric thresholding method has proven to be an efficient way to extract water areas based on SAR backscatter as a function of the physical properties of the objects, given that water is less reflective than other materials. Still, this approach is highly sensitive to the selected threshold. It is difficult to pinpoint an accurate threshold, since the study area is so variable and  it depends on the size of water in the image. And, if the grayscale histogram is unimodal (Figure 3), the threshold becomes more difficult to detect. Processing such complex images is also very time consuming. To do so, the time-series approach is proposed. With repeated orbits of remote sensing, a collection of images of a given area can be gathered. Following the appropriate calibration, these images can be joined to monitor meteorological disasters such flooding. Using EO time series data, sophisticated underlying processes can be detected that would be hard to recognize with the radiometric thresholding method or other traditional approaches. The GEE cloud platform was further used to support the downloading and processing of images, eliminate some of the constraints of traditional methods especially in terms of costly and time-consuming as well as to enable efficient implementation of the algorithms. Figures 14 and  15 demonstrate the outcomes obtained for the Casablanca and Tetouan cities (Morocco).

Flood waters depth estimate
The Figures 16 and 17 show the results obtained concerning the depth of flood waters for both Moroccan cities Casablanca and Tetouan, by implementing the subtraction-based approach of the flooded areas layer by a recent DEM. Based on the findings, the inundated areas with peak depths of up to 1 meter, for Tetouan city, are predominantly concentrated around Tetouan  Industrial Zone ( Figure 19) and close to Oum Kaltoum housing estate. As for Casablanca city, such areas are found mainly in Sidi Bernoussi, Hay Assalam Ahl Loghlam, Ain Sbaa Bernoussi Industrial Zone (Figure 18), Jawhara, Street Lieutenant Fernand, Boulevard Moulay Abdellah Cherif and Maarif Ancien. Accordingly, the time-series approach coupled with the subtraction-based approach have allowed the extraction of flooded areas with varying flood waters depth in both urban and rural environments.
The inundated areas revealed within the breakwaters or groynes (case of Casablanca port) demonstrate the sea level rise caused by winter rain, with water running from ocean to the land.
But for intermittent waterways such as oueds or rivers (case of Oued Martil -Tetouan), the water escaping from its usual limits is referred to as an overflow and is called riverine floods.

Flood damage assessment
Early 2021 witnessed severe weather and heavy rainfall in Morocco across several cities. As a result, Casablanca and Tetouan cities were both among the hardest hit areas, with flooding leading to significant damages to the facilities and infrastructures, properties and even a severe threat to human life. The adopted methodology based on the overlap of available products furnished by  (Figure 20), 45533 people were exposed to flooding and 12606 hectares of urban/ built-up areas were affected, while 646 hectares of cropland were hit by the severe flooding. As for Tetouan city (Figure 21), the 2021 floods have significantly affected the vegetation cover leaving approximately 222 hectares of cropland susceptible to flooding. Also, a total of 69 hectares of urban areas have been exposed, putting 129 people at risk.

CONCLUSIONS
This study aims to map the flooded areas for the cities of Casablanca and Tetouan (Morocco) during the 2021 floods. Using GEE cloud platform and its EO data, an innovative algorithm for flood inundation extent mapping was implemented by incorporating a tremendous repository of geospatial data regularly updated in quantity and quality, and by harnessing the strength of cloud computing with its potential to store and analyze huge datasets up to petabytes for knowledge-based decision making and analysis. The planetary-scale platform provides a broad collection of SAR data, which are suitable for flood risk assessment due to its insensitivity to clouds and its effectiveness regardless of weather conditions, compared to optical data. To derive the flood extent from 10 meters spatial resolution based on Sentinel-1 satellite data, the pixel values of the pre-and coflood images were each compared. The difference between the two collections of images is then computed, thus effectively allowing the classification of pixels that pertain to permanent water bodies (e.g., rivers, lakes and reservoirs), from those pixels that represent flooded areas during heavy rains. A comparison was also made between the Sentinel-1 time-series approach and other traditional approaches, including the radiometric thresholding method as well as NDWI, MNDWI and FWI calculation. The findings demonstrate that by adopting the radiometric thresholding technique, errors are very likely to be incurred because it is based on the chosen threshold which separates water from all other land uses, and this challenge is further compounded if the histogram is bell-shaped. In addition, the approach also requires a significant effort and time for the manual removal of water bodies corresponding to permanent waters, and remains poorly robust in dense urban areas, as radar is blind in such areas. Which makes the proper detection of flooded areas dependent on sufficient water depth that surrounds the buildings. By comparing the approach based on the processing of radar satellite image time series with those using optical remote sensing data, the results show that optical images are very limited to flood mapping due to the prevailing of cloudy conditions that prevent providing a coherent image coverage to be used during flood period. It is one of the major drawbacks of optical sensors, that they cannot penetrate through clouds and hence acquiring cloud-free images is almost infeasible. Unlike optical sensors, SAR instruments proved to have a high potential for flood mapping due to their independence from daytime and weather conditions. The depth of flood waters was also estimated in this study based on the flooded areas reached and by adopting the subtraction-based approach. Leveraging the extensive database of GEE platform to get a recent DEM, the water levels were evaluated as the result of subtracting the local elevation from the DEM product within the flooded domain. And lastly, the flood damages were assessed, including the number of people exposed to flood hazard, and the amount of affected cropland and built-up areas. For the Casablanca city, 655 ha flooded, thereby exposing 45533 to this hazard, as well as affecting 12606 ha of built-up areas and 646 ha of cropland. As for Tetouan city, 223 ha inundated putting at risk 129 people, and impacting 69 ha of urban areas and 222 ha of cropland.
In the light of the results reached, climate change poses significant risks to properties, facilities and infrastructure as well as human beings. It is one of the most important issues facing the world today, and in many countries, including Morocco, flood risks have increased due to rapid urban and economic development in flood-prone areas, leading to higher exposure of communities to these risks. Building resilience in urban environments is therefore required to protect citizens and the landscape they interact with, and to address some of the challenges related to sustainable urban development. It is now a priority to act for the resilience and adaptation of cities against climate change, urban plans have to take into account these risks, institutions must evolve towards greater efficiency and better coordination, and urban protection need to be improved and reinforced. The outcomes of this study are intended to support institutions and decision-makers to recognize the areas at risk for both cities Casablanca and Tetouan (Morocco), and to take the appropriate interventions so as to prevent damage to the inhabitants and their properties.