Skip to content

描述 ​

接收一个 bbox(边界框),返回一个等价的 多边形。

参数 ​

名称类型描述
bboxBBox范围,按 [minX, minY, maxX, maxY] 顺序
options?Object可选参数 (默认 {})
options.properties?GeoJsonProperties将属性转换到多边形 (默认 {})
options.id?string | number将 Id 转换到多边形 (默认 {})

返回值 ​

Feature<Polygon> 边界框的多边形表示

示例 ​

javascript
var bbox = [0, 0, 10, 10];

var poly = turf.bboxPolygon(bbox);

安装 ​

javascript
$ npm install @turf/bbox-polygon

import { bboxPolygon } from "@turf/bbox-polygon";
const result = bboxPolygon(...);
javascript
$ npm install @turf/turf

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