Fighting California forest fires using spatial analysis¶
The state of California has had a dangerous fire season in 2015 and 2016. A standard procedure while fighting these fires is identifying facilities that are at risk and evacuating them. Tasks such as this can be accomplished easily using spatial analysis tools available on your GIS. Spatial analysis tools allow overlaying the extent of fire and the locations of the facilities on a map and identifying the ones that fall within the fire's extent.
Thus, this sample demonstrates the application of spatial analysis tools such as buffer and overlay.
This notebook describes a scenario wherein an analyst automates the process of identifying facilities at risk from forest fires and sharing this information with other departments such as the fire department, etc.
Note: To run this sample, you need the
pandas library in your conda environment. If you don't have the library, install it by running the following command from cmd.exe or your shell
conda install pandas
import datetime import arcgis from arcgis.gis import GIS from IPython.display import display import pandas as pd # create a Web GIS object gis = GIS("https://python.playground.esri.com/portal", "arcgis_python", "amazing_arcgis_123")
Using groups to share items and collaborate¶
A group effort spanning several professionals and teams is required to meet challenges such as forest fires. Members of a web GIS can collaborate with each other by sharing web maps, layers, applications, etc. with each other. This sharing is accomplished by creating groups in the GIS and items shared to a group can be used by members of the group.
The code below lists the items shared with the 'LA County Emergency Management' group. This group contains a collection of maps, apps and layers that are published as the authoritative common map for the county of Los Angeles.
# get our group group = gis.groups.search('LA County Emergency Management') group
# list items in the group items = group.content() for item in items: display(item)
Visualize the fire data¶
Let us create a map widget to see the fire related information in it's geographic context:
# create a map of our area of interest m = gis.map('Los Angeles', 9) m
# add the active fires layer fires = items m.add_layer(fires)
# add our critical infrastructure layer infra = items m.add_layer(infra)
#we shall use this webmap item in the last section of the notebook. webmapitem = items
fires feature layer, that we just added to the map, contains the boundaries of the active forest fires in the region. For this demo scenario, this layer is being constantly updated by the Fire Department with inputs from fire fighters in the field and remote sensing data obtained from satellites.
infra feature layer contains the locations of critical infrastructure facilities in the region. The objective of this script is to identify critical infrastructure facilities that are at risk due to the fires, and alert firefighters, county officials and others for allocating firefighting resources, planning evacuations, etc.
Create a buffer of 4 miles around fire boundaries¶
To identify the critical infrastructure resources that are the risk, let us create a buffer of 4 miles around the fire boundaries and consider all facilities that fall within this area at risk. The process of buffer expands the feature's boundaries in all directions.
To perform buffers, we use the
create_buffers function available in the
As an input to the tool, we provide the fires layer as the layer to be buffered.
Feature analysis tools can return (in memory) feature collections as output for immediate consumption, or create a new feature service if the
output_name parameter is specified.
We specify an output name (with a timestamp) for the service as we may want the buffered fire perimeters to be persisted for bookkeeping purposes, or be shared with others as feature layers or in web maps:
# create a map of our area of interest m1 = gis.map('Los Angeles', 9) m1