bboxPolygon
描述
🌐 Description
接收一个边界框并返回一个等效的多边形。
🌐 Takes a bbox and returns an equivalent polygon.
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| bbox | BBox | 范围按 [minX, minY, maxX, maxY] 顺序 |
| options? | Object | 可选参数 (默认 {}) |
| options.properties? | GeoJsonProperties | 将属性转换为多边形 (默认 {}) |
| options.id? | string | number | 将 Id 转换为 Polygon (默认 {}) |
返回
🌐 Returns
示例
🌐 Examples
var bbox = [0, 0, 10, 10];
var poly = turf.bboxPolygon(bbox);
安装
🌐 Installation
$ npm install @turf/bbox-polygon
import { bboxPolygon } from "@turf/bbox-polygon";
const result = bboxPolygon(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.bboxPolygon(...);