0.0.0 • Published 12 years ago
extents v0.0.0
extents
Compute the extents around a polygon.
Extents are like a bounding box, only decomposed into west, south, north, and east values instead of 2 or 4 points.
example
var extents = require('extents');
var polygon = [
[ 37.96, -122.45 ],
[ 37.95, -122.90 ],
[ 38.21, -122.62 ]
];
var ex = extents(polygon);
console.dir(ex);
{ w: -122.9, s: 37.95, e: -122.45, n: 38.21 }
methods
var extents = require('extents')
extents(polygon)
Compute the extents object for polygon
.
The polygon
object should be an array of 2-item [lat,lon]
arrays.
install
With npm do:
npm install extents
license
MIT
0.0.0
12 years ago