WFSClient
WFSClient
Format
R6Class
object.
Value
Object of R6Class
with methods for interfacing an OGC
Web Feature Service.
Super classes
ows4R::OGCAbstractObject
-> ows4R::OWSClient
-> WFSClient
Methods
Inherited methods
ows4R::OGCAbstractObject$ERROR()
ows4R::OGCAbstractObject$INFO()
ows4R::OGCAbstractObject$WARN()
ows4R::OGCAbstractObject$encode()
ows4R::OGCAbstractObject$getClass()
ows4R::OGCAbstractObject$getClassName()
ows4R::OGCAbstractObject$getNamespaceDefinition()
ows4R::OGCAbstractObject$isFieldInheritedFrom()
ows4R::OGCAbstractObject$logger()
ows4R::OGCAbstractObject$print()
ows4R::OWSClient$getCASUrl()
ows4R::OWSClient$getConfig()
ows4R::OWSClient$getHeaders()
ows4R::OWSClient$getPwd()
ows4R::OWSClient$getToken()
ows4R::OWSClient$getUrl()
ows4R::OWSClient$getUser()
ows4R::OWSClient$getVersion()
Method new()
This method is used to instantiate a WFSClient with the url
of the
OGC service. Authentication is supported using basic auth (using user
/pwd
arguments),
bearer token (using token
argument), or custom (using headers
argument). By default, the logger
argument will be set to NULL
(no logger). This argument accepts two possible
values: INFO
: to print only ows4R logs, DEBUG
: to print more verbose logs
Method getFeatures()
Get features
Arguments
typeName
the name of the feature type
...
any other parameter to pass to the WFSGetFeature request
Method getFeatureTypes()
List the feature types available. If pretty
is TRUE,
the output will be an object of class data.frame
Returns
a list
of WFSFeatureType or a data.frame
Examples
# \dontrun{
#example based on a WFS endpoint responding at http://localhost:8080/geoserver/wfs
wfs <- WFSClient$new("http://localhost:8080/geoserver/wfs", serviceVersion = "1.1.1")
#> Error in curl::curl_fetch_memory(url, handle = handle): Failed to connect to localhost port 8080 after 0 ms: Connection refused
#get capabilities
caps <- wfs$getCapabilities()
#> Error in eval(expr, envir, enclos): object 'wfs' not found
#find feature type
ft <- caps$findFeatureTypeByName("mylayer")
#> Error in eval(expr, envir, enclos): object 'caps' not found
if(length(ft)>0){
data <- ft$getFeatures()
data_with_filter <- ft$getFeatures(cql_filter = "somefilter")
}
#> Error in eval(expr, envir, enclos): object 'ft' not found
#Advanced examples at https://github.com/eblondel/ows4R/wiki#wfs
# }