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?PropertiesTranslate properties to Polygon (default {})
options.id?string | numberTranslate Id to Polygon (default {})

Returns

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