When trying to use the FeatureSetByAssociation Arcade function for Connectivity Association type, we are not able to fetch the associations, it just returns an empty result.
When we use the Container association type it is returning correct record counts of the associated features
For example with this first TelecomEdgeObject record, we have 12 Containment and 2 Connectivity Associations:
When we try to use Arcade:
Returns 12 as count of associated features
Returns 0 as count of associated features
What could be going wrong here? We tried creating an association(connectivity) manually, and it still does not consider it.
Any thoughts would be helpful!!
Solved! Go to Solution.
If you are looking for junction Edge associations you should use
featureSetByAssociation($feature, 'junctionEdge')
"Connected" is only for JJ associations
I recommend you check out the Arcade documentation for that method for the possible values for the association type parameter: FeatureSet functions | ArcGIS Arcade | Esri Developer.
I don't see 'connectivity' listed as a valid value. Depending on the type of connectivity you're looking for, you should be able to use one of the other association types.
Thank you @RobertKrisher,
We used the "junctionEdge" and it worked.
If you are looking for junction Edge associations you should use
featureSetByAssociation($feature, 'junctionEdge')
"Connected" is only for JJ associations
Thank you @HusseinNasser2,
We used the "junctionEdge" key string for this and it worked.
As a side note, I admire all your work and blogs on Arcade!!
I would like to know, if you have written a blog/article on how to optimize Arcade scripts? For example we have a script which takes long time to evaluate 250 records, the script(Batch Rule) picks records from the table(GeolocatorLine)--> find that record on the parent table(TelecomEdgeObject(non-spatial)--> fetch all associations(point, line, polygons)--> converts them all to Line and also does a Union--> update the row with geometry. It takes almost 3 hours to complete this.
Arcade is not well suited to heavy data processing tasks like this, think of Attribute Rules like triggers. Even when they are set to be batch rules that just means execution is deferred. Each attribute rule is run on each feature. When you run a batch rule on 250 features, you are fetching all that data and recreating the association lines 250 times, once for each feature. I recommend that you rewrite the process to use Python; it should be significantly faster.
This lets you fetch all the data and do all your analysis once, then push all the updates to your 250 features. (instead of rerunning the analysis 250 times). To help get you started I'd recommend you use the Create Association Lines tool to turn all the associations into lines.
Thank you @RobertKrisher for the suggestions!
Sure, we'll check if python implementation is possible for the overall requirement.