gdal.PolygonRings
A collection of polygon rings, used by gdal.Polygon.
Table of Contents
Methods
add
(
-
ring(s)
Adds a ring to the collection.
Parameters:
-
ring(s)
gdal.LinearRing
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
Iterates through all rings using a callback function.
Parameters:
-
callback
FunctionThe 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
Outputs all rings as a regular javascript array.
Returns:
Array:
List of LineString instances.