Select to view content in your preferred language

Calculated expression triggered without editing feature

646
6
07-06-2022 12:39 PM
DamonBreen
Regular Contributor

All,

I have a map with some defined polygons that represent specific areas field users need to patrol. I then have a tracking line that they use to show where all they have patrolled via streaming. We also have a confirmation attribute that basically says whether the area has been patrolled or not, with the default being "No". I have a calculated field that checks whether or not a tracking line intersects the patrolled area, and if so, this confirmation attribute changes to "Yes". The only problem is that they have to click on the patrolled area and edit it for the change to take place. Is there a way to set things up so that the area checks for an intersecting line and auto updates?

 

Thanks,

Damon

0 Kudos
6 Replies
jcarlson
MVP Esteemed Contributor

Are you comfortable with Python? A script that checks for the intersection and applies the relevant edits would be pretty simple, and could run at frequent intervals.

- Josh Carlson
Kendall County GIS
0 Kudos
DamonBreen
Regular Contributor
I'm not opposed to it, but I've never written code for ArcGIS outside of Arcade. I'm not even sure which code editor I would use for something like this. Would this be done in ArcGIS Pro, or in Notebooks in AGOL?
0 Kudos
jcarlson
MVP Esteemed Contributor

Either would work. If you don't have experience with writing Python, Pro might be a good place to start. You can take any geoprocessing tools (or even a model) and output the Python, or convert a tool into a scheduled task, which would require little to no actual "coding" on your part.

AGOL Notebooks have the benefit of always being on, so a recurring scheduled script would not be dependent upon leaving one of your physical machines running all the time. They cost credits to run on a schedule, but it's pro-rated based on how long the notebook runs, and a lightweight field calculation is usually very quick.

- Josh Carlson
Kendall County GIS
0 Kudos
DamonBreen
Regular Contributor
So I can create a script in Pro, that will update a web map or a feature layer stored in AGOL? I wouldn't have guessed that. I really haven't messed with the python portion of ArcGIS Pro at all. If that's the case, I imagine I have a few more use cases for this.
0 Kudos
by Anonymous User
Not applicable

How exactly does this work? I have 2 models that I run manually every afternoon. They take points collected with Quick Capture and copy them over to a Workforce Assignments layer (and run a few calculations to populate some attributes). Would converting my models to python and adding them say, a notebook in pro, ensure that every time a new point is added to Quick Capture the models will automatically process the point and add it to my assignments feature service?

0 Kudos
DamonBreen
Regular Contributor

I'm just getting into the notebooks stuff, but yes, I think it would work exactly like that. I don't have any models that I've built to try it with, but I think you can convert it to a python script and then load it into a notebook, and assign it to a monthly/weekly/daily cycle. I've created a couple now to reset two attributes once a month on 5 different layers and it seems to work pretty well.

0 Kudos