Learn R Programming

ows4R (version 0.2)

WFSClient: WFSClient

Description

WFSClient

Arguments

Value

Object of R6Class with methods for interfacing an OGC Web Feature Service.

Format

R6Class object.

Methods

new(url, serviceVersion, user, pwd, logger)

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

getCapabilities()

Get service capabilities. Inherited from OWS Client

reloadCapabilities()

Reload service capabilities

describeFeatureType(typeName)

Get the description of a given featureType

getFeatures(typeName, ...)

Retrieves the features for a given feature type.

getFeatureTypes(pretty)

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

Examples

Run this code
# 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
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab