Canadian-Geospatial-Platform / geocore-gcs

Viewer Configuration Service (VCS)
MIT License
0 stars 0 forks source link

GET reponse for GCS and RCS configurations #2

Open bo-lu opened 9 months ago

bo-lu commented 9 months ago

Get RCS using requests and GCS from dynamodb table.

Sample response:

{
  "uuid": "0c25772d-da22-4ac1-b130-c1d97b935f6f",
  "message": {
    "gcs": "Success returning GCS",
    "rcs": "Success returning RCS"
  },
  "reponse": {
    "rcs": [
      {
        "layers": [
          {
            "isTimeAware": false,
            "layerType": "esriDynamic",
            "service_url": "https://maps-cartes.services.geo.ca/server_serveur/rest/services/CNSC/RRD_NuclearProcessingFacilities_Discharge_en/MapServer",
            "name": "Radionuclide Releases - Direct Discharge of Nuclear Processing Facilities",
            "id": "rcs.0c25772d-da22-4ac1-b130-c1d97b935f6f.en",
            "url": "https://maps-cartes.services.geo.ca/server_serveur/rest/services/CNSC/RRD_NuclearProcessingFacilities_Discharge_en/MapServer",
            "layerEntries": [
              {
                "index": 0
              }
            ]
          }
        ]
      }
    ],
    "gcs": {
      "en": {
        "chart": {
          "enable": true,
          "labelsPie": {
            "type": "config",
            "values": "",
            "split": ";"
          },
          "layers": [
            {
              "type": "link",
              "details": {
                "enabled": false
              },
              "id": "0c25772d-da22-4ac1-b130-c1d97b935f6f",
              "nameField": "facility_substance",
              "linkUrl": "https://maps-cartes.services.geo.ca/server_serveur/rest/services/CNSC/RRD_NuclearProcessingFacilities_Discharge_en/MapServer/1",
              "linkField": "facility_substance",
              "data": [
                {
                  "type": "combine",
                  "linkType": "multi",
                  "label": {
                    "type": "field",
                    "values": "substance_name",
                    "split": ";"
                  },
                  "regex": "\\(|\\),\\(|\\)",
                  "split": ",",
                  "prefix": "",
                  "suffix": "",
                  "link": "facility_substance",
                  "date": "year",
                  "measure": "direct_discharge",
                  "values": "substance_name"
                }
              ]
            }
          ],
          "type": "line",
          "title": "Radionuclide Releases - Direct Discharge of Nuclear Processing Facilities",
          "axis": {
            "xAxis": {
              "type": "date",
              "title": "Year",
              "values": "",
              "split": ";"
            },
            "yAxis": {
              "type": "linear",
              "title": "Annual release",
              "precision": 2,
              "values": "",
              "split": ";"
            }
          },
          "options": {
            "colors": "#FF4500",
            "cutOut": 0
          }
        }
      },
      "fr": {
        "chart": {
          "enable": true,
          "labelsPie": {
            "type": "config",
            "values": "",
            "split": ";"
          },
          "layers": [
            {
              "type": "link",
              "details": {
                "enabled": false
              },
              "id": "0c25772d-da22-4ac1-b130-c1d97b935f6f",
              "nameField": "installation_substance",
              "linkUrl": "https://maps-cartes.services.geo.ca/server_serveur/rest/services/CNSC/RRD_NuclearProcessingFacilities_Discharge_fr/MapServer/1",
              "linkField": "installation_substance",
              "data": [
                {
                  "type": "combine",
                  "linkType": "multi",
                  "label": {
                    "type": "field",
                    "values": "nom_substance",
                    "split": ";"
                  },
                  "regex": "\\(|\\),\\(|\\)",
                  "split": ",",
                  "prefix": "",
                  "suffix": "",
                  "link": "installation_substance",
                  "date": "annee",
                  "measure": "evacuations_directes",
                  "values": "nom_substance"
                }
              ]
            }
          ],
          "type": "line",
          "title": "Rejets de radionucléides - Évacuations directes des installations de traitement nucléaire",
          "axis": {
            "xAxis": {
              "type": "date",
              "title": "Année",
              "values": "",
              "split": ";"
            },
            "yAxis": {
              "type": "linear",
              "title": "Rejets annuels",
              "precision": 2,
              "values": "",
              "split": ";"
            }
          },
          "options": {
            "colors": "#FF4500",
            "cutOut": 0
          }
        }
      }
    }
  }
}
bo-lu commented 9 months ago

Add option to append the geocore metadata