Closed annakrystalli closed 1 year ago
In context of ows4R, that's a complex issue, it deals with geometa that I will tackle asap. For the timebeing, you have to import the package, and can't rely on the namespace approach. This said, using ows4R, you depend on geometa, so it's still valid approach to consider an import. In the case of WCS, as I said in another ticket, the Coverage description is directly handled by the GML COV specification which is managed by geometa. To avoid any binding issue, you will need to have all geometa classes loaded. You don't have the issue in WFS, because WFS feature type description are managed by the OGC WFS standard, not any base binding managed by geometa.
I've included a workaround for this (i.e. loading the package on loading of EMODnetWCS
) P.S. I had to load ows4R
not geometa
for it to work so the class appears to be internal to ows4R
.
@annakrystalli can you please re-install geometa and ows4R, and retry the above code? The problem is related to the fact that WCSCoverageDescription
inherits from a specific GML binding that is managed in geometa. Because it's part of geometa package, with the ows4R::
approach, ows4R decoding (which approach consist in loading the appropriate binding from XML elements, at decoding time) was unable to understand WCSCoverageDescription
parent class is actually part of geometa and not ows4R; which is not straightfoward in R to implement with the R6 class model. I found a way to make sure this inheritance works, and ows4R auto-discovers the corresponding GML binding in geometa.
Let me know if it works for you
Thanks @eblondel , this works now.
When using
ows4R
methods after callingows4R::WCSClient
(i.e using::
rather than loading package as is required practice in package development), required classes are not available unless the package is loaded.Created on 2022-08-17 by the reprex package (v2.0.1)
This causes problems when using
ows4R
internally in other packages as loading the whole package is not recommended while loading individual classes is cumbersome and feels unnecessary. Should the required classes not be imported by the methods requiring them inows4R
? Interestingly I had not come across this problem withEMODnetWFS