List of related table from intersect features

235
0
08-18-2023 05:28 AM
mfafard
New Contributor II

Hi

I want to have the list from of attributes in a related table that come from features object that intersects a polygon (attribute rule: list of road signs from intersected poles).

 

I have the error "Entité attendue" in french (Feature needed?) at line 5 of the following code.

Thanks for help

 

 

var supports = FeatureSetByName($datastore, "SIG.Support", ["interventionsupporttxt"]);
var inter = Intersects(supports, $feature);

// Have a list of road panels from supports
var panneaux = FeatureSetByRelationshipName(inter, "SIG.Support_PanneauSignalisation", ["interventionpanneautxt"]);

// Statistics for road panel
var panneauStats = GroupBy(panneaux, "interventionpanneautxt", [{ name: 'NbrInterventionParPanneau', expression: '1', statistic: 'COUNT' }]);

// Final output
var finalOutput = "";
for (var stat in panneauStats){
finalOutput += panneauStats[stat].NbrInterventionParPanneau + " " + panneauStats[stat].value + TextFormatting.NewLine;
}

return finalOutput;

0 Kudos
0 Replies