turf-square

turf square module

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
turf-square
003.0.126 years ago9 years agoMinified + gzip package size for turf-square in KB

Readme

turf-square
build status
turf square module

turf.square(bbox)

Takes a bounding box and calculates the minimum square bounding box that would contain the input.

Parameters

| parameter | type | description | | --------- | -------------- | -------------- | | bbox | Array. | a bounding box |

Example

var bbox = [-20,-20,-15,0];
var squared = turf.square(bbox);
var features = turf.featurecollection([
  turf.bboxPolygon(bbox),
  turf.bboxPolygon(squared)]);

//=features

Installation

Requires nodejs.
$ npm install turf-square

Tests

$ npm test