polyhash
Generate an array of geohashes that completely contains a polygon.
example
var polyhash = ;var polygon =3796 -122453795 -122903821 -12262;var hashes = ;consoledirhashes;
[ '9q8x', '9q8z', '9qb8', '9qbb' ]
methods
var polyhash =
polyhash(polygon, level)
Return an array of geohashes
that completely contains the array of points described by polygon
.
Points are of the form [ lat, lon ]
.
The level
provided is the maximum hash resolution which is also the maximum
string length of the geohash entries.
At the maximum geohash resolution level
, hashes that are partially intersected
will be counted. All other levels recurse down to sublevels until a completely
contained hash is found.
install
With npm do:
npm install polyhash
license
MIT