Skip to contents

Geoserver REST API Style Manager

Geoserver REST API Style Manager

Format

R6Class object.

Value

Object of R6Class with methods for managing the styles of a GeoServer instance.

Author

Emmanuel Blondel <emmanuel.blondel1@gmail.com>

Super class

geosapi::GSManager -> GSStyleManager

Methods

Inherited methods


Method getStyles()

Get the list of available styles.

Usage

GSStyleManager$getStyles(ws = NULL)

Arguments

ws

an optional workspace name

Returns

an object of class list containing items of class GSStyle


Method getStyleNames()

Get the list of available style names

Usage

GSStyleManager$getStyleNames(ws = NULL)

Arguments

ws

an optional workspace name

Returns

a vector of class character


Method getStyle()

Get a GSStyle object given a style name.

Usage

GSStyleManager$getStyle(style, ws = NULL)

Arguments

style

style name

ws

workspace name. Optional

Returns

object of class GSStyle


Method createStyle()

Creates a GeoServer style given a name.

Usage

GSStyleManager$createStyle(file, sldBody = NULL, name, raw = FALSE, ws = NULL)

Arguments

file

file

sldBody

SLD body

name

name

raw

raw

ws

workspace name

Returns

TRUE if the style has been successfully created, FALSE otherwise


Method updateStyle()

Updates a GeoServer style given a name.

Usage

GSStyleManager$updateStyle(file, sldBody = NULL, name, raw = FALSE, ws = NULL)

Arguments

file

file

sldBody

SLD body

name

name

raw

raw

ws

workspace name

Returns

TRUE if the style has been successfully updated, FALSE otherwise


Method deleteStyle()

Deletes a style given a name. By defaut, the option recurse is set to FALSE, ie datastore layers are not removed. To remove all coverage store layers, set this option to TRUE. The purge parameter is used to customize the delete of files on disk (in case the underlying reader implements a delete method).

Usage

GSStyleManager$deleteStyle(name, recurse = FALSE, purge = FALSE, ws = NULL)

Arguments

name

name

recurse

recurse

purge

purge

ws

workspace name

Returns

TRUE if the style has been successfully deleted, FALSE otherwise


Method getSLDVersion()

Get SLD version

Usage

GSStyleManager$getSLDVersion(sldBody)

Arguments

sldBody

SLD body


Method getSLDBody()

Get SLD body

Usage

GSStyleManager$getSLDBody(style, ws = NULL)

Arguments

style

style name

ws

workspace name

Returns

an object of class xml_node-class


Method clone()

The objects of this class are cloneable with this method.

Usage

GSStyleManager$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# \dontrun{
   GSStyleManager$new("http://localhost:8080/geoserver", "admin", "geoserver")
#> Error in curl::curl_fetch_memory(url, handle = handle): Failed to connect to localhost port 8080 after 0 ms: Connection refused
# }