Skip to main content
Version: Next

bboxPolygon

描述

¥Description

Takes a bbox and returns an equivalent polygon.

参数

¥Parameters

名称类型描述
bboxBBoxextent in [minX, minY, maxX, maxY] order
options?对象可选参数(默认
options.properties?GeoJsonPropertiesTranslate properties to Polygon (default )
options.id?string | numberTranslate Id to Polygon (default )

返回

¥Returns

特性<多边形> a Polygon representation of the bounding box

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