Skip to content

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

License

Notifications You must be signed in to change notification settings

lightstream-company/covarea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 :

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published