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