Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
compute the bounding extents around a polygon
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
example
test implementation from polyhash with an example and a test
.travis.yml
LICENSE
README.markdown
index.js
package.json

README.markdown

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.

build status

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

Something went wrong with that request. Please try again.