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 = ;var polygon =3796 -122453795 -122903821 -12262;var ex = ;consoledirex;
{ w: -122.9, s: 37.95, e: -122.45, n: 38.21 }
methods
var 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