Skip to main content
Version: 7.2.0

bboxPolygon

描述

¥Description

获取一个边界框 (bbox) 并返回一个等效的 polygon

¥Takes a bbox and returns an equivalent polygon.

参数

¥Parameters

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

返回

¥Returns

特性<多边形> 边界框的多边形表示

¥Feature<Polygon> a Polygon representation of the bounding box

示例

¥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(...);