getObservation in sos4R

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

getObservation in sos4R

mjacke
Hey list,

trying to request observations in a SOS 4.0.1 by sos4R (sos4R_0.2-11) in
R (3.0.2) I received an error:

>
getObservation(sos=mysos,offering=mysosoffering,observedProperty=mysosobsprop,verbose=TRUE)

...
[... request ... correct response? ...]
...
[sos4R] Received response (size: 2776 bytes), parsing ...
[.getObservation_1.0.0] Content-Type: application/xml UTF-8
[.getObservation_1.0.0] Got XML string as response (based on
isXMLString()).
Error in if (.subtypeIdx > 0) { : argument is of length zero

I copied the request from the information in the verbose mode to
the 52N test client. It worked fine.

There is no message in the log-file of the SOS webservice.

traceback() in R gave me follwing:
> traceback()
3: .getObservation_1.0.0(sos = sos, offeringId = .offeringId, observedProperty = observedProperty,
       responseFormat = responseFormat, srsName = srsName, eventTime = eventTime,
       procedure = procedure, featureOfInterest = featureOfInterest,
       result = result, resultModel = resultModel, responseMode = responseMode,
       BBOX = BBOX, latest = latest, verbose = verbose, inspect = inspect,
       saveOriginal = saveOriginal)
2: getObservation(sos = mysos, offering = mysosoffering, observedProperty = mysosobsprop,
       verbose = TRUE)
1: getObservation(sos = mysos, offering = mysosoffering, observedProperty = mysosobsprop,
       verbose = TRUE)

Could you help me to get the observation?

Thank you!
Markus


_______________________________________________
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
|  
Report Content as Inappropriate

Re: getObservation in sos4R

Daniel Nüst - 52N
Administrator
Hi Markus!

Thanks for your interest in sos4R!

Is your SOS publicly available so we can test it?

Or can you create a minimal script based on our demo server [1]?

(There seems to be a minor change in the subtype that SOS 4.0 returns.)

Best regards,
Daniel

[1] http://sensorweb.demo.52north.org/52n-sos-webapp/

Am 12/02/2015 um 16:38 schrieb Markus Jackenkroll:

> Hey list,
>
> trying to request observations in a SOS 4.0.1 by sos4R (sos4R_0.2-11) in
> R (3.0.2) I received an error:
>
>>
> getObservation(sos=mysos,offering=mysosoffering,observedProperty=mysosobsprop,verbose=TRUE)
>
> ...
> [... request ... correct response? ...]
> ...
> [sos4R] Received response (size: 2776 bytes), parsing ...
> [.getObservation_1.0.0] Content-Type: application/xml UTF-8
> [.getObservation_1.0.0] Got XML string as response (based on
> isXMLString()).
> Error in if (.subtypeIdx > 0) { : argument is of length zero
>
> I copied the request from the information in the verbose mode to
> the 52N test client. It worked fine.
>
> There is no message in the log-file of the SOS webservice.
>
> traceback() in R gave me follwing:
>> traceback()
> 3: .getObservation_1.0.0(sos = sos, offeringId = .offeringId, observedProperty = observedProperty,
>         responseFormat = responseFormat, srsName = srsName, eventTime = eventTime,
>         procedure = procedure, featureOfInterest = featureOfInterest,
>         result = result, resultModel = resultModel, responseMode = responseMode,
>         BBOX = BBOX, latest = latest, verbose = verbose, inspect = inspect,
>         saveOriginal = saveOriginal)
> 2: getObservation(sos = mysos, offering = mysosoffering, observedProperty = mysosobsprop,
>         verbose = TRUE)
> 1: getObservation(sos = mysos, offering = mysosoffering, observedProperty = mysosobsprop,
>         verbose = TRUE)
>
> Could you help me to get the observation?
>
> Thank you!
> Markus
>
>
> _______________________________________________
> 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
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-36
Fax: +49-(0)-251–396371-11

http://52north.org/
Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849
_______________________________________________
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
|  
Report Content as Inappropriate

Re: getObservation in sos4R

mjacke
Hey Daniel,

I would like to  do the following steps, which I tried to transfer to  
your demo server:

library("sos4R")
testsos=SOS("http://sensorweb.demo.52north.org/52n-sos-webapp/sos/pox")
testsosoffering<-sosOfferings(testsos)[["http://www.52north.org/test/offering/6"]]
sosObservedProperties(testsosoffering)
testsosobsprop <-sosObservedProperties(testsosoffering)[1]
getObservation(sos = testsos, offering = testsosoffering,  
observedProperty = testsosobsprop)

It was not possible to connect the server. Message: "Error: Internal  
Server Error".

KR
Markus

_______________________________________________
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
|  
Report Content as Inappropriate

Re: getObservation in sos4R

Daniel Nüst - 52N
Administrator
Am 15/02/2015 um 16:22 schrieb [hidden email]:
> I would like to  do the following steps, which I tried to transfer to
> your demo server:
>
> library("sos4R")
> testsos=SOS("http://sensorweb.demo.52north.org/52n-sos-webapp/sos/pox")
> testsosoffering<-sosOfferings(testsos)[["http://www.52north.org/test/offering/6"]]

That selection actually does not work for me because the IDs are
different. Can you please send the complete output of

sosOfferings(testsos)

along with sessionInfo(). Thanks!

Now to the real problem:

> sosObservedProperties(testsosoffering)
> testsosobsprop <-sosObservedProperties(testsosoffering)[1]
> getObservation(sos = testsos, offering = testsosoffering,
> observedProperty = testsosobsprop)
>
> It was not possible to connect the server. Message: "Error: Internal
> Server Error".

Same test as before: Can you please also include the created SOS request
for testing with the test client? Thanks!

The following code works for me at least on the request based on sos4R
version 0.2-11 (from CRAN):

# request works, but resposne not:
testsos <- SOS("http://sensorweb.demo.52north.org/52n-sos-webapp/sos/pox")
testsosoffering <- sosOfferings(testsos)[[5]]
getObservation(sos = testsos, offering = testsosoffering,
observedProperty = sosObservedProperties(testsosoffering)[1], verbose =
TRUE)
# Error in if (.subtypeIdx > 0) { : argument is of length zero

Can you confirm the error with ".subtypeIdx" ?


/Daniel

--
Daniel Nüst
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-36
Fax: +49-(0)-251–396371-11

http://52north.org/
Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849
_______________________________________________
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
|  
Report Content as Inappropriate

Re: getObservation in sos4R

mjacke
Hey Daniel,

you are right. I used a wrong ID in the request. I changed now

testsosoffering<-sosOfferings(testsos)[["http://www.52north.org/test/offering/6"]]
to
testsosoffering<-sosOfferings(testsos)[["ttp___www.52north.org_test_offering_developer"]]

I kept all other requests and finally end up at "getObservation":

> getObservation(sos = testsos, offering = testsosoffering,
observedProperty = testsosobsprop)
[sos4R] Received response (size: 6760 bytes), parsing ...
Error in if (.subtypeIdx > 0) { : argument is of length zero

So yes, I can confirm the error.

KR
Markus

_______________________________________________
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
|  
Report Content as Inappropriate

Re: getObservation in sos4R

Daniel Nüst - 52N
Administrator
Am 18/02/2015 um 18:15 schrieb Markus Jackenkroll:

> Hey Daniel,
>
> you are right. I used a wrong ID in the request. I changed now
>
> testsosoffering<-sosOfferings(testsos)[["http://www.52north.org/test/offering/6"]]
> to
> testsosoffering<-sosOfferings(testsos)[["ttp___www.52north.org_test_offering_developer"]]
>
> I kept all other requests and finally end up at "getObservation":
>
>> getObservation(sos = testsos, offering = testsosoffering,
> observedProperty = testsosobsprop)
> [sos4R] Received response (size: 6760 bytes), parsing ...
> Error in if (.subtypeIdx > 0) { : argument is of length zero
>
> So yes, I can confirm the error.

Good!

The code works after this bugfix: https://github.com/52North/sos4R/issues/37

For now I'd recommend to download and install that fix directly from
GitHub so that you don't have to wait for the version on CRAN to be fixed:

library("devtools")
devtools::install_git("git://github.com/nuest/sos4R.git", branch =
"bugfix/52n-sos-4x")

Hope this helps!

/Daniel

--
Daniel Nüst
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-36
Fax: +49-(0)-251–396371-11

http://52north.org/
Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849
_______________________________________________
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
|  
Report Content as Inappropriate

Re: getObservation in sos4R

mjacke
Hey Daniel,

the error-message is gone. Thanks for fixing the bug!

Markus

_______________________________________________
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
Loading...