From 5d4441fb9172bbf1ad70d4d1639f40e776c26e86 Mon Sep 17 00:00:00 2001 From: Emmanuel Mathot Date: Thu, 23 May 2024 11:54:27 +0200 Subject: [PATCH 1/3] Add asset key to syndication links in StarsAtomItem.cs --- src/Stars.Data/Model/Atom/StarsAtomItem.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Stars.Data/Model/Atom/StarsAtomItem.cs b/src/Stars.Data/Model/Atom/StarsAtomItem.cs index a3a802b0..61a2b719 100644 --- a/src/Stars.Data/Model/Atom/StarsAtomItem.cs +++ b/src/Stars.Data/Model/Atom/StarsAtomItem.cs @@ -211,11 +211,16 @@ private static IEnumerable GetFunctionalLinks(IDictionary links = new List(); var overviews = assets.Where(a => a.Value.Roles.Contains("overview") || a.Value.Roles.Contains("thumbnail") || a.Value.Roles.Contains("legend")); - links.AddRange(overviews.Select(o => new SyndicationLink(GetAssetUri(stacObjectUri, o.Value), + foreach (var o in overviews) + { + var link = new SyndicationLink(GetAssetUri(stacObjectUri, o.Value), GetRelationshipFromRoles(o.Value.Roles), GetTitleFromRoles(o), o.Value.MediaType.ToString(), - Convert.ToInt64(o.Value.FileExtension().Size)))); + Convert.ToInt64(o.Value.FileExtension().Size)); + link.AttributeExtensions.Add(new XmlQualifiedName("asset"), o.Key); + links.Add(link); + } return links; } From 6764ce8d40d303ca28386895f019ab626509ac09 Mon Sep 17 00:00:00 2001 From: Emmanuel Mathot Date: Thu, 23 May 2024 15:13:20 +0200 Subject: [PATCH 2/3] feat: Add VAPTest to StacItemToAtomItemTests.cs --- .../StacItemToAtomItemTests_VAPTest.json | 112 ++++++++++++++++++ .../Translators/StacItemToAtomItemTests.cs | 27 +++++ 2 files changed, 139 insertions(+) create mode 100644 src/Stars.Data.Tests/Resources/Translators/StacItemToAtomItemTests_VAPTest.json diff --git a/src/Stars.Data.Tests/Resources/Translators/StacItemToAtomItemTests_VAPTest.json b/src/Stars.Data.Tests/Resources/Translators/StacItemToAtomItemTests_VAPTest.json new file mode 100644 index 00000000..244818bc --- /dev/null +++ b/src/Stars.Data.Tests/Resources/Translators/StacItemToAtomItemTests_VAPTest.json @@ -0,0 +1,112 @@ +{ + "stac_version": "1.0.0", + "stac_extensions": [ + "https://stac-extensions.github.io/file/v1.0.0/schema.json", + "https://stac-extensions.github.io/version/v1.0.0/schema.json", + "https://terradue.github.io/disaster/v1.0.0/schema.json" + ], + "type": "Feature", + "id": "act-874-vap-1002-6", + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 36.833, + -1.208 + ], + [ + 37.003, + -1.208 + ], + [ + 37.003, + -1.329 + ], + [ + 36.833, + -1.329 + ], + [ + 36.833, + -1.208 + ], + [ + 36.833, + -1.208 + ] + ] + ] + }, + "properties": { + "disaster:class": "ValueAddedProduct", + "cpe:status": { + "stage": "notificationImported", + "message": "2 assets imported", + "link": "https://supervisor.disasterscharter.org/hangfire/jobs/details/34839" + }, + "updated": "2024-05-23T09:33:59.0295601Z", + "disaster:activation_id": 874, + "cpe:cos2_id": "act-874-vap-1002-6", + "datetime": "2024-05-06T10:36:29Z", + "cpe:cos2_xml": "\n\n 1002-6\n 874\n 2024-05-07T02:38:19Z\n 2024-05-07T02:38:30Z\n Flood impact analysis in Central Nairobi, Kenya as of 1 May 2024\n 2024-05-06T10:36:29Z\n Includes Pleiades material © CNES (2024), Distribution Airbus DS.;Includes Pleiades material © CNES (2024), Distribution Airbus DS.;Includes Pleiades material © CNES (2024), Distribution Airbus DS.\n https://disasterscharter.org/cos-api/service/vap/1002/6.pdf\n https://disasterscharter.org/documents/10180/24551505/vap-1002-6-quicklook.jpg/96c86441-71dd-4774-9c66-2b66cbe3081a?version=1.0\n This map illustrates satellite-detected surface waters in Nairobi, Kenya, as observed from a Pléiades image acquired on 1 May 2024 at 11:06 local time (08:06 UTC). Within the analyzed area, about 2 km² of land appears to be flooded. UNITAR-UNOSAT identified 3,387 affected structures, about 7 km of affected roads, and 9 affected bridges.\nThis is a preliminary analysis and has not yet been validated in the field. Please send ground feedback to the United Nations Satellite Centre (UNOSAT).\n \n \n -1.208\n 36.833\n \n \n -1.208\n 37.003\n \n \n -1.329\n 37.003\n \n \n -1.329\n 36.833\n \n \n -1.208\n 36.833\n \n \n 0\n", + "created": "2024-05-07T02:38:19Z", + "title": "Flood impact analysis in Central Nairobi, Kenya as of 1 May 2024 [05/06/2024 10:36:29]", + "source": null, + "copyright": "Includes Pleiades material © CNES (2024), Distribution Airbus DS.;Includes Pleiades material © CNES (2024), Distribution Airbus DS.;Includes Pleiades material © CNES (2024), Distribution Airbus DS.", + "additional_information": "This map illustrates satellite-detected surface waters in Nairobi, Kenya, as observed from a Pléiades image acquired on 1 May 2024 at 11:06 local time (08:06 UTC). Within the analyzed area, about 2 km² of land appears to be flooded. UNITAR-UNOSAT identified 3,387 affected structures, about 7 km of affected roads, and 9 affected bridges.\nThis is a preliminary analysis and has not yet been validated in the field. Please send ground feedback to the United Nations Satellite Centre (UNOSAT).", + "description": "Name | Value\n---- | -----\nSource | ****\nCopyright | **Includes Pleiades material © CNES (2024), Distribution Airbus DS.;Includes Pleiades material © CNES (2024), Distribution Airbus DS.;Includes Pleiades material © CNES (2024), Distribution Airbus DS.**\nAdditional Information | **This map illustrates satellite-detected surface waters in Nairobi, Kenya, as observed from a Pléiades image acquired on 1 May 2024 at 11:06 local time (08:06 UTC). Within the analyzed area, about 2 km² of land appears to be flooded. UNITAR-UNOSAT identified 3,387 affected structures, about 7 km of affected roads, and 9 affected bridges. This is a preliminary analysis and has not yet been validated in the field. Please send ground feedback to the United Nations Satellite Centre (UNOSAT).**\nAcquisition Date | **06/05/2024 10:36:29**\nCreated | **07/05/2024 02:38:19**\nUpdated | **07/05/2024 02:38:30**\n", + "cpe:notification_source": "cos2", + "cpe:notified": [ + "2024-05-07T02:38:30.5503974Z" + ], + "version": "1" + }, + "bbox": [ + 36.833, + -1.329, + 37.003, + -1.208 + ], + "assets": { + "overview": { + "type": "image/jpeg", + "roles": [ + "overview" + ], + "title": "Value Added Product Overview", + "href": "https://supervisor.disasterscharter.org/assets/activations/act-874/vaps/act-874-vap-1002-6/act-874-vap-1002-6.json?key=overview", + "file:size": 314027 + }, + "enclosure": { + "type": "application/pdf", + "roles": [ + "data", + "visual" + ], + "title": "Value Added Product Enclosure", + "href": "https://supervisor.disasterscharter.org/assets/activations/act-874/vaps/act-874-vap-1002-6/act-874-vap-1002-6.json?key=enclosure", + "file:size": 4687256 + } + }, + "links": [ + { + "type": "application/geo+json", + "rel": "self", + "title": "Flood impact analysis in Central Nairobi, Kenya as of 1 May 2024 [05/06/2024 10:36:29]", + "href": "https://supervisor.disasterscharter.org/api/activations/act-874/vaps/act-874-vap-1002-6/items/act-874-vap-1002-6.json.json" + }, + { + "type": "application/json", + "rel": "root", + "title": "Root Catalog", + "href": "https://supervisor.disasterscharter.org/api/catalog.json" + }, + { + "rel": "collection", + "title": "collection", + "href": "https://supervisor.disasterscharter.org/api/activations/act-874/vaps/act-874-vap-1002-6.json" + } + ], + "collection": "act-874-vap-1002-6" +} \ No newline at end of file diff --git a/src/Stars.Data.Tests/Translators/StacItemToAtomItemTests.cs b/src/Stars.Data.Tests/Translators/StacItemToAtomItemTests.cs index f64a49ac..65f53c59 100644 --- a/src/Stars.Data.Tests/Translators/StacItemToAtomItemTests.cs +++ b/src/Stars.Data.Tests/Translators/StacItemToAtomItemTests.cs @@ -250,6 +250,33 @@ public async System.Threading.Tasks.Task S1A_IW_GRDH_1SDV_20220903T165054_202209 } + [Fact] + public async System.Threading.Tasks.Task VAPTest() + { + string json = GetJson("Translators"); + + StacItem stacItem = StacConvert.Deserialize(json); + + StacItemToAtomItemTranslator stacItemToAtomItemTranslator = new StacItemToAtomItemTranslator(ServiceProvider); + + StacItemNode stacItemNode = new StacItemNode(stacItem, new System.Uri("https://supervisor.disasterscharter.org/api/activations/act-874/vaps/act-874-vap-1002-6/items/act-874-vap-1002-6.json")); + + AtomItemNode atomItemNode = await stacItemToAtomItemTranslator.TranslateAsync(stacItemNode, CancellationToken.None); + + // find browse link + var browseLink = atomItemNode.AtomItem.Links.FirstOrDefault(r => r.RelationshipType == "icon"); + + Assert.NotNull(browseLink); + Assert.True(browseLink.Uri.ToString() == "https://supervisor.disasterscharter.org/assets/activations/act-874/vaps/act-874-vap-1002-6/act-874-vap-1002-6.json?key=overview"); + // Check that the asset reference is set in the link attributes + Assert.True(browseLink.AttributeExtensions.ContainsKey(new XmlQualifiedName("asset"))); + Assert.True(browseLink.AttributeExtensions[new XmlQualifiedName("asset")].ToString() == "overview"); + + // Check that description is not in markdown + Assert.DoesNotContain("Value----", atomItemNode.AtomItem.Summary.Text); + + } + } From fb04ed279dc922ac66117949b407077fb8cce66c Mon Sep 17 00:00:00 2001 From: Emmanuel Mathot Date: Thu, 23 May 2024 15:14:17 +0200 Subject: [PATCH 3/3] ready to release 2.22.8 --- CHANGELOG.md | 22 +++++++++++++++++-- .../Terradue.Stars.Console.csproj | 2 +- src/Stars.Data/Terradue.Stars.Data.csproj | 2 +- .../Terradue.Stars.Services.csproj | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8653114f..01761a48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -## [2.22.6](https://github.com/Terradue/Stars/compare/2.22.5...2.22.6) +## [2.22.8](https://github.com/Terradue/Stars/compare/2.22.7...2.22.8) -this fixes MCUBE-10 and MCUBE-11 +### Commits + +- feat: Add VAPTest to StacItemToAtomItemTests.cs [`6764ce8`](https://github.com/Terradue/Stars/commit/6764ce8d40d303ca28386895f019ab626509ac09) +- Add asset key to syndication links in StarsAtomItem.cs [`5d4441f`](https://github.com/Terradue/Stars/commit/5d4441fb9172bbf1ad70d4d1639f40e776c26e86) + +## [2.22.7](https://github.com/Terradue/Stars/compare/2.22.6...2.22.7) - 2024-05-23 + +### Merged + +- Fix for wrongly assigned processing level in SAOCOM identifier [`#57`](https://github.com/Terradue/Stars/pull/57) +- Correction for incorrect Landsat-8/9 orbit states (orbit direction) [`#53`](https://github.com/Terradue/Stars/pull/53) + +### Commits + +- Fix for wrongly assigned processing level in identifier [`bcfb105`](https://github.com/Terradue/Stars/commit/bcfb10597097c586c5d4b282c72f032dd4aefa2e) +- Changed orbit direction calculation and added test case [`b9a4254`](https://github.com/Terradue/Stars/commit/b9a42543ce21d44d91992c406eb07229209a3544) +- Restored SAOCOM L1A expected output [`e3124fa`](https://github.com/Terradue/Stars/commit/e3124fa7971880c2c982d67904658a1499991568) + +## [2.22.6](https://github.com/Terradue/Stars/compare/2.22.5...2.22.6) - 2024-05-21 ### Commits diff --git a/src/Stars.Console/Terradue.Stars.Console.csproj b/src/Stars.Console/Terradue.Stars.Console.csproj index ce9c71f3..7d3345f9 100644 --- a/src/Stars.Console/Terradue.Stars.Console.csproj +++ b/src/Stars.Console/Terradue.Stars.Console.csproj @@ -2,7 +2,7 @@ Exe net6.0 - 2.22.7 + 2.22.8 Stars is a CLI for working with Spatio Temporal Catalog such as STAC but not only $(Version)-$(VersionSuffix) diff --git a/src/Stars.Data/Terradue.Stars.Data.csproj b/src/Stars.Data/Terradue.Stars.Data.csproj index 6308342a..84f3b345 100644 --- a/src/Stars.Data/Terradue.Stars.Data.csproj +++ b/src/Stars.Data/Terradue.Stars.Data.csproj @@ -4,7 +4,7 @@ Terradue.Stars.Data Terradue.Stars.Data Collection of data Plugins for Terradue.Stars - 2.22.7 + 2.22.8 $(Version)-$(VersionSuffix) NU1603 diff --git a/src/Stars.Services/Terradue.Stars.Services.csproj b/src/Stars.Services/Terradue.Stars.Services.csproj index f1be1f30..e399d7bc 100644 --- a/src/Stars.Services/Terradue.Stars.Services.csproj +++ b/src/Stars.Services/Terradue.Stars.Services.csproj @@ -3,7 +3,7 @@ netstandard2.0 Terradue.Stars Stars is a set of services for working with Spatio Temporal Catalog such as STAC but not only - 2.22.7 + 2.22.8 $(Version)-$(VersionSuffix) Terradue.Stars.Services