JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1078
  • Score
    100M100P100Q99712F
  • License MIT

Converts gps points to motion vectors

Package Exports

  • vectorize

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vectorize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build StatusCoverage Status

vectorize

Converts gps points to motion vectors using victor library, provides three types of vectors: position, velocity, and accleration. Useful for filtering and analysis of GPS data.

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install vectorize --save

Vectors:

  Position {x: ∆lng, y: ∆lat}
  Velocity  {x: ∆lng / ∆time, y: ∆lat / ∆time}
  Acceleration {x: ∆xVelocity / ∆time, y: ∆yVelocity / ∆time}

Use

# Points is expected to be an array of GPS points with a latitude, longitude, and timestamp;
# Valid formats: Latitude: [lat, latitude, y]
#                Longitude[lng,longitude,x] 
#                Timestamp[time, timestamp, startime]
                
#Coordinate data in decimal, timestamp can be in any format momentjs can handle

#ALL SPEEDS ARE IN M/S
var vectorize = require('vectorize');

.toPositions(points)
  return arrayOfPositionVectors;
  
.toVelocities(points)
  returns arrayOfVelocityVectors;

.toAccelerations(points)
  returns arrayOfAccelerationVectors;

Tests

npm install
npm test

Dependencies

  • speed-filter: Filters GPS data based on speed
  • victor: A JavaScript 2D vector class with methods for common vector operations

Dev Dependencies

  • chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
  • coveralls: takes json-cov output into stdin and POSTs to coveralls.io
  • istanbul: Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests
  • mocha-lcov-reporter: LCOV reporter for Mocha

License

MIT