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

fix invalid supported UOMs description #686

Merged
merged 2 commits into from
Oct 30, 2023
Merged

Conversation

fmigneault
Copy link
Collaborator

@fmigneault fmigneault commented Oct 28, 2023

Overview

Fix process description literal UOMs reporting duplicates of the first default UOM instead of all supported UOMs.

For example, passing uoms=['metre', 'feet'] to LiteralInput would cause it to report as follows in the WPS description.
The default UOM would be repeated for as many supported UOMs that were passed to the input.

<LiteralData>
  <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#float">float</ows:DataType>
  <UOMs>
    <Default>
      <ows:UOM ows:reference="">m/s²</ows:UOM>
    </Default>
    <Supported>
      <ows:UOM ows:reference="">metre</ows:UOM>
      <ows:UOM ows:reference="">metre</ows:UOM>  <!-- error should be 'feet' -->
    </Supported>
  </UOMs>
</LiteralData>

At the same time, this fixes the optional reference attribute accordingly if it was not provided explicitly, or could not be mapped to a known unit of OGC URN.

According to https://schemas.opengis.net/ows/1.1.0/owsDomainType.xsd
the ows:UOM which depends on ows:DomainMetadataType
shows <attribute ref="ows:reference" use="optional" />

But the previous check of UOM class caused it to check of OGCUNIT if not provided with an empty string.
The corresponding if in the template were also not consistent about reporting reference.

Related Issue / Discussion

Required by crim-ca/weaver#541
Required by crim-ca/weaver#430
Fixes #685

Contribution Agreement

(as per https://github.com/geopython/pywps/blob/master/CONTRIBUTING.rst#contributions-and-licensing)

  • I'd like to contribute bugfix to PyWPS. I confirm that my contributions to PyWPS will be compatible with the PyWPS license guidelines at the time of contribution.
  • I have already previously agreed to the PyWPS Contributions and Licensing Guidelines

@cehbrecht
Copy link
Collaborator

@fmigneault with PR #687 the tests should work again. If you think this PR is ready I can merge it.

@cehbrecht cehbrecht mentioned this pull request Oct 30, 2023
2 tasks
@fmigneault
Copy link
Collaborator Author

@cehbrecht
Can you consider this fix into 4.6.0 release?

@fmigneault
Copy link
Collaborator Author

On my side, the tests were running, but you can combine them with the other PR to validate they work together.
Thanks!

@cehbrecht cehbrecht merged commit d285c58 into geopython:main Oct 30, 2023
1 of 6 checks passed
@fmigneault fmigneault deleted the fix-uom branch November 1, 2023 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input with optional reference in UoM raises KeyError if not a OGC unit
2 participants