Show:

A collection of polygon rings, used by gdal.Polygon.

Methods

add
(
  • rings
)

Adds a ring to the collection.

Parameters:

Example:

var ring1 = new gdal.LinearRing();
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:
polygon.rings.add(ring1);

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

Returns the number of rings that exist in the collection.

Returns:

Number
forEach
(
  • callback
)

Iterates through all rings using a callback function.

Parameters:

  • callback forEachCb

    The callback to be called with each LineString

Example:

polygon.rings.forEach(function(array, i) { ... });`
get
(
  • index
)
gdal.LinearRing

Returns the ring at the specified index. The ring at index 0 will always be the polygon's exterior ring.

Parameters:

  • index Number

Returns:

Example:

var exterior = polygon.rings.get(0);
var interior = polygon.rings.get(1);`
map<U>
(
  • callback
)
U[]

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

Parameters:

  • callback mapCb

    The callback to be called with each LineString

Returns:

U[]

Example:

var result = polygon.rings.map(function(array, i) {
    return value;
});`
Symbol.iterator ()

Iterates through all rings using an iterator

Example:

for (const array of polygon.rings) {
}
toArray () gdal.LineString[][]

Outputs all rings as a regular javascript array.

Returns:

gdal.LineString[][]:

List of LineString instances.