The functions decode a given XML object to an R representation, which can be an object of a specific class, a list, a named character vector, …
parseFile(sos, file, verbose = FALSE, ...)
parseCSV(obj, verbose = FALSE)
parseNoParsing(obj)
parseCategoryObservation(obj, sos, verbose = FALSE)
parseComplexObservation(obj, sos, verbose = FALSE)
parseComponent(obj, verbose = FALSE)
parseCompositePhenomenon(obj, verbose = FALSE)
parseCountObservation(obj, sos, verbose = FALSE)
parseDataArray(obj, sos, verbose = FALSE)
parseElementType(obj, sos, verbose = FALSE)
parseEncoding(obj, sos, verbose = FALSE)
parseFeatureCollection(obj, sos)
parseField(obj, sos, verbose = FALSE)
parseFOI(obj, sos, verbose = FALSE)
parseGeometryObservation(obj, sos, verbose = FALSE)
parseMeasure(obj)
parseMeasurement(obj, sos, verbose = FALSE)
parseObservation(obj, sos, verbose = FALSE)
parseObservationCollection(obj, sos, verbose)
parseOM(obj, sos, verbose = FALSE)
parseOwsException(obj)
parseOwsExceptionReport(obj, verbose = FALSE)
parseOwsOperation(obj, namespaces = SosAllNamespaces())
parseOwsRange(obj)
parseOwsServiceIdentification(obj, namespaces = SosAllNamespaces())
parseOwsServiceProvider(obj)
parsePhenomenonProperty(obj, verbose = FALSE)
parsePoint(obj, sos)
parsePosition(obj, sos)
parseResult(obj, sos, verbose = FALSE)
parseSamplingPoint(obj, sos)
parseSensorML(obj, sos, verbose = FALSE)
parseSosCapabilities(obj, sos)
parseSosFilter_Capabilities(obj, sos)
parseSosObservationOffering(obj, sos)
parseTemporalObservation(obj, sos, verbose = FALSE)
parseTextBlock(obj)
parseTimeGeometricPrimitiveFromParent(obj, format)
parseTimeInstant(obj, format)
parseTimeInstantProperty(obj, format)
parseTimePeriod(obj, format)
parseTimePosition(obj, format)
parseTimeObject(obj, format, timeObjectMap = list(), verbose = FALSE)
parseTruthObservation(obj, sos, verbose = FALSE)
parseValues(values, fields, encoding, sos, verbose = FALSE)
The object to decode, normally objects of either xml_document
.
An object of class SOS-class, which may be utilized/required by some parsing functions to access other parsing functions or encoding information.
A boolean value indication whether information is printed out to the console during the process - potentially a lot of output!
A vector of namespace prefixes and definitions to use.
A character string defining the time format to be used in strptime
.
The values to be parsed in parseValues(...)
.
Field information in parseValues(...)
, a named list.
Name of the file to be parsed in sosParse(...)
.
Encoding information in parseValues(...)
, an object of class SweTextBlock
.
A named list of time objects passed on during parsing (name is the id) to resolve in-document references.
Additional arguments that are parsed to xmlParse(...)
in sosParse(...)
.
An objects of a specific class depending on the parsing method and the passed object, possibly even lists or named character vectors.
Functions might result in error if parsed an object of the wrong type, because that is normally not checked.
Some of the functions are placeholders for future implementations!
The naming of the functions follow the following rule: parse[optional: namespace prefix][name of the XML element to be parsed]
Not all parsing function that have a SOS
object or verbose
in their signature, but few actually use it at this points of development. Some of the parsing functions are exchangeable when creating a new SOS connection. Please see the examples!
parseOM
is a special function in the respect that it matches sub parsing function depending on an objects xmlName
from the list of the given SOS
's parsing functions.
parseNoParsing
is a convenience function that directly returns the object without any changes.
sosParse
allows parsing of files for all elements that have a parsers registered with the given SOS.
# NOT RUN {
# parsing a XML string to an exception report object
er.doc <- xml2::read_xml(paste0("<ows:ExceptionReport xmlns:ows=\"http://www.opengis.net/ows/1.1\"",
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"1.0.0\"",
" xsi:schemaLocation=\"http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd\">",
"<ows:Exception exceptionCode=\"VersionNegotiationFailed\" locator=\"AcceptVersions\">",
"<ows:ExceptionText>The parameter 'AcceptVersions' does not contain the version",
" of this SOS: '1.0.0'</ows:ExceptionText></ows:Exception></ows:ExceptionReport>"))
er.parsed <- parseOwsExceptionReport(er.doc)
print(er.parsed)
str(er.parsed)
# }
# NOT RUN {
# save and re-parse an observation from file
obsId <- getObservationById(sos = mySOS, observationId = "o_3508493",
saveOriginal = TRUE)
.files <- list.files(getwd())
.startWithO_ <- .files %in% grep("o_", .files, value=TRUE)
.observationFiles <- subset(.files, .startWithO_)
obsId <- parseFile(sos = mySOS, file = .observationFiles[[1]])
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab