Skip to content

Commit

Permalink
Merge branch 'hotfix/1.6.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Dec 12, 2022
2 parents bc5e08f + 2d615da commit b042d3b
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 7 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

## [1.6.3](https://github.com/Terradue/DotNetStac/compare/1.6.2...1.6.3)
## [1.6.3](https://github.com/Terradue/DotNetStac/compare/1.6.3...1.6.3)

### Commits

- null geometry must be serialized [`6b56f04`](https://github.com/Terradue/DotNetStac/commit/6b56f0445446a92164c1bf596bc4887a3e43e40d)

## [1.6.3](https://github.com/Terradue/DotNetStac/compare/1.6.2...1.6.3) - 2022-12-02

### Commits

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

<h3 align="center">

![Build Status](https://github.com/Terradue/DotNetStac/actions/workflows/build.yaml/badge.svg?branch=hotfix/1.6.3)
![Build Status](https://github.com/Terradue/DotNetStac/actions/workflows/build.yaml/badge.svg?branch=hotfix/1.6.4)
[![NuGet](https://img.shields.io/nuget/vpre/DotNetStac)](https://www.nuget.org/packages/DotNetStac/)
[![codecov](https://codecov.io/gh/Terradue/DotNetStac/branch/hotfix/1.6.3/graph/badge.svg)](https://codecov.io/gh/Terradue/DotNetStac)
[![codecov](https://codecov.io/gh/Terradue/DotNetStac/branch/hotfix/1.6.4/graph/badge.svg)](https://codecov.io/gh/Terradue/DotNetStac)
[![Gitter](https://img.shields.io/gitter/room/SpatioTemporal-Asset-Catalog/Lobby?color=yellow)](https://gitter.im/SpatioTemporal-Asset-Catalog/Lobby)
[![License](https://img.shields.io/badge/license-AGPL3-blue.svg)](LICENSE)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/Terradue/DotNetStac/master?filepath=example.ipynb)
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetStac.Test/Collection/CollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public void SerializeSimpleCollection()
{
var simpleItemJson = GetJson("Collection", "CanSerializeMinimalSample");
var simpleItem = StacConvert.Deserialize<StacItem>(simpleItemJson);
StacCollection simpleCollection = StacCollection.Create("simple-collection", "Simple Collection",
StacCollection simpleCollection = StacCollection.Create("simple-collection", "Simple Collection",
new Dictionary<Uri, StacItem> { { new Uri("item1", UriKind.Relative), simpleItem } }, "various");
var newJson = JsonConvert.SerializeObject(simpleCollection);
ValidateJson(newJson);
Expand Down
19 changes: 18 additions & 1 deletion src/DotNetStac.Test/Item/ItemTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void CanSerializeExtendedSample()
// item.BoundingBoxes = new double[4] { -122.59750209, 37.48803556, -122.2880486, 37.613537207 };
item.BoundingBoxes = item.GetBoundingBoxFromGeometryExtent();



var actualJson = StacConvert.Serialize(item);

Expand Down Expand Up @@ -448,5 +448,22 @@ public void EmptyProviders()
Assert.NotNull(item.Providers);

}

[Fact]
public void EmptyGeometry()
{
var json = GetJson("Item");

var item = StacConvert.Deserialize<StacItem>(json);

Assert.Null(item.Geometry);

json = StacConvert.Serialize(item);

JToken token = JToken.Parse(json);

Assert.NotNull(token.Children().FirstOrDefault(c => c.Path == "geometry"));

}
}
}
108 changes: 108 additions & 0 deletions src/DotNetStac.Test/Resources/Item/ItemTests_EmptyGeometry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"stac_version": "1.0.0",
"stac_extensions": [
"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-2",
"geometry": null,
"properties": {
"disaster:class": "Activation",
"cpe:status": {
"stage": "notificationNew",
"message": null,
"link": null
},
"updated": "2022-06-23T12:31:13.5064407Z",
"title": "[Act-2/Call-2] ONF Fires Monitoring",
"disaster:activation_id": 2,
"disaster:call_ids": [
2
],
"cpe:pm_user_id": "fpacini",
"disaster:type": [
"Fire"
],
"disaster:region": [
"South France"
],
"disaster:country": "FRA",
"datetime": "2022-06-21T07:30:00Z",
"cpe:cos2_xml": "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<disaster xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n <callId>2</callId>\n <provider>gdaonf</provider>\n <disasterDate>2022-06-21T07:30:00Z</disasterDate>\n <recordUpdated>2022-06-21T07:55:39Z</recordUpdated>\n <title language=\"en\">ONF Fires Monitoring</title>\n <description language=\"en\">desc</description>\n <activationId>2</activationId>\n <pmUserId>fpacini</pmUserId>\n <type>fire</type>\n <webPageUrl>https://www.terradue.com</webPageUrl>\n <country>FRA</country>\n <region language=\"en\">South France</region>\n <area>\n <isAreaPrivate>false</isAreaPrivate>\n <kmlFileUrl>s3://mcube-catalog/activations/act-2/act-2.kml</kmlFileUrl>\n </area>\n <location>\n <latitude>43.192</latitude>\n <longitude>3.009</longitude>\n </location>\n <isClosed>false</isClosed>\n</disaster>",
"created": "2022-06-21T07:30:00Z",
"cpe:activation_status": "open",
"description": "<div style=\"float: left; width: 80px;\"><img src=\"https://store.terradue.com/api/cos2/various/icons/fire.png\" /></div>\n\n## [Act-2/Call-2] ONF Fires Monitoring\n\n**21/06/2022 07:30:00**\n\n[Link on disastercharter.org](https://www.terradue.com/)\n\n<div>desc</div>",
"providers": [
{
"name": "gdaonf",
"roles": [
"producer"
]
}
],
"cpe:notified": [
"2022-06-21T15:08:45.7088154Z",
"2022-06-23T12:30:21.3505743Z"
],
"cpe:notification_source": "cos2",
"version": "6"
},
"bbox": [
3.009,
43.192,
3.009,
43.192
],
"assets": {
"icon": {
"type": "image/png",
"roles": [
"thumbnail"
],
"title": "placemark",
"href": "s3://mcube-catalog/activations/act-2/fire.png",
"file:size": 11452
},
"area1": {
"type": "application/vnd.google-earth.kml+xml",
"roles": [
"area",
"metadata"
],
"title": "Area 1",
"href": "s3://mcube-catalog/activations/act-2/act-2.kml",
"file:size": 1591
}
},
"links": [
{
"type": "text/html",
"rel": "about",
"title": "Disaster Charter Web Page",
"href": "https://www.terradue.com"
},
{
"type": "application/geo+json",
"rel": "item",
"title": "[Area] South of France",
"href": "areas/South_of_France.json"
},
{
"type": "application/geo+json",
"rel": "item",
"title": "[Area] Corse",
"href": "areas/Corse.json"
},
{
"type": "application/geo+json",
"rel": "self",
"href": "s3://mcube-catalog/activations/act-2/act-2.json"
},
{
"type": "application/json",
"rel": "root",
"href": "s3://mcube-catalog/catalog.json"
}
]
}
2 changes: 1 addition & 1 deletion src/DotNetStac/DotNetStac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Title>DotNetStac</Title>
<Description>Terradue .Net library for working with any SpatioTemporal Asset Catalog</Description>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<VersionPrefix>1.6.3</VersionPrefix>
<VersionPrefix>1.6.4</VersionPrefix>
<Authors>Emmanuel Mathot</Authors>
<Authors>emmanuelmathot</Authors>
<Company>Terradue</Company>
Expand Down
2 changes: 1 addition & 1 deletion src/DotNetStac/StacItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Stac
/// <summary>
/// STAC Item Object implementing STAC Item spec (https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md)
/// </summary>
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore, MemberSerialization = MemberSerialization.OptIn)]
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public partial class StacItem : GeoJSON.Net.Feature.Feature, IStacObject, ICloneable
{
public const string MEDIATYPE = "application/geo+json";
Expand Down

0 comments on commit b042d3b

Please sign in to comment.