eblondel / ows4R

R Interface for OGC Web-Services (OWS)
https://eblondel.github.io/ows4R/
Other
37 stars 8 forks source link

revdep of sf / s2 breaks ows4R #48

Closed edzer closed 3 years ago

edzer commented 3 years ago

I see this

Package: ows4R
Check: examples
Old result: OK
New result: ERROR
  Running examples in ‘ows4R-Ex.R’ failed
  The error most likely occurred in:

  > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
  > ### Name: BBOX
  > ### Title: BBOX
  > ### Aliases: BBOX
  > ### Keywords: BBOX Expression OGC
  > 
  > ### ** Examples
  > 
  >   bbox <- OWSUtils$toBBOX(-180,-90,180,90)
  >   expr <- BBOX$new(bbox)
  >   expr_xml <- expr$encode() #see how it looks like in XML
  Error in xmlSchemaValidate(xsd, xml) : 
    trying to get slot "ref" from an object of a basic class ("NULL") with no slots
  Calls: <Anonymous> -> <Anonymous> -> <Anonymous> -> xmlSchemaValidate
  Execution halted

when revdep checking ows4R using s2 (1.0.5, CRAN) and sf from github (branch sf_1_0); planning to submit this branch soon as sf 1.0 to CRAN. Let me know if we can help.

See https://github.com/r-spatial/sf/issues/1649 for more info (and possibly help).

eblondel commented 3 years ago

Hi @edzer , the error you get is due to an issue of XML schema validation when trying to $encode the xml. This embedds geometa objects, here GML bindings, for which the resulting XML is by default validated against the schema. XML Schemas are loaded when loading geometa package (loaded with ows4R).

Now, part of the schemas are local (All ISO/OGC are stored locally in geometa for a proper use), but still base XML schemas from W3C are loaded from the web, and for temporary maintenance downtime, it occurs that these schemas are not reachable. If you load geometa during these downtimes, geometa references a NULL schema reference, and all attempts to encode xml after fail, like in your case.

This is likely to be a unexpected error, and it will work back when W3C xml schemas back online. Now just tried, and it works.

This said, I had already this unexpected behavior in the past, and I will look into geometa to see if I can handle local copies for all XML schemas (including w3c) to avoid random failures in unit/integration tests.

I don't think this is related to your change in sf deps.

edzer commented 3 years ago

Ah, so this was a false positive (for me). Thanks!