Fuel data resampling
Navixy Eco Fleet Lab has developed a solution for complex fuel data analysis. This method regenerates data sets which will be beneficial for a variety of exercises, enabling researchers, developers, and diagnostics experts to use the processed data.
Diagnostic process is an important procedure undertaken by numerous partners and investigators. Its primary purpose is to identify the underlying causes, which is essential for efficient fuel management by identifying any abnormalities. For example, they analyze key events - drains and refueling for fraud or look for a reason for the appearance of noise in the fuel data.
When partners or integrators incorporate fuel-related data into third-party systems for further analysis and processing, including machine learning, it can be highly effective in identifying behavioral patterns and detecting exceptions. This allows for more efficient investigations and enhances overall data processing capabilities.
Effective data management relies on accurate and synchronized raw data. However, inconsistencies in different data sets (i.e. position, speed, and fuel level) across various timeframes can pose challenges.
To tackle the challenges posed by incomplete or inconsistent data, we utilize advanced statistical models. With our API requests, you can easily access and download processed datasets from our platform for specific time periods. This API request specifically provides fuel-related data in a convenient CSV format.
Data resampling refers to the joint process of creating a uniform data structure by organizing existing values and generating new ones (for missing values) in a chronological order, while considering equal time intervals. This approach ensures data integrity and facilitates analysis.
data_resampling
Description
The API response is presented in a convenient CSV format, incorporating columns below:
Time - timestamp (depending on the timezone the tracker is located)
[FUEL_SENSOR_NAME] - Fuel level (The column name is derived based on the sensor name. There could be more than 1 column)
SPEED - object speed (km/h)
MOVEMENT - movement status (0 - parking, 1 - moving, 2 - Idle)
LNG - Longitude
LAT - Latitude
API path: /trackers/$tracker_id/resampling, on the /eco_fleet/v1 base path.
Additional list of resampling parameters
data_type
Data type. Options: FUEL, SPEED,MOVEMENT, LNG, LAT
string
"SPEED"
resampling_method
Resampling method. Options: FOLLOWING, PREVIOUS, MEDIAN_IN_WINDOW, AVERAGE_IN_WINDOW, AVERAGE.
string
"FOLLOWING"
delta
Delta time in seconds. Has different meaning for different algorithms.
int
null/1
fixed_value
A fixed value that will be used if no data is found in the interval. You can specify null or any number.
float
nulll/5.5
Description of resampling_method
FOLLOWING - In this series, the subsequent value is utilized to substitute any missing values. Consequently, neighboring missing values are all substituted with the subsequent valid value. If there are any missing values at the end of the series, they are replaced with the preceding valid value. If delta is not null than algorithm changes: if the time interval [T-Δ, T+0] contains at least one value, otherwise fixed_value.
PREVIOUS - The previous value in the series is utilized to substitute missing values. Consequently, the neighboring missing values are replaced with the earliest preceding valid value. If delta is not null than algorithm changes: if the time interval [T-0, T+Δ] contains at least one value, otherwise fixed_value.
MEDIAN_IN_WINDOW - In this algorithm, the presence of delta is imperative. The average of all the neighboring values in the series within the interval [T-Δ, T+Δ], fixed_value if no values.
AVERAGE_IN_WINDOW- In this algorithm, the presence of delta is imperative. The median of all the neighboring values in the series within the interval [T-Δ, T+Δ], fixed_value if no values.
AVERAGE - To replace missing values in a series, we use the average of the two neighboring values. For any missing values between valid ones, we replace them with the average of the surrounding valid values. If the series begins or ends with missing values, we substitute them with the next or previous valid value accordingly. If delta is not equal to null than algorithm changes: if the interval [T-Δ, T+Δ] contains at least one value, otherwise fixed_value.
We recommend utilizing distinct methods for varying data types, as outlined in the table below. However, the choice of which methods to employ ultimately depends on your individual needs and expectations.
Following
Ordered
Data that is missing at the end of a time series or sequence, i.e Fuel, Movement
Previous
Ordered
Data that is missing at the beginning of a time series or sequence, i.e Fuel, Movement
Median
Evenly distributed
Data that is not normally distributed, i.e. Fuel, Speed
Average
Normally distributed
Data that is not evenly distributed, i.e. Fuel, Speed
Note that the response is CSV, not JSON, and that errors follow RFC 7807 problem details rather than the numeric status.code the Platform API uses.
Return fuel, speed, movement and location values resampled onto a uniform time grid, as CSV.
Columns are Time, one column per fuel sensor named after that sensor, SPEED in km/h, MOVEMENT where 0 is parking, 1 is moving and 2 is idle, LNG, and LAT. A tracker with no fuel sensors returns the Time column alone.
Timestamps follow the timezone the tracker is located in.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". The same credential the Platform API uses.
ID of the tracker, also known as object_id. Must belong to the authorized user and must not be blocked.
123456Period to analyse, as an ISO 8601 interval. Defaults to the last week.
P7D/2020-12-31T00:00ZResampling step in minutes.
1Resampled series as CSV
Bad request, or the period could not be parsed.
No credential supplied. Type errors/default/unauthorized.
Tracker not found. Type errors/entity/not-found.
The Navixy Platform API could not be reached, or returned an error. Type errors/external-api/navixy, with the underlying code and message in detail.
Error response, following RFC 7807 problem details. Note this is not the Platform API error shape: there is no success field and no numeric status.code.
POST /eco_fleet/v1/trackers/{tracker_id}/resampling HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 120
{
"step_size": 1,
"resampling_props": [
{
"data_type": "FUEL",
"resampling_method": "FOLLOWING",
"delta": 600,
"fixed_value": null
}
]
}Time,FUEL_TANK,SPEED,MOVEMENT,LNG,LAT
2026-08-11T00:00,42.5,0,0,60.545,56.826
Errors
This API reports errors as RFC 7807 problem-detail strings, so the general error codes do not apply to it:
errors/entity/not-found- if there is no tracker with such ID belonging to the authorized user.errors/external-api/navixy- error accessing the Navixy Platform API. The underlying numeric code and message arrive in thedetailfield, so this is where Platform API errors such as 204 Entity not found and 208 Device blocked surface, rather than as top-level codes of this API.errors/default/unauthorized- no credential supplied.
Last updated
Was this helpful?