ArcGIS Living Atlas

Earthquake Mapping Part I: One Symbol from Multiple Fields in Arcade

Have you ever had multiple fields in your data that you wanted to display as one unified symbol in ArcGIS Online? Arcade makes it easy to take any fields in your dataset and combine them into one symbol on your map.

The steps are outlined below using Esri’s Live Feed earthquake data.

At the end follow the link to Earthquake Mapping Part II: The Cartography of Time, Magnitude, and Alert Levels which dives deeper into the cartographic riddle for displaying hundreds of earthquake symbols on a map.

 

A portion of the front page of the first Daily News published on April 18, 1906 after a 7.9 earthquake struck San Francisco, California.

 

Earthquake Data in the Living Atlas

The Living Atlas of the World hosts recent global earthquakes from the U.S. Geological Survey (USGS) and their Prompt Assessment of Global Earthquakes for Response (PAGER) program.

This Live Feed is updated every five minutes and has fields detailing individual earthquake information including an event’s ID, Hours Old, Magnitude, Location, and PAGER Alert Level.

The first 30 seconds of the 6.9 Richter magnitude Loma Prieta earthquake that struck the Bay Area along the San Andreas Fault in California on October 17, 1989.
The first 30 seconds of the 6.9 Richter magnitude Loma Prieta earthquake that struck the Bay Area along the San Andreas Fault in California on October 17, 1989.

 

Attributes and Fields

All hosted feature layers in ArcGIS Online contain an attribute table.  Attribute tables have rows (features) and columns (fields) that store the data for that layer.

 

Image showing earthquake data fields.

 

What’s Important for Mapping Earthquakes?

This map needs to show earthquakes of interest, but not get obscured by the hundreds of other points that are also part of the story.  The map will need to logically show:

When was the earthquake?
How big was the earthquake?
What are the impacts on people and the environment?

This is a situation where the important information is contained in three fields of our data:

Hours Old
Magnitude
Alert Level

Let’s first take a look at how these fields look individually:

 

Classified by Hours Old

Earthquake data classified by Time.

 

Classified by Magnitude

Earthquake data classified by Magnitude.

 

Classified by Alert Level

Earthquake data classified by Alert Level.

 

It’s hard to differentiate the earthquake’s time, size, and severity as you flip between the maps and yet we need to be able to see them all.

 

Interpretation is at the Heart of Our Work

Is a 6.5 magnitude earthquake important? It depends right?

When did it happen? Where? In the middle of nowhere?  A populated area?  Are roads and buildings damaged or are people hurt?

We want to display each of our three fields genuinely, but also honor and respect each attribute’s contribution towards understanding of the complete dataset.

Compelling map symbology requires knowing your data fields, evaluating each one’s importance, and being able to interpret them together in a way that will uniquely, and beautifully,  tell their story.

In order to visualize the fields together on one map they need to become combinations of:

3 Time Periods – Past 24 hours, 1 week, and 3 months
4 Ranges of Magnitude-  4 to 4.9, 5 to 5.9, 6 to 6.9, and +7
5 Classes for Alert Level – None, Green, Yellow, Orange, and Red

Without any additional data processing we will use Arcade to join these fields together to form new sets of information for our map.

 

Damage to apartment building at Beach and Divisadero Streets in the San Francisco Marina District from the 1989 Loma Prieta Earthquake the week of October 17, 1989.
Damage to apartment building at Beach and Divisadero Streets in the San Francisco Marina District from the 1989 Loma Prieta Earthquake the week of October 17, 1989.

 

Before you Start

Esri’s Earthquake data is located here (copy the URL on the bottom right of the page).  Add this as a Web Layer to your ArcGIS Online map.

Begin by filtering out all of the smaller earthquakes that are < 4 magnitude.

Demonstration image on "Apply Filter".

 

Since earthquakes that are within the range of 4-4.9 magnitude (See The Modified Mercalli Intensity Scale) are detectable by people outdoors and are strong enough to wake some people up at night, this is a good threshold for representation on the map.  See this blog about applying filters.

 

Building the Expression

Click to “Change Style” of the layer.

 

Demonstration image showing how to make "Change Style".

 

Under “Choose an attribute to show” scroll to the bottom and select “New Expression”.

 

Demonstration image showing how to make a "New Expression".

 

Paste in the following Arcade expression:

var MAG=When(
$feature.mag >= 4 && $feature.mag < 5, “Mag 4-4.9”,
$feature.mag >= 5 && $feature.mag < 6, “Mag 5-5.9”,
$feature.mag >= 6 && $feature.mag < 7, “Mag 6-6.9”,
“Mag >= 7”)

var TIME=When(
$feature.hoursOld < 25, “Past 24 Hr”,
$feature.hoursOld > 24 && $feature.hoursOld < 145, “Past Week”,
“Past 3 Months”)

var PAGER =When(
$feature.alert == ‘GREEN’, “PAGER GREEN”,
$feature.alert == ‘YELLOW’, “PAGER YELLOW”,
$feature.alert == ‘ORANGE’, “PAGER ORANGE”,
$feature.alert == ‘RED’, “PAGER RED”,
“NO PAGER”)

TIME + ” ” + MAG + ” – ” + PAGER

Please Note: When you copy the above text and paste it into Arcade you will have to modify the ‘single’ and “double” quotes.  They will come in formatted curly and you need to make them straight.

It will look like:

 

Image of the Arcade code to classify the earthquakes by Time, Magnitude, and Alert Level.

 

What this code is saying is:

MAG
When (the magnitude is greater than or equal to 4 and less than 5, give it the name “Mag 4-4.9”,
When the magnitude is greater than or equal to 5 and less than 6, give it the name “Mag 5-5.9”,
When the magnitude is greater than or equal to 6 and less than 7, give it the name “Mag 6-6.9”,
Anything else greater than or equal to 7, give it the name “Mag >=7”)

TIME
When (the hours old is less than 25, give it the name “Past 24 hr”,
When the hours old is greater than 25 but less than 145, give it the name “Past Week”,
Anything else give it the name “Past 3 Months)

ALERT
When (the alert equals “GREEN”, give it the name “PAGER GREEN”,
When the alert equals “YELLOW”, give it the name “PAGER YELLOW”
When the alert equals “ORANGE”, give it the name “PAGER ORANGE”
When the alert equals “RED”, give it the name “PAGER RED”,
Anything else give it the name “NO PAGER”)

Put them all together and they are named: TIME + space in between words + MAG + space in between words + PAGER

 

One 50-foot (15 m) section of the San Francisco–Oakland Bay Bridge collapsed during the 1989 Loma Prieta earthquake.
One 50-foot (15 m) section of the San Francisco–Oakland Bay Bridge collapsed during the 1989 Loma Prieta earthquake.

 

Applying the Expression

We have our expression to classify the earthquakes by Time, Magnitude, and Alert Level.  Watch the short video to see how to apply it and rearrange the new classifications.

 

Plain white bar.

Now That We Have What We Want

Since we have just combined three attributes together, and given what those are, you might be thinking that this is going to produce a lot of results.  You are right!  This will give us 60 possible combinations!

Legend for the earthquake map showing magnitude, colors, and USGS Alert Levels.

 

Without a doubt mapping earthquakes can get complicated quickly given the various Time, Magnitude, and Alert Level combinations!

 

Arcade Makes it Possible to Map 100’s of Earthquakes Dynamically

Combining fields in Arcade is a great way to visualize your map dynamically. This is handy when you have data that has hundreds of points and also has the potential for 60 symbols.

There are resources available for using Arcade in your ArcGIS Online maps.  You can start by visiting the Arcade documentation page, Esri Technical Support, or check out this blog on Smart Mapping for other Arcade examples.  There are also a few more linked blogs below.

 

Up Next…Earthquake Mapping Part II

Keeping the symbols simple and intuitive are important for this map. Follow this link to Earthquake Mapping Part II: The Cartography of Time, Magnitude, and Alert Levels to find out how this Arcade expression gets symbolized in this complex earthquake map!

The final map is here and the app is here. Here are a couple of sneak peeks below.

 

Light Basemap

Final earthquake map image on the Light Basemap.

 

Dark Basemap

Final map on a Dark Basemap.

 

One Last Note…

I would like to thank Paul Dodd for his help with the Arcade expression. Paul’s knowledge of computers and Esri remind me of wizardry and I have tremendous gratitude for his time and thorough explanations.

By the way…I grew up in the San Francisco Bay Area in California and I experienced the devastating 1989 6.9 magnitude Loma Prieta earthquake.  I brought that experience to this project and it was a frame of reference for me.

 

 

Red, yellow, and gray dots.
Plain white bar.

About the author

Emily has worked professionally in GIS for 16 years. She has mapped elephants in Thailand, wildlife poachers in the Republic of Palau, land use related issues around Yosemite National Park, and active wildfire incidents for the State of California. Presently she is a Cartographer for Esri's Living Atlas of the World.

Connect:

Next Article

Simplify weather measurements in the field using Arcade

Read this article