Show:

A collection of connected curves, used by gdal.CompoundCurve.

Methods

add
(
  • curves
)

Adds a curve to the collection.

Parameters:

Example:

var ring1 = new gdal.CircularString();
ring1.points.add(0,0);
ring1.points.add(1,0);
ring1.points.add(1,1);
ring1.points.add(0,1);
ring1.points.add(0,0);

// one at a time:
compound.curves.add(ring1);

// many at once:
compound.curves.add([ring1, ...]);`
count () Number

Returns the number of curves that exist in the collection.

Returns:

Number
forEach
(
  • callback
)

Iterates through all curves using a callback function.

Parameters:

  • callback forEachCb

    The callback to be called with each SimpleCurve

Example:

compoundCurves.curves.forEach(function(array, i) { ... });`

Returns the curve at the specified index.

Parameters:

  • index Number

Example:

var curve0 = compound.curves.get(0);
var curve1 = compound.curves.get(1);`
map<U>
(
  • callback
)
U[]

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

Parameters:

  • callback mapCb

    The callback to be called with each SimpleCurve

Returns:

U[]

Example:

var result = compoundCurves.curves.map(function(array, i) {
    return value;
});`
Symbol.asyncIterator ()

Iterates through all curves using an async iterator

Example:

for await (const array of compoundCurves.curves) {
}
Symbol.iterator ()

Iterates through all curves using an iterator

Example:

for (const array of compoundCurves.curves) {
}

Outputs all curves as a regular javascript array.

Returns:

gdal.SimpleCurve[][]:

List of SimpleCurve instances.