Skip to contents

Publishes a vector layer to GeoServer. The layer source must have previously been defined as a GeoSever datastore.

Usage

publish_layer(gso, layer, title)

# S3 method for class 'geoserver'
publish_layer(gso, layer, title = NULL)

Arguments

gso

An object of class `geoserver` containing GeoServer connection details.

layer

A string, the name of the layer to publish.

title

A string, an optional title for the layer. Defaults to the layer name if not provided.

Value

An integer:

  • 0 if the operation was successful or if the layer already exists.

  • 1 if an error occurred.

Details

Prints an appropriate message indicating success or failure.

See also

Examples

if (FALSE) { # \dontrun{
gso <- geoserver(
  url = "http://localhost:8080/geoserver",
  user = "admin",
  password = "geoserver",
  workspace = "sigugr_test"
)

gso <- gso |>
  register_datastore_postgis(
    "sigugr-postgis",
    db_name = 'sigugr_example',
    host = 'localhost',
    port = 5432,
    db_user = 'user',
    db_password = 'password',
    schema = "public"
  )

gso |>
  publish_layer(layer = 'sigugr_layer')
} # }