Skip to main content
Version: Next

bboxPolygon

Description

Takes a bbox and returns an equivalent polygon.

Parameters

NameTypeDescription
bboxBBoxextent in [minX, minY, maxX, maxY] order
options?ObjectOptional parameters (default {})
options.properties?GeoJsonPropertiesTranslate properties to Polygon (default {})
options.id?string | numberTranslate 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(...);