bboxPolygon
Description
Takes a bbox and returns an equivalent polygon.
Parameters
Name | Type | Description |
---|---|---|
bbox | BBox | extent in [minX, minY, maxX, maxY] order |
options? | Object | Optional parameters (default {}) |
options.properties? | GeoJsonProperties | Translate properties to Polygon (default {}) |
options.id? | string | number | Translate Id to Polygon (default {}) |
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(...);