Skip to content

More robust parsing of OGC webservice responses #416

@JonasGilg

Description

@JonasGilg

The OGC-Webservices, like WCS respond with an xml document. Some of them use xml namespaces, some don't. Sadly CosmoScout VR's xml parsing library TinyXML doesn't support namespaces and thus the user of the library has to specify them as the part of the elements name.

Here are two examples of how a response can look like:

<Capabilities xmlns="http://www.opengis.net/wcs/2.0" ... />
or
<wcs:Capabilities xmlns:wcs="http://www.opengis.net/wcs/2.0" ... />

The easiest solution is to provide the namespace prefix for each namespace as part of the config:

"csp-visual-query": {
  "port": 9999,
  "wcs": [
    { 
      "url": "https://geoservice.dlr.de/eoc/elk/wcs",
      "namespaces": {
         "wcs": "", // or undefined?
         "ows": "ows:"
       }
     }
  ]
}

A more sofisticated solution then either uses a library that supports xml namespaces or parses the root element itself.

An example query with all the namespaces: https://geoservice.dlr.de/eoc/atmosphere/wcs?SERVICE=WCS&REQUEST=GetCapabilities

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions