Skip to content

Intugine-Technologies/LocSwarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LocSwarm

npm version install size

Halt calculation for a set of locations

Table of Contents

Installation

Using npm:

    $ npm i -S @intugine-technologies/halts

Example

const loc_swarm = require("@intugine-technologies/halts");

const data = [
    {
        loc: [29.79957, 77.93455],
        time: "2019-07-04T13:20:32.732Z",
    },
    {
        loc: [29.79957, 77.93455],
        time: "2019-07-04T13:20:32.732Z",
    }
    {
        loc: [29.79957, 77.93455],
        time: "2019-07-04T13:20:32.732Z",
    }
    ......
];

const halts = loc_swarm(data, 1000);
console.log(halts);

Reference

Definition

loc_swarm(locations = [], distance_threshold = 1000, minimum_halt_time = 1000 * 60 * 60 * 1,ignore_locations = [], ignore_locations_distance_threshold = 60000)

Arguments

  • locations - Array of objects in format of {loc: [lat, long], time: ISOString}
  • distance_threshold - Radius of the cluster you want to form (what do you consider a halt) in metres
  • minimum_halt_time - Minimum halt duration you want filter out, in ms
  • ignore_locations - Array of objects, containing the set of locations around which no halts will be calculated
  • ignore_locations_distance_threshold - Distance threshold to be used to ignore the ignore_locations in metres

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published