Select to view content in your preferred language

Detect Incidents - Time on Site Calculations

258
6
07-31-2024 11:33 AM
MuneerMajid
Emerging Contributor

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
6 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
Emerging Contributor

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

MuneerMajid
Emerging Contributor

Hey @PeterNasuti , I have given this several tries. The TrackFieldWindow doesnt seem to be able to grab the most recent record under the same incident and report the joined fields as expected. The field calculations are returning blank fields. I am suspecting that the filter with status ended perhaps causes this issue since the target values for the TrackFieldWindow are the located under the last 'Ongoing' status for this same incident. I am not quite sure if thats really the case though.

0 Kudos
PeterNasuti
Esri Contributor

@MuneerMajid Can you log an Esri Support case for assistance with this? If you have identified a Track ID and Start Time fields in your schema the Track functions should be returning prior values if configured correctly. Remember that the first observation for a track will return null values as there are no prior values when an analytic starts processing. This will require a screenshare to review your settings and configuration to assist.

0 Kudos
MuneerMajid
Emerging Contributor

Hi Peter, I have submitted case# 03709378 for this. Appreciate your help on this thus far. 

0 Kudos
Joanna_Nishimura
Esri Contributor

I wanted to provide an update on this issue and provide info that may be helpful for others:

I worked with MuneerMajid to further investigate this issue. In MuneerMajid's workflow, the Detect Incidents tool was being used in a Real-Time analytic.  Even though fields were specified in the Join Field parameter of the tool, those fields and their values were not being populated in the final incident point (the incident point that had a  status of “Ended”). 

The Detect Incident tool had an Open Condition spatial relationship of “Intersects” and did not use a Close Condition spatial relationship. Without a Close Condition relationship set, the tool will use the logical opposite of the Close Condition relationship.  The opposite of “Intersects” is “Disjoint,” and when “Disjoint” is used as a spatial relationship, then the Join Field values are expected to be null. 

To address this issue, we set the Close Condition spatial relationship to “Exit,” and saw the Join Field values populate.  We will be updating the documentation to address this nuance. 

0 Kudos