Class: MultiPolygon

ol/geom/MultiPolygon~MultiPolygon


import MultiPolygon from 'ol/geom/MultiPolygon';

Multi-polygon geometry.

new MultiPolygon(coordinates, opt_layout, opt_endss)

geom/MultiPolygon.js, line 28
Name Type Description
coordinates Array.<Array.<Array.<module:ol/coordinate~Coordinate>>> | Array.<number>

Coordinates. For internal use, flat coordinats in combination with opt_layout and opt_endss are also accepted.

layout module:ol/geom/GeometryLayout

Layout.

endss Array.<number>

Array of ends for internal use with flat coordinates.

Methods

appendPolygon(polygon)

geom/MultiPolygon.js, line 117

Append the passed polygon to this multipolygon.

Name Type Description
polygon module:ol/geom/Polygon~Polygon

Polygon.

clone(){module:ol/geom/MultiPolygon~MultiPolygon}

geom/MultiPolygon.js, line 142

Make a complete copy of the geometry.

Returns:
Clone.

getArea(){number}

geom/MultiPolygon.js, line 182

Return the area of the multipolygon on projected plane.

Returns:
Area (on projected plane).

getCoordinates(opt_right){Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>}

geom/MultiPolygon.js, line 200

Get the coordinate array for this geometry. This array has the structure of a GeoJSON coordinate array for multi-polygons.

Name Type Description
right boolean

Orient coordinates according to the right-hand rule (counter-clockwise for exterior and clockwise for interior rings). If false, coordinates will be oriented according to the left-hand rule (clockwise for exterior and counter-clockwise for interior rings). By default, coordinate orientation will depend on how the geometry was constructed.

Returns:
Coordinates.

getInteriorPoints(){module:ol/geom/MultiPoint~MultiPoint}

geom/MultiPolygon.js, line 242

Return the interior points as multipoint.

Returns:
Interior points as XYM coordinates, where M is the length of the horizontal intersection that the point belongs to.

getPolygon(index){module:ol/geom/Polygon~Polygon}

geom/MultiPolygon.js, line 285

Return the polygon at the specified index.

Name Type Description
index number

Index.

Returns:
Polygon.

getPolygons(){Array.<module:ol/geom/Polygon~Polygon>}

geom/MultiPolygon.js, line 311

Return the polygons of this multipolygon.

Returns:
Polygons.

getType()

geom/MultiPolygon.js, line 336

intersectsExtent()

geom/MultiPolygon.js, line 344

setCoordinates(coordinates, opt_layout)

geom/MultiPolygon.js, line 356

Set the coordinates of the multipolygon.

Name Type Description
coordinates Array.<Array.<Array.<module:ol/coordinate~Coordinate>>>

Coordinates.

layout module:ol/geom/GeometryLayout

Layout.