Show:

A collection of Geometries, used by gdal.GeometryCollection.

Methods

add
(
  • geometry
)

Adds geometry(s) to the collection.

Parameters:

  • geometry Mixed

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

Returns the number of items.

Returns:

Integer

forEach
(
  • callback
)

Defined in lib/gdal.js:383

Iterates through all child geometries using a callback function.

Parameters:

  • callback Function

    The callback to be called with each Geometry

Example:

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

Returns the geometry at the specified index.

Parameters:

  • index Integer

    0-based index

Returns:

map
(
  • callback
)

Defined in lib/gdal.js:396

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

Parameters:

  • callback Function

    The callback to be called with each Geometry

Example:

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

Removes the geometry at the specified index.

Parameters:

  • index Integer

    0-based index

toArray () Array

Defined in lib/gdal.js:470

Outputs all geometries as a regular javascript array.

Returns:

Array:

List of Geometry instances.