WFSClient: WFSClient

WFSClientR Documentation

WFSClient

Description

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

Public methods

Inherited methods

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

Usage
WFSClient$new(
  url,
  serviceVersion = NULL,
  user = NULL,
  pwd = NULL,
  token = NULL,
  headers = c(),
  config = httr::config(),
  cas_url = NULL,
  logger = NULL
)
Arguments
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


Method getCapabilities()

Get WFS capabilities

Usage
WFSClient$getCapabilities()
Returns

an object of class WFSCapabilities


Method reloadCapabilities()

Reloads WFS capabilities

Usage
WFSClient$reloadCapabilities()

Method describeFeatureType()

Describes a feature type

Usage
WFSClient$describeFeatureType(typeName)
Arguments
typeName

the name of the feature type

Returns

a list of WFSFeatureTypeElement


Method getFeatures()

Get features

Usage
WFSClient$getFeatures(typeName, ...)
Arguments
typeName

the name of the feature type

...

any other parameter to pass to the WFSGetFeature request

Returns

features as object of class sf


Method getFeatureTypes()

List the feature types available. If pretty is TRUE, the output will be an object of class data.frame

Usage
WFSClient$getFeatureTypes(pretty = FALSE)
Arguments
pretty

whether the output should be summarized as data.frame

Returns

a list of WFSFeatureType or a data.frame


Method clone()

The objects of this class are cloneable with this method.

Usage
WFSClient$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Emmanuel Blondel <emmanuel.blondel1@gmail.com>

Examples

## 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)


ows4R documentation built on Sept. 1, 2023, 5:09 p.m.