Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelmathot committed Feb 7, 2023
1 parent 596b5e1 commit 63d7de8
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 62 deletions.
1 change: 1 addition & 0 deletions src/DotNetStac.Test/Extensions/VersionExtensionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// File Name: VersionExtensionTests.cs

using Newtonsoft.Json;
using Stac.Extensions.Version;
using Xunit;

namespace Stac.Test.Extensions
Expand Down
117 changes: 55 additions & 62 deletions src/DotNetStac/Extensions/View/ViewStacExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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<double>(OffNadirField);
}

set
{
this.StacPropertiesContainer.SetProperty(OffNadirField, value);
this.DeclareStacExtension();
}
get
{
return this.StacPropertiesContainer.GetProperty<double>(OffNadirField);
}

set
{
this.StacPropertiesContainer.SetProperty(OffNadirField, value);
this.DeclareStacExtension();
}
}

public double IncidenceAngle
{
get
{
return this.StacPropertiesContainer.GetProperty<double>(IncidenceAngleField);
}

set
{
this.StacPropertiesContainer.SetProperty(IncidenceAngleField, value);
this.DeclareStacExtension();
}
get
{
return this.StacPropertiesContainer.GetProperty<double>(IncidenceAngleField);
}

set
{
this.StacPropertiesContainer.SetProperty(IncidenceAngleField, value);
this.DeclareStacExtension();
}
}

public double Azimuth
{
get
{
return this.StacPropertiesContainer.GetProperty<double>(AzimuthField);
}

set
{
this.StacPropertiesContainer.SetProperty(AzimuthField, value);
this.DeclareStacExtension();
}
get
{
return this.StacPropertiesContainer.GetProperty<double>(AzimuthField);
}

set
{
this.StacPropertiesContainer.SetProperty(AzimuthField, value);
this.DeclareStacExtension();
}
}

public double SunAzimuth
{
get
{
return this.StacPropertiesContainer.GetProperty<double>(SunAzimuthField);
}

set
{
this.StacPropertiesContainer.SetProperty(SunAzimuthField, value);
this.DeclareStacExtension();
}
get
{
return this.StacPropertiesContainer.GetProperty<double>(SunAzimuthField);
}

set
{
this.StacPropertiesContainer.SetProperty(SunAzimuthField, value);
this.DeclareStacExtension();
}
}

public double SunElevation
{
get
{
return this.StacPropertiesContainer.GetProperty<double>(SunElevationField);
}

set
{
this.StacPropertiesContainer.SetProperty(SunElevationField, value);
this.DeclareStacExtension();
}
get
{
return this.StacPropertiesContainer.GetProperty<double>(SunElevationField);
}

set
{
this.StacPropertiesContainer.SetProperty(SunElevationField, value);
this.DeclareStacExtension();
}
}

/// <inheritdoc/>
Expand Down
14 changes: 14 additions & 0 deletions src/DotNetStac/Extensions/View/ViewStacExtensionExtensions.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}

0 comments on commit 63d7de8

Please sign in to comment.