WFSClient | R Documentation |
WFSClient
WFSClient
R6Class
object.
Object of R6Class
with methods for interfacing an OGC
Web Feature Service.
ows4R::OGCAbstractObject
-> ows4R::OWSClient
-> WFSClient
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()
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
WFSClient$new( url, serviceVersion = NULL, user = NULL, pwd = NULL, token = NULL, headers = c(), config = httr::config(), cas_url = NULL, logger = NULL )
url
url
serviceVersion
WFS service version
user
user
pwd
password
token
token
headers
headers
config
config
cas_url
Central Authentication Service (CAS) URL
logger
logger
getCapabilities()
Get WFS capabilities
WFSClient$getCapabilities()
an object of class WFSCapabilities
reloadCapabilities()
Reloads WFS capabilities
WFSClient$reloadCapabilities()
describeFeatureType()
Describes a feature type
WFSClient$describeFeatureType(typeName)
typeName
the name of the feature type
a list
of WFSFeatureTypeElement
getFeatures()
Get features
WFSClient$getFeatures(typeName, ...)
typeName
the name of the feature type
...
any other parameter to pass to the WFSGetFeature request
features as object of class sf
getFeatureTypes()
List the feature types available. If pretty
is TRUE,
the output will be an object of class data.frame
WFSClient$getFeatureTypes(pretty = FALSE)
pretty
whether the output should be summarized as data.frame
a list
of WFSFeatureType or a data.frame
clone()
The objects of this class are cloneable with this method.
WFSClient$clone(deep = FALSE)
deep
Whether to make a deep clone.
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
## Not run:
#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")
#get capabilities
caps <- wfs$getCapabilities()
#find feature type
ft <- caps$findFeatureTypeByName("mylayer")
if(length(ft)>0){
data <- ft$getFeatures()
data_with_filter <- ft$getFeatures(cql_filter = "somefilter")
}
#Advanced examples at https://github.com/eblondel/ows4R/wiki#wfs
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.