Skip to content

Commit

Permalink
stacItem clone + factory extensions types access
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Nov 4, 2020
1 parent 35054f2 commit 251129d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/DotNetStac/Extensions/StacExtensionsFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public static StacExtensionsFactory Default
}
}

public Dictionary<string, Type> StacExtensionsDictionary => stacExtensionsDictionary;

public static StacExtensionsFactory CreateDefaultFactory()
{
return new StacExtensionsFactory();
Expand Down
10 changes: 10 additions & 0 deletions src/DotNetStac/Item/StacItem.Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ public StacItem(IGeometryObject geometry, object properties, string id = null) :
{
}

public StacItem(StacItem stacItem) : this(stacItem.Geometry, stacItem.Properties, stacItem.Id)
{
this.stacExtensionsStrings = stacItem.stacExtensionsStrings;
this.stacVersion = stacItem.stacVersion;
this.links = stacItem.links;
this.assets = stacItem.assets;
this.collection = stacItem.collection;
this.sourceUri = stacItem.sourceUri;
}

[JsonProperty("stac_extensions")]
public string[] StacExtensionsStrings { get => stacExtensionsStrings; set => stacExtensionsStrings = value; }

Expand Down

0 comments on commit 251129d

Please sign in to comment.