Chennai Floods 2015–A Geographic Analysis

On December 1–2, 2015, the Indian city of Chennai received more rainfall in 24 hours than it had seen on any day since 1901. The deluge followed a month of persistent monsoon rains that were already well above normal for the Indian state of Tamil Nadu. At least 250 people had died, several hundred had been critically injured, and thousands had been affected or displaced by the flooding that has ensued.

The image above provides satellite-based estimates of rainfall over southeastern India on December 1–2, accumulating in 30–minute intervals. The rainfall data is acquired from the Integrated Multi-Satellite Retrievals for GPM (IMERG), a product of the Global Precipitation Measurement mission. The brightest shades on the maps represent rainfall totals approaching 400 millimeters (16 inches) during the 48-hour period. These regional, remotely-sensed estimates may differ from the totals measured by ground-based weather stations. According to Hal Pierce, a scientist on the GPM team at NASA’s Goddard Space Flight Center, the highest rainfall totals exceeded 500 mm (20 inches) in an area just off the southeastern coast.

[Source: NASA http://earthobservatory.nasa.gov/IOTD/view.php?id=87131]

Summary of this sample

This sample showcases not just the analysis and visualization capabilities of your GIS, but also the ability to store illustrative text, graphics and live code in a Jupyter notebook.

The sample starts off reporting the devastating effects of the flood. We plot the locations of rainfall guages and interpolate the data to create a continuous surface representing the amount of rainfall throughout the state.

Next we plot the locations of major lakes and trace downstream the path floods waters would take. We create a buffer around this path to demark at risk areas.

In the second part of the sample, we take a look at time series satellite imagery and observe the human impacts on natural reservoirs over a period of two decades.

We then vizualize the locations of relief camps and analyze their capacity using pandas and matplotlib. We aggregate the camps district wise to understand which ones have the largest number of refugees.

In the last part, we perform a routing analysis to figure out the best path to route emergency supplies from storage to the relief camps

First, let's import all the necessary libraries and connect to our GIS via an existing profile or creating a new connection by e.g. gis = GIS("https://www.arcgis.com", "arcgis_python", "P@ssword123").

In [1]:
import datetime

%matplotlib inline
import matplotlib.pyplot as pd
from IPython.display import display, YouTubeVideo

import arcgis
from arcgis.gis import GIS
from arcgis.features.analyze_patterns import interpolate_points
from arcgis.geocoding import geocode
from arcgis.features.find_locations import trace_downstream
from arcgis.features.use_proximity import create_buffers

gis = GIS(profile = "your_online_profile")

Chennai Floods Explained

In [2]:
YouTubeVideo('x4dNIfx6HVs')
Out[2]:

The catastrophic flooding in Chennai is the result of the heaviest rain in several decades, which forced authorities to release a massive 30,000 cusecs from the Chembarambakkam reservoir into the Adyar river over two days, causing it to flood its banks and submerge neighbourhoods on both sides. It did not help that the Adyar’s stream is not very deep or wide, and its banks have been heavily encroached upon over the years. Similar flooding triggers were in action at Poondi and Puzhal reservoirs, and the Cooum river that winds its way through the city. While Chief Minister J Jayalalithaa said, during the earlier phase of heavy rain last month, that damage during the monsoon was “inevitable”, the fact remains that the mindless development of Chennai over the last two decades — the filling up of lowlands and choking of stormwater drains and other exits for water — has played a major part in the escalation of the crisis.

[Source: Indian Express http://indianexpress.com/article/explained/why-is-chennai-under-water/#sthash.LlhnqM4B.dpuf]

How much rain and where?

To get started with our analysis, we bring in a map of the affected region. The map is a live widget that is internally using the ArcGIS JavaScript API.

In [67]:
map = gis.map("Chennai")
map
Out[67]:

We can search for content in our GIS and add layers to our map that can be used for visualization or analysis:

In [4]:
chennaipop = gis.content.search("Chennai_Population", 
                                item_type="Feature Layer", 
                                outside_org=True)[0]
chennaipop
Out[4]:
Chennai_Population
Feature Layer Collection by arcgis_python
Last Modified: February 23, 2019
0 comments, 9 views

Assign an optional JSON paramter to specify its opacity, e.g. map.add_layer(chennaipop, {"opacity":0.7}) or else just add the layer with no transparency.

In [58]:
map.add_layer(chennaipop, {"renderer":"ClassedColorRenderer", 
                           "field_name": "TOTPOP_CY", 
                           "opacity":0.7})

To get a sense of how much it rained and where, let's use rainfall data for December 2nd 2015, obtained from the Regional Meteorological Center in Chennai. Tabular data is hard to visualize, so let's bring in a map from our GIS to visualize the data:

In [6]:
search_rainfall = gis.content.search("Chennai_precipitation", 
                              item_type="Feature Layer", 
                              outside_org=True)
if len(search_rainfall) >= 1:
    rainfall = search_rainfall[0]
else:
    # if the "Chennai_precipitation" web layer does not exist
    print("Web Layer does not exist. Re-publishing...")
    # import any pandas data frame, with an address field, as a layer in our GIS
    import pandas as pds
    df = pds.read_csv('data/Chennai_precipitation.csv')
    # Create an arcgis.features.FeatureCollection object by importing the pandas dataframe with an address field
    rainfall = gis.content.import_data(df, {"Address" : "LOCATION"})
Web Layer does not exist. Re-publishing...
In [68]:
map2 = gis.map("Tamil Nadu, India")
map2
Out[68]:

We then add this layer to our map to see the locations of the weather stations from which the rainfall data was collected:

In [8]:
map2.add_layer(rainfall, {"renderer":"ClassedSizeRenderer", 
                          "field_name":"RAINFALL" })

Here we used the smart mapping capability of the GIS to automatically render the data with proportional symbols.

Spatial Analysis

Rainfall is a continuous phenonmenon that affects the whole region, not just the locations of the weather stations. Based on the observed rainfall at the monitoring stations and their locations, we can interpolate and deduce the approximate rainfall across the whole region. We use the Interpolate Points tool from the GIS's spatial analysis service for this.

The Interpolate Points tool uses empirical Bayesian kriging to perform the interpolation.

In [9]:
interpolated_rf = interpolate_points(rainfall, field='RAINFALL')

Let us create another map of Tamil Nadu state and render the output from Interpolate Points tool

In [69]:
intmap = gis.map("Tamil Nadu")
intmap
Out[69]:
In [11]:
intmap.add_layer(interpolated_rf['result_layer'])

We see that rainfall was most severe in and around Chennai as well some parts of central Tamil Nadu.

What caused the flooding in Chennai?

A wrong call that sank Chennai

Much of the flooding and subsequent waterlogging was a consequence of the outflows from major reservoirs into swollen rivers and into the city following heavy rains. The release of waters from the Chembarambakkam reservoir in particular has received much attention. [Source: The Hindu, http://www.thehindu.com/news/cities/chennai/chennai-floods-a-wrong-call-that-sank-the-city/article7967371.ece]

In [70]:
lakemap = gis.map("Chennai")
lakemap.height='450px'
lakemap
Out[70]:

Let's have look at the major lakes and water reservoirs that were filled to the brim in Chennai due the rains. We plot the locations of some of the reservoirs that had a large outflow during the rains:

To plot the locations, we use geocoding tools from the tools module. Your GIS can have more than 1 geocoding service, for simplicity, the sample below chooses the first available geocoder to perform an address search

In [14]:
lakemap.draw(geocode("Chembarambakkam, Tamil Nadu")[0], 
             {"title": "Chembarambakkam", "content": "Water reservoir"})
lakemap.draw(geocode("Puzhal Lake, Tamil Nadu")[0], 
             {"title": "Puzhal", "content": "Water reservoir"})
lakemap.draw(geocode("Kannampettai, Tamil Nadu")[0], 
             {"title": "Poondi Lake ", "content": "Water reservoir"})

To identify the flood prone areas, let's trace the path that the water would take when released from the lakes. To do this, we first bring in a layer of lakes in Chennai:

In [15]:
search_results = gis.content.search("Chennai_lakes", 
                                   item_type="Feature Layer",
                                   outside_org=True)
search_results
Out[15]:
[<Item title:"Chennai Lakes OverFlow Path" type:Feature Layer Collection owner:Balaganesh99>,
 <Item title:"Possible Flood Zones" type:Feature Layer Collection owner:Balaganesh99>,
 <Item title:"Chennai_lakes" type:Feature Layer Collection owner:yjiang_geosaurus>]
In [16]:
chennai_lakes = search_results[2]
chennai_lakes
Out[16]:
Chennai_lakes
Feature Layer Collection by yjiang_geosaurus
Last Modified: February 22, 2019
0 comments, 5 views

Now, let's call the Trace Downstream analysis tool from the GIS:

In [17]:
downstream = trace_downstream(chennai_lakes)
downstream.query()
Out[17]:
<FeatureSet> 11 features

The areas surrounding the trace paths are most prone to flooding and waterlogging. To identify the areas that were at risk, we buffer the traced flow paths by one mile in each direction and visualize it on the map. We see that large areas of the city of Chennai were susceptible to flooding and waterlogging.

In [18]:
floodprone_buffer = create_buffers(downstream, [ 1 ], units='Miles')
In [19]:
lakemap.add_layer(floodprone_buffer)

Nature's fury or human made disaster?

"It is easy to attribute the devastation from unexpected flooding to the results of nature and climate change when in fact it is a result of poor planning and infrastructure. In Chennai, as in several cities across the country, we are experiencing the wanton destruction of our natural buffer zones—rivers, creeks, estuaries, marshlands, lakes—in the name of urban renewal and environmental conservation.

The recent floods in Chennai are a fallout of real estate riding roughshod over the city’s waterbodies. Facilitated by an administration that tweaked and modified building rules and urban plans, the real estate boom has consumed the city’s lakes, ponds, tanks and large marshlands.

The Ennore creek that used to be home to sprawling mangroves is fast disappearing with soil dredged from the sea being dumped there. The Kodungaiyur dump site in the Madhavaram–Manali wetlands is one of two municipal landfills that service the city. Velachery and Pallikaranai marshlands are a part of the Kovalam basin that was the southern-most of the four river basins for the city. Today, the slightest rains cause flooding and water stagnation in Velachery, home to the city’s largest mall, several other commercial and residential buildings, and also the site where low income communities were allocated land. The Pallikaranai marshlands, once a site for beautiful migratory birds, are now home to the second of the two landfills in the city where the garbage is rapidly leeching into the water and killing the delicate ecosystem."

[Source: Chennai's Rain Check http://www.epw.in/commentary/chennais-rain-check.html]

There are several marshlands and mangroves in the Chennai region that act as natural buffer zones to collect rain water. Let's see the human impact on Pallikaranai marshland over the last decade by comparing satellite images.

In [20]:
def exact_search(my_gis, title, owner_value, item_type_value, max_items_value=20):
    final_match = None
    search_result = my_gis.content.search(query= title + ' AND owner:' + owner_value, 
                                          item_type=item_type_value, max_items=max_items_value, outside_org=True)
    
    if "Imagery Layer" in item_type_value:
        item_type_value = item_type_value.replace("Imagery Layer", "Image Service")
    elif "Layer" in item_type_value:
        item_type_value = item_type_value.replace("Layer", "Service")
    
    for result in search_result:
        if result.title == title:
            final_match = result
            break
    return final_match

ls_water = exact_search(gis, 'Landsat GLS Multispectral', 'esri', 'Imagery Layer')
ls_water
Out[20]:
Landsat GLS Multispectral
Landsat GLS 30 and 60m Multispectral 8 band images with visual renderings and indices.Imagery Layer by esri
Last Modified: May 03, 2018
0 comments, 7,363 views

Lets us see how the Pallikaranai marshland has changed over the past few decades, and how this has also contributed to the flooding. We create two maps and load the Land / Water Boundary layer to visualize this. This image layer is time enabled, and the map widget gives you the ability to navigate this dataset via time as well.

In [ ]:
ls_water_lyr = ls_water.layers[0]
In [22]:
from arcgis.geocoding import geocode
area = geocode("Tamil Nadu, India", out_sr=ls_water_lyr.properties.extent.spatialReference)[0]
ls_water_lyr.extent = area['extent']

In the cell below, we will use a band combination [5,4,3] (a.k.a. mid-IR (Band 5), near-IR (Band 4) and red (Band 3)) of Landsat to provide definition of land-water boundaries and highlights subtle details not readily apparent in the visible bands alone. The reason that we use more infrared bands is to locate inland lakes and streams with greater precision. Generally, the wetter the soil, the darker it appears, because of the infrared absorption capabilities of water.

In [23]:
# data source option 
from arcgis.raster.functions import stretch, extract_band
target_img_layer = stretch(extract_band(ls_water_lyr, [5,4,3]),
                           stretch_type="percentclip", gamma=[1,1,1], dra=True)

Use the cell below to filter imageries based on the temporal conditions, and export the filtered results as local images, then show comparatively with other time range. You can either use the where clause e.g. where="(Year = " + str(start_year) + ")", or use the temporal filter as shown below.

In [24]:
import pandas as pd
from arcgis import geometry
import datetime as dt

def filter_images(my_map, start_year, end_year):
    selected = target_img_layer.filter_by(where="(Category = 1) AND (CloudCover <=0.2)",
                                          time=[dt.datetime(start_year, 1, 1), dt.datetime(end_year, 1, 1)],
                                          geometry=arcgis.geometry.filters.intersects(ls_water_lyr.extent))
    my_map.add_layer(selected)
    
    fs = selected.query(out_fields="AcquisitionDate, GroupName, Month, DayOfYear, WRS_Row, WRS_Path")
    tdf = fs.sdf  
    return tdf

First, search for qualified satellite imageries (tiles) intersecting with the area of interest at year 1991.

In [1]:
satmap1 = gis.map("Pallikaranai, Tamil Nadu, India", 13)
df = filter_images(satmap1, 1991, 1992) 
df.head()
Out[1]:

Then search for satellite imageries intersecting with the area of interest at 2009.

In [2]:
satmap2 = gis.map("Pallikaranai, Tamil Nadu, India", 13)
df = filter_images(satmap2, 2009, 2010)
df.head()
Out[2]:
In [3]:
from ipywidgets import *

satmap1.layout=Layout(flex='1 1', padding='10px', height='300px')
satmap2.layout=Layout(flex='1 1', padding='10px', height='300px')

box = HBox([satmap1, satmap2])
box
Out[3]:

The human impact on the marshland is all too apparent in the satellite images. The marshland has shrunk to less than a third of its size in just two decades.

"Not long ago, it was a 50-square-kilometre water sprawl in the southern suburbs of Chennai. Now, it is 4.3 square kilometres – less than a tenth of its original. The growing finger of a garbage dump sticks out like a cancerous tumour in the northern part of the marshland. Two major roads cut through the waterbody with few pitifully small culverts that are not up to the job of transferring the rain water flows from such a large catchment. The edges have been eaten into by institutes like the National Institute of Ocean Technology. Ironically, NIOT is an accredited consultant to prepare Environmental Impact Assessments on various subjects, including on the implications of constructing on waterbodies.

Other portions of this wetland have been sacrificed to accommodate the IT corridor. But water offers no exemption to elite industry. Unmindful of the lofty intellectuals at work in the glass and steel buildings of the software parks, rainwater goes by habit to occupy its old haunts, bringing the back-office work of American banks to a grinding halt."

[Source: http://scroll.in/article/769928/chennai-floods-are-not-a-natural-disaster-theyve-been-created-by-unrestrained-construction]

Flood Relief Camps

To provide emergency assistance, the Tamil Nadu government has set up several flood relief camps in the flood affected areas. They provide food, shelter and the basic necessities to thousands of people displaced by the floods. The locations of the flood relief camps was obtained from http://cleanchennai.com/floodrelief/2015/12/09/relief-centers-as-on-8-dec-2015/ and published to the GIS as a layer, that is visualized below:

In [28]:
relief_centers = gis.content.search("Chennai Relief Centers")[0]
In [76]:
reliefmap = gis.map("Chennai")
reliefmap
Out[76]:

Assign an optional JSON paramter to specify its opacity, e.g. reliefmap.add_layer(chennaipop, {"opacity":0.5}) or else just add the layer with no transparency.

In [73]:
reliefmap.add_layer(chennaipop, {"opacity":0.5})
In [74]:
reliefmap.add_layer(relief_centers)

Let us read the relief center layer as a pandas dataframe to analyze the data further

In [32]:
relief_data = relief_centers.layers[0].query().sdf
relief_data.head()
Out[32]:
Contact_No Division__ FID F_Locations No_of_Cent No_of_fami No_of_pers SHAPE Sl_No_ SymbolID Zone______
0 Balamurali, 9445190311 10 1 Poonthotam School, Chennai 10 65 200 {"x": 8919695.334199999, "y": 1464332.82629999... 1 I
1 Jayakumar, 9445190302 2 2 St.Joseph church community Hall, Chennai 0 200 600 {"x": 8936283.704100002, "y": 1469202.8202, "s... 2
2 Jayakumar, 9445190302 2 3 Nehru Nagar chennai Middle school, Chennai 0 75 250 {"x": 8916764.954599999, "y": 1450941.69069999... 3
3 Shanmugam, 9445190301 7 4 Kalaimagal School, Chennai 0 15 50 {"x": 8924034.069200002, "y": 1462457.79919999... 4
4 Rameshkumar, 9445190304 4 5 Ramanathapuram School, Chennai 0 100 300 {"x": 8919695.334199999, "y": 1464332.82629999... 5
In [33]:
relief_data['No_of_pers'].sum()
Out[33]:
31478
In [34]:
relief_data['No_of_pers'].describe()
Out[34]:
count     136.000000
mean      231.455882
std       250.334202
min        10.000000
25%        60.000000
50%       150.000000
75%       300.000000
max      1500.000000
Name: No_of_pers, dtype: float64
In [35]:
relief_data['No_of_pers'].hist()
Out[35]:
<matplotlib.axes._subplots.AxesSubplot at 0x29b5361a748>

In our dataset, each row represents a relief camp location. To quickly get the dimensions (rows & columns) of our data frame, we use the shape property

In [36]:
relief_data.shape
Out[36]:
(136, 11)

As of 8th December, 2015, there were 31,478 people in the 136 relief camps. Let's aggregate them by the district the camp is located in. To accomplish this, we use the aggregate_points tool.

In [37]:
chennai_pop_featurelayer = chennaipop.layers[0]
In [38]:
res = arcgis.features.summarize_data.aggregate_points(  relief_centers, 
                                                        chennai_pop_featurelayer, 
                                                        False, 
                                                        ["No_of_pers Sum"])
In [39]:
aggr_lyr = res['aggregated_layer']
In [75]:
reliefmap.add_layer(aggr_lyr, { "renderer": "ClassedSizeRenderer", 
                               "field_name":"SUM_No_of_pers"})
In [41]:
df = aggr_lyr.query().sdf
df.head()
Out[41]:
AVGHHSZ_CY Age_15_30 Age_30_45 Age_45_60 AnalysisArea ENRICH_FID ENRICH_F_1 FEMALES_CY FID HasData ... Wtr_Pump Wtr_River Wtr_Spring Wtr_Treatd Wtr_Tube Wtr_Uncvrd Wtr_Untrtd Wtr_Well sourceCo_1 sourceCoun
0 3.90 104365 86739 53977 13.622797 33 33 330353 1 1 ... 2959 420 178 57608 15077 3872 10455 2196 IN IN
1 3.91 89395 74300 46237 24.148443 25 25 195680 2 1 ... 2024 107 189 39164 18452 6655 8469 3292 IN IN
2 3.92 159311 140362 86549 32.373704 30 30 463066 3 1 ... 4144 58 465 55034 31547 16120 18771 12708 IN IN
3 3.92 245989 204995 127679 49.687276 26 26 287041 4 1 ... 11674 309 410 113026 39136 8584 29476 6020 IN IN
4 3.93 177140 155732 95889 63.265503 29 29 337026 5 1 ... 3061 248 254 55623 37354 16703 24798 12411 IN IN

5 rows × 40 columns

Let us represent the aggreate result as a table:

In [44]:
df = aggr_lyr.query().sdf

df2 = df[['NAME', 'SUM_No_of_pers']]
df2.set_index('NAME', inplace=True)
df2
Out[44]:
SUM_No_of_pers
NAME
Alandur 1256
Tambaram 950
Ambattur 1886
Shollingalanur 1632
Poonamallee 2785
Chennai 19765
Chengalpattu 49
Sriperumbudur 3155
In [45]:
df2.plot(kind='bar')
Out[45]:
<matplotlib.axes._subplots.AxesSubplot at 0x29b5373bef0>

Routing Emergency Supplies to Relief Camps

A centralized location has been established at Nehru Stadium to organise the relief materials collected from various organizations and volunteers. From there, the relief material is distributed to the needy flood affected people.

The GIS provided routing tools that can help plan routes of the relief trucks from the center to relief camps:

In [77]:
routemap = gis.map("Chennai")
routemap
Out[77]:
In [47]:
nehru_stadium = geocode('Jawaharlal Nehru Stadium, Chennai')[0]
routemap.draw(nehru_stadium, {"title": "Nehru Stadium", 
                              "content": "Chennai Flood Relief Center"})
In [48]:
start_time = datetime.datetime(2015, 12, 13, 9, 0)
In [49]:
routes = arcgis.features.use_proximity.plan_routes(
    relief_centers, 
    15, 
    15, 
    start_time, 
    nehru_stadium, 
    stop_service_time=30)
routemap.add_layer(routes['routes_layer'])
Input field [OID] was not mapped to a field in the network analysis class "Orders".
Input field [OID] was not mapped to a field in the network analysis class "Depots".
Network elements with avoid-restrictions are traversed in the output (restriction attribute names: "Avoid Unpaved Roads" "Avoid Private Roads" "Through Traffic Prohibited" "Avoid Gates").
{"messageCode": "AO_100116", "message": "Only 10 out of 15 routes are needed to reach all stops. If you want to use more routes, run Plan Routes again but reduce the limits on the maximum number of stops or the total route time per vehicle.", "params": {"routeCount": 15, "routesUsed": 10}}
In [50]:
routemap.add_layer(routes['assigned_stops_layer'])

Once the routes have been generated, they can be given to drivers, and used to ensure that relief material is promptly delivered to those in need and help alleviate the suffering they are going through.


Feedback on this topic?