Archives for posts with tag: Example

Today I gave my presentation at useR! 2011. I am not satisfied with how it went – I ran over the time by 2 minutes (which is a lot considering it was supposed to be 17 minutes) and forgot to make a main point, which is showing the XML that goes in and out of the packages! So if you’re interested, be sure to run lines 72 to 75 of the code below.

Nevertheless, Read the rest of this entry »

Alessandro Oggioni from the Laboratory of Aquatic Botany at ISE, Italy, created two nice videos of analysis and visualization of biologic data. The data retrieval is based on sos4R, the visualization is done with RGL, which creates a great 3-dimensional view of the data, and GoogleVIS, which allows presentation of the data with the Google Visualization API in a browser with Javascript.

Good work! I look forward to more examples of how the raw result data from SOS can be processed into actual information.

It will be a bit quiet around sos4R for the rest of the year, so I’d like to share some older work today, one of the first plots I made based on ifgi’s WeatherSOS.  It is now part of a demo of the package, so it’s very easy for you to produce it yourself, and the demo even contains another plot.

# load sos4R package
library("sos4R")

# start the demo
demo("weathersos")

# press 'Enter' to go through the available plots

The first plot contains two lines showing the temperature in Münster and Kärnten for a week in August 2009:

WeatherSOS Temperatur in Münster and Kärnten

The second plot shows the station just in Münster for the month of September in 2010 together with a (polynomial) fitted line:

WeatherSOS Demo Plot 2, Temperatur in Münster with regression lineThere are more demos, which are currently the best way to get to know the package. Check them out!

Yesterday I successfully requested a time series from the WeatherSOS service! The code below shows how that works: First requesting the data (including using some help-functions to create time interval and access the features of the SOS), second plotting it using R’s plot function.

weathersos = SOS("http://v-swe.uni-muenster.de:8080/WeatherSOS/sos")
go.offering = sosOfferings(weathersos)[[4]] # ATHMOSPHERIC_TEMPERATURE
go.observedProperty = sosObservedProperties(weathersos)[[4]] # temperature urn
go.eventTime3 = sosCreateEventTime(sosCreateTimePeriod(sos = weathersos, begin = as.POSIXct("2010-09-16 18:00"), end = as.POSIXct("2010-09-20 18:00")))

obs3 <- getObservation(sos = weathersos,observedProperty = list(go.observedProperty),
procedure = list(sosProcedures(weathersos)[[1]]), eventTime = go.eventTime3, offering = go.offering@id)

obs3@result
# heureka!

summary(obs3@result) # finally!
plot(x = obs3@result[["Time"]], y = obs3@result[["urn:ogc:def:property:OGC::Temperature"]],
type = "l", main = "Temperature in Münster", xlab = "Time", ylab = "Temperature (°C)")

This is quite a milestone for the project, and a good start in this week. For today, spatial queries and testing (also other SOS instances) are on the agenda.