diff --git a/NAMESPACE b/NAMESPACE index 9f1f67d..54b480b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -44,6 +44,7 @@ export(GSVirtualTableParameter) export(GSWorkspace) export(GSWorkspaceManager) export(GSWorkspaceSettings) +export(GSWorldImageCoverageStore) import(XML) import(httr) import(keyring) diff --git a/R/GSAbstractCoverageStore.R b/R/GSAbstractCoverageStore.R index 2c1e4fc..5164786 100644 --- a/R/GSAbstractCoverageStore.R +++ b/R/GSAbstractCoverageStore.R @@ -31,7 +31,7 @@ GSAbstractCoverageStore <- R6Class("GSAbstractCoverageStore", public = list( url = NULL, initialize = function(xml = NULL, type = NULL, - name = NULL, description = "", enabled = TRUE, url){ + name = NULL, description = "", enabled = TRUE, url = NULL){ super$initialize(xml = xml, storeType = private$STORE_TYPE, type = type, name = name, description = description, enabled = enabled) if(!missing(xml) & !is.null(xml)){ diff --git a/R/GSArcGridCoverageStore.R b/R/GSArcGridCoverageStore.R index 3c64c8a..c40235d 100644 --- a/R/GSArcGridCoverageStore.R +++ b/R/GSArcGridCoverageStore.R @@ -23,7 +23,7 @@ GSArcGridCoverageStore <- R6Class("GSArcGridCoverageStore", ), public = list( url = NULL, - initialize = function(xml = NULL, name = NULL, description = "", enabled = TRUE, url){ + initialize = function(xml = NULL, name = NULL, description = "", enabled = TRUE, url = NULL){ super$initialize(xml = xml, type = private$TYPE, name = name, description = description, enabled = enabled, url = url) } diff --git a/R/GSCoverageStoreManager.R b/R/GSCoverageStoreManager.R index 51e4c00..cc8d96f 100644 --- a/R/GSCoverageStoreManager.R +++ b/R/GSCoverageStoreManager.R @@ -245,7 +245,7 @@ GSCoverageStoreManager <- R6Class("GSCoverageStoreManager", pwd = private$keyring_backend$get(service = private$keyring_service, username = private$user), path = sprintf("/workspaces/%s/coveragestores.xml", ws), content = GSUtils$getPayloadXML(coverageStore), - contentType = "text/xml", + contentType = "application/xml", verbose = self$verbose.debug ) if(status_code(req) == 201){ @@ -368,7 +368,7 @@ GSCoverageStoreManager <- R6Class("GSCoverageStoreManager", pwd = private$keyring_backend$get(service = private$keyring_service, username = private$user), path = sprintf("/workspaces/%s/coveragestores/%s/coverages.xml", ws, cs), content = GSUtils$getPayloadXML(coverage), - contentType = "text/xml", + contentType = "application/xml", verbose = self$verbose.debug ) if(status_code(req) == 201){ @@ -487,7 +487,7 @@ GSCoverageStoreManager <- R6Class("GSCoverageStoreManager", ws = ws, cs = cs, endpoint = endpoint, extension = "geotiff", filename = filename, configure = configure, update = update, - contentType = "image/geotiff" + contentType = "text/plain" )) }, @@ -511,7 +511,7 @@ GSCoverageStoreManager <- R6Class("GSCoverageStoreManager", ws = ws, cs = cs, endpoint = endpoint, extension = "arcgrid", filename = filename, configure = configure, update = update, - contentType = "image/arcgrid" + contentType = "text/plain" )) }, diff --git a/R/GSGeoTIFFCoverageStore.R b/R/GSGeoTIFFCoverageStore.R index b35740d..1d437f7 100644 --- a/R/GSGeoTIFFCoverageStore.R +++ b/R/GSGeoTIFFCoverageStore.R @@ -23,7 +23,7 @@ GSGeoTIFFCoverageStore <- R6Class("GSGeoTIFFCoverageStore", ), public = list( url = NULL, - initialize = function(xml = NULL, name = NULL, description = "", enabled = TRUE, url){ + initialize = function(xml = NULL, name = NULL, description = "", enabled = TRUE, url = NULL){ super$initialize(xml = xml, type = private$TYPE, name = name, description = description, enabled = enabled, url = url) } diff --git a/R/GSImageMosaicCoverageStore.R b/R/GSImageMosaicCoverageStore.R index 8b3c4c1..8795d05 100644 --- a/R/GSImageMosaicCoverageStore.R +++ b/R/GSImageMosaicCoverageStore.R @@ -23,7 +23,7 @@ GSImageMosaicCoverageStore <- R6Class("GSImageMosaicCoverageStore", ), public = list( url = NULL, - initialize = function(xml = NULL, name = NULL, description = "", enabled = TRUE, url){ + initialize = function(xml = NULL, name = NULL, description = "", enabled = TRUE, url = NULL){ super$initialize(xml = xml, type = private$TYPE, name = name, description = description, enabled = enabled, url = url) } diff --git a/R/GSUtils.R b/R/GSUtils.R index 2f3e7f0..bf6a5f2 100644 --- a/R/GSUtils.R +++ b/R/GSUtils.R @@ -101,7 +101,7 @@ GSUtils$PUT <- function(url, user, pwd, path, add_headers( "User-Agent" = GSUtils$getUserAgent(), "Authorization" = paste("Basic", GSUtils$getUserToken(user, pwd)), - "Content-type" = contentType + "Content-Type" = contentType ), body = body ) @@ -120,7 +120,7 @@ GSUtils$POST <- function(url, user, pwd, path, content, contentType, verbose = F add_headers( "User-Agent" = GSUtils$getUserAgent(), "Authorization" = paste("Basic", GSUtils$getUserToken(user, pwd)), - "Content-type" = contentType + "Content-Type" = contentType ), body = content ) diff --git a/R/GSWorldImageCoverageStore.R b/R/GSWorldImageCoverageStore.R new file mode 100644 index 0000000..c72c338 --- /dev/null +++ b/R/GSWorldImageCoverageStore.R @@ -0,0 +1,31 @@ +#' Geoserver REST API WorldImageCoverageStore +#' +#' @docType class +#' @importFrom R6 R6Class +#' @export +#' @keywords geoserver rest api CoverageStore WorldImage +#' @return Object of \code{\link{R6Class}} for modelling a GeoServer WorldImage CoverageStore +#' @format \code{\link{R6Class}} object. +#' +#' @section Methods: +#' \describe{ +#' \item{\code{new(xml, name, description, enabled, url)}}{ +#' This method is used to instantiate a \code{GSWorldImageCoverageStore} +#' } +#' } +#' +#' @author Emmanuel Blondel +#' +GSWorldImageCoverageStore <- R6Class("GSWorldImageCoverageStore", + inherit = GSAbstractCoverageStore, + private = list( + TYPE = "WorldImage" + ), + public = list( + url = NULL, + initialize = function(xml = NULL, name = NULL, description = "", enabled = TRUE, url = NULL){ + super$initialize(xml = xml, type = private$TYPE, + name = name, description = description, enabled = enabled, url = url) + } + ) +) diff --git a/man/GSWorldImageCoverageStore.Rd b/man/GSWorldImageCoverageStore.Rd new file mode 100644 index 0000000..7b5180f --- /dev/null +++ b/man/GSWorldImageCoverageStore.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/GSWorldImageCoverageStore.R +\docType{class} +\name{GSWorldImageCoverageStore} +\alias{GSWorldImageCoverageStore} +\title{Geoserver REST API WorldImageCoverageStore} +\format{ +\code{\link{R6Class}} object. +} +\value{ +Object of \code{\link{R6Class}} for modelling a GeoServer WorldImage CoverageStore +} +\description{ +Geoserver REST API WorldImageCoverageStore +} +\section{Methods}{ + +\describe{ + \item{\code{new(xml, name, description, enabled, url)}}{ + This method is used to instantiate a \code{GSWorldImageCoverageStore} + } +} +} + +\author{ +Emmanuel Blondel +} +\keyword{CoverageStore} +\keyword{WorldImage} +\keyword{api} +\keyword{geoserver} +\keyword{rest}