Archives for category: 52N

It has been very quiet around sos4R in the last months, due to the fact that I am working on other projects now and I don’t have any feature requests coming my way at the moment – although there was the first bug report ever for sos4R, which was more a case of  “bad documentation” than a bug. But it is a signal that there are actual users out there!

“Smart innovations for a smarter world”

Despite of the lack of news regarding sos4R development I want to post here to advertise this years 52°North Student Innovation Prize. This prize made sos4R a reality two years ago and I can only recommend all students to think about innovative ideas, apply, and make them reality.

 

Today was the final presentation of both 52° North Innovation Price winners. It went really well for my, even the live demos worked! Check out the slides and the code below.


################################################################################
# PegelOnlineSOS
pegelsos <- SOS(url = "http://v-sos.uni-muenster.de:8080/PegelOnlineSOSv2/sos")

# what data do I get?
names(sosOfferings(pegelsos))

# let's find interesting data
procs <- sosProcedures(pegelsos)
contain_Bake <- procs %in% grep("*Bake*", procs, value=TRUE)
baken <- subset(procs, contain_Bake)
baken
# Bake_Z, http://www.pegelonline.wsv.de/gast/stammdaten?pegelnr=9510066

# what and when?
wasserstand <- sosObservedProperties(pegelsos)[3]
wasserstand_roh <- sosOfferings(pegelsos)[[2]]
tPeriod <- sosCreateEventTimeList(
time = sosCreateTimePeriod(
sos = pegelsos,
begin = Sys.time() - (3600 * 24 * 30),
end = Sys.time()))
str(tPeriod)
encodeXML(tPeriod[[1]], pegelsos)

# three procedures, but only getting 1 element with one procedure...
pegelObs <- getObservation(sos = pegelsos,
observedProperty = wasserstand,
offering = wasserstand_roh,
procedure = baken[c(7, 9, 11)],
eventTime = tPeriod)

# show parts of the data frame:
pegelObs[[1]]@result[1:2,]
pegelObs[[2]]@result[1:2,]
pegelObs[[3]]@result[1:2,]

# not enough info? got field descriptions as attributes for each column:
attributes(pegelObs[[1]]@result$Time) # TIME
attributes(pegelObs[[1]]@result$Wasserstand) # actual value

# do something with the data!
r1 <- pegelObs[[1]]@result
range(r1$Wasserstand)
r1clean <- subset(r1, Wasserstand > 0)
range(r1clean$Wasserstand)
plot(r1clean$Time, r1clean$Wasserstand, type = "l", ylim=c(200,800))

# Plot a quantile regression line with standard error bounds, using the quantreg package.
library("ggplot2"); library("latticeExtra"); library("quantreg")
r1plot <- xyplot(r1clean$Wasserstand ~ r1clean$Time, r1clean, type = "l", col = "orange")
r1plot + layer(panel.quantile(x, y, tau = c(.95, .5, .05)))

################################################################################
# OOSTethys SOS                                                                #
# http://www.oostethys.org/development/web-services/web-services-summary       #
################################################################################
# Sensor Observation Service (SOS) for Marine Metadata Interoperability
# Initiative (MMI) # Using GET works!

MBARI <- SOS("http://mmisw.org/oostethys/sos", method = "GET")

sosOfferings(MBARI)
paste(sosProcedures(MBARI))
paste(sosObservedProperties(MBARI))

myOff <- sosOfferings(MBARI)[[1]]
myProc <- sosProcedures(MBARI)[3]

mbariObs <- getObservation(sos = MBARI, offering = myOff, procedure = myProc)

# add converter for UOM C (which is not a valid unit)
myConverters <- SosFieldConvertingFunctions(
"C" = sosConvertDouble,
"S/m" = sosConvertDouble,
"http://mmisw.org/ont/cf/parameter/sea_water_salinity" = sosConvertDouble)

# creat SOS connection again and request data
MBARI <- SOS("http://mmisw.org/oostethys/sos", method = "GET",
dataFieldConverters = myConverters)
mbariObs <- getObservation(sos = MBARI, offering = myOff, procedure = myProc)

mbariObs@result[1:3,]
attributes(mbariObs@result$Temperature)
str(mbariObs@result)

# quick plot
plot(mbariObs@result)
plot(mbariObs@result[,c("Temperature", "Salinity", "Conductivity")])

# covariance, ...
cov(mbariObs@result[, 5:7])
# correlation
cor(mbariObs@result[, 5:7])

Today I had a short meeting with one of my scientific supervisors, Simon Jirka from 52° North. I presented the current status and we discussed some issues. One of these is the code management, but that is finally settled now. In consultation with Edzer Pebesma, the leader of the geostatistics community, I uploaded the current implementation status to the SVN repository, into the geostatistics corner to be more precise. See the download page for details!

If you want to try out the code, simply open the class testing.R and try out the examples there, like requesting the capabilities:

weathersosUrl = "http://v-swe.uni-muenster.de:8080/WeatherSOS2/sos"
sos = SOS(weathersosUrl)
capabilities = getCapabilities(sos)

It’s time now to introduce the second basic element (the first being R) of the sos4R project: the OGC Sensor Observation Service. Instead of going deeply into the specification, I just like to cite some paragraphs from the specification document and elaborate myself more about what I use and the utilized implementation.

What is the SOS?

A Sensor Observation Service provides an API for managing deployed sensors and retrieving sensor data and specifically “observation” data. Whether from in-situ sensors (e.g., water monitoring) or dynamic sensors (e.g., satellite imaging), measurements made from sensor systems contribute most of the geospatial data by volume used in geospatial systems today.

What can it do? Read the rest of this entry »

The SOS4R project is only possible because of the generous donation of the 52° North Student Innovation Prize. But who is “52°North”. I got involved with 52N a while ago because of the close relations between the working group at my institute, SWSL, and 52N working with projects of sensor simulation and networking, sensor observation storare, and sensor registries.

What is 52°North?

52° North Logo

52°North Initiative for Geospatial Open Source Software GmbH is an international research and development company whose mission is to promote the conception, development and application of free open source geo-software for research, education, training and practical use. 52°North backs an open initiative, which is driven by leading research organizations and individuals in the international GIS field. Cooperation partners participate in research and development with focii on Sensor Web Enablement (SWE), Web Security and Geo-Rights Management, as well as Geo-Processing .

Welcome to the brand new developer blog of the project SOS4R – an OGC Sensor Observation Service client for the R-project. In this blog I will regularly present the progress I make on the project. I really look forward to develop with R (as that is new to me) and hopefully my work will be able to bring the two communities Sensor Web and Geostatistics closer together.

For starters I’d like to present my project proposal that I applied with in December 2009: Read the rest of this entry »