# 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, sos = SOS_Test())
print(er.parsed)
utils::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]])
# list caches
ls(get("sos4R_caches"))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab