Learn R Programming

sos4R (version 0.4.2)

Coercion: Coercion of SOS objects to Spatial classes

Description

The package sos4R comes with several classes that contain spatial information, such as coordinates of sensors or observation data associated with coordinates. For easy access to these coordinates, there are coercion functions to matching classes from the package sp.

Arguments

Details

Most coercions, e.g. from Gml.. classes, are used internally during parsing and result extraction.

Objects containing data, e.g. OmObservationCollection, return a SpatialPointsDataFrame.

Objects not containing data, e.g. SensorML instances, return an object of class SpatialPoints.

To just get the most fitting class, coerce to "Spatial" as shown in the examples.

Examples

Run this code
# NOT RUN {
# sensor location
mySOS <- SOS(url = "http://sensorweb.demo.52north.org/sensorwebtestbed/service/kvp",
             binding = "KVP")
mySensor <- describeSensor(sos = mySOS,
		procedure = sosProcedures(mySOS)[[1]],
		outputFormat = 'text/xml; subtype="sensorML/1.0.1"')
as(mySensor, "Spatial")

# offering bounding box
as(sosOfferings(mySOS)[[1]], "Spatial")
# }

Run the code above in your browser using DataLab