Below is the arcade expression I'm using to intersect my field maps collection layers with the UTM grid layer in order to return the zone value in a field. This works fine for points but in the case for lines and polygons they might span two UTM zones. I'm trying to develop a way to deal with this. I was thinking I could tweak this expression in order to return the value of the grid polygon the line or polygon overlaps with the most. Wondering if anyone knows how to do that? Would I have to get the length or area first then return the value based on that number?
If anyone has an easier solution please let me know.
Arcade Expression:
var UTMgrid = Intersects(FeatureSetByName($map, "UTM Zone Grid"), $feature)
var zone = false;
for (var g in UTMgrid){
zone=true;
}
if (zone==true){
return Text(g.Zone);
}
else{
return "No Data";
}