arcgis pro arcade examples

"ArcGIS Pro Arcade Scripts: Examples & Tutorials"

By Daniel Taylor
AD

Are you looking to take your GIS projects to the next level with ArcGIS Pro? One of the most powerful features of this software is its Arcade expression language, which allows you to perform calculations, make decisions, and format data directly in your maps and layouts. In this article, we'll explore some practical examples of how you can use Arcade in ArcGIS Pro to enhance your workflows and create more dynamic and interactive maps.

Understanding Arcade Expressions

Before we dive into the examples, let's briefly recap what Arcade expressions are. Arcade is a lightweight, interpreted, and easy-to-learn expression language that's built into ArcGIS Pro. It uses a simple syntax and a set of built-in functions to perform operations on data. Expressions can be used in various places within ArcGIS Pro, such as:

  • Symbology rules to control how features are symbolized
  • Labeling expressions to control what text is displayed and how it's formatted
  • Popup expressions to display dynamic content in a feature's popup
  • Data driven pages and layouts to create dynamic maps and reports

Arcade Examples in ArcGIS Pro

Example 1: Symbolizing Features Based on a Field Value

One of the most common uses of Arcade is to control the symbology of features based on a field value. Let's say you have a point feature class of parks, and you want to symbolize them differently based on their size (in acres). You can use the following Arcade expression in the symbology rule:

AD
an image of some red and black paper with different designs on it, including the letter snk
an image of some red and black paper with different designs on it, including the letter snk
Arcade
Arcade
an image of some video game characters in the shape of a paper cutout,
an image of some video game characters in the shape of a paper cutout,

$feature.Area > 100 ? "Large Park" : "Small Park"

In this expression, if the area of the park is greater than 100 acres, it will be classified as "Large Park"; otherwise, it will be classified as "Small Park".

2-Player Bartop Arcade Machine (Powered by Pi)
2-Player Bartop Arcade Machine (Powered by Pi)
four different images of mario and luigi's shoes with the names of their characters
four different images of mario and luigi's shoes with the names of their characters
Home Arcade Machine Part 7 - Cabinet Plans | Retromash
Home Arcade Machine Part 7 - Cabinet Plans | Retromash

Example 2: Formatting Labels Based on Feature Type

You can also use Arcade to control the formatting of labels. Let's say you have a line feature class of rivers, and you want to display the name of each river in a different font style depending on whether it's a major or minor river. You can use the following Arcade expression in the label's text symbol:

$feature.Type == "Major" ? "Bold Italic" : "Regular"

AD

In this expression, if the type of the river is "Major", the label will be displayed in bold italic font; otherwise, it will be displayed in regular font.

ARC P2
ARC P2
Come ho costruito un Bartop Arcade
Come ho costruito un Bartop Arcade
an arcade with neon lights and pool tables
an arcade with neon lights and pool tables
The Madness of Sega’s Arcade Super Circuit
The Madness of Sega’s Arcade Super Circuit
an old arcade game with neon colors and planets in the background, as well as other items
an old arcade game with neon colors and planets in the background, as well as other items
Bartop Arcade Kit Deluxe - Cam Lock, Graphics, Control Kit
Bartop Arcade Kit Deluxe - Cam Lock, Graphics, Control Kit

Example 3: Displaying Dynamic Content in Popups

Arcade can also be used to display dynamic content in feature popups. Let's say you have a polygon feature class of countries, and you want to display the population density in the popup. You can use the following Arcade expression in the popup's content:

"Population Density: " & ($feature.Population / $feature.Area).toFixed(2) & " people per square kilometer"

AD

In this expression, the population density is calculated by dividing the population by the area, and the result is displayed in the popup with a fixed precision of 2 decimal places.

Burgercade Opens In Riverhead With Burgers, Arcade Games, Nostalgia
Burgercade Opens In Riverhead With Burgers, Arcade Games, Nostalgia
How to Make Games in MakeCode Arcade
How to Make Games in MakeCode Arcade
Building a Home Arcade Machine - Cabinet Design | Retromash
Building a Home Arcade Machine - Cabinet Design | Retromash
an animated video game room with arcade machines
an animated video game room with arcade machines
Easy Cab (arcade)
Easy Cab (arcade)
The Internet Arcade, A Large Collection of Coin-Operated Arcade Games Playable in a Web Browser
The Internet Arcade, A Large Collection of Coin-Operated Arcade Games Playable in a Web Browser
an image of the back side of a car with different colors and numbers on it
an image of the back side of a car with different colors and numbers on it
DIY Arcade Controller — cuddleburrito
DIY Arcade Controller — cuddleburrito
an old computer game with hearts and numbers on the screen, which reads score ranking
an old computer game with hearts and numbers on the screen, which reads score ranking
Comment construire sa borne d'arcade - Plan à télécharger
Comment construire sa borne d'arcade - Plan à télécharger
\
\
Bigger Bartop Arcade Build
Bigger Bartop Arcade Build
Comment construire sa borne d'arcade ?
Comment construire sa borne d'arcade ?
All in One Arcade System
All in One Arcade System

Example 4: Creating Data-Driven Pages and Layouts

Arcade can be used to create dynamic maps and reports using data-driven pages and layouts. Let's say you have a point feature class of schools, and you want to create a report that displays the number of students in each school. You can use the following Arcade expression in the data-driven page's filter:

$feature.Students > 500

AD

In this expression, only the schools with more than 500 students will be included in the report. You can also use Arcade expressions in the layout's text elements to display dynamic content, such as the school's name, address, and number of students.

Example 5: Performing Calculations on the Fly

Arcade can also be used to perform calculations on the fly, such as calculating the distance from a point to a line or polygon. Let's say you have a point feature class of customers, and you want to calculate the distance from each customer to the nearest store. You can use the following Arcade expression in a new field calculator:

$feature.geometry.distanceTo(near($feature, "Stores", "NEARést_Store"))

In this expression, the distance from each customer to the nearest store is calculated using the `distanceTo()` function and the `near()` function to find the nearest store.

Example 6: Making Decisions Based on Multiple Factors

Arcade can also be used to make decisions based on multiple factors. Let's say you have a point feature class of properties, and you want to symbolize them based on their value and zoning. You can use the following Arcade expression in the symbology rule:

switch($feature.Value > 100000, "High Value", $feature.Zoning == "Residential", "Residential", "Other")

In this expression, if the value of the property is greater than $100,000, it will be classified as "High Value"; otherwise, if the zoning is "Residential", it will be classified as "Residential"; otherwise, it will be classified as "Other".

Tips for Working with Arcade in ArcGIS Pro

Here are some tips to help you get the most out of Arcade in ArcGIS Pro:

  • Use the Arcade expression builder to help you create and test expressions. You can access it from the expression editor's toolbar.
  • Use comments in your expressions to make them easier to read and maintain. You can add comments by prefixing a line with `//`.
  • Use parentheses to group expressions and control the order of operations.
  • Use the `toString()` function to convert numbers to strings, and the `toNumber()` function to convert strings to numbers.
  • Use the `switch()` function to simplify expressions with multiple conditions.

Arcade is a powerful tool in ArcGIS Pro that can help you create more dynamic and interactive maps and reports. By using Arcade expressions in your symbology, labeling, popup, data-driven pages, and layouts, you can unlock new possibilities and take your GIS projects to the next level.

AD