# NOT RUN {
# simple default values
show(sosDefaultCharacterEncoding)
show(sosDefaultDescribeSensorOutputFormat)
show(sosDefaultGetCapAcceptFormats)
show(sosDefaultGetCapOwsVersion)
show(sosDefaultGetCapSections)
show(sosDefaultGetObsResponseFormat)
show(sosDefaultSpatialOpPropertyName)
show(sosDefaultTempOpPropertyName)
show(sosDefaultTemporalOperator)
show(sosDefaultTimeFormat)
SosDefaultBinding()
# }
# NOT RUN {
# usage of defaults in construction method for SOS class
sos <- SOS("http://mysos.com/sos", binding = SosDefaultBinding(),
timeFormat = sosDefaultTimeFormat)
# functions to disable all parsing
SosDisabledParsers()
# }
# NOT RUN {
# Replace a parsing function
myER <- function(xml) {
return("EXCEPTION!!!11")
}
myParsingFunctions <- SosParsingFunctions("ExceptionReport" = myER)
# use inclusion and exclusion, important: even the just added function needs to
# be included manually!
myParsingFunctions <- SosParsingFunctions("ExceptionReport" = myER,
include = c("GetObservation", "DescribeSensor", "ExceptionReport"))
myParsingFunctions <- SosParsingFunctions(exclude = c("GetObservation", "DescribeSensor"))
# }
# NOT RUN {
# Replace an encoding function
myEncoding <- function(object, v) {
return(utils::str(object))
}
sos = SOS(url = "http://mysos.com/sos",
encoders = SosEncodingFunctions("POST" = myPostEncoding))
# Use custom converting function and connection method. This mechanism works the
# same for encoders and decoders.
myConverters <- SosDataFieldConvertingFunctions(
"myNumericUnit" = sosConvertDouble)
mySos <- SOS(sos.url, binding = "KVP", dataFieldConverters = myConverters)
sosDataFieldConverters(mySos)
# inspecting XML using dummy parsing function
sos = SOS(url = "http://mysos.com/sos", parsers = SosDisabledParsers)
describeSensor(sos, sosProcedures(sos)[[1]])
# replace the parsing functions with the default ones
sos <- SosResetParsingFunctions(sos)
# }
# NOT RUN {
# a named list of all defaults
SosDefaults()
# parsing options used by xml2
SosDefaultParsingOptions()
# }
Run the code above in your browser using DataLab