@signalk/tracks-plugin

Plugin to keep track of tracks of vessels

Usage no npm install needed!

<script type="module">
  import signalkTracksPlugin from 'https://cdn.skypack.dev/@signalk/tracks-plugin';
</script>

README

@signalk/tracks and @signalk/tracks-plugin

This repo contains two npm modules:

  • @signalk/tracks - RxJs based module that accumulates positions into a track, using a configured time resolution and retains a sliding window of points. Contains the code for both a Signal K server plugin that implements the track api and client side "TrackAccumulator" class that manages the track for a single vessel. TrackAccumulator can optionally bootstrap the track data from the server. The result is available as Observable<LatLng[]>.
  • @signalk/tracks-plugin Convenience module that exposes the plugin part of @signalk/tracks.

Tracks

Plugin for tracks accumulation and the track API

Usage:

Retrieve tracks for individual vessel:

/signalk/v1/api/tracks/<vesselId>


Retrieve tracks for all vessels:

/signalk/v1/api/tracks

If maxRadius is specified only vessels with last track position within this distance are returned.


Retrieve tracks for all vessels within a given radius (in meters) from your vessel position:

/signalk/v1/api/tracks?radius=50000

Note: This value overrides the maxRadius value specified in plugin configuration.


Retrieve tracks for all vessels within a bounded area:

/signalk/v1/api/tracks?bbox=130,-35,139,-33

Bounded area is defined as lon1, lat1, lon2, lat2

lon1, lat1 = lower left corner of bounded area

lon2, lat2 = upper right corner of bounded area