sos4r describe sensor request

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

sos4r describe sensor request

G.Laty

Hi !


using the converters, i manage to access the informations I needed


 SosDataFieldConvertingFunctions("urn:ogc:def:parameter:x-istsos:1.0:time:iso8601"=sosConvertTime)


but I have now another problem, when  i try to get the describesensor I have an error

> mySensor <- describeSensor(sos = mySOS, procedure = procedure_choice)
Warning message:
In .handleExceptionReport(sos, .response) :
  Object of class OwsExceptionReport; version: 1.0.0; lang: en;
 1 exception(s) (code @ locator : text):
  InvalidParameterValue @ outputFormat :
   
    Supported "outputFormat" values are: text/xml;subtype="sensorML/1.0.1"

is there anyway to get around that?

Thanks

Guillaume



On 12.04.2017 11:48, Daniel Nüst wrote:
Hi Guillaume,

thanks for your interest in sos4R :-)

On 12/04/17 11:14, Guillaume Laty wrote:
My name is Guillaume and I'm working for the unep GRID. I'm trying SOS4R
to get some data from itsos.

Here is what I do and what's happening as an error

 
mySOS <- SOS(url = "http://ig3is.grid.unep.ch/istsos/ghg")
 off.temp <- sosOfferings(mySOS)[[1]]

obs.temp.procedure.1 <- getObservation(sos = mySOS, offering =
off.temp, procedure = sosProcedures(off.temp))
[sos4R] Received response (size: 848 bytes), parsing ...
Error in if (.subtypeIdx > 0) { : argument is of length zero
Here is the sessionInfo()

 > sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: i686-pc-linux-gnu (32-bit)
Running under: Ubuntu 14.04.5 LTS

and I use this version of SOS4R
 sos4R_0.2-11

Does anyone have any idea how can I get unstucked?
I can reproduce the error, which is good!

By using "GET" as the communication protocol instead of the default
"POST", I get a bit further.

mySOS <- SOS(url = "http://ig3is.grid.unep.ch/istsos/ghg", method =
SosSupportedConnectionMethods()[["GET"]])

getObservation(sos = mySOS, offering = off.temp)
[sos4R] Received response (size: 9256 bytes), parsing ...
Error in sum(.resultLength) : invalid 'type' (list) of argument
In addition: Warning messages:
1: In .valParser(values = obj[[sweValuesName]], fields = .fields,
encoding = .encoding,  :
  No converter found for the given field Time,
urn:ogc:def:parameter:x-istsos:1.0:time:iso8601
2: In .valParser(values = obj[[sweValuesName]], fields = .fields,
encoding = .encoding,  :
  No converter found! Skipping field Time
No converter found! Skipping field
urn:ogc:def:parameter:x-istsos:1.0:time:iso8601

In the vignette [1] section 6.4 you find instructions on how to define
the missing converters.

If you switch on the verbose option, you will also see the raw requests,
which might help:

getObservation(sos = mySOS, offering = off.temp, verbose = TRUE)
This shows me that data is indeed returned.


Hope this helps for now, please keep us posted on your progress.

/Daniel

[1] https://cran.r-project.org/web/packages/sos4R/vignettes/sos4R.pdf




_______________________________________________
Geostatistics mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geostatistics
http://geostatistics.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines

_______________________________________________
Geostatistics mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geostatistics
http://geostatistics.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|

Re: sos4r describe sensor request

ninsbl
Hi,

see also the related issue here: https://github.com/istSOS/istsos2/issues/23

Cheers,
Stefan



--
Sent from: http://geostatistics.forum.52north.org/
_______________________________________________
Geostatistics mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geostatistics
http://geostatistics.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|

Re: sos4r describe sensor request

Daniel Nüst-2
In reply to this post by G.Laty
This should be fixed now, see

http://geostatistics.forum.52north.org/error-with-SOS4R-tp4022976p4022984.html

On 20/04/17 08:11, Guillaume Laty wrote:

> Hi !
>
>
> using the converters, i manage to access the informations I needed
>
>
>  SosDataFieldConvertingFunctions("urn:ogc:def:parameter:x-istsos:1.0:time:iso8601"=sosConvertTime)
>
>
> but I have now another problem, when  i try to get the describesensor I
> have an error
>
>> mySensor <- describeSensor(sos = mySOS, procedure = procedure_choice)
> Warning message:
> In .handleExceptionReport(sos, .response) :
>   Object of class OwsExceptionReport; version: 1.0.0; lang: en;
>  1 exception(s) (code @ locator : text):
>   InvalidParameterValue @ outputFormat :
>    
>     Supported "outputFormat" values are: text/xml;subtype="sensorML/1.0.1"
>
> is there anyway to get around that?
>
> Thanks
>
> Guillaume
>
>
>
> On 12.04.2017 11:48, Daniel Nüst wrote:
>> Hi Guillaume,
>>
>> thanks for your interest in sos4R :-)
>>
>> On 12/04/17 11:14, Guillaume Laty wrote:
>>> My name is Guillaume and I'm working for the unep GRID. I'm trying SOS4R
>>> to get some data from itsos.
>>>
>>> Here is what I do and what's happening as an error
>>>
>>>  
>>>> mySOS <- SOS(url = "http://ig3is.grid.unep.ch/istsos/ghg")
>>>  off.temp <- sosOfferings(mySOS)[[1]]
>>>
>>>>> obs.temp.procedure.1 <- getObservation(sos = mySOS, offering =
>>>>> off.temp, procedure = sosProcedures(off.temp))
>>>> [sos4R] Received response (size: 848 bytes), parsing ...
>>>> Error in if (.subtypeIdx > 0) { : argument is of length zero
>>> Here is the sessionInfo()
>>>
>>>  > sessionInfo()
>>> R version 3.3.3 (2017-03-06)
>>> Platform: i686-pc-linux-gnu (32-bit)
>>> Running under: Ubuntu 14.04.5 LTS
>>>
>>> and I use this version of SOS4R
>>>  sos4R_0.2-11
>>>
>>> Does anyone have any idea how can I get unstucked?
>> I can reproduce the error, which is good!
>>
>> By using "GET" as the communication protocol instead of the default
>> "POST", I get a bit further.
>>
>>> mySOS <- SOS(url = "http://ig3is.grid.unep.ch/istsos/ghg", method =
>> SosSupportedConnectionMethods()[["GET"]])
>>
>>> getObservation(sos = mySOS, offering = off.temp)
>> [sos4R] Received response (size: 9256 bytes), parsing ...
>> Error in sum(.resultLength) : invalid 'type' (list) of argument
>> In addition: Warning messages:
>> 1: In .valParser(values = obj[[sweValuesName]], fields = .fields,
>> encoding = .encoding,  :
>>   No converter found for the given field Time,
>> urn:ogc:def:parameter:x-istsos:1.0:time:iso8601
>> 2: In .valParser(values = obj[[sweValuesName]], fields = .fields,
>> encoding = .encoding,  :
>>   No converter found! Skipping field Time
>> No converter found! Skipping field
>> urn:ogc:def:parameter:x-istsos:1.0:time:iso8601
>>
>> In the vignette [1] section 6.4 you find instructions on how to define
>> the missing converters.
>>
>> If you switch on the verbose option, you will also see the raw requests,
>> which might help:
>>
>>> getObservation(sos = mySOS, offering = off.temp, verbose = TRUE)
>> This shows me that data is indeed returned.
>>
>>
>> Hope this helps for now, please keep us posted on your progress.
>>
>> /Daniel
>>
>> [1] https://cran.r-project.org/web/packages/sos4R/vignettes/sos4R.pdf
>>
>>
>>
>>
>> _______________________________________________
>> Geostatistics mailing list
>> [hidden email]
>> http://list.52north.org/mailman/listinfo/geostatistics
>> http://geostatistics.forum.52north.org
>> Please respect our mailing list guidelines:
>> http://52north.org/resources/mailing-lists-and-forums/guidelines
>
>
> _______________________________________________
> Geostatistics mailing list
> [hidden email]
> http://list.52north.org/mailman/listinfo/geostatistics
> http://geostatistics.forum.52north.org
> Please respect our mailing list guidelines:
> http://52north.org/resources/mailing-lists-and-forums/guidelines
>

--
Daniel Nüst
Institute for Geoinformatics (ifgi),   University of Münster
Heisenbergstraße 2, 48149 Münster, Germany; +49 251 83 31962
http://ifgi.uni-muenster.de/~d_nues01        http://o2r.info
_______________________________________________
Geostatistics mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geostatistics
http://geostatistics.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|

Re: sos4r describe sensor request

ninsbl
In reply to this post by G.Laty

Hi again,

 

Yes and no.

Now it “almost” works, under the condition that the outputFormat is defined exactly like this: 'text%2Fxml%3Bsubtype%3D"sensorML%2F1.0.1"' then the request does not throw an exception but produces a proper response. Yet, note that specifying text/xml;subtype="sensorML/1.0.1" in single quotes as outputFormat (or leaving it blank)) does not work.

 

In addition, parsing the response produces a warning message:

 

install.packages("devtools")

devtools::install_github("52North/sos4R", ref = "dev")

library(sos4R)

 

mySOS <- SOS(url = "http://istsos.org/istsos/demo", binding = "KVP")

 

mySensor <- describeSensor(sos = mySOS

                           , procedure = sosProcedures(obj = mySOS)[[4]]

                           , outputFormat = 'text%2Fxml%3Bsubtype%3D"sensorML%2F1.0.1"'

                           , verbose=TRUE

                           )

 

(…)

Warning messages:

1: In checkRequest(service = sos, operation = request, verbose = verbose) :

  Outputformat has to be one of text/xml;subtype="sensorML/1.0.1" but is text%2Fxml%3Bsubtype%3D"sensorML%2F1.0.1"  ( text%2Fxml%3Bsubtype%3D"sensorML%2F1.0.1" )

2: In xpathApply.XMLInternalDocument(ndoc, path, fun, ..., namespaces = namespaces,  :

  the XPath query has no namespace, but the target document has a default namespace. This is often an error and may explain why you obtained no results

 

 

Cheers

Stefan


_______________________________________________
Geostatistics mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geostatistics
http://geostatistics.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|

Re: sos4r describe sensor request

Daniel Nüst-2
On 07/09/17 09:25, Stefan Blumentrath wrote:

> Yes and no.
>
> Now it “almost” works, under the condition that the outputFormat is
> defined exactly like this: 'text%2Fxml%3Bsubtype%3D"sensorML%2F1.0.1"'
> then the request does not throw an exception but produces a proper
> response. Yet, note that specifying text/xml;subtype="sensorML/1.0.1" in
> single quotes as outputFormat (or leaving it blank)) does not work.
>
>  
>
> In addition, parsing the response produces a warning message:

I get the same warnings, but those are not an issue to me now.

The information from the SensorML response is not fully extracted,
because istSOS uses a different element to put the location in
(sml:location vs. //sml:System/sml:position/swe:Position where sos4R is
looking for it).

Is that an issue for you?

SensorML parsing is quite rudimentary so far, you can add your own
parsing functions to adopt to the response this service returns.

/Daniel

> install.packages("devtools")
>
> devtools::install_github("52North/sos4R", ref = "dev")
>
> library(sos4R)
>
>  
>
> mySOS <- SOS(url = "http://istsos.org/istsos/demo", binding = "KVP")
>
>  
>
> mySensor <- describeSensor(sos = mySOS
>
>                            , procedure = sosProcedures(obj = mySOS)[[4]]
>
>                            , outputFormat =
> 'text%2Fxml%3Bsubtype%3D"sensorML%2F1.0.1"'
>
>                            , verbose=TRUE
>
>                            )
>
>  
>
> (…)
>
> Warning messages:
>
> 1: In checkRequest(service = sos, operation = request, verbose = verbose) :
>
>   Outputformat has to be one of text/xml;subtype="sensorML/1.0.1" but is
> text%2Fxml%3Bsubtype%3D"sensorML%2F1.0.1"  (
> text%2Fxml%3Bsubtype%3D"sensorML%2F1.0.1" )
>
> 2: In xpathApply.XMLInternalDocument(ndoc, path, fun, ..., namespaces =
> namespaces,  :
>
>   the XPath query has no namespace, but the target document has a
> default namespace. This is often an error and may explain why you
> obtained no results
>
>  
>
>  
>
> Cheers
>
> Stefan
>
>
>
> _______________________________________________
> Geostatistics mailing list
> [hidden email]
> http://list.52north.org/mailman/listinfo/geostatistics
> http://geostatistics.forum.52north.org
> Please respect our mailing list guidelines:
> http://52north.org/resources/mailing-lists-and-forums/guidelines
>

--
Daniel Nüst
Institute for Geoinformatics (ifgi),   University of Münster
Heisenbergstraße 2, 48149 Münster, Germany; +49 251 83 31962
http://ifgi.uni-muenster.de/~d_nues01        http://o2r.info
_______________________________________________
Geostatistics mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geostatistics
http://geostatistics.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines