The Calculate Motion Statistics tool calculates motion statistics and measures for event features based on Track ID and Start Time key fields. Calculations include distance, timespan, height, speed, acceleration, heading, and idling based on the provided time values and geometry of point-based events.

## Examples

- A city is monitoring snow plow operations and wants to better understand vehicle movement. The Calculate Motion Statistics tool can be used to determine idle locations and time spent idling, average and maximum speeds, total distance covered, and many other statistics.

## Usage notes

- The Calculate Motion Statistics tool returns all input observations, therefore, the first observation for each track will have null values for motion statistics. Until there are enough observations in the track to satisfy the history depth, the first few observations will calculate motion statistics using available observations. Once there are enough features to satisfy the History Depth, motion statistics will be calculated using the number of features indicated by the history depth.
- Idling is determined based on whether an observation has moved less than the distance tolerance and the time between observations is greater than the timespan tolerance.
- The units of the output motion statistics depend upon the units specified for the Distance Tolerance and Timespan Tolerance parameters. For example, if specifying a Distance Tolerance of 750 meters and a Timespan Tolerance of 10 minutes, the output distance fields would be in meters, the output timespan fields would be in minutes, and the output speed fields would contain values with units of meters per minute.
- The Method parameter determines how distances and other spatial calculations are made. Options include:
- Planarâ€”Euclidean calculations will be generated. Euclidean distance is measured in a two-dimensional Cartesian plane, where a straight-line is calculated between two points on a flat surface (the Cartesian plane). Euclidean distance is the more common type of distance calculation and work well when analyzing distances around features in a projected coordinate system that are concentrated in a relatively small area such as one UTM zone. Euclidean distances are referred to as planar distances.
- Geodesicâ€”Geodesic calculations will be generated. Geodesic distances account for the actual shape of the earth (an ellipsoid, or more properly, a geoid). Distances are calculated between two points on a curved surface (the geoid) as opposed to two points on a flat surface (the Cartesian plane). Consider using geodesic calculations in the following circumstances:
- The input features are dispersed (cover multiple UTM zones, large regions, or the entire globe).
- The spatial reference (map projection) of the input features distorts distances to preserve other properties such as area.
- In a real-time analytic, the tool operates in a stateful manner, allowing it to compare sequential observations to one another to calculate motion statistics. For example, how the current position, speed, altitude, and more is different from that of the previous observation.
- The Target Time Window parameter in a real-time analytic should be at least as long as the longest anticipated interval between observations for any given track. Observations older than this duration will be purged from memory in order to manage resources

- In big data analytics, one or more fields can be specified to identify tracks in addition to the Track ID field. Tracks are represented by the unique combination of one or more track fields.

## Parameters

Parameter | Description | Data Type |
---|---|---|

Input Layer | The point features for which density will be calculated. This dataset must have Track ID and Start Time key fields defined. | Features |

Timespan Tolerance | The timespan tolerance value that will be used to determine idling. Idling is determined based on whether an observation has moved less than the distance tolerance and the time between observations is greater than the timespan tolerance. | String |

Distance Tolerance | The distance tolerance value that will be used to determine idling. Idling is determined based on whether an observation has moved less than the distance tolerance and the time between observations is greater than the timespan tolerance. | String |

History Depth | The number of event observations to evaluate per track (includes the current observation). Motion calculations will be done based on this information. For example, if you set a History Depth of 3, each time a record is processed, the motion calculations such as average speed will calculate this value based off the speed of the current observation and the previous two observations. ## Note:The first few observation for each track will have null values for motion statistics. The next observations while still fewer than the history depth will have motion statistics calculated based on existing features that are less than the history depth. For example, if you set the History Depth to 3, the first features for each Track ID feature will have null motion statistics. The second and third features for each Track ID will have motion statistics calculated off the available features. | Integer |

Method | Whether the distance calculation method should be Geodesic or Planar (Euclidean). ## Note:If Planar is selected, the input points must be projected. The Project tool can be used to project the input features prior to calculating distances. | String; Allowed values: Planar | Geodesic |

Target Time Window | This setting defines the longest anticipated period of time between observations for each track. Applies to real-time analytics only. | String |

Track ID Fields (big data analytics only) | Choose the field(s) to uniquely identify features to be processed. The parameter will be auto-populated if a TRACK_ID key field is set on the Input Layer. | Fields |

## Output layer

The output layer will contain the following attributes appended to the original attributes for each feature. All statistical attributes (min, max, and more) are calculated based on the specified History Depth. The first few observations for each track will have null values for most motion statistics until there are enough observations in the track to satisfy the history depth. For example, if you set the History Depth to 3, the first three features for each Track ID feature will have null motion statistics.

##### Note:

The units of the output motion statistics depend on the units specified in the Distance Tolerance and Timespan Tolerance parameters. For example, if specifying a Distance Tolerance of 750 meters and a Timespan Tolerance of 10 minutes, the output distance fields would be in meters, the output timespan fields would be in minutes, and the output speed fields would contain values with units of meters per minute.

Field Name | Description | Field Type |
---|---|---|

Distance | Distance traveled since the previous observation. | Float64 |

TotalDistance | Total distance traveled. | Float64 |

MinDistance | Minimum distance traveled. | Float64 |

MaxDistance | Maximum distance traveled. | Float64 |

AvgDistance | Average distance traveled between observations. | Float64 |

Speed | Current speed since the previous observation. | Float64 |

CumSpeed | Cumulative speed. | Float64 |

MinSpeed | Minimum speed. | Float64 |

MaxSpeed | Maximum speed. | Float64 |

AvgSpeed | Average speed. | Float64 |

TimeSpan | The elapsed time since the previous observation. | Float64 |

TotalTimeSpan | Total elapsed time. | Float64 |

MinTimeSpan | Minimum elapsed time. | Float64 |

MaxTimeSpan | Maximum elapsed time. | Float64 |

AvgTimeSpan | Average timespan. | Float64 |

CurrentHeight | Current Height of the observation. | Float64 |

ChangeHeight | Change in height from the previous observation. | Float64 |

TotalChangeHeight | Total change in height from the first observation in the history depth to the current observation. ## Note:This can be a negative value. | Float64 |

MinHeight | Minimum height observed. | Float64 |

MaxHeight | Maximum height observed. | Float64 |

AvgHeight | Average/mean height observed. | Float64 |

Slope | Current slope of travel since the previous observation. | |

MinSlope | Minimum slope. | Float64 |

MaxSlope | Maximum slope. | Float64 |

AvgSlope | Average slope. ## Note:Average slope is calculated based on the slopes observed since the beginning of the history depth. If the history depth is 3, average slope would be the average of the slope from observation 1 to observation 2 and then from observation 2 to observation 3. | Float64 |

Acceleration | Acceleration since the previous observation. | Float64 |

TotalAcceleration | Total acceleration. | Float64 |

MinAcceleration | Minimum acceleration. | Float64 |

MaxAcceleration | Maximum acceleration. | Float64 |

AvgAcceleration | Average acceleration. ## Note:Average acceleration is calculated based on the accelerations observed since the beginning of the history depth. So if the history depth is 3, average acceleration would be the average of the acceleration from observation 1 to observation 2 and then from observation 2 to observation 3. | Float64 |

Idling | Whether or not the track is idle, based on a distance and time threshold from the previous observation. | Boolean |

TotalIdleTime | Cumulative amount of time for which idling was detected. | Float64 |

PercentageIdleTime | Percentage of time for which idling was detected. | Float64 |

Heading | Angle of travel direction (geodetic bearing, which is the angle measured clockwise from north). | Float64 |