Tornadoes occur in many parts of the world, including Australia, Europe, Africa, Asia, and South America, but they are found most frequently in the United States. Outside the United States, two of the highest concentrations of tornadoes are found in Argentina and Bangladesh.
Tornadoes are the most violent of all atmospheric storms and in the United States alone have caused an average of more than 80 deaths and 1,400 injuries each year (based on 1950–2011 data). A tornado is a narrow, violently rotating column of air that extends from the base of a thunderstorm to the ground. Tornado formation is complex, and no two tornadoes are the same; however, they need certain conditions to form, including intense or unseasonable heat. Wind speed within a tornado can vary from just above 0 mph up to 70 mph, with an average of 30 mph (NOAA). The Fujita damage scale is used to quantify the intensity of a tornado.
Explore the map of tornadoes across the United States: Twister! United States tornadoes from 1950 to 2012. Which states have had the most tornadoes? Using tornado location data from the United States severe weather report database, provided by the National Oceanic and Atmospheric Administration (NOAA)/National Weather Service Storm Prediction Center (http://www.spc.noaa.gov/gis/svrgis/), you can find the total number of tornadoes by state.
Connect your GIS
from arcgis.gis import GIS
To create the GIS object, we pass in the url and our login credentials as shown below
gis = GIS(profile='your_online_profile')
Search
for the title: tornado_lyr layer.You can search the GIS for feature layer collections by specifying the item type as 'Feature Layer Collection' or 'Feature Layer'. You can also mention the owner name of the layer to get better search results.
data = gis.content.search('Tornadoes_and_Tracks owner: api_data_owner',
'Feature layer', outside_org=True)
Display the list of results.
from IPython.display import display
for item in data:
display(item)
Get the first item from the results.
item = data[0] #tornado_lyr
The code below cycles through the layers and print their names.
for lyr in item.layers:
print(lyr.properties.name)
Tornadoes_5011 Kansas_tracks MeanTrack_Merge Kansas_counties10 StatePop_5011
Since the item is a Feature Layer Collection, accessing the layers property gives us a list of FeatureLayer objects. The StatePop_5011 layer is in the last index position for the list of layers and tornadoes is in the first.
#StatePop_5011
boundary = item.layers[4]
#Tornadoes_5011
tornado_lyr = item.layers[0]
Aggregate_points
tool summarizes data from spot measurements by area. To learn more about this tool and the formula it uses, refer to the documentation here.
from arcgis.features.summarize_data import aggregate_points
from datetime import datetime as dt
Please change the output_name if this is not the first you run the cell below.
agg_points = aggregate_points(point_layer=tornado_lyr,
polygon_layer=boundary,
keep_boundaries_with_no_points=True,
output_name="agg_tornado_points" + str(dt.now().microsecond))
agg_points
agg_lyr = agg_points.layers[0]
The GIS object includes a map widget for displaying geographic locations, visualizing GIS content, as well as the results of your analysis. To use the map widget, call gis.map()
and assign it to a variable.
m1 = gis.map('US')
m1
m1.zoom = 4
m1.content.add(agg_lyr)
Who has suffered the most?
There can be many devastating effects from a tornado, including loss of life, injuries, property damage, and financial losses. To identify populations that have been affected by tornadoes, you can aggregate the number of tornadoes to the state level and normalize by population.
m2 = gis.map('Midwest')
m2
m2.content.add(agg_lyr, options={"opacity":0.7})
rm_layer = m2.content.renderer(0)
rm_layer.smart_mapping().class_breaks_renderer(break_type="color", field="AvgPop", num_classes=10)
m2.legend.enabled = True
Feature layers hosted can be easily read into a Spatially Enabled DataFrame using the from_layer method. Once you read it into a SEDF object, you can create reports, manipulate the data, or convert it to a form that is comfortable and makes sense for its intended purpose.
import pandas as pd
sdf = pd.DataFrame.spatial.from_layer(agg_lyr)
sdf.head()
OBJECTID | STATE | NAME | Average | AvgPop | Point_Count | AnalysisArea | SHAPE | |
---|---|---|---|---|---|---|---|---|
0 | 1 | 11 | District of Columbia | 673920.5161 | 673921.0 | 2 | 68.337318 | {"rings": [[[-8575619.3133, 4720462.3076], [-8... |
1 | 2 | 10 | Delaware | 609949.2258 | 609949.0 | 56 | 2025.151926 | {"rings": [[[-8402132.4511, 4824614.7585], [-8... |
2 | 3 | 44 | Rhode Island | 955012.3871 | 955012.0 | 9 | 1104.035392 | {"rings": [[[-7946174.496, 5146505.0916], [-79... |
3 | 4 | 09 | Connecticut | 3027382.71 | 3027380.0 | 89 | 4986.287282 | {"rings": [[[-8132251.0361, 5166952.3], [-8127... |
4 | 5 | 34 | New Jersey | 7269192.065 | 7269190.0 | 137 | 7780.021177 | {"rings": [[[-8263743.7337, 5033439.7722], [-8... |
sdf.shape
(51, 8)
Visualize which states have had the most tornadoes.
sdf.sort_values(by='Point_Count', ascending=False, axis=0, inplace=True)
df = sdf[0:10]
import matplotlib.pyplot as plt
plt.figure(figsize=(10,7))
plt.bar(df.NAME, df.Point_Count)
plt.xlabel('NAME', fontsize=7)
plt.ylabel('point_count', fontsize=7)
plt.xticks(fontsize=8, rotation=45)
plt.title('The ten states with the highest number of tornadoes')
plt.show()
Number of tornadoes by state, 1950–2011
Some states are subject to many more tornadoes than others. Over a 62-year period (1950–2011), Texas had by far the most tornadoes (with 7,935), followed by Kansas (with 3,713), while others such as Vermont, Rhode Island, and the District of Columbia had fewer than 50. The ten states shown in the graph below had 20 percent of the total number of tornadoes.
Conclusion
In this notebook, we demonstrate how to use aggregation analysis to summarize the number of data points within each polygon. Thus, using aggregate_points()
method, we arrive at the number of tornadoes that hit each state. and published the aggregation results as an online service. Mapping results often show new insights that lead to deeper understanding and more clearly defined analysis.