Class: module:LayerClient

module:LayerClient(url, auth)

new module:LayerClient(url, auth)

Creates a GeoServer REST LayerClient instance.
Parameters:
Name Type Description
url String The URL of the GeoServer REST API endpoint
auth String The Basic Authentication string
Source:

Methods

(async) deleteFeatureType(workspace, datastore, name, recurse)

Deletes a FeatureType.
Parameters:
Name Type Description
workspace String Workspace where layer to delete is in
datastore String The datastore where the layer to delete is in
name String Layer to delete
recurse Boolean Flag to enable recursive deletion
Source:
Throws:
Error if request fails

(async) enableTimeCoverage(workspace, datastore, name, presentation, resolution, defaultValue, nearestMatchEnabledopt, rawNearestMatchEnabledopt, acceptableIntervalopt)

Enables TIME dimension for the given coverage layer.
Parameters:
Name Type Attributes Description
workspace String Workspace where layer to enable time dimension for is in
datastore String The datastore where the layer to enable time dimension for is in
name String Layer to enable time dimension for
presentation String Presentation type: 'LIST' or 'DISCRETE_INTERVAL' or 'CONTINUOUS_INTERVAL'
resolution Number Resolution in milliseconds, e.g. 3600000 for 1 hour
defaultValue String The default time value, e.g. 'MINIMUM' or 'MAXIMUM' or 'NEAREST' or 'FIXED'
nearestMatchEnabled Boolean <optional>
Enable nearest match
rawNearestMatchEnabled Boolean <optional>
Enable raw nearest match
acceptableInterval String <optional>
Acceptable interval for nearest match, e.g.'PT30M'
Source:
Throws:
Error if request fails

(async) enableTimeFeatureType(workspace, datastore, name, attribute, presentation, resolution, defaultValue, nearestMatchEnabledopt, rawNearestMatchEnabledopt)

Enables TIME dimension for the given FeatureType layer.
Parameters:
Name Type Attributes Description
workspace String Workspace containing layer to enable time dimension for
datastore String The datastore containing the FeatureType to enable time dimension for
name String FeatureType to enable time dimension for
attribute String Data column / attribute holding the time values
presentation String Presentation type: 'LIST' or 'DISCRETE_INTERVAL' or 'CONTINUOUS_INTERVAL'
resolution Number Resolution in milliseconds, e.g. 3600000 for 1 hour
defaultValue String The default time value, e.g. 'MINIMUM' or 'MAXIMUM' or 'NEAREST' or 'FIXED'
nearestMatchEnabled Boolean <optional>
Enable nearest match
rawNearestMatchEnabled Boolean <optional>
Enable raw nearest match
Source:
Throws:
Error if request fails

(async) get(workspace, layerName) → {Object}

Returns a GeoServer layer by the given workspace and layer name, e.g. "myWs:myLayer".
Parameters:
Name Type Description
workspace String The name of the workspace, can be undefined
layerName String The name of the layer to query
Source:
Throws:
Error if request fails
Returns:
An object with layer information or undefined if it cannot be found
Type
Object

(async) getAll() → {Object}

Returns all layers in the GeoServer.
Source:
Throws:
Error if request fails
Returns:
An object with all layer information
Type
Object

(async) getCoverage(workspace, coverageStore, name) → {Object}

Returns a dedicated coverage object.
Parameters:
Name Type Description
workspace String Workspace containing the coverage
coverageStore String The coveragestore containing the coverage
name String Coverage to query
Source:
Throws:
Error if request fails
Returns:
An object with coverage information or undefined if it cannot be found
Type
Object

(async) getFeatureType(workspace, datastore, name) → {Object}

Get detailed information about a FeatureType.
Parameters:
Name Type Description
workspace String The workspace of the FeatureType
datastore String The datastore of the FeatureType
name String The name of the FeatureType
Source:
Throws:
Error if request fails
Returns:
The object of the FeatureType
Type
Object

(async) getLayers(workspace) → {Object}

Get all layers of a workspace.
Parameters:
Name Type Description
workspace String The workspace
Source:
Throws:
Error if request fails
Returns:
An object with the information about the layers
Type
Object

(async) getWmsLayer(workspace, datastore, layerName) → {Object}

Returns information about a cascaded WMS layer.
Parameters:
Name Type Description
workspace String The workspace
datastore String The datastore
layerName String The WMS layer name
Source:
Throws:
Error if request fails
Returns:
An object with layer information or undefined if it cannot be found
Type
Object

(async) getWmtsLayer(workspace, datastore, layerName) → {Object}

Returns information about a cascaded WMTS layer.
Parameters:
Name Type Description
workspace String The workspace
datastore String The datastore
layerName String The WMTS layer name
Source:
Throws:
Error if request fails
Returns:
An object with layer information or undefined if it cannot be found
Type
Object

(async) modifyAttribution(workspace, layerName, attributionTextopt, attributionLinkopt)

Sets the attribution text and link of a layer.
Parameters:
Name Type Attributes Description
workspace String The name of the workspace, can be undefined
layerName String The name of the layer to query
attributionText String <optional>
The attribution text
attributionLink String <optional>
The attribution link
Source:
Throws:
Error if request fails

(async) publishDbRaster(workspace, coverageStore, nativeName, name, titleopt, srsopt, enabled, abstractopt)

Publishes a raster stored in a database.
Parameters:
Name Type Attributes Default Description
workspace String Workspace to publish layer in
coverageStore String The coveragestore where the layer's data is in
nativeName String Native name of raster
name String Published name of layer
title String <optional>
Published title of layer
srs String <optional>
"EPSG:4326" The SRS of the layer
enabled String Flag to enable layer by default
abstract String <optional>
The abstract of the layer
Source:
Throws:
Error if request fails

(async) publishFeatureType(workspace, dataStore, nativeNameopt, name, titleopt, srsopt, enabled, abstractopt, nativeBoundingBoxopt)

Publishes a FeatureType in the given data store of the workspace.
Parameters:
Name Type Attributes Default Description
workspace String Workspace to publish FeatureType in
dataStore String The datastore where the FeatureType's data is in
nativeName String <optional>
Native name of FeatureType
name String Published name of FeatureType
title String <optional>
Published title of FeatureType
srs String <optional>
"EPSG:4326" The SRS of the FeatureType
enabled String Flag to enable FeatureType by default
abstract String <optional>
The abstract of the layer
nativeBoundingBox String <optional>
The native BoundingBox of the FeatureType (has to be set if no data is in store at creation time)
Source:
Throws:
Error if request fails

(async) publishFeatureTypeDefaultDataStore(workspace, nativeNameopt, name, titleopt, srsopt, enabled, abstractopt)

Publishes a FeatureType in the default data store of the workspace.
Parameters:
Name Type Attributes Default Description
workspace String Workspace to publish FeatureType in
nativeName String <optional>
Native name of FeatureType
name String Published name of FeatureType
title String <optional>
Published title of FeatureType
srs String <optional>
"EPSG:4326" The SRS of the FeatureType
enabled String Flag to enable FeatureType by default
abstract String <optional>
The abstract of the layer
Source:
Throws:
Error if request fails

(async) publishWmsLayer(workspace, dataStore, nativeName, nameopt, titleopt, srsopt, enabled, abstractopt)

Publishes a WMS layer.
Parameters:
Name Type Attributes Default Description
workspace String Workspace to publish WMS layer in
dataStore String The datastore where the WMS is connected
nativeName String Native name of WMS layer
name String <optional>
Published name of WMS layer
title String <optional>
Published title of WMS layer
srs String <optional>
"EPSG:4326" The SRS of the WMS layer
enabled String Flag to enable WMS layer by default
abstract String <optional>
The abstract of the layer
Source:
Throws:
Error if request fails

(async) renameCoverageBands(workspace, datastore, layername, bandNames)

Renames the existing bands of a coverage layer. Make sure to provide the same number of bands as existing in the layer.
Parameters:
Name Type Description
workspace String Workspace of layer
datastore String The datastore of the layer
layername String The layer name
bandNames Array.<String> An array of the new band names in correct order
Source:
Throws:
Error if request fails