GSDataStoreManager: Geoserver REST API DataStore Manager

GSDataStoreManagerR Documentation

Geoserver REST API DataStore Manager

Description

Geoserver REST API DataStore Manager

Geoserver REST API DataStore Manager

Format

R6Class object.

Value

Object of R6Class with methods for managing GeoServer DataStores (i.e. stores of vector data)

Super class

geosapi::GSManager -> GSDataStoreManager

Methods

Public methods

Inherited methods

Method getDataStores()

Get the list of available dataStores.

Usage
GSDataStoreManager$getDataStores(ws)
Arguments
ws

workspace name

Returns

an object of class list giving items of class GSAbstractDataStore


Method getDataStoreNames()

Get the list of available dataStore names.

Usage
GSDataStoreManager$getDataStoreNames(ws)
Arguments
ws

workspace name

Returns

a vector of class character


Method getDataStore()

Get an object of class GSAbstractDataStore given a workspace and datastore names.

Usage
GSDataStoreManager$getDataStore(ws, ds)
Arguments
ws

workspace name

ds

datastore name

Returns

the datastore


Method createDataStore()

Creates a datastore given a workspace and an object of class GSAbstractDataStore.

Usage
GSDataStoreManager$createDataStore(ws, dataStore)
Arguments
ws

workspace name

dataStore

datastore object of class GSAbstractDataStore

Returns

TRUE if created, FALSE otherwise


Method updateDataStore()

Updates a datastore given a workspace and an object of class GSAbstractDataStore.

Usage
GSDataStoreManager$updateDataStore(ws, dataStore)
Arguments
ws

workspace name

dataStore

datastore object of class GSAbstractDataStore

Returns

TRUE if updated, FALSE otherwise


Method deleteDataStore()

Deletes a datastore given workspace and datastore names. By defaut, the option recurse is set to FALSE, ie datastore layers are not removed. To remove all datastore layers, set this option to TRUE.

Usage
GSDataStoreManager$deleteDataStore(ws, ds, recurse = FALSE)
Arguments
ws

workspace name

ds

datastore name

recurse

recurse

Returns

TRUE if deleted, FALSE otherwise


Method getFeatureTypes()

Get the list of available feature types for given workspace and datastore.

Usage
GSDataStoreManager$getFeatureTypes(ws, ds, list = "configured")
Arguments
ws

workspace name

ds

datastore name

list

list type value, among "configured", "available", "available_with_geom", "all"

Returns

an object of class list giving items of class GSFeatureType


Method getFeatureTypeNames()

Get the list of available feature type names for given workspace and datastore.

Usage
GSDataStoreManager$getFeatureTypeNames(ws, ds)
Arguments
ws

workspace name

ds

datastore name

Returns

a vector of classcharacter


Method getFeatureType()

Get an object of class GSFeatureType given a workspace, datastore and feature type names.

Usage
GSDataStoreManager$getFeatureType(ws, ds, ft)
Arguments
ws

workspace name

ds

datastore name

ft

feature type name

Returns

an object of class GSFeatureType


Method createFeatureType()

Creates a new featureType given a workspace, datastore names and an object of class GSFeatureType

Usage
GSDataStoreManager$createFeatureType(ws, ds, featureType)
Arguments
ws

workspace name

ds

datastore name

featureType

feature type

Returns

TRUE if created, FALSE otherwise


Method updateFeatureType()

Updates a featureType given a workspace, datastore names and an object of class GSFeatureType

Usage
GSDataStoreManager$updateFeatureType(ws, ds, featureType)
Arguments
ws

workspace name

ds

datastore name

featureType

feature type

Returns

TRUE if updated, FALSE otherwise


Method deleteFeatureType()

Deletes a featureType given a workspace, datastore names, and an object of class GSFeatureType. By defaut, the option recurse is set to FALSE, ie datastore layers are not removed.

Usage
GSDataStoreManager$deleteFeatureType(ws, ds, ft, recurse = FALSE)
Arguments
ws

workspace name

ds

datastore name

ft

feature type name

recurse

recurse

Returns

TRUE if deleted, FALSE otherwise


Method publishLayer()

Publish a feature type/layer pair given a workspace and datastore. The name 'layer' here encompasses both GSFeatureType and GSLayer resources.

Usage
GSDataStoreManager$publishLayer(ws, ds, featureType, layer)
Arguments
ws

workspace name

ds

datastore name

featureType

object of class GSFeatureType

layer

object of class GSLayer

Returns

TRUE if published, FALSE otherwise


Method unpublishLayer()

Unpublish a feature type/layer pair given a workspace and datastore. The name 'layer' here encompasses both GSFeatureType and GSLayer resources.

Usage
GSDataStoreManager$unpublishLayer(ws, ds, lyr)
Arguments
ws

workspace name

ds

datastore name

lyr

layer name

Returns

TRUE if published, FALSE otherwise


Method uploadData()

Uploads features data. The extension corresponds to the format/type of features to be uploaded among "shp", "spatialite", "h2", "gpkg". The endpoint takes a value among "file" (default), "url" or "external". The filename is the name of the coverage file to upload and set for the newly created datastore. The configure parameter can take a value among values "none" (indicates to configure only the datastore but no layer configuration) or "first" (configure both datastore and layer). The update defines the strategy for the upload: "append" (default value) for the first upload, "overwrite" in case the file should be overwriten.

Usage
GSDataStoreManager$uploadData(
  ws,
  ds,
  endpoint = "file",
  extension,
  configure = "first",
  update = "append",
  filename,
  charset,
  contentType
)
Arguments
ws

workspace name

ds

datastore name

endpoint

endpoint

extension

extension

configure

configure strategy among values: "first" or "none"

update

update strategy, among values: "append", "overwrite"

filename

file name of the resource to upload

charset

charset

contentType

content type

Returns

TRUE if uploaded, FALSE otherwise


Method uploadShapefile()

Uploads zipped shapefile. The endpoint takes a value among "file" (default), "url" or "external". The filename is the name of the coverage file to upload and set for the newly created datastore. The configure parameter can take a value among values "none" (indicates to configure only the datastore but no layer configuration) or "first" (configure both datastore and layer). The update defines the strategy for the upload: "append" (default value) for the first upload, "overwrite" in case the file should be overwriten.

Usage
GSDataStoreManager$uploadShapefile(
  ws,
  ds,
  endpoint = "file",
  configure = "first",
  update = "append",
  filename,
  charset = "UTF-8"
)
Arguments
ws

workspace name

ds

datastore name

endpoint

endpoint

configure

configure strategy among values: "first" or "none"

update

update strategy, among values: "append", "overwrite"

filename

file name of the resource to upload

charset

charset

Returns

TRUE if uploaded, FALSE otherwise


Method uploadProperties()

Uploads properties. The endpoint takes a value among "file" (default), "url" or "external". The filename is the name of the coverage file to upload and set for the newly created datastore. The configure parameter can take a value among values "none" (indicates to configure only the datastore but no layer configuration) or "first" (configure both datastore and layer). The update defines the strategy for the upload: "append" (default value) for the first upload, "overwrite" in case the file should be overwriten.

Usage
GSDataStoreManager$uploadProperties(
  ws,
  ds,
  endpoint = "file",
  configure = "first",
  update = "append",
  filename,
  charset = "UTF-8"
)
Arguments
ws

workspace name

ds

datastore name

endpoint

endpoint

configure

configure strategy among values: "first" or "none"

update

update strategy, among values: "append", "overwrite"

filename

file name of the resource to upload

charset

charset

Returns

TRUE if uploaded, FALSE otherwise


Method uploadH2()

Uploads H2 database. The endpoint takes a value among "file" (default), "url" or "external". The filename is the name of the coverage file to upload and set for the newly created datastore. The configure parameter can take a value among values "none" (indicates to configure only the datastore but no layer configuration) or "first" (configure both datastore and layer). The update defines the strategy for the upload: "append" (default value) for the first upload, "overwrite" in case the file should be overwriten.

Usage
GSDataStoreManager$uploadH2(
  ws,
  ds,
  endpoint = "file",
  configure = "first",
  update = "append",
  filename,
  charset = "UTF-8"
)
Arguments
ws

workspace name

ds

datastore name

endpoint

endpoint

configure

configure strategy among values: "first" or "none"

update

update strategy, among values: "append", "overwrite"

filename

file name of the resource to upload

charset

charset

Returns

TRUE if uploaded, FALSE otherwise


Method uploadSpatialite()

Uploads spatialite file. The endpoint takes a value among "file" (default), "url" or "external". The filename is the name of the coverage file to upload and set for the newly created datastore. The configure parameter can take a value among values "none" (indicates to configure only the datastore but no layer configuration) or "first" (configure both datastore and layer). The update defines the strategy for the upload: "append" (default value) for the first upload, "overwrite" in case the file should be overwriten.

Usage
GSDataStoreManager$uploadSpatialite(
  ws,
  ds,
  endpoint = "file",
  configure = "first",
  update = "append",
  filename,
  charset = "UTF-8"
)
Arguments
ws

workspace name

ds

datastore name

endpoint

endpoint

configure

configure strategy among values: "first" or "none"

update

update strategy, among values: "append", "overwrite"

filename

file name of the resource to upload

charset

charset

Returns

TRUE if uploaded, FALSE otherwise


Method uploadAppschema()

Uploads App schema. The endpoint takes a value among "file" (default), "url" or "external". The filename is the name of the coverage file to upload and set for the newly created datastore. The configure parameter can take a value among values "none" (indicates to configure only the datastore but no layer configuration) or "first" (configure both datastore and layer). The update defines the strategy for the upload: "append" (default value) for the first upload, "overwrite" in case the file should be overwriten.

Usage
GSDataStoreManager$uploadAppschema(
  ws,
  ds,
  endpoint = "file",
  configure = "first",
  update = "append",
  filename,
  charset = "UTF-8"
)
Arguments
ws

workspace name

ds

datastore name

endpoint

endpoint

configure

configure strategy among values: "first" or "none"

update

update strategy, among values: "append", "overwrite"

filename

file name of the resource to upload

charset

charset

Returns

TRUE if uploaded, FALSE otherwise


Method uploadGeoPackage()

Uploads GeoPackage. The endpoint takes a value among "file" (default), "url" or "external". The filename is the name of the coverage file to upload and set for the newly created datastore. The configure parameter can take a value among values "none" (indicates to configure only the datastore but no layer configuration) or "first" (configure both datastore and layer). The update defines the strategy for the upload: "append" (default value) for the first upload, "overwrite" in case the file should be overwriten.

Usage
GSDataStoreManager$uploadGeoPackage(
  ws,
  ds,
  endpoint = "file",
  configure = "first",
  update = "append",
  filename,
  charset = "UTF-8"
)
Arguments
ws

workspace name

ds

datastore name

endpoint

endpoint

configure

configure strategy among values: "first" or "none"

update

update strategy, among values: "append", "overwrite"

filename

file name of the resource to upload

charset

charset

Returns

TRUE if uploaded, FALSE otherwise


Method clone()

The objects of this class are cloneable with this method.

Usage
GSDataStoreManager$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Emmanuel Blondel <emmanuel.blondel1@gmail.com>

Examples

## Not run: 
   GSDataStoreManager$new("http://localhost:8080/geoserver", "admin", "geoserver")
 
## End(Not run)


geosapi documentation built on Oct. 4, 2023, 5:06 p.m.