Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get parameter of a observation #176

Open
borg1310 opened this issue Oct 28, 2020 · 3 comments
Open

get parameter of a observation #176

borg1310 opened this issue Oct 28, 2020 · 3 comments
Assignees

Comments

@borg1310
Copy link

borg1310 commented Oct 28, 2020

hi,

the parameter of following getobs response om observation [0] is not available in parsed response of sos4r [1] (slot parameter)

regards,
juergen

[0]

<om:OM_Observation gml:id="o_58B72E56017ACA3BA090E1DCDEBFADAF8D319BFC">
      <om:phenomenonTime>
        <gml:TimeInstant gml:id="phenomenonTime_58B72E56017ACA3BA090E1DCDEBFADAF8D319BFC">
          <gml:timePosition>2015-10-17T22:11:00.000Z</gml:timePosition>
        </gml:TimeInstant>
      </om:phenomenonTime>
      <om:resultTime xlink:href="#phenomenonTime_58B72E56017ACA3BA090E1DCDEBFADAF8D319BFC"/>
      <om:procedure xlink:href="AGIA_K_001"/>
      <om:parameter>
        <om:NamedValue>
          <om:name xlink:href="QualityFlag"/>
          <om:value xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">4_2002</om:value>
        </om:NamedValue>
      </om:parameter>
      <om:observedProperty xlink:href="AirHumidity_Relative_2m_Avg10min"/>
      <om:featureOfInterest xlink:href="AGIA_K_001"/>
      <om:result xmlns:ns="http://www.opengis.net/gml/3.2" uom="%_Sat" xsi:type="ns:MeasureType">94.5</om:result>
    </om:OM_Observation>

[1]


An object of class "OmOM_Observation"
Slot "phenomenonTime":
GmlTimePosition [ time: 2015-10-17 22:11:00 ]
Slot "procedure":
[1] "AGIA_K_001"

Slot "observedProperty":
Object of class SwePhenomenonProperty; href: AirHumidity_Relative_2m_Avg10min; phenomenon:  

Slot "featureOfInterest":
Object of class GmlFeatureProperty, href: AGIA_K_001, feature:  

Slot "result":
  %_Sat
1  91.8

Slot "metadata":
[1] NA

Slot "resultTime":
GmlTimePosition [ time: 2015-11-08 21:51:00 ]
Slot "resultQuality":
[1] NA

Slot "parameter":
[1] NA
@EHJ-52n
Copy link
Member

EHJ-52n commented Oct 29, 2020

Welcome and thank you very much for pointing this out, @borg1310.

I checked the according code and made the following findings:

  1. the slot parameter is reserved for om:parameter values as you expected.
  2. the parsing method for OM_Measurement is still missing parsing of optional values, e.g. parameter.

Hence, you have the following options to get a solution for your problem:

  1. Implement the missing parts by yourself and provide a PR and a signed CLA.
  2. Find anyone who funds us to implement the features you need.
  3. Wait until we find someone who requires this feature, too, and is willing to fund us.

I am sorry that I cannot provide a solution at once. If you go for number 3, I will save this as a feature request.

@borg1310
Copy link
Author

borg1310 commented Nov 6, 2020

hi,

i implemented the feature by myself.
to check if everything is still working (despite my changes) i ran the tests (devtools::test()). a lot of failures occurred also when running in the master branch (without my changes) (see [0]). is there something i do wrong while testing?

gruss juergen

[0]
test_getobservationbyid.R:130: warning: POX (SOS 1.0.0)
Only reference was returned:urn:ogc:def:nil:OGC:inapplicable

test_getobservationbyid.R:134: failure: POX (SOS 1.0.0)
obs[[1]] inherits from OmObservationProperty not OmMeasurement.

test_getobservationbyid.R:135: failure: POX (SOS 1.0.0)
sosResult(obs) is not an S3 object

test_getobservationbyid.R:135: failure: POX (SOS 1.0.0)
sosResult(obs) inherits from matrix not data.frame.

test_getobservationbyid.R:136: failure: POX (SOS 1.0.0)
sosResult(obs)[1, 1] not equal to 1.1.
Types not compatible: character is not double

test_getobservationbyid.R:148: failure: POX (2.0.0)
obs is not an S4 object

test_getobservationbyid.R:148: failure: POX (2.0.0)
obs inherits from list/vector not OmOM_Observation.

test_getobservationbyid.R:149: failure: POX (2.0.0)
obs has length 0, not length 1.

test_getobservationbyid.R:150: failure: POX (2.0.0)
sosResult(obs) is not an S3 object

test_getobservationbyid.R:150: failure: POX (2.0.0)
sosResult(obs) inherits from NULL not data.frame.

test_getobservationbyid.R:151: failure: POX (2.0.0)
sosResult(obs)[1, 1] not equal to 1.1.
target is NULL, current is numeric

test_getobservationbyid.R:168: failure: file saving works (2.0.0)
obs is not an S4 object

test_getobservationbyid.R:168: failure: file saving works (2.0.0)
obs inherits from list/vector not OmOM_Observation.
────────────────────────────────────────────────────────────────────────────────

══ Terminating early ═══════════════════════════════════════════════════════════
Too many failures

Save workspace image? [y/n/c]: n
sorg@borgfzj:/tmp/sos4R$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

@EHJ-52n
Copy link
Member

EHJ-52n commented Nov 11, 2020

@nuest Could you please verify that the master branch is the correct one to provide a solution for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants