☀Everything Automotive, Tested & Explained Stories

Explore Creative ArcGIS Arcade Examples

By

ArcGIS Arcade, once referred to as Geometry Engine, is a powerful scripting language within the ArcGIS platform. It enables users to perform geospatial calculations, data analysis, and visualization. Arcade allows for complex spatial operations to be simplified, leading to more efficient and accurate results. Let's delve into some intriguing ArcGIS Arcade examples.

Before we explore specific examples, it's crucial to understand Arcade's syntactic structure. It uses a syntax similar to JavaScript, making it intuitive for those familiar with the language. Now, let's dive into practical use cases.

Spatial Operations

One of the most compelling uses of Arcade is its ability to perform spatial operations. It can calculate the distance between two features, the length of a line, or the area of a polygon.

ArcGIS Urban 101 – Projects and Plans
ArcGIS Urban 101 – Projects and Plans
ArcGIS Urban: An Introduction
ArcGIS Urban: An Introduction
Streamline Planning and Community Development
Streamline Planning and Community Development

Example: ``` var distance = $feature Length along ($feature, "start_location", "end_location"); ``` The above script calculates the distance along a line from start_location to end_location.

Distance Calculation

Arcade can compute the closest facility or the shortest route between two points. Here's a simple example: ``` var shortest_distance = $features 'editing:closest_facility'($feature); ``` This expression calculates the shortest distance to the closest facility from the current feature.

QGIS vs ArcGIS Pro
QGIS vs ArcGIS Pro
Raster and Vector Data in ArcGIS
Raster and Vector Data in ArcGIS
Enterprise GIS System | Cloud-Native Geospatial Software | ArcGIS Enterprise
Enterprise GIS System | Cloud-Native Geospatial Software | ArcGIS Enterprise

Similarly, you can calculate the shortest route with:

``` var shortest_route = $feature 'editing:shortest_route'($feature, "start_point", "end_point"); ``` This calculates the shortest route between start_point and end_point.

Feature Geometry Manipulation

Arcade allows for manipulation of feature geometries. You can shift a feature's location, change its shape, or even add new features to the map. ``` var shifted_feature = $feature Shape 'shift'($feature, "x_offset", "y_offset"); var new_feature = 'create_point'($feature, "lat", "long"); ``` The first line shifts the feature's location by x_offset and y_offset. The second line creates a new point feature at the specified latitude and longitude.

an open laptop computer sitting on top of a desk
an open laptop computer sitting on top of a desk
ArcNews Fall 2004 Issue -- ArcGIS Raster Data Models
ArcNews Fall 2004 Issue -- ArcGIS Raster Data Models
a computer screen showing an image of a city with lots of different colored blocks and shapes
a computer screen showing an image of a city with lots of different colored blocks and shapes
a poster with instructions for geoprocesing overlay and extra tools
a poster with instructions for geoprocesing overlay and extra tools
arcgis
arcgis
Quick tips for mastering the ArcGIS StoryMaps builder
Quick tips for mastering the ArcGIS StoryMaps builder

Attribute Data Processing

Arcade can extract, manipulate, and aggregate attribute data. It can compute statistics, concatenate strings, or convert data types.

Example: ``` var total_population = $feature 'sum'($record. Population); var concatenated_name = $record. First_Name + " " + $record. Last_Name; var converted_date = $feature 'dateformat'($feature. 'Date_of_Birth', 'yyyy-MM-dd'); ``` The first line calculates the total population. The second concatenates the first and last name fields. The third converts a date field to a specific format.

Conditional Logic

Arcade supports conditional logic using the if-else statement. This allows for complex if-then-else logic to be performed on feature attributes. ``` var category; if ($feature. Amount > 1000) { category = 'High'; } else if ($feature. Amount > 500) { category = 'Medium'; } else { category = 'Low'; } ``` This script assigns a category based on the 'Amount' attribute.

ArcGIS Online Basemaps Styles Customization Using ArcGIS Vector Tile Editor
ArcGIS Online Basemaps Styles Customization Using ArcGIS Vector Tile Editor
What is ArcGIS? - SlideServe
What is ArcGIS? - SlideServe
Learn How to Be a Storyteller | ArcGIS StoryMaps Resources, Blog, Help
Learn How to Be a Storyteller | ArcGIS StoryMaps Resources, Blog, Help

In conclusion, ArcGIS Arcade opens up a world of possibilities for automating workflows, performing complex calculations, and enhancing the user experience within the ArcGIS platform. Its intuitive syntax and robust functionality make it an invaluable tool for any GIS professional. So, start exploring and building your own Arcade scripts today!