# NOT RUN {
# request observations
mySOSpox <- SOS(url = "http://sensorweb.demo.52north.org/sensorwebtestbed/service/pox",
binding = "POX", useDCPs = FALSE)
myOffering <- sosOfferings(mySOS)[["ws2500"]]
period <- sosCreateTimePeriod(sos = mySOS,
begin = as.POSIXct("2015/11/01"),
end = as.POSIXct("2015/11/02"))
eventTime <- sosCreateEventTimeList(period)
nov2015 <- getObservation(sos = mySOSpox,
offering = myOffering,
eventTime = eventTime)
# request observation by identifier and get the data
obsId <- getObservationById(sos = mySOSpox,
observationId = "http://www.52north.org/test/observation/1")
sosResult(obsId, coordinates = TRUE)
# }
# NOT RUN {
showClass("SosGetObservation")
showClass("SosGetObservationById")
responseFormat <- "text/xml;subtype="om/1.0.0""
obsReq <- SosGetObservation(service = "SOS", version = "1.0.0",
offering = "temperatures",
observedProperty = list("urn:property:AirTemperature"),
responseFormat = responseFormat)
print(obsReq)
obsByIdReq <- SosGetObservationById(service = "SOS", version = "1.0.0",
observationId = "o_12345",
responseFormat = responseFormat)
print(obsByIdReq)
# }
# NOT RUN {
sos <- SOS("http://mysos.net/sos")
encodeXML(obsByIdReq, sos = sos)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab