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.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## 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")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.