This year I enrolled into GEOG 4GS3: GIS Programming offered at McMaster University. The course offers advanced treatment of GIS focusing on the creation of scripts to enhance productivity by automating time-consuming and repetitive tasks. Some of the learning outcomes include understanding the fundamental components of the Python language, developing Python scripts, working with the ArcPy site package and creating new script tools in ArcToolbox. As a final project, I was asked to develop a geospatial tool that makes some task easier, faster and reusable.

After days of brainstorming and help from my professor, Dr. Scott, who provided me with the following news article, http://nationalpost.com/news/canada/a-disaster-in-slow-mo-see-how-vulnerable-vancouver-halifax-and-other-areas-are-to-rising-seas, I decided to make a tool that analyzed land destruction based on water level rise due to a flooding event. In its most simple explanation, the user inputs a flooding level of x meters and the tool creates a shapefile that shows the amount of land now underwater due to the x meters of flood. With the shapefile, the tool also generates an attribute table that lists the total area effected by a flood based on the category of land, like agriculture, commercial, industrial and so forth. The attribute table also lists the amount of area as a percent of the whole area impacted by the flooding event based on the category of land.

Figure 1. Product of Flooding Tool showing the amount of land effected by a flood and the subsequent attribute table. In this case, the flooding level is 10 meters at the City of Vancouver.

The geospatial tool requires three pieces of information from the user: a digital elevation model of a city, a landuse shapefile of the same city with the same coordinate system as the DEM and a flooding height in meters. For my tool, I chose to use data from the City of Vancouver’s open source data catalog but because the tool is not hard-coded, any city can be analyzed with this geospatial tool as long as the three pieces of user information are correctly selected when prompted to execute the tool. As the tool runs, it starts by creating a new raster where 0 represents flooded land and 1 represents land not effected by the flood. The extent of 0’s and 1’s generated is dependent on the height of the flood. Taking the amount of land not effected by the flood, the tool converts the raster into a vector. Using Erase Overlay, the vector is erased from the original landuse shapefile of the city (in my case, the City of Vancouver) thus leaving behind a new vector that represents the amount of land effected by the flooding event. The tool also generates an attribute table based on mathematical operations coded using Python to display the total amount of land impacted by the flood in meters squared based on the category of that land. The execution of the tool takes about 2 minutes.

Figure 2. Block of code that creates an attribute table to calculate the sum of the area in square meters that is flooded by the land use category.

Though the tool does execute quickly, there are limitations in the use of the Flood Tool. It does assume that the base elevation of the flood is 0 meters. This is appropriate for coastal cities like Vancouver or St. John’s but does not apply to inland cities, much like Toronto or Hamilton. With inland cities, the base value is not zero and must be determine from the DEM and water bodies which would require additional information and code. Moving forward with the tool, I do intend to remove limitations that I am aware of and others that do arise. Strengthening my ability to code using Python and becoming more familiar with the syntax, especially the ArcPy site package, would be the first step to improving my tool.

Implementing Python into an ArcGIS problem reduces the amount of time it takes execute a solution. Though learning the syntax was tough at the beginning, the more I got to practice through bi-weekly assignments throughout the course, the more comfortable I got with my ability to use Python in order to solve problems, whether that be GIS related or not. I look forward to improving my Python skills and eventually learning other languages that I can implement into ArcMap and ArcGIS Pro.