vectorize
v0.1.1
Published
Converts gps points to motion vectors
Downloads
2,599
Readme
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