Show:

A collection of Geometries, used by gdal.GeometryCollection.

Methods

add
(
  • geometry
)

Adds geometry(s) to the collection.

Parameters:

Example:

// one at a time:
geometryCollection.children.add(new Point(0,0,0));

// add many at once:
geometryCollection.children.add([
    new Point(1,0,0),
    new Point(1,0,0)
]);`
count () Number

Returns the number of items.

Returns:

Number
forEach
(
  • callback
)

Iterates through all child geometries using a callback function.

Parameters:

  • callback forEachCb

    The callback to be called with each Geometry

Example:

geometryCollection.children.forEach(function(array, i) { ... });`
get
(
  • index
)
gdal.Geometry

Returns the geometry at the specified index.

Parameters:

  • index Number

    0-based index

Returns:

map<U>
(
  • callback
)
U[]

Iterates through child geometries using a callback function and builds an array of the returned values.

Parameters:

  • callback mapCb

    The callback to be called with each Geometry

Returns:

U[]

Example:

var result = geometryCollection.children.map(function(array, i) {
    return value;
});`
remove
(
  • index
)

Removes the geometry at the specified index.

Parameters:

  • index Number

    0-based index, -1 for all geometries

Symbol.iterator ()

Iterates through all child geometries using an iterator

Example:

for (const array of geometryCollection.children) {
}