Skip to content

Commit

Permalink
#1 missing Rdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Feb 16, 2018
1 parent e746d63 commit 76bad19
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 24 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export(OWSClient)
export(OWSRequest)
export(OWSServiceIdentification)
export(OWSUtils)
export(OWSUtilsInternal)
export(WFSCapabilities)
export(WFSClient)
export(WFSDescribeFeatureType)
Expand Down
28 changes: 24 additions & 4 deletions R/OWSRequest.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
#' OWSRequest
#'
#' @docType class
#' @export
#' @keywords OGC OWS Request
#' @return Object of \code{\link{R6Class}} for modelling a generic OWS request
#' @format \code{\link{R6Class}} object.
#'
#' @field request
#' @field status
#' @field response
#'
#' @section Methods:
#' \describe{
#' \item{\code{new(url, namedParams, mimeType)}}{
#' This method is used to instantiate a object for doing an OWS request
#' }
#' }
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
OWSRequest <- R6Class("OWSRequest",
#private methods
private = list(
#buildRequest
buildRequest = function(baseUrl, namedParams, mimeType){
buildRequest = function(url, namedParams, mimeType){
params <- paste(names(namedParams), namedParams, sep = "=", collapse = "&")
request <- paste(baseUrl, "&", params, sep = "")
request <- paste(url, "&", params, sep = "")
message("Fetching ", request)
r <- GET(request)
responseContent <- NULL
Expand All @@ -28,8 +48,8 @@ OWSRequest <- R6Class("OWSRequest",
status = NA,
response = NA,
#initialize
initialize = function(baseUrl, namedParams, mimeType = "text/xml") {
req <- private$buildRequest(baseUrl, namedParams, mimeType)
initialize = function(url, namedParams, mimeType = "text/xml") {
req <- private$buildRequest(url, namedParams, mimeType)
self$request <- req$request
self$status <- req$status
self$response <- req$response
Expand Down
34 changes: 15 additions & 19 deletions R/OWSUtils.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#' OWSUtils
#'
#' @export
OWSUtilsInternal <- R6Class("OWSUtilsInternal",
public = list(

initialize = function(){
},

#' @keywords OGC OWS Utils
#' @return set of OWS Utilities
#' @format \code{\link{R6Class}} object.
#'
#' @section Static methods:
#' \describe{
#' }
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
#'
OWSUtils <- list(

#getNamespaces
#---------------------------------------------------------------
getNamespaces = function(xmlObj) {
Expand Down Expand Up @@ -137,16 +145,4 @@ OWSUtilsInternal <- R6Class("OWSUtilsInternal",
ratio <- (bbox[1,2]-bbox[1,1]) / (bbox[2,2]-bbox[2,1])
return(ratio)
}

)
)

#'@export
OWSUtils <- list(
getNamespaces = OWSUtilsInternal$new()$getNamespaces,
findNamespace = OWSUtilsInternal$new()$findNamespace,
toBBOX = OWSUtilsInternal$new()$toBBOX,
toCRS = OWSUtilsInternal$new()$toCRS,
toEPSG = OWSUtilsInternal$new()$toEPSG,
getAspectRatio = OWSUtilsInternal$new()$getAspectRatio
)
)
37 changes: 37 additions & 0 deletions man/OWSRequest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions man/OWSUtils.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 76bad19

Please sign in to comment.