Select to view content in your preferred language

Allow Arcade Expressions in parameters of Geoprocessing tools

1057
2
07-15-2022 09:58 AM
Status: Open
Labels (1)
RichardFairhurst
MVP Honored Contributor

One of the improvements introduced in ArcGIS Pro is the ability to use Arcade expressions not only as a replacement language where ArcMap used languages like Python or VB Script, such as Labels and Display Expressions, but in new places where ArcMap does not support custom expressions as inputs, such as the Symbology tab.  In ArcMap, the Symbology tab only takes existing fields as valid inputs for the unique value category symbology options or the quantities symbology options, which does not allow the user to apply reclassified values or unit conversions to the values in a field without calculating over the values or adding and calculating a new field.  However, in ArcGIS Pro the user can use an Arcade Expression instead of a field that can eliminate the need to create or calculate any field in the source data to accomplish symbology effects that present the data under classifications or in units of measure that are not directly stored in the source attributes.

However, while applying an Arcade expression to the Symbology tab gives the appearance that the features have merged and dissolved together based on the user defined custom field values, the underlying features have not actually dissolved according to that Arcade expression and cannot be used in a geoprocessing workflow that needs an actual Dissolved feature class that is based on the case values the user custom defined using Arcade.

To create the actual Dissolve feature class in ArcGIS Pro the user still needs to add a new field to the source data and calculate the values to be stored in the table prior to running the Dissolve tool.  This becomes a real problem when the user has to make a copy of the source data in order to make changes to the schema and the source features class is very large and is only updated on a relatively small percentage of its features each day.  The geoprocessing steps required simply to copy the source data, add the field and calculate its values are extremely time consuming and can take up the bulk of the time required to rerun many geoprocessing models if the user is trying to maintain outputs that approach anything resembling real time concurrency with the underlying large data sources. 

However, if I was able to use an Arcade Expression for the Summary fields or Case field in the geoprocessing tools that do aggregation, like the Dissolve tool, Summary Statistics tool, Frequency tool or Spatial Join tool, I could accomplish the same thing that an Arcade expression now can accomplish in the Symbology tab, but actually output a feature class rather than just the artificial appearance of that dissolve in a map that is only accessible in my project and not suited for further geoprocessing analysis.  If Arcade was incorporated into those tools to extend the options available in the parameters that currently only accept fields as inputs, I would be able to eliminate all of the geoprocessing steps currently required to copy the source data and add fields calculated with custom field values to achieve the desired reclassified geoprocessing output.

Although not all geoprocessing tool parameters may be suitable to be extended to allow Arcade expressions as alternatives to the standard validated parameter types and the introduction of Arcade into geoprocessing tools presents new challenges for validating the tool parameters, the value of the time saved by users would more than justify the effort in many cases, like the aggregation tools I mentioned.  I am sure that many temporary files currently required to carry out most geoprocessing workflows could be eliminated if Arcade was introduced as an option for at least some of the existing geoprocessing tool parameters.  Additionally, incorporating Arcade expressions as an option directly implemented for at least some of the geoprocessing parameters would make Arcade even more more portable and reusable across the platform and support the creation of a much larger array of outputs that not only can be used within ArcGIS Pro application itself, but can be used to create outputs that could be exported in formats that are suitable for external use in such things as Traffic Models.

2 Comments
AlfredBaldenweck

Yes!

I recently ran into an issue where using Arcade was far more flexible and user-friendly than the alternatives for that workflow.

Arcade is incredibly friendly to write (I only know how to calculate field in Arcade, for example); I think we could benefit from it having more applications and uses. Using it for aggregation is a great example.

feralcatcolonist_old

Obviously having a dissolve be able to respond to an arcade expression would open a lot of excellent shortcuts. Being able to subdivide established fields, or piece together disparate fields based on calculations; classifying data in-place. Like @RichardFairhurst explained about, this cuts out the step of needing to export production data, add field(s), and calculate those field(s) if it could be done at point of sale.

A little thing like this would require at least two steps in the current method: LEFT($feature.ZIPCODE,5)

I think that allowing it on the stats could work as well, the Arcade might need a higher level of verification, aside from does it run?

In my mind I see something like this:

feralcatcolonist_0-1658937920704.png

feralcatcolonist_1-1658937929760.png

 

All of those tools are great ideas. People who don't normally use Arcade may continue to use the tools as they always have-- --but those that use Arcade regularly can greatly speed-up simplify their workflows.