From 3a0b83f342a0184e3d90a2c771cb05ef2dae324b Mon Sep 17 00:00:00 2001
From: Matthieu Benoist <mbenoist@ausy-group.com>
Date: Wed, 16 Jun 2021 15:08:58 +0200
Subject: [PATCH] Add new rule for the geojson output format for ATMO data

---
 .../resource-download-item.component.ts                     | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/app/dataset-detail/components/dataset-downloads/resource-download-item/resource-download-item/resource-download-item.component.ts b/src/app/dataset-detail/components/dataset-downloads/resource-download-item/resource-download-item/resource-download-item.component.ts
index 289c3af0..39e3865f 100644
--- a/src/app/dataset-detail/components/dataset-downloads/resource-download-item/resource-download-item/resource-download-item.component.ts
+++ b/src/app/dataset-detail/components/dataset-downloads/resource-download-item/resource-download-item/resource-download-item.component.ts
@@ -152,6 +152,12 @@ export class ResourceDownloadItemComponent implements OnInit {
           `${this.format.mapServerType}`;
         const projectionAndBbox = this.getProjectionAndBbox(this.format);
 
+        if (Array.isArray(this.metadata.providers) && this.metadata.providers[0].match(/ATMO/g)) {
+          if (this.format.mapServerType.match(/application\/json/)) {
+            outputFormat = `&${this.labelFormat[this.resource.type]}=GEOJSON`;
+          }
+        }
+
         const baseParameters = this.resource.parametersUrl ? `?${this.resource.parametersUrl}` : '';
         queryableUrl += baseParameters +
           layer +
-- 
GitLab