Skip to main content
Version: 6.5.0

multiPolygon

Description

Creates a Feature<MultiPolygon> based on a coordinate array. Properties can be added optionally.

Parameters

NameTypeDescription
coordinatesArray<Array<Array<Array<number>>>>an array of Polygons
properties?Objectan Object of key-value pairs to add as properties (default {})
options?ObjectOptional Parameters (default {})
options.bbox?Array<number>Bounding Box Array [west, south, east, north] associated with the Feature
options.id?string | numberIdentifier associated with the Feature

Returns

Examples

var multiPoly = turf.multiPolygon([
[
[
[0, 0],
[0, 10],
[10, 10],
[10, 0],
[0, 0],
],
],
]);

//=multiPoly

Installation

$ npm install @turf/helpers

import { multiPolygon } from "@turf/helpers";
const result = multiPolygon(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.multiPolygon(...);