Select to view content in your preferred language

Detect Incidents - Time on Site Calculations

96
2
3 weeks ago
MuneerMajid
New Contributor III

As we know, Detect Incidents for Geofences reports the results with a Status flag ('Started', 'Ongoing', 'Ended'). There is also an accompanying Incident Duration Field along with other joined fields that come out of your Geofence/polygon layers. 

There is no slick way (that I am aware of) of reporting time on site against each geofence using this information. The incident status 'Ended' field should typically have the total time spent on site, but since this observation was recorded outside of the geofence, it doesnt include any information from the join fields and leaves them blank. If this wasnt the case, you could simply have a filter for IncidentStatus = Ended and could have reported each Geofence incident with the Track ID, Geofence Name/ID (from Join Field) and time on site. 

I have tried to figure out an efficient way within arcade to isolate this information, but havent been able to figure this out yet. Anyone who has been able to effectively translate this info directly from the Detect Incidents Output table, appreciate if you can shed some light on your observations/learning. 

0 Kudos
2 Replies
PeterNasuti
Esri Contributor

I would configure a Filter by Expression tool ($feature.IncidentStatus == 'Ended') followed by a Calculate Fields tool. In the Calculate Fields tool expression, you can use a TrackFieldWindow function to obtain the prior IncidentDuration value as well as the joined field value.

 

var lastInsideDuration = TrackFieldWindow('IncidentDuration', -1,0)
var lastIntersectFeatureName = TrackFieldWindow('YourGeofenceIdentifierField', -1,0)

 

Use Track Functions documentation for additional reference. Let me know if there are questions on this.

MuneerMajid
New Contributor III

@PeterNasuti  I am going to try this out, TrackFieldWindow sounds like it could be the solution.