Speed data type |
The data type Speed represents a speed measurement.
The TDE data types for quantifiable data (numeric values with units of measure) are all stored as double and are handled similarly for template scripting.
Tip |
---|
Since every quantifiable data type is stored as double, be sure to account for that when you test equivalency (for example, 1 may actually be stored as 0.999999). Either round off the values being compared, or use ranges for the comparison. |
MilesPerHour or mph — default
KilometersPerHour or kph
Knots or kn
MetersPerSecond or m/s
FeetPerSecond or ft/s
Data from TDE defaults to the first unit listed for each data type. In the [Output] section, you can convert these values to the units you need:
[Output] LastSpeed(kph) = input.LastLocationSpeed # converts mph data to kph
The effective range of this data type is: 0 to 670,616,629 mph
When you use the optional [Script] section to insert your own JavaScript functions, access this data type as follows:
new Speed({Unit:Value})
You can access the valid units of measure as fields:
.MilesPerHour
.KilometersPerHour
.Knots
.MetersPerSecond
.FeetPerSecond