ArcGIS Business Analyst

Data-driven trade areas with Arcade expressions

This is the 1st article in a 5-part series highlighting new capabilities in the ArcGIS Business Analyst Pro 2.7 release from December 2020.

This latest release adds support for Arcade expressions in several geoprocessing tools.  This capability allows flexibility in building data-driven trade areas for just about any scenario you can think of.

Arcade expressions, in fact, are amazing.  To show that’s not hyperbole, in this article I will do the following:

  1. Walk through three use cases highlighting trade area customization
  2. Provide the sample scripts from each scenario – that you can modify and reuse
  3. Wrap it all into a video to see them in action.

As a bonus, I’ve also added the project package for download so you can try everything you see and read in this article, at home.

These new capabilities are in high demand.  Check out this GeoNet post where a user was asking about them in early 2020.  We read them all(!) and want to help.

Here is the video:

 

Now let’s walk through the scenarios covered in the video and provide sample scripts:

Scenario 1:  Controlling input parameters with field names to create multiple ring sizes

This first example uses street names to control the input type and shows how to build trade areas where different sites have both different sizes and different sets of rings.

The expression says:  If a street name is “West or East Front Street” – kindly create a 50 meter buffer (blue).  For all other street locations, create two buffers of 25 and 30 meters (yellow and orange).

Here is the Arcade code:

if ($feature.STREET == “W FRONT ST”) {return 50} if ($feature.STREET == “E FRONT ST”) {return 50} else {return [25, 30]}

Rings around WiFi locations
Input types built using field names to control ring sizes and the number of rings per location.

Scenario 2:  Using data-driven values to control input types to build multiple drive time sizes

This second example uses an expression to control the size of a drive time, based on a value in my data.  Here my organization classifies facility locations using numeric codes as either urban or rural sites.  Customers at rural locations will typically drive farther for services and I want to model that.

The expression says:  Use the field “Urban_Rural_Class” where 1 is urban and 2 is rural – create a 3-minute drive time boundary for urban locations (shown at center), and a 10-minute drive time for rural locations.

Here is the Arcade code:

if ($feature.URBAN_RURAL_CLASS == “1”) {return 3} if ($feature.URBAN_RURAL_CLASS == “2”) {return 10}

Drive Times
Differing drive time sizes based on input data values.

Scenario 3:  Using data ranges to control input types to build multiple buffers

This third example uses an expression to build threshold rings using data ranges, essentially combining several input locations into groups.  After identifying these I can customize the size of the trade areas to specific to the different groups.

The expression says:  For any business with employees in the 100 to 300 range, return an area that grows until 10,000 people are found (red).  For all other smaller businesses, find an area containing 500 people (green).

Here is the Arcade code:

if (($feature.EMPNUM <= 300) && ($feature.EMPNUM > 100)) {return 10000} else {return 500}

Threshold rings built using data ranges.
Threshold rings built using ranges of data values for multiple locations.

These are just a few simple examples to share and believe me, they can get crazy complex (i.e. anything is possible!).  We have plans to provide plenty of Arcade resources this year.  Using expressions will give you increased control in your inputs and outputs, all the while saving time and clicks in your workflows.

The following distance-based Business Analyst Trade Area Geoprocessing tools support Arcade expressions:

Additional information about ArcGIS Arcade can found at:  https://developers.arcgis.com/arcade/ . We’re so happy to share these enhancements with you.  Please reach out and let us know if you have any questions about Arcade expressions of any other capabilities in ArcGIS Business Analyst.

Email the team: businessanalyst@esri.com

Below you can find some links for Business Analyst that you may find useful.

About the author

Kyle is a Lead Product Engineer with Esri - focusing on geospatial technologies and demographics to develop next generations of ArcGIS Business Analyst apps - used by organizations to discover patterns and predict change.

Leave a Reply

Please Login to comment

Next Article

Community-Sourced Content Added to Basemaps and Imagery

Read this article