Generate an array of geohashes that completely contains a polygon.
var polyhash = require('polyhash'); var polygon = [ [ 37.96, -122.45 ], [ 37.95, -122.90 ], [ 38.21, -122.62 ] ]; var hashes = polyhash(polygon, 4); console.dir(hashes);
[ '9q8x', '9q8z', '9qb8', '9qbb' ]
var polyhash = require('polyhash')
Return an array of geohashes
that completely contains the array of points described by
Points are of the form
[ lat, lon ].
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.
With npm do:
npm install polyhash