Skip to main content
Version: 7.1.0

square

Description

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

Parameters

NameTypeDescription
bboxBBoxextent in [west, south, east, north] order

Returns

    BBox a square surrounding bbox

Examples

const bbox = [-20, -20, -15, 0];
const squared = turf.square(bbox);

Installation

$ npm install @turf/square

import { square } from "@turf/square";
const result = square(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.square(...);