Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

turf-square

Turfjs73.8kMITdeprecated3.0.12

Turf packages are now namespaced: please use @turf/square instead

turf square module

turf, gis, geojson, extent

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.<number> 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