Show:

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

Methods

add
(
  • ring(s)
)

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

Returns the number of rings that exist in the collection.

Returns:

Integer

forEach
(
  • callback
)

Defined in lib/gdal.js:335

Iterates through all rings using a callback function.

Parameters:

  • callback Function

    The callback to be called with each LineString

Example:

polygon.rings.forEach(function(ring, i) { ... });`

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

Returns:

Example:

var exterior = polygon.rings.get(0);
var interior = polygon.rings.get(1);`
toArray () Array

Defined in lib/gdal.js:498

Outputs all rings as a regular javascript array.

Returns:

Array:

List of LineString instances.