I am struggling with what I thought would be an easy task..
Specifically, I have a Velocity RTA that needs to determine if a vehicle is speeding by looking at three successive reports and if they are all over the limit, flag a speeding violation --
So the Feed uses the UnitId as the Track_id and the Event_time as the Start_time.
In the Calculate Field I have the following Arcade --
// Get last 3 speed observations
var speeds = TrackFieldWindow("speedInMph", -2, 0);
// Check that all 3 speeds are > 25 MPH
return
Count(speeds) >= 3 &&
speeds[0] > 25 &&
speeds[1] > 25 &&
speeds[2] > 25;
But when I add some additional logic and acpture the values of count(speeds)
it's always two which is the Index not the Count. And the if I read the
Documentation properly speeds[0] is Current, Speeds[1] is previous report and
speeds[2] is two previosu of the current report.
Anway, my question is my trackFieldWindow() not correct or is something else going
on here ??