Skip to contents

[Experimental] This function obtains the observations shared by Sensor Observation Service (SOS).

Usage

get_sos_obs(sosURL, procedure, foi = NULL, show_map = FALSE)

Arguments

sosURL

A character. The endpoint of the Sensor Observation Service (SOS) service.

procedure

A character. The procedure/sensor ID. Possible value are the Feature of Interest(FOI) ID, which can be obtained via the get_sos_procedure_info() function.

foi

A character. This parameter selects which Feature(s) Of Interest (FOI(s)) are retrieved and returned in the observations. Possible value are the FOI(s) ID, which can be obtained via the get_sos_foi() function. If the FOI parameter is not set, all observations reached in all FOIs by a sensor, will be downloaded. Note that the request time may be very long! Multiple values can be indicated. Default NA.

show_map

A logical. When TRUE the boundary will be plotted on a Leaflet map. Default FALSE.

Value

The output of the function is a tibble. The output can be divided in two parts: the columns concerning the observations and the ancillary information concerning who and where the observations were made. The first part, usually starting with date and time values, contains all columns representing all the observed properties (e.g. air temperature) measured by sensor. The second part contains columns about: Feature(s) Of Interest - FOI ( foiLabel and foiID), identifier of the observations block (obsBlockID), procedure/sensor (procedureID and procedureName), sampling feature (typeSf, description, name), sampled feature id (sampledFeature), coordinate reference system code (srsName) and coordinates (lon and lat). A map can be obtained indicating the parameter show_map TRUE. The output contains also a semantic link, as provided by SOS. The uriattribute contains all URIs of the terms indicated in the headers columns. To the observed properties columns are labeled with a unit of measurement, as mentioned in the SOS, using R package units. This labelling simplify the propagation, conversion and derivation of units of collected observed properties.

The function output

Map of the point where the observations

Possible output from function result

Plot of the observations where the

Plot of the same observations are

Author

Alessandro Oggioni, phD oggioni.a@irea.cnr.it

Paolo Tagliolato, phD tagliolato.p@irea.cnr.it

Examples

if (FALSE) {
## Not run:

# Fluoro Probe sensor
# FP <- get_sos_obs(
#   sosURL = "http://getit.lteritalia.it/observations/service",
#   procedure = "http://www.get-it.it/sensors/getit.lteritalia.it/procedure/noOwnerDeclared/noModelDeclared/noSerialNumberDeclared/1286194C-A5DF-11DF-8ED7-1602DFD72097",
#   foi = c("http://www.get-it.it/sensors/getit.lteritalia.it/sensors/foi/SSF/SP/4326/45.9547/8.63403"),
#   show_map = TRUE
# )
# FP

# Air temperature sensor
airTemp <- get_sos_obs(
  sosURL = "http://getit.lteritalia.it/observations/service",
  procedure = "http://www.get-it.it/sensors/getit.lteritalia.it/procedure/noOwnerDeclared/noModelDeclared/noSerialNumberDeclared/SI001469-SPNAirTemp", #720 Slowinski National Park
  show_map = TRUE
)
airTemp

# about units of measurement (UOM)
# the UOM of this observed property is °C
airTemp$Air_Temperature

# is is easily convert to °F
units::set_units(airTemp$Air_Temperature, "°F")

# about semantic enrichment
# the URI of the label of first two columns
# of `airTemp`
attributes(airTemp)$uri
  
}
## End (Not run)