Skip to main content
Version: Next

square

描述

¥Description

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

参数

¥Parameters

名称类型描述
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(...);