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

Terria integration slightly broken #135

Open
Tracked by #6030
benjimin opened this issue Nov 5, 2021 · 6 comments
Open
Tracked by #6030

Terria integration slightly broken #135

benjimin opened this issue Nov 5, 2021 · 6 comments

Comments

@benjimin
Copy link
Collaborator

benjimin commented Nov 5, 2021

Apparently TerriaJS is not integrating properly with this PyWPS app. Basic functionality still works, but upon processing completion the UI continues to display the text "Job is finished, downloading results..." (even after the results have been displayed) and "Error upserting model JSON" is raised inside the browser console.

Probably an upstream issue, but reportedly can be bypassed by omitting the complexOutput.

h/t @gtgrp-user for reporting (by slack and TerriaJS/terriajs#5942 discussion).

@benjimin
Copy link
Collaborator Author

benjimin commented Nov 5, 2021

The local (terria-cube) configuration of Terria is pretty straightforward: just specify type: wps, the url for the WPS, and the identifier for a particular process therein. (There is also some free-form labelling such as a name, anchor id, and description.)

The rest seems to be handled by TerriaJS: the wps type is the archetype example of their "catalog function" component, which produces a different "catalog item" (visible in the "now viewing / workbench" pane) for each processing request. I'm guessing this code loops over each individual output returned by the WPS request, and can handle an SVG link (which it formats as a thumbnail image) or an HTML link (which it formats as hyperlinked text), but crashes when it encounters raw time-series data embedded as JSON?

This architecture seems intended to handle any WPS generically, which is convenient up to a point but may make it difficult to deprecate server-side SVG output (#128) or perform arbitrary UI customisations (#126).

(Aside, if we configured terria-cube with the wps-getcapabilities "catalog group" then it would populate the browsable catalogue with different processes automatically.)

@benjimin
Copy link
Collaborator Author

For debugging, confirmed that stripping the ComplexOutput from the PyWPS process outputs list (e.g. 545f008) does bypass the Terria problem, letting it draw the geometry onto the map and update (truncate) the message to "Job is finished". If there is a ComplexOutput then Terria does not display any representation of the WPS request geometry.

image

@nf-s
Copy link

nf-s commented Nov 17, 2021

Hi @benjimin

ODC-WPS is returning Terria catalog models in the old version 7 format. We try to automatically upgrade it to version 8, but there seems to be an issue here:

https://github.com/TerriaJS/terriajs/blob/80737c16a4d7e8fe0616f292bd24d599664a1ea8/lib/Models/Catalog/Ows/WebProcessingServiceCatalogFunctionJob.ts#L416-L434

@nf-s nf-s mentioned this issue Dec 6, 2021
8 tasks
@nf-s
Copy link

nf-s commented Dec 6, 2021

Hi @benjimin

I have a PR which seems to fix the issue. I have added a forceConvertResultsToV8 property which is set to true for your WPS processes. So when this PR is merged you will need to add this property to https://github.com/GeoscienceAustralia/dea-config/blob/master/dev/terria/terria-cube-v8.json

Link to test:
http://ci.terria.io/wps-v7-fix/#clean&https://gist.githubusercontent.com/nf-s/b4891446b77102dcd5aac4c4911b2bfa/raw/75ed2688c38bd836691c0967d9f2d6a5d06cfb7d/terria-cube-wps.json

Please let me know if this fixes your problem
Thanks!

@benjimin
Copy link
Collaborator Author

benjimin commented Dec 6, 2021

@nf-s are there any docs for the v7 and v8 format specs?

@nf-s
Copy link

nf-s commented Dec 6, 2021

We have a v7 to v8 migration guide here - https://docs.terria.io/guide/contributing/migration-guide/

Other docs can be found here https://docs.terria.io/guide/

For example - CSV catalog item format - https://docs.terria.io/guide/connecting-to-data/catalog-type-details/csv/

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

No branches or pull requests

2 participants