gdal.GeometryCollectionChildren
A collection of Geometries, used by gdal.GeometryCollection.
Table of Contents
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
Iterates through all child geometries using a callback function.
Parameters:
-
callback
FunctionThe callback to be called with each Geometry
Example:
geometryCollection.children.forEach(function(geometry, i) { ... });`
Returns the geometry at the specified index.
Parameters:
-
index
Integer0-based index
Returns:
map
(
-
callback
Iterates through all child geometries using a callback function and builds an array of the returned values.
Parameters:
-
callback
FunctionThe 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
Integer0-based index
toArray
()
Array
Outputs all geometries as a regular javascript array.
Returns:
Array:
List of Geometry instances.