Calculate Motion Statistics

Tool icon Available in real-time and big data analytics.

The Calculate Motion Statistics tool Calculate Motion Statistics calculates motion statistics and measures for observations based on the key fields specified for the Track ID and Start Time options. Calculations include distance, time span, height, speed, acceleration, heading, slope, and idling based on time values from the Start Time option and geometry of point-based events.

Example

A city is monitoring snowplow operations and city officials want 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, average distance traveled between observations, and other statistics.

Usage notes

Keep the following in mind when working with the Calculate Motion Statistics tool:

  • The Calculate Motion Statistics tool has a State Store Depth parameter to specify the value for the number of observations per track used to calculate motion statistics option. This value determines the number of observations the tool caches per track in the state store. As new observations for a track are received, older observations of the same track are deleted. The tool uses the observations in the state store to calculate motion statistics.
    • For example, if the State Store Depth parameter is set to the Motion statistics are calculated using the last 5 observations per track option, the current observation and previous four observations are used to calculate statistics, such as minimum acceleration, maximum speed, and average distance traveled per observation.
    • Three observations per track are required to calculate acceleration values, so this parameter must be set at a positive integer value greater than or equal to three.
    • Not all motion statistics are calculated using all observations in the state store. For example, the Idling statistic is calculated using only the current observation and the previous observation.
  • The tool outputs all input observations. As a result, the first observation for each track contains null values for motion statistics because there are no previous observations in the state store to use for calculations. Until there are enough observations in the track to meet the State Store Depth value, motion statistics are calculated using the available observations from the state store. Once there are enough observations to meet the State Store Depth value, motion statistics are calculated using the number of observations specified.
  • In real-time analytics, the Calculate Motion Statistics tool provides a parameter to determine the value for the Maximum amount of time to retain observations for a track option. Observations are deleted from the state store after the specified time has exceeded the key field specified for the Start Time option.
    • For example, if a value of one hour is used, all observations with a Start Time value that is not within an hour of the current time are deleted from the state store.
    • If this parameter deletes observations from the state store and there are not at least two observations per track remaining, no statistics can be calculated for the current observation. At least three observations per track are required to calculate acceleration statistics.
  • This tool has two parameters to determine whether an observation is idling. In the user interface, these appear as Observations are idling if they have moved less than or equal to <Idle Distance Tolerance (distance units)> and more than <Idle Time Tolerance (time units)> has elapsed since the last observation.
    • Idling is set to True if the distance between the current observation and the previous observation is less than or equal to the Idle Distance Tolerance parameter value and the duration between the current observation and the previous observation is greater than the Idle Time Tolerance parameter. Idling is set to False if one or both of these conditions are not met.
    • For example, if Idle Distance Tolerance is set to 50 meters and Idle Time Tolerance is set to 5 seconds, an observation would be considered as idling if the distance between the current and previous observation was 45 meters and the duration between the Start Time values of the current and previous observations was 6 seconds. If the duration between the current and previous observations was 5 seconds instead, the feature would not be considered idling, since only the Idle Distance Tolerance condition is met.
  • The unit of measurement for the output motion statistics depends on the unit of measurement specified for the Idle Distance Tolerance and Idle Timespan Tolerance parameter values. For example, if you specify a Idle Distance Tolerance parameter value of 750 meters and an Idle Timespan Tolerance parameter value of 10 minutes, the output distance fields are in meters, the output time span fields are in minutes, and the output speed fields contain values with a meters-per-minute unit of measurement.
  • The Method parameter defines how distances and other spatial calculations are made. Options include the following:
    • Planar—Euclidean calculations are generated. Euclidean distance is measured in a two-dimensional Cartesian plane in which a straight line is calculated between two points on a flat surface, otherwise known as the Cartesian plane. Euclidean distance is the more common type of distance calculation and works 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 are 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 covering multiple UTM zones, large regions, or the entire globe.
      • The spatial reference, or 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 other statistics are different from that of the previous observation.
  • In real-time analytics, the Calculate Motion Statistics tool maintains a state store of the current observation for each track ID. The State Store Depth parameter determines the size of this state store per track. When a new observation is received, it is compared to the current observation of the same track ID, if present, to calculate motion attributes. If the new observation has a newer time stamp than the current observation in the state store, the current observation is replaced. If it has an identical time stamp to the current observation for the same track ID, the tool does not distinguish between the two observations. This means the tool does not replace the current observation in the state store with the new observation, the new observation is not added to the state store, and future observations for this track ID are compared to the current observation that remains in the state store until a new observation arrives with a later time stamp. A warning is logged by the tool when this occurs.
  • In big data analytics, one or more fields can be specified to identify tracks in addition to the one specified for the Track ID option. Tracks are represented by the unique combination of one or more track fields.

Parameters

The following are the parameters for the Calculate Motion Statistics tool:

ParameterDescriptionData type
Input Layer

The point observations for which motion statistics are calculated.

This dataset must have key fields defined for the Track ID and Start Time options.

Features

Idle Timespan Tolerance

The idle time span tolerance value is used to determine idling.

Idling is set to True if the distance between the current observation and the previous observation is less than or equal to the Idle Distance Tolerance parameter value, and the duration between the current observation and the previous observation is greater than the Idle Time Tolerance parameter. Idling is set to False if one or both of these conditions are not met. 

String

Idle Distance Tolerance

The idle distance tolerance value is used to determine idling.

Idling is set to True if the distance between the current observation and the previous observation is less than or equal to the Idle Distance Tolerance parameter value and the duration between the current observation and the previous observation is greater than the Idle Time Tolerance parameter. Idling is set to False if one or both of these conditions are not met.

String

State Store Depth

The number of cached observations per track in the state store, including the current observation. Motion statistics are calculated based on the observations in the state store.

For example, if you set a State Store Depth value of 3, each time an observation is processed, motion statistics calculations such as average speed are calculated based on the speed of the current observation and the previous two observations. Not all motion statistics are calculated using all observations in the state store, such as Idling, which uses the current observation and previous observation only.

Note:

The first observation for each track has null values for motion statistics, as there are no previous observations in the state store to use for calculations. Until there are enough observations in the track to meet the State Store Depth value, motion statistics are calculated using all available observations from the state store. Once there are enough observations to meet the State Store Depth value, motion statistics are calculated using the number of observations specified.

For example, if you set the State Store Depth value to 3, the first observation for each track has null motion statistics (based on the key field specific in the Track ID option). The second observation has motion statistics calculated based on the current and previous observations. For all following observations, motion statistics are calculated from available observations (three observations per track).

Integer

Method

Specifies whether the distance calculation method is Geodesic or Planar (Euclidean).

Note:

If Planar is chosen, the input points must be projected. You can use the Project tool to project the input features before calculating distances.

String

Allowed values: Planar | Geodesic

Maximum time to retain observations

(real-time analytics only)

Observations are deleted from the state store after the specified amount of time has exceeded the key field specified for the Start Time option.

For example, if a value of one hour is used, all observations with a start time that is not within an hour of the current time are deleted from the state store.

Caution:

If this parameter deletes observations from the state store and there are not at least two observations per track remaining, no statistics can be calculated for the current observation. At least three observations per track are required for calculating acceleration statistics.  

String

Track ID Fields

(big data analytics only)

The fields that uniquely identify features to be processed. If a track ID field is specified, the Track ID value is automatically set on the Input Layer value.

Fields

Output layer

The output layer contains the attributes described below appended to the original attributes for each feature. Note that some statistics are calculated using only the previous and current observations while others use all observations in the state store.

Note:

The unit of measurement for the output motion statistics depends on the unit of measurement specified for the Idle Distance tolerance and Idle Timespan tolerance parameter values. For example, if you specify an Idle Distance tolerance parameter value of 750 meters and an Idle Timespan tolerance parameter value of 10 minutes, the output distance fields are in meters, the output time span fields are in minutes, and the output speed fields contain values with a meters-per-minute unit of measurement.

Field nameDescriptionCalculated usingField type

Distance

The distance traveled since the previous observation.

Current and previous observations

Float64

TotalDistance

The total distance traveled from the oldest observation in the state store to the current observation.

All state store observations

Float64

MinDistance

The minimum distance traveled between observations.

All state store observations

Float64

MaxDistance

The maximum distance traveled between observations.

All state store observations

Float64

AvgDistance

The average distance traveled between observations.

All state store observations

Float64

Speed

The current speed since the previous observation.

Current and previous observations

Float64

CumSpeed

The cumulative speed.

All state store observations

Float64

MinSpeed

The minimum speed.

All state store observations

Float64

MaxSpeed

The maximum speed.

All state store observations

Float64

AvgSpeed

The average speed.

All state store observations

Float64

TimeSpan

The time elapsed since the previous observation.

Current and previous observations

Float64

TotalTimeSpan

The total time elapsed from the oldest observation in the state store to the current observation.

All state store observations

Float64

MinTimeSpan

The minimum time elapsed between observations.

All state store observations

Float64

MaxTimeSpan

The maximum time elapsed between observations.

All state store observations

Float64

AvgTimeSpan

The average time span between observations.

All state store observations

Float64

CurrentHeight

The current height of the observation.

Current observation

Float64

ChangeHeight

The change in height from the previous observation.

Current and previous observations

Float64

TotalChangeHeight

The total change in height from the oldest observation in the state store to the current observation.

Note:

This can be a negative value.

All state store observations

Float64

MinHeight

The minimum height observed.

All state store observations

Float64

MaxHeight

The maximum height observed.

All state store observations

Float64

AvgHeight

The average (mean) height observed.

All state store observations

Float64

Slope

The current slope of travel since the previous observation.

Current and previous observations

MinSlope

The minimum slope.

All state store observations

Float64

MaxSlope

The maximum slope.

All state store observations

Float64

AvgSlope

The average slope.

Note:

Average slope is calculated based on the slopes observed since the oldest observation in the state store. If the State Store Depth value is 3, the average slope is the average of the slope from observation 1 to observation 2 and from observation 2 to observation 3.

All state store observations

Float64

Acceleration

The acceleration since the previous observation.

Current and previous observations, requires that speed has been calculated for the previous observation

Float64

TotalAcceleration

The total acceleration from the oldest observation in the state store to the current observation.

All state store observations

Float64

MinAcceleration

The minimum acceleration.

All state store observations

Float64

MaxAcceleration

The maximum acceleration.

All state store observations

Float64

AvgAcceleration

The average acceleration.

Note:

Average acceleration is calculated based on the accelerations observed since the oldest observation in the state store. If the State Store Depth value is 3, average acceleration is the average acceleration from observation 1 to observation 2, and from observation 2 to observation 3.

All state store observations

Float64

Idling

Specifies whether the track is idle based on the distance between the current and previous observations and time span between the current and previous observations.

Current and previous observations

Boolean

TotalIdleTime

The cumulative amount of time during which idling was detected since the oldest observation in the state store.

All state store observations

Float64

PercentageIdleTime

The percentage of time during which idling was detected since the oldest stored observation in the state store.

All state store observations

Float64

Heading

The geodetic bearing. This is an angle of the travel direction (geodetic bearing, which is the angle measured clockwise from north).

Current and previous observations

Float64