Coercion.Rd
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.
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.
if (FALSE) { # 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") }