diff --git a/src/DotNetStac.Test/Extensions/VersionExtensionTests.cs b/src/DotNetStac.Test/Extensions/VersionExtensionTests.cs index 537fd3ed..e0ca8827 100644 --- a/src/DotNetStac.Test/Extensions/VersionExtensionTests.cs +++ b/src/DotNetStac.Test/Extensions/VersionExtensionTests.cs @@ -3,6 +3,7 @@ // File Name: VersionExtensionTests.cs using Newtonsoft.Json; +using Stac.Extensions.Version; using Xunit; namespace Stac.Test.Extensions diff --git a/src/DotNetStac/Extensions/View/ViewStacExtension.cs b/src/DotNetStac/Extensions/View/ViewStacExtension.cs index 8d92196e..aac46960 100644 --- a/src/DotNetStac/Extensions/View/ViewStacExtension.cs +++ b/src/DotNetStac/Extensions/View/ViewStacExtension.cs @@ -7,14 +7,7 @@ namespace Stac.Extensions.View { - public static class ViewStacExtensionExtensions - { - public static ViewStacExtension ViewExtension(this StacItem stacItem) - { - return new ViewStacExtension(stacItem); - } - } - + public class ViewStacExtension : StacPropertiesContainerExtension, IStacExtension { public const string JsonSchemaUrl = "https://stac-extensions.github.io/view/v1.0.0/schema.json"; @@ -32,83 +25,83 @@ public ViewStacExtension(IStacObject stacObject) } public static string OffNadirField => "view:off_nadir"; - + public static string IncidenceAngleField => "view:incidence_angle"; - + public static string AzimuthField => "view:azimuth"; - + public static string SunAzimuthField => "view:sun_azimuth"; - + public static string SunElevationField => "view:sun_elevation"; public double OffNadir { - get - { - return this.StacPropertiesContainer.GetProperty(OffNadirField); - } - - set - { - this.StacPropertiesContainer.SetProperty(OffNadirField, value); - this.DeclareStacExtension(); - } + get + { + return this.StacPropertiesContainer.GetProperty(OffNadirField); + } + + set + { + this.StacPropertiesContainer.SetProperty(OffNadirField, value); + this.DeclareStacExtension(); + } } public double IncidenceAngle { - get - { - return this.StacPropertiesContainer.GetProperty(IncidenceAngleField); - } - - set - { - this.StacPropertiesContainer.SetProperty(IncidenceAngleField, value); - this.DeclareStacExtension(); - } + get + { + return this.StacPropertiesContainer.GetProperty(IncidenceAngleField); + } + + set + { + this.StacPropertiesContainer.SetProperty(IncidenceAngleField, value); + this.DeclareStacExtension(); + } } public double Azimuth { - get - { - return this.StacPropertiesContainer.GetProperty(AzimuthField); - } - - set - { - this.StacPropertiesContainer.SetProperty(AzimuthField, value); - this.DeclareStacExtension(); - } + get + { + return this.StacPropertiesContainer.GetProperty(AzimuthField); + } + + set + { + this.StacPropertiesContainer.SetProperty(AzimuthField, value); + this.DeclareStacExtension(); + } } public double SunAzimuth { - get - { - return this.StacPropertiesContainer.GetProperty(SunAzimuthField); - } - - set - { - this.StacPropertiesContainer.SetProperty(SunAzimuthField, value); - this.DeclareStacExtension(); - } + get + { + return this.StacPropertiesContainer.GetProperty(SunAzimuthField); + } + + set + { + this.StacPropertiesContainer.SetProperty(SunAzimuthField, value); + this.DeclareStacExtension(); + } } public double SunElevation { - get - { - return this.StacPropertiesContainer.GetProperty(SunElevationField); - } - - set - { - this.StacPropertiesContainer.SetProperty(SunElevationField, value); - this.DeclareStacExtension(); - } + get + { + return this.StacPropertiesContainer.GetProperty(SunElevationField); + } + + set + { + this.StacPropertiesContainer.SetProperty(SunElevationField, value); + this.DeclareStacExtension(); + } } /// diff --git a/src/DotNetStac/Extensions/View/ViewStacExtensionExtensions.cs b/src/DotNetStac/Extensions/View/ViewStacExtensionExtensions.cs new file mode 100644 index 00000000..427bbb99 --- /dev/null +++ b/src/DotNetStac/Extensions/View/ViewStacExtensionExtensions.cs @@ -0,0 +1,14 @@ +// Copyright (c) by Terradue Srl. All Rights Reserved. +// License under the AGPL, Version 3.0. +// File Name: ViewStacExtension.cs + +namespace Stac.Extensions.View +{ + public static class ViewStacExtensionExtensions + { + public static ViewStacExtension ViewExtension(this StacItem stacItem) + { + return new ViewStacExtension(stacItem); + } + } +}