Publishes bands of a multi-band GeoTIFF raster file as separate coverages in a specified workspace on a GeoServer instance.
Usage
publish_bands(gso, raster, prefix, postfix, bands)
# S3 method for class 'geoserver'
publish_bands(gso, raster, prefix = NULL, postfix = NULL, bands = NULL)
Arguments
- gso
An object of class `geoserver` containing GeoServer connection details.
- raster
A character string specifying the file path to the GeoTIFF raster file to be uploaded.
- prefix
A string to prepend to each layer name. Default is `NULL`.
- postfix
A string to append to each layer name. Default is `NULL`.
- bands
A named integer vector, index of the bands to publish with layer names. If it is `NULL`, which is the default value, all bands are published using the band name as the layer name. If unnamed indices are provided, the band name is also used as the layer name.
Value
An integer:
0
if the operation was successful or if the layer already exists.1
if an error occurred.
See also
Other publish to GeoServer:
geoserver()
,
publish_layer()
,
publish_layer_set()
,
publish_raster()
,
register_datastore_postgis()
Examples
if (FALSE) { # \dontrun{
gso <- geoserver(
url = "http://localhost:8080/geoserver",
user = "admin",
password = "geoserver",
workspace = "sigugr_test"
)
source_tif <- system.file("extdata/sat.tif", package = "sigugr")
gso |>
publish_bands(source_tif)
} # }