27. Speed Report

Returns a list of the maximum speeds for asset(s) within a specified time range and optionally a specific location of interest. A single asset may be specified or information may be retrieved for all assets.
Note: This function is only available in version 2.X of the OMI.

2.1 Request Data

Speed report Request:
Required Information
Name Description
action showposition
operation speed
format xml or json - (json format only used with 'getfive' parameter listed below)
fromdate epoch time. Results will be from events that occurred during or after this time.
todate epoch time. Results will be from events the occurred during or before this time.
Optional Information
logvers Acceptable values:
  • 1 - default output.
  • 2 - add the location attribute to the assetspeed element in the XML response
    Note: Only available with format=xml
Note: If a value is not passed, logvers=1 is assumed.
target Query for a specific asset and only return information for that asset. If specified a reqtype (request type) must be specified as well.
reqtype Flag to identify the key being used to identify the asset. Acceptable values:
  • tag Key is a Zonar RFID tag number. In version 2.X a type must also be specified.
  • exsid Key is the external system id.
  • vin Key is the Vehicle Identification Number (VIN).
  • dbid Key is the internal database id number. This is the most reliable key to use.
  • fleet Key is the asset fleet number. In version 2.X a type must also be specified.
type When using reqtype of tag or fleet this must also be specified in version 2. In version 1.x type Standard (0) is assumed. See asset types for more details.
loilocation If specified, the report will be created using position from inside the specified location of interest*. Value must be a location of interest name.
getfive A value of "t" is required.
If specified, the report will return the previous 3 points (within 10 minutes) and the following 2 points (within 10 minutes) of the 'fromdate' specified.
This makes the 'todate' not required and not used.
The 'target' parameter is now required as an db id, the 'format' parameter must be 'json', and 'reqtype' must be 'dbid'.

27.2 Data Returned

The XML information returned is similar to the GPS Speed Report from the web application:

logvers=1 Speed Report Results DTD:
<!ELEMENT speedlist (assetspeed*)>
<!ATTLIST speedlist ver CDATA #REQUIRED>
<!ATTLIST speedlist count CDATA #REQUIRED>
<!ATTLIST speedlist start CDATA #REQUIRED>
<!ATTLIST speedlist end CDATA #REQUIRED>

<!ELEMENT assetspeed (speed)>
<!ATTLIST assetspeed tag CDATA #REQUIRED>
<!ATTLIST assetspeed fleet CDATA #REQUIRED>
<!ATTLIST assetspeed type CDATA #REQUIRED>
<!ATTLIST assetspeed id CDATA #REQUIRED>
<!ATTLIST assetspeed latlong CDATA>
<!ATTLIST assetspeed unit CDATA>
<!ATTLIST assetspeed timestamp CDATA>

<!ELEMENT speed (#PCDATA)>

logvers=2 Speed Report Results DTD:
<!ELEMENT speedlist (assetspeed*)>
<!ATTLIST speedlist ver CDATA #REQUIRED>
<!ATTLIST speedlist count CDATA #REQUIRED>
<!ATTLIST speedlist start CDATA #REQUIRED>
<!ATTLIST speedlist end CDATA #REQUIRED>

<!ELEMENT assetspeed (speed)>
<!ATTLIST assetspeed tag CDATA #REQUIRED>
<!ATTLIST assetspeed fleet CDATA #REQUIRED>
<!ATTLIST assetspeed type CDATA #REQUIRED>
<!ATTLIST assetspeed id CDATA #REQUIRED>
<!ATTLIST assetspeed latlong CDATA>
<!ATTLIST assetspeed unit CDATA>
<!ATTLIST assetspeed timestamp CDATA>
<!ATTLIST assetspeed location CDATA>

<!ELEMENT speed (#PCDATA)>

Speed Report Results:
Reply Data
Name Description
version The version number of the OMI call and return data.
count The number of results returned.
start The request epoch time (fromdate).
end The request epoch time (todate).
tag The Zonar RFID tag number assigned to the asset. Coupled with the Type, this is usually the means by which an asset is identified in an inspection. The combination of tag number and type must be unique for each asset.
fleet Fleet number. An arbitrary text string of up to 20 characters in length. If the asset is a vehicle this is intended to be the user assigned identification for the vehicle.
This is usually labeled 'Asset No.' in the web interface. The combination of fleet number and type must be unique for each asset. All assets must have a fleet number.
type The asset type identifier. The combination of tag number and type or fleet number and type is used to uniquely identify the asset. Text, 32 characters maximum length. All assets have a type.
id (asset) The internal database identifier for the asset object. This is the primary means of identifying an asset and how the asset is linked to other objects.
timestamp The timestamp when the speed event occurred. An epoch timestamp.
latlong The latitude and longitude position of where the longest idle occurred (format: lat,long).
unit The measurement unit the speed is reported in.
speed The maximum reported speed for the asset. A floating point number.


Example Request Get the maximum speeds for all assets:

https://development.zonarsystems.net/interface.php?action=showposition&operation=speed&format=xml&customer=abc1234&fromdate=1141397988&todate=1141398000&vers=2

Reply (XML):

Reply

Example Request Get the maximum speed for a specific asset.

https://development.zonarsystems.net/interface.php?action=showposition&operation=speed&format=xml&customer=abc1234&target=138021074&reqtype=tag&fromdate=1141220175&todate=1149551361&vers=2

Reply (XML):

Reply


JASON Get Five Speed Report Results DTD:
<!ELEMENT eventlist (ver, count, start, end, maxts, assetevents*)>
<!ATTLIST ver CDATA #REQUIRED>
<!ATTLIST count CDATA #REQUIRED>
<!ATTLIST start CDATA #REQUIRED>
<!ATTLIST end CDATA #REQUIRED>
<!ATTLIST maxts CDATA #REQUIRED>

<!ELEMENT assetevents (fleet, id, lat, lng, heading, unit, dt, speed, power)>
<!ATTLIST fleet CDATA #REQUIRED>
<!ATTLIST id CDATA #REQUIRED>
<!ATTLIST lat CDATA #REQUIRED>
<!ATTLIST lng CDATA #REQUIRED>
<!ATTLIST heading CDATA #REQUIRED>
<!ATTLIST unit CDATA #REQUIRED>
<!ATTLIST dt CDATA>
<!ATTLIST speed CDATA>
<!ATTLIST power CDATA>

Get Five Speed Report Results:
Reply Data
Name Description
version The version number of the OMI call and return data.
count The number of results returned.
start The 'start' epoch time (fromdate - 10 minutes).
end The 'end' epoch time (fromdate + 10 minutes).
maxts The time epoch of the max speed event (fromdate)
assetevents Returns null if no events or the grouped values listed below:
fleet Fleet number. An arbitrary text string of up to 20 characters in length. If the asset is a vehicle this is intended to be the user assigned identification for the vehicle.
This is usually labeled 'Asset No.' in the web interface. The combination of fleet number and type must be unique for each asset. All assets must have a fleet number.
id (asset) The internal database identifier for the asset object. This is the primary means of identifying an asset and how the asset is linked to other objects.
lat The latitude of the point being returned. A floating point number.
lng The longitude of the point being returned. A floating point number.
heading A representation of the assets heading in degrees for the point being returned. A floating point number.
unit The measurement unit the speed is reported in. ("MPH" or "KPH")
dt The date/time String for the point being returned. ex. "Mon 27 Sep 2010 08:44"
speed The speed for the point being returned. A floating point number representing MPH or KPH.
power Boolean value representing the assets power state (true for on and false for off) for the point being returned.


Example Request:

https://development.zonarsystems.net/interface.php?action=showposition&operation=speed&format=json&getfive=t&customer=abc1234&fromdate=1141397988&vers=2&reqtype=dbid

Reply (JSON):

Reply



*LOI means Location of Interest; called "Zone" in GPS tools and reports in Ground Traffic Control web application.