square
描述
🌐 Description
获取一个边界框并计算可以包含输入的最小正方形边界框。
🌐 Takes a bounding box and calculates the minimum square bounding box that would contain the input.
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| bbox | BBox | 范围按 [西、南、东、北] 顺序 |
返回
🌐 Returns
BBox 一个包围 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(...);