TerriaJS / RaPPMap

Fork of TerriaJS/TerriaMap for GEOGLAM RAPP
5 stars 4 forks source link

Connect EASI WPS with Terria #133

Open mpaget opened 1 year ago

mpaget commented 1 year ago

We're presently developing/configuring/deploying a datacube-wps service (uses pywps), see https://github.com/csiro-easi/datacube-wps. For RappMap we expect this will replace GSKY. Will be in touch when its ready for testing with Terria (Dec 2022 or Jan 2023).

Related to:

mpaget commented 1 year ago

Hi Terria team, Can you point @haotanggg and I at the query and receiving formats (headers and data structures) for WPS calls from/to Terria, please? This will help us test and develop the service at our end. We're making progress.... Cheers!

AnaBelgun commented 1 year ago

Hi @mpaget have you tried this https://docs.terria.io/guide/connecting-to-data/catalog-type-details/wps/

mpaget commented 1 year ago

Thank you @AnaBelgun. We'll take a look and get back to you with any questions.

haotanggg commented 1 year ago

Hi @AnaBelgun,

I'm trying to get datacube-wps to return a timeseries CSV to Terria for Terria to render. This is the error we're getting on our local Terria instance. Can you please confirm whether there is any specific WPS-CSV handling in the GeoRAPP instance of Terria vs the default/quickstart local Terria. As far as we can tell, the response XML has the same structure (nesting, keys etc.)

error_upserting_json

AnaBelgun commented 1 year ago

@na9da or @mwu2018 would you please help @haotanggg figure this out?

na9da commented 1 year ago

Hi @haotanggg - In your terriajs catalog definition, could you try setting forceConvertResultsToV8 to true?

From the error message, it looks like the service is returning the a terriajs-v7 JSON response. The above setting instructs terria to convert it to the newer terriajs-v8 JSON.

mpaget commented 1 year ago

Hi @na9da - Can you provide details for the terriajs-v8 JSON format too, please?

na9da commented 1 year ago

Hi @mpaget

The v7 JSON response looks something like the following:

{
  "data": "<-- actual csv content -->",
  "isEnabled": true,
  "type": "csv",
  "name": "0968",
  "tableStyle": {
    "columns": {
      "pixel_frac": {
        "units": "%",
        "chartLineColor": "#FFFFFF",
        "yAxisMin": 0,
        "yAxisMax": 100,
        "active": true
      }
    }
  }
}

which when converted to v8 becomes:

{
  "type": "csv",
  "name": "0968",
  "csvString": "<-- the csv content that used to be previously set in `data` -->",
  "columns": [
    {
      "name": "pixel_frac",
      "units": "%"
    }
  ],
  "defaultStyle": {
    "chart": {
      "lines": [
        {
          "color": "#FFFFFF",
          "yAxisMinimum": 0,
          "yAxisMaximum": 100,
          "isSelectedInWorkbench": true,
          "yAxisColumn": "pixel_frac"
        }
      ]
    }
  }
}

There is some documentation on the v8 properties available for CSV type here.

Please do let me know if you need more help with it.