Location time series

The location time series captures the locations and timestamps for an action/user as a compressed string. The location time series is based on Google's encoded polyline format, which stores static locations (without timestamps) in a string. All route visualisations on HyperTrack are powered using the location time series.

Sample

spxsBsdb|Lymo`qvAx@TKvAr@K

The above string captures the following location data. With this compressed format, thousands of location data is made available in a single API call. This string can be decoded to obtain location data whenever required.

[
    [19.13626, 72.92506, '2016-07-21T05:43:09+00:00'],
    [19.13597, 72.92495, '2016-07-21T05:43:15+00:00'],
    [19.13553, 72.92469, '2016-07-21T05:43:21+00:00']
]

Benefits of using location time series

  • With this compressed format, thousands of location data is made available in a single API call
  • Richer visualisation features like replays can be built using this format as it has timestamps besides locations

Polyline

Get the location time series from API

You can get the location time series as a JSON for an Action HTTP entity.

API call HTTP method Request url
Get action details https://api.hypertrack.com/api/v2/actions/<ACTION_ID>/
curl "https://app.hypertrack.io/api/v2/actions/41caa9f2-ad63-4a8b-98ed-1414c372e1ce/"
  -H "Authorization: token PUBLISHABLE_KEY"

Get locations from the location time series

The location time series can be decoded to get the latitude, longitude and timestamp data of the location stream as given below. To decode, you can use our open source libraries in Python and JavaScript.

If your language of choice is not available, let us know and we would be happy to ship it quickly.

$ pip install time_aware_polyline
from time_aware_polyline import decode_time_aware_polyline

polyline = 'spxsBsdb|Lymo`qvAx@TKvAr@K'
decoded = decode_time_aware_polyline(polyline)
$ npm i time-aware-polyline
var polylineUtil = require('time-aware-polyline');

var polyline = 'spxsBsdb|Lymo`qvAx@TKvAr@K';
polylineUtil.decodeTimeAwarePolyline(polyline);

Try it out

var polylineUtil = require('time-aware-polyline');

var polyline = 'spxsBsdb|Lymo`qvAx@TKvAr@K';
polylineUtil.decodeTimeAwarePolyline(polyline);

See the route traveled on the map

You can see the polyline on a map on the hypertrack dashboard, or on your own dashboard using widgets or customisable JS library.

Internally, the above views decode the location time series into an encoded polyline. All kinds of maps take input in the encoded polyline format to visualise routes.

How does HyperTrack generate location time series?

Location filtering

Our real-time filtering removes noise, smoothens and improves accuracy of the location data. This ensures that distance metering can be accurate. Read more on how that works.

Example filtering

Encoding the data

Each location is a tuple of latitude, longitude and timestamp. A location stream can be encoded into a location time series. We have open sourced the libraries that we use to do this encoding in Python and JavaScript.

results matching ""

    No results matching ""