gdal.DatasetLayers
An encapsulation of a Dataset's vector layers.
var layers = dataset.layers;`
Table of Contents
Methods
Copies a layer.
Parameters:
-
src_lyr_name
String -
dst_lyr_name
String -
[options=null]
Object | String[] optionallayer creation options
Returns:
count
()
Integer
Returns the number of layers.
Returns:
Integer
Adds a new layer.
Parameters:
-
name
StringLayer name
-
srs
gdal.SpatialReference | NullLayer projection
-
geomType
Integer | FunctionGeometry type or constructor (see geometry types)
-
creation_options
String[] | Objectdriver-specific layer creation options
Returns:
Example:
dataset.layers.create('layername', null, gdal.Point);
forEach
(
-
callback
Iterates through all layers using a callback function.
Parameters:
-
callback
FunctionThe callback to be called with each Layer
Example:
dataset.layers.forEach(function(layer, i) { ... });`
Returns the layer with the given name or identifier.
Parameters:
-
key
String | IntegerLayer name or ID.
Returns:
map
(
-
callback
Iterates through all layers using a callback function and builds an array of the returned values.
Parameters:
-
callback
FunctionThe callback to be called with each Layer
Example:
var result = dataset.layers.map(function(field, i) {
return value;
});`
remove
(
-
index
Removes a layer.
Parameters:
-
index
Integer