Learn R Programming

sos4R (version 0.4.2)

sites: This function queries a SOS v2.0 for its sites and returns them as SpatialPointsDataFrame

Description

Information about the registered sites in a SOS can be queried using this function. This function allows for different levels of detail and returns a SpatialPointsDataFrame.

Usage

sites(sos,
      begin = NA,
      end = NA,
      phenomena = list(),
      empty = FALSE,
      includePhenomena = FALSE,
      includeTemporalBBox = FALSE,
      ...)

Arguments

sos

A SOS object from a call to SOS containing the URL of a SOS.

begin

Object of class POSIXt. Note that creating timestamps with as.POSIXct(..) will use your local timezone.

end

Object of class POSIXt. Note that creating timestamps with as.POSIXct(..) will use your local timezone.

phenomena

A list, vector or one-column data.frame with characters identifying the relevant phenomena.

empty

Whether also empty sites shall be included in the response.

includePhenomena

Whether the phenomena shall also be reported in the result.

includeTemporalBBox

Whether the observation containing timespan of each phenomenon shall also be reported.

...

Named parameters passed on to other wrapper functions.

Value

A SpatialPointsDataFrame-class containing all sites that match the filter conditions with corresponding metadata defined via the arguments. If empty = TRUE, the data slot contains a logical column 'empty' indicating whether any data has been observed for this site. If listPhenomena = TRUE, the data.frame contains a logical column per phenomenon indicating whether this specific phenomenon has been observed at that site. If includeTemporalBBox = TRUE, the data.frame contains a two column data.frame with beginTime and endTime per phenomenon.

Examples

Run this code
# NOT RUN {
mySos <- SOS(url = "https://climate-sos.niwa.co.nz/",
             binding = "KVP", useDCPs = FALSE, version = "2.0.0")

sites(sos = mySos)
# }

Run the code above in your browser using DataLab