covarea

0.2.1 • Public • Published

covarea

Calculate the coverage of a rectangular area by circles on a 2D map

It basically uses either a single circle, if bounding box is smaller than the max radius, or a honeycomb distribution to optimize the coverage of a larger area.

Usage

Run npm i -S covarea

Then

const cover = require('coverea');
 
const boundingBox = {
  southWest: { lat: 0, lon: 0 },
  northEast: { lat: 10, lon: 10 }
}; // in decimal format
 
const maxRadius = 300000; // in meters
 
const coverage = cover(boundingBox, maxRadius);
 
/*
coverage.length : 8
 
coverage[0] : {
  center: { lat: 1.34747, lon: 0 },
  radius: 300000
}
*/

Thanks

Thanks to :

Readme

Keywords

none

Package Sidebar

Install

npm i covarea

Weekly Downloads

1

Version

0.2.1

License

MIT

Last publish

Collaborators

  • rehia