These functions are called by the parsers of om:Observation and om:Measurement documents to convert the actual values to the correct classes.

sosConvertString(x, sos)
sosConvertDouble(x, sos)
sosConvertTime(x, sos)
sosConvertLogical(x, sos)

Arguments

x

The object to be converted.

sos

An object of class SOS, whose settings, like formating information, can be utilized.

Details

The methods are automatically called from the given SOS's list of conversion functions. This is either default or can be set manually on creation.

If you want to provide you own conversion functions, follow the example below. Always include the common parameters x and sos.

There are functions to access the converters of a SOS (sosDataFieldConverters-methods) and to combine default and your own converters (SosDataFieldConvertingFunctions).

Value

An object of the respective class converted from the parameter x.

See also

Examples

if (FALSE) { sos <- SOS_Test() one <- sosConvertDouble("1", sos) class(one) # add conversion rules, also possible to override default ones myConverters <- SosDataFieldConvertingFunctions( "C" = sosConvertDouble, "S/m" = sosConvertDouble) sos <- SOS(url = SosExampleServices()[[2]], dataFieldConverters = myConverters) # show converters sosDataFieldConverters(sos) }