I have 2 layers . One is an administrative boundary (polygon) and the other is a centroid of houses (points).
I want to calculate the number of houses *automatically* as soon as the polygon has been finished and drawn up.
how can I achieve that? I am using Arcgis Pro 3.1
QGIS has this capability https://geogear.wordpress.com/2015/01/14/spatialjoin-v1-0/
Hi - you need to set up an immediately calculation attribute rule:
Which will run some Arcade code when a new feature is inserted into your geodatabase feature class. The Arcade code to run will get a Count of the Intersects because the new $feature and the house centroid points layer made into a feature set. https://community.esri.com/t5/arcgis-online-questions/arcade-expression-to-count-points-in-polygons/...
It does not work. There is error: "Invalid Expression. Error Line 1: Object Not Found. $map".
This is what I have tried:
var features = FeatureSetByName($map,'mylayer', ['*'], true); (I also tried FeatureSetById)
$feature.atribute1 = Count(features);
I have 'mylayer' as one of the layer on my layer list and 'atribute1' as one of the colomn name.
I am using Arcgis Pro 3.1.0 and all data are in File Geodatabase
I have my polygon feature class and point feature class (Point_1) in the same geodatabase. And set up this immediate calculation attribute rule on inserts. So when I draw a new polygon, it automatically calculates the number of intersecting points and puts it into the count_from_att_rule field.
var points = FeatureSetByName($datastore, "Point_1")
var countPoints = Count(Intersects(points, $feature))
return countPoints