EOxServer / eoxserver

EOxServer is a Python application and framework for presenting Earth Observation (EO) data and metadata.
https://eoxserver.org
Other
40 stars 18 forks source link

WCS GetEOCoverageSet not usable via POST/XML due to Namespaces difference #531

Closed lubojr closed 2 years ago

lubojr commented 2 years ago

Due to namespace discrepancy, the WCS GetEOCoverageSet can not be called via XML/POST.

https://github.com/EOxServer/eoxserver/blob/5ed51cc3037a9d54ea1f4e371bfde0d47019fe2c/eoxserver/services/ows/wcs/v20/util.py#L57 defines a namespace wcseo11 but it is not added to the nsmap which the request implementation decoder expects: https://github.com/EOxServer/eoxserver/blob/5ed51cc3037a9d54ea1f4e371bfde0d47019fe2c/eoxserver/services/ows/wcs/v20/geteocoverageset.py#L397-L398

Following data:

<wcseo11:GetEOCoverageSet service="WCS" version="2.0.1" xmlns:wcs="http://www.opengis.net/wcs/2.0" xmlns:wcseo11="http://www.opengis.net/wcs/wcseo/1.1"
xmlns:scal="http://www.opengis.net/wcs/scaling/1.0">
    <wcseo11:eoId>coverage_example1,coverage_example2</wcseo11:eoId>
    <wcseo11:packageFormat>application/zip</wcseo11:packageFormat>
</wcseo11:GetEOCoverageSet>

currently yields

<ows:ExceptionText>Undefined namespace prefix</ows:ExceptionText>

The question is, under which NS the GetEOCoverageSet parameters should be searched via decoder? wcseo or wcseo11?

WCS 2.0.1 http://docs.opengeospatial.org/is/10-140r2/10-140r2.html#_em_geteocoverageset_em_request mentions wcseo:GetEOCoverageSet

I can provide a PR changing the implementation either way, adding a test along the line, but would need a confirmation @Schpidi @constantinius

constantinius commented 2 years ago

I'd say the best way forward is to create a new NamespaceMap object and add it to the decoder class. The namespace is http://www.opengis.net/wcs/wcseo/1.1, the prefix does not really matter, it is just the name we use to identify items in the XPath expressions. So using wcseo11 is fine I think.