From c7586886e858e2e3f93cb0928beafb55872832b3 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Tue, 3 Oct 2023 13:51:28 +0200 Subject: [PATCH 1/3] add OGC:COG to possible values for gmd:protocol --- .../src/main/plugin/iso19115-3.2018/loc/eng/labels.xml | 1 + .../src/main/plugin/iso19115-3.2018/loc/fre/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/ara/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/cat/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/chi/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/dut/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/eng/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/fin/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/fre/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/ger/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/ita/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/nor/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/pol/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/por/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/rus/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/slo/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/spa/labels.xml | 1 + schemas/iso19139/src/main/plugin/iso19139/loc/tur/labels.xml | 1 + 18 files changed, 18 insertions(+) diff --git a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/loc/eng/labels.xml b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/loc/eng/labels.xml index fe586415a23..1d7a33e2279 100644 --- a/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/loc/eng/labels.xml +++ b/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/loc/eng/labels.xml @@ -3927,6 +3927,7 @@ + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/ara/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/ara/labels.xml index ddeb5951d13..a7b9643ff2c 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/ara/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/ara/labels.xml @@ -2193,6 +2193,7 @@ + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/cat/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/cat/labels.xml index b41df24378b..f52c2d51340 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/cat/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/cat/labels.xml @@ -1875,6 +1875,7 @@ + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/chi/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/chi/labels.xml index 4ed4f2aea1b..2c78d9449af 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/chi/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/chi/labels.xml @@ -2189,6 +2189,7 @@ + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/dut/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/dut/labels.xml index d6c5f64fd67..c054d6ddaa6 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/dut/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/dut/labels.xml @@ -1837,6 +1837,7 @@ + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/eng/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/eng/labels.xml index cee9fb1e04c..9734aca0800 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/eng/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/eng/labels.xml @@ -2274,6 +2274,7 @@ + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/fin/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/fin/labels.xml index 9464ca5bd83..e80ffafe0a0 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/fin/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/fin/labels.xml @@ -2158,6 +2158,7 @@ + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/ger/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/ger/labels.xml index 9b6d3c1dd1a..0d9a861ad56 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/ger/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/ger/labels.xml @@ -2584,6 +2584,7 @@ + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/ita/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/ita/labels.xml index a9692eff160..71dffb075ee 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/ita/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/ita/labels.xml @@ -2041,6 +2041,7 @@ + + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/pol/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/pol/labels.xml index 975381cc8d2..251bd479aa4 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/pol/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/pol/labels.xml @@ -1645,6 +1645,7 @@ + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/por/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/por/labels.xml index 3ab41c2967e..c78c0423672 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/por/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/por/labels.xml @@ -2129,6 +2129,7 @@ + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/rus/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/rus/labels.xml index 2a85dd80283..8a2e19b42a5 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/rus/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/rus/labels.xml @@ -2223,6 +2223,7 @@ + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/slo/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/slo/labels.xml index 55d4f682920..b25c966c971 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/slo/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/slo/labels.xml @@ -1754,6 +1754,7 @@ presnosť / vertikálna - + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/spa/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/spa/labels.xml index c4026824333..ca84fda5dde 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/spa/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/spa/labels.xml @@ -1945,6 +1945,7 @@ + diff --git a/schemas/iso19139/src/main/plugin/iso19139/loc/tur/labels.xml b/schemas/iso19139/src/main/plugin/iso19139/loc/tur/labels.xml index cc08c25b4e1..45c029ca16e 100644 --- a/schemas/iso19139/src/main/plugin/iso19139/loc/tur/labels.xml +++ b/schemas/iso19139/src/main/plugin/iso19139/loc/tur/labels.xml @@ -1785,6 +1785,7 @@ + From 7c7fb625d0e1eb64b8b7e671cc93d84ffda64e28 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Tue, 3 Oct 2023 13:54:24 +0200 Subject: [PATCH 2/3] add support to open OGC:COG links in the external viewer --- .../metadataactions/RelatedResourcesService.js | 11 ++++++++++- web-ui/src/main/resources/catalog/js/CatController.js | 1 + web-ui/src/main/resources/catalog/style/gn_icons.less | 1 + .../main/resources/catalog/views/default/module.js | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedResourcesService.js b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedResourcesService.js index 888176dabe9..19a1a71ad9e 100644 --- a/web-ui/src/main/resources/catalog/components/metadataactions/RelatedResourcesService.js +++ b/web-ui/src/main/resources/catalog/components/metadataactions/RelatedResourcesService.js @@ -79,7 +79,7 @@ return r.mimeType; } else if (r.protocol && r.protocol.indexOf("WWW:DOWNLOAD:") >= 0) { return r.protocol.replace("WWW:DOWNLOAD:", ""); - } else if (mainType.match(/W([MCF]|MT)S.*|3DTILES|ESRI:REST/) != null) { + } else if (mainType.match(/W([MCF]|MT)S.*|3DTILES|COG|ESRI:REST/) != null) { return mainType.replace("SERVICE", ""); } else if (mainType.match(/KML|GPX/) != null) { return mainType; @@ -128,6 +128,8 @@ gnViewerSettings.resultviewFns && gnViewerSettings.resultviewFns.addMdLayerToMap; var add3dTilesToMap = gnViewerSettings.resultviewFns && gnViewerSettings.resultviewFns.addMdLayerToMap; + var addCogeoToMap = + gnViewerSettings.resultviewFns && gnViewerSettings.resultviewFns.addMdLayerToMap; var addEsriRestToMap = gnViewerSettings.resultviewFns && gnViewerSettings.resultviewFns.addMdLayerToMap; @@ -286,6 +288,11 @@ label: "addToMap", action: add3dTilesToMap }, + COG: { + iconClass: "fa-globe", + label: "addToMap", + action: addCogeoToMap + }, TMS: { iconClass: "fa-globe", label: "addToMap", @@ -517,6 +524,8 @@ return "WMTS"; } else if (protocolOrType.match(/3dtiles/i)) { return "3DTILES"; + } else if (protocolOrType.match(/cog/i)) { + return "COG"; } else if (protocolOrType.match(/tms/i)) { return "TMS"; } else if (protocolOrType.match(/wfs/i)) { diff --git a/web-ui/src/main/resources/catalog/js/CatController.js b/web-ui/src/main/resources/catalog/js/CatController.js index fa8ac889a80..418509c2eb0 100644 --- a/web-ui/src/main/resources/catalog/js/CatController.js +++ b/web-ui/src/main/resources/catalog/js/CatController.js @@ -1311,6 +1311,7 @@ layers: [ "OGC:WMS", "OGC:3DTILES", + "OGC:COG", "OGC:WMTS", "OGC:WMS-1.1.1-http-get-map", "OGC:WMS-1.3.0-http-get-map", diff --git a/web-ui/src/main/resources/catalog/style/gn_icons.less b/web-ui/src/main/resources/catalog/style/gn_icons.less index a254a3dcf5c..9425c45040f 100644 --- a/web-ui/src/main/resources/catalog/style/gn_icons.less +++ b/web-ui/src/main/resources/catalog/style/gn_icons.less @@ -295,6 +295,7 @@ .gn-icontype-wcs, .gn-icontype-atom, .gn-icontype-3dtiles, +.gn-icontype-cog, .gn-icontype-esri-rest, .gn-icontype-wfs { background-color: @btn-success-bg !important; diff --git a/web-ui/src/main/resources/catalog/views/default/module.js b/web-ui/src/main/resources/catalog/views/default/module.js index 43c3fefb526..c11ddb8184b 100644 --- a/web-ui/src/main/resources/catalog/views/default/module.js +++ b/web-ui/src/main/resources/catalog/views/default/module.js @@ -362,6 +362,8 @@ ? "esrirest" : link.protocol == "OGC:3DTILES" ? "3dtiles" + : link.protocol == "OGC:COG" + ? "cog" : "wms", url: $filter("gnLocalized")(link.url) || link.url }; From 4cb3d94ce432c1a73a5c177093401380c072975f Mon Sep 17 00:00:00 2001 From: Olivia Date: Fri, 6 Oct 2023 17:50:03 +0200 Subject: [PATCH 3/3] show an alert saying COG/3DTiles is not supported yet This will also avoid switching to the viewer if no layer with supported protocol is found --- .../resources/catalog/locales/en-core.json | 1 + .../resources/catalog/views/default/module.js | 64 +++++++++++++------ 2 files changed, 47 insertions(+), 18 deletions(-) diff --git a/web-ui/src/main/resources/catalog/locales/en-core.json b/web-ui/src/main/resources/catalog/locales/en-core.json index 0a462d1c40c..5ba7ea65c8f 100644 --- a/web-ui/src/main/resources/catalog/locales/en-core.json +++ b/web-ui/src/main/resources/catalog/locales/en-core.json @@ -379,6 +379,7 @@ "layerNotAvailableInMapProj": "The service does not provide the layer in the map projection '{{proj}}'. The layer will be added to the map but may not be displayed properly.", "layerCRSNotFound": "The layer does not provide coordinate reference system information. This may be related to a WMS version lower than 1.3.0.", "layerTileLoadError": "Something went wrong while loading tile '{{url | limitTo: 30}} ...' for layer '{{layer}}'.", + "layerProtocolNotSupported": "The following protocol is not supported yet in the map viewer: {{type}}", "getCapFailure":"The WMS getCapabilities request failed", "standards": "Metadata standard", "documentStandard": "Metadata standard", diff --git a/web-ui/src/main/resources/catalog/views/default/module.js b/web-ui/src/main/resources/catalog/views/default/module.js index c11ddb8184b..b177ea7f38c 100644 --- a/web-ui/src/main/resources/catalog/views/default/module.js +++ b/web-ui/src/main/resources/catalog/views/default/module.js @@ -169,6 +169,7 @@ "gnFacetSorter", "gnExternalViewer", "gnUrlUtils", + "gnAlertService", function ( $scope, $location, @@ -191,7 +192,8 @@ gnESFacet, gnFacetSorter, gnExternalViewer, - gnUrlUtils + gnUrlUtils, + gnAlertService ) { var viewerMap = gnSearchSettings.viewerMap; var searchMap = gnSearchSettings.searchMap; @@ -353,18 +355,23 @@ }); function buildAddToMapConfig(link, md) { + var type = "wms"; + if (link.protocol.indexOf("WMTS") > -1) { + type = "wmts"; + } else if ( + link.protocol === "ESRI:REST" || + link.protocol.startsWith("ESRI REST") + ) { + type = "esrirest"; + } else if (link.protocol === "OGC:3DTILES") { + type = "3dtiles"; + } else if (link.protocol === "OGC:COG") { + type = "cog"; + } + var config = { uuid: md ? md.uuid : null, - type: - link.protocol.indexOf("WMTS") > -1 - ? "wmts" - : link.protocol == "ESRI:REST" || link.protocol.startsWith("ESRI REST") - ? "esrirest" - : link.protocol == "OGC:3DTILES" - ? "3dtiles" - : link.protocol == "OGC:COG" - ? "cog" - : "wms", + type, url: $filter("gnLocalized")(link.url) || link.url }; @@ -414,6 +421,19 @@ ); return; } + + // no support for COG or 3DTiles for now + if (config.type === "cog" || config.type === "3dtiles") { + gnAlertService.addAlert({ + msg: $translate.instant("layerProtocolNotSupported", { + type: link.protocol + }), + delay: 20000, + type: "warning" + }); + return; + } + return config; } @@ -421,20 +441,28 @@ addMdLayerToMap: function (link, md) { // This is probably only a service // Open the add service layer tab + var config = buildAddToMapConfig(link, md); + if (!config) { + return; + } $location.path("map").search({ - add: encodeURIComponent(angular.toJson([buildAddToMapConfig(link, md)])) + add: encodeURIComponent(angular.toJson([config])) }); - return; }, addAllMdLayersToMap: function (layers, md) { - var config = []; - angular.forEach(layers, function (layer) { - config.push(buildAddToMapConfig(layer, md)); - }); + var config = layers + .map(function (layer) { + return buildAddToMapConfig(layer, md); + }) + .filter(function (config) { + return !!config; + }); + if (config.length === 0) { + return; + } $location.path("map").search({ add: encodeURIComponent(angular.toJson(config)) }); - return; }, loadMap: function (map, md) { gnOwsContextService.loadContextFromUrl(map.url, viewerMap);