Hello all,
I am trying to return multiple attributes into a single field using attributes rules and Intersects.
For example two polygons overlap, such as a separate county and a separate state feature class, if I have a road how can I pick up the state and county attribute "name" based on intersects and place them into a single field such as "County, State"?
This will be a repeated workflow; currently running at 2.6.4 and the dataset consists of 12 feature classes that include points, lines, and polygons.
AaronCRose_0-1638285691682.png
My goal is to have the name from multiple polygons returned in the name field for the intersecting feature, see above for an example. The closest solution I could find was from @jcarlson https://community.esri.com/t5/arcgis-pro-questions/help-with-intersect-intersection-attribute-rule/m...
Points, lines, and polygons will need to have this rule applied, but once I get one its easiest enough to figure out the others.
Thanks!
Below is a basic template you can follow: this is an attribute rule that fires upon insertion or modification of a site address point and returns the value of the ZIP field of an underlying polygon called "MSD.SLCOMSD.ZipcodesMSD" (a feature class in our Enterprise/SDE db) to the site address point feature.
The if/else block is key as it checks to be sure there is a valid intersection between the point feature and the respective underlying polygon. Also, all of your features need to be in the same $datastore which is ESRI/Arcade for database.
var zip = FeatureSetByName($datastore,"MSD.SLCOMSD.ZipcodesMSD",["ZIP"], true)
var intersectLayer = Intersects(zip, Geometry($feature))
if (Count(intersectLayer) > 0) {
var layer = First(intersectLayer);
return layer.ZIP;
} else {
return null;
}
Assuming you'd like the "County, State" field in the road layer, here is one way to accomplish that:
LeePenney_0-1637766815936.png
In this example I have the state of Maine and Aroostook County in two separate feature classes, and a section of road I'd like to update the attributes of as you described.
1. Run the "Intersect" tool with all layers
LeePenney_1-1637766958055.png
2. Make a new field for the combined attributes
The updated road layer will have the state and county names in separate columns since they came from separate layers.
LeePenney_3-1637767483742.png
3. Use the field calculator to combine the different attributes into your new field
!Sate_Field! + ", " + !County_Field!LeePenney_4-1637767876946.png
LeePenney_5-1637767924755.png
Hope this helps!
AaronCRose_0-1638529841727.png
My goal is to have the name from multiple polygons returned in the name field for the intersecting feature, see above for an example. The closest solution I could find was from @jcarlson https://community.esri.com/t5/arcgis-pro-questions/help-with-intersect-intersection-attribute-rule/m...
Points, lines, and polygons will need to have this rule applied, but once I get one its easiest enough to figure out the others.