multiPolygon
Description
Creates a Feature<MultiPolygon> based on a coordinate array. Properties can be added optionally.
Parameters
Name | Type | Description |
---|---|---|
coordinates | UNCERTAIN | |
properties? | GeoJsonProperties | an Object of key-value pairs to add as properties (default {}) |
options? | Object | Optional Parameters (default {}) |
options.bbox? | BBox | Bounding Box Array [west, south, east, north] associated with the Feature |
options.id? | Id | Identifier associated with the Feature |
Returns
Feature<MultiPolygon, GeoJsonProperties> a multipolygon feature
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(...);