We have recently made the move to ArcGIS Pro for everything except our 911 Addressing. We are searching for an Attribute rule that would allow us to take attribute data from several polygon layers and put them into our address layer. In other words, we want to enter a new address point and have the attribute rule to go out and find certain data (ESN, Community, Senate, House, JP District, etc.) and enter that into our Address layer. We were able to do this in ArcGIS Desktop using a script but that script will not work in Attribute rules. Unfortunately, I do not understand Arcade and I'm pretty limited with vbscript. I'm hoping that there is someone out there that has built something like this that would share it with me.
Thank You all in advance.
Solved! Go to Solution.
The trick with getting values from underlying polygon features is those features have to reside in the same "datastore" as your points. The datastore is nothing more than than the database, be it FGDB or EGDB that holds your data. It's a limitation of Arcade. However, here is a rule that I apply to get underlying zip code onto a site address point:
var zip = FeatureSetByName($datastore,"MSD.SLCOMSD.ZipcodesMSD",["ZIP_MOD_ID"], true)
var intersectLayer = Intersects(zip, Geometry($feature))
if (Count(intersectLayer) > 0) {
var layer = First(intersectLayer);
return layer.ZIP_MOD_ID;
} else {
return null;
}
Here I'm extracting the value of the field ZIP_MOD_ID from the ZipcodesMSD layer in our SDE database. The if statement makes sure there is an intersecting layer to the point; @XanderBakker guided me through this one so all my intersecting rules check for that first.
I'm assuming the script you had running while using Desktop was a PYTHON script. That being the case, why can't you run that same script in PRO? Import that script to your toolbox and run it.
Hi @TINATHOMPSON ,
@AlexRodriguez has a valid point. If you have a Python script that worked in ArcMap chances are high that it will work in Pro too (maybe with some slight modifications). A potential downside could be that you need to create some sort of trigger to execute the script to update the data when changes are made. You can work with scheduled tasks in Pro.
Now, using attribute rules may have the advantage that updating the data will trigger the attribute rule and update the data so you will always look at updated information and are not depending on a manual or scheduled update. It will require you to rewrite the code, your data must reside in the same data store and they must have GlobalIDs...
@TINATHOMPSON check this blog. I don't work in 9-1-1 anymore but I still do addressing and I use the ESRI Address Data Management Solution. I augmented the solution with a couple of my own rules that grab underlying polygon data to populate address points. I really like the solution for addressing, but will be the first to tell you that the Arcade portion can be a challenge; but that's what this forum is for. Just ask @XanderBakker how many times he helped me out...
The trick with getting values from underlying polygon features is those features have to reside in the same "datastore" as your points. The datastore is nothing more than than the database, be it FGDB or EGDB that holds your data. It's a limitation of Arcade. However, here is a rule that I apply to get underlying zip code onto a site address point:
var zip = FeatureSetByName($datastore,"MSD.SLCOMSD.ZipcodesMSD",["ZIP_MOD_ID"], true)
var intersectLayer = Intersects(zip, Geometry($feature))
if (Count(intersectLayer) > 0) {
var layer = First(intersectLayer);
return layer.ZIP_MOD_ID;
} else {
return null;
}
Here I'm extracting the value of the field ZIP_MOD_ID from the ZipcodesMSD layer in our SDE database. The if statement makes sure there is an intersecting layer to the point; @XanderBakker guided me through this one so all my intersecting rules check for that first.
Thank you for your help. I've been doing this for 30+ years, I'm ready to retire as well. I have found the python script that we used to use and I'm going to try it, as well as possibly look at your solution.
Hi @JoeBorgione ,
Quick question... would you create multiple rules since the OP needs to update values from multiple layers or would you use a single attribute rule? If it is the latter, I suppose the return value should be changed to include multiple values. I was looking for an example of this and can't find any, but I suppose it should be similar to updating another feature layer, right?
Hey @XanderBakker ; for each layer I have a rule. I did it that way because each layer has a value for a different field in my site address points:
Municipalities layer provides a city name for the point field CITY
Zip code layer provides a numeric zipcode value for the point field ZipCode
etc... For a 9-1-1 application there would be feature layers like PoliceBeat, FireZone, EMTZone etc...
I don't know how to construct a single attribute rule for multiple attributes.
Hi @JoeBorgione ,
Thanks for getting back. It makes sense what you are saying. I think it should be possible to return multiple values in a single Attribute Rule, but I haven't seen examples of this. I do suppose that it follows the same logic as the "Edit another feature class with a calculation rule" example here: https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-script-expre...
(but I am not sure)