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

Add wms-group to ckan and ignore duplicate wms layers in groups #6255

Merged
merged 5 commits into from
Apr 22, 2022

Conversation

nf-s
Copy link
Contributor

@nf-s nf-s commented Apr 14, 2022

What this PR does

Fixes #5745 #5893

Reverts parts of #6240

  • Breaking changes:
    • CkanItemReference no longer copies default stratum to target - please use itemProperties instead.
  • Revert Use CKAN Dataset name property for WMS layers as last resort.
  • Add support for WebMapServiceCatalogGroup to CkanItemReference - this will be used instead of WebMapServiceCatalogItem if WMS layers can't be identified from CKAN resource metadata.
    • Add allowEntireWmsServers to CkanCatalogGroupTraits - defaults to true
  • Ignore WMS Layers with duplicate Name properties

Test me

Previously broken layers

NationalMap BOM layers

Pacificmap "GEBCO"

Pacificmap "Global Distribution of Coral Reefs"

Pacificmap "SEDAC data products and services"

Layers which are now worse off - they are now groups

This is due to "Revert Use CKAN Dataset name property for WMS layers as last resort"

Checklist

  • There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
  • I've updated relevant documentation in doc/.
  • I've updated CHANGES.md with what I changed.
  • I've provided instructions in the PR description on how to test this PR.

@nf-s nf-s marked this pull request as ready for review April 14, 2022 07:30
Copy link
Member

@t83714 t83714 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done @nf-s & thanks for your excellent work -- I believe this PR gives more choices to the user and also helps to reduce the chance that we have to report an error to the user.

Also thank you for supplying the test datasets --- it makes it much easier to play with the PR 💯

re: the test datasets, I guess the first test link is the "before the PR" link and the 2nd link is the "after PR" link for the same dataset.

  • I have played "NationalMap BOM layers", "Pacificmap "GEBCO", Pacificmap "Global Distribution of Coral Reefs" & Pacificmap "SEDAC data products and services". I think they all work better (using the 2nd "after PR" test link) after the PR.
  • The last dataset example, unfortunately, indeed comes with a less desired outcome after the PR. I'd say generally the "name" field is meant to be a human-readable title of the resource in ckan. The chance of people using that field to supply layer name is very low as a layer name usually use - as spaces (probably why we will see more positive cases). I'd suggest asking the data custodian to fix this issue by adding a layers query parameters to the wms of the dataset. If we have to solve it, we probably need to apply some validation rules before using the "name" field as the last resort for this case. e.g. if the name field contains any space, it won't be a valid layer name. Having said that, considering the probability of this case and the correct usage of name field, I'd say probably not worth implementing it.
    • by the way, I believe the one from DGA ckan is actually an "obsolete" dataset and only shows up recently (last year) due to a data recovery issue yet to solve (by DTA now ABS). They are all prior 2018 datasets before Magda on board and crawled by DGA ckan from other sources (for this case it's adon). After 2018, those external sources are handled by Magda and those "obsolete" datasets seems to have been removed from CKAN DB but only brought back incorrectly during the data loss incident last year. Those datasets's "data_state" field in ckan package data has value "inactive". We probably can filter out in this way.
  • In the end --- only a minor UI suggestion ( and probably a separate issue and should be addressed by a separate PR): When opening a share link (Take NationalMap BOM layers for example, it's correctly opened as WMS group. But as the group is added at the very bottom of the catalogue list, the user will have to scroll down before he can find the layer selection list. Do you think it will be better if we can auto-scroll the group into the viewport when it's opened via a share link?

Generally, I think this PR works very good and is ready to merge (the suggestion above probably could fit into a separate PR unless it's very tiny) and I will add my approval.

@nf-s
Copy link
Contributor Author

nf-s commented Apr 22, 2022

Thanks @t83714 for the review!

I agree with all your points.

There is already an issue for scrolling to shared group - #5204

I have created an issue re filtering out datasets with "data_state" = "inactive" - TerriaJS/nationalmap#1143

@nf-s nf-s merged commit f59c289 into main Apr 22, 2022
@nf-s nf-s deleted the wms-group-ckan branch April 22, 2022 06:06
@AnaBelgun AnaBelgun mentioned this pull request Sep 22, 2022
6 tasks
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.

v7 - v8: CKAN missing property allowEntireWmsServers
2 participants