diff --git a/src/DotNetStac/Collection/StacExtent.cs b/src/DotNetStac/Collection/StacExtent.cs index 8bb6eceb..4ca24dc0 100644 --- a/src/DotNetStac/Collection/StacExtent.cs +++ b/src/DotNetStac/Collection/StacExtent.cs @@ -81,7 +81,7 @@ public object Clone() internal void Update(ICollection items) { - Spatial = new StacSpatialExtent(items.Select(i => i.GetBoundingBoxFromGeometryExtent()[0]) + this.Spatial = new StacSpatialExtent(items.Select(i => i.GetBoundingBoxFromGeometryExtent()[0]) .Concat(new double[] { this.Spatial.BoundingBoxes[0][0] }) .Min(), items.Select(i => i.GetBoundingBoxFromGeometryExtent()[1]) @@ -93,7 +93,7 @@ internal void Update(ICollection items) items.Select(i => i.GetBoundingBoxFromGeometryExtent()[3]) .Concat(new double[] { this.Spatial.BoundingBoxes[0][3] }) .Max()); - Temporal = new StacTemporalExtent(items.Select(i => i.DateTime.Start) + this.Temporal = new StacTemporalExtent(items.Select(i => i.DateTime.Start) .Concat(new DateTime[] { this.Temporal.Interval[0][0].GetValueOrDefault() }) .Min(), items.Select(i => i.DateTime.End) diff --git a/src/DotNetStac/Collection/StacSpatialExtent.cs b/src/DotNetStac/Collection/StacSpatialExtent.cs index b10992a9..89bc3dbe 100644 --- a/src/DotNetStac/Collection/StacSpatialExtent.cs +++ b/src/DotNetStac/Collection/StacSpatialExtent.cs @@ -24,7 +24,7 @@ public class StacSpatialExtent : ICloneable [JsonConstructor] public StacSpatialExtent(double minX, double minY, double maxX, double maxY) { - BoundingBoxes = new double[1][] { new double[4] { minX, minY, maxX, maxY } }; + this.BoundingBoxes = new double[1][] { new double[4] { minX, minY, maxX, maxY } }; } /// diff --git a/src/DotNetStac/Collection/StacSummaryItem.cs b/src/DotNetStac/Collection/StacSummaryItem.cs index 9d7f4fee..47790a59 100644 --- a/src/DotNetStac/Collection/StacSummaryItem.cs +++ b/src/DotNetStac/Collection/StacSummaryItem.cs @@ -35,7 +35,7 @@ public JToken this[object key] { get { - return summary[key]; + return this.summary[key]; } } @@ -45,7 +45,7 @@ public JToken this[object key] /// /// JToken transformer /// - public JToken AsJToken => summary; + public JToken AsJToken => this.summary; /// public abstract IEnumerable Enumerate(); @@ -56,12 +56,12 @@ public JToken this[object key] /// public IEnumerator GetEnumerator() { - return summary.Children().GetEnumerator(); + return this.summary.Children().GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return summary.Children().GetEnumerator(); + return this.summary.Children().GetEnumerator(); } } diff --git a/src/DotNetStac/Collection/StacSummaryRangeObject.cs b/src/DotNetStac/Collection/StacSummaryRangeObject.cs index 486e9b2d..2d7314cb 100644 --- a/src/DotNetStac/Collection/StacSummaryRangeObject.cs +++ b/src/DotNetStac/Collection/StacSummaryRangeObject.cs @@ -34,8 +34,8 @@ public StacSummaryRangeObject(JObject summary) : base(summary) /// public StacSummaryRangeObject(T min, T max) : base(new JObject()) { - Min = min; - Max = max; + this.Min = min; + this.Max = max; } /// @@ -45,7 +45,7 @@ public StacSummaryRangeObject(T min, T max) : base(new JObject()) /// /// Minimum of the range /// - public T Min { get => summary["minimum"].Value(); set => summary["minimum"] = new JValue(value); } + public T Min { get => this.summary["minimum"].Value(); set => this.summary["minimum"] = new JValue(value); } /// /// Maximum of the range @@ -54,12 +54,12 @@ public StacSummaryRangeObject(T min, T max) : base(new JObject()) /// /// Maximum of the range /// - public T Max { get => summary["maximum"].Value(); set => summary["maximum"] = new JValue(value); } + public T Max { get => this.summary["maximum"].Value(); set => this.summary["maximum"] = new JValue(value); } /// public override IEnumerable Enumerate() { - return new object[2] { Min, Max }; + return new object[2] { this.Min, this.Max }; } } } diff --git a/src/DotNetStac/Collection/StacSummaryValueSet.cs b/src/DotNetStac/Collection/StacSummaryValueSet.cs index 884c30f4..acc6c62b 100644 --- a/src/DotNetStac/Collection/StacSummaryValueSet.cs +++ b/src/DotNetStac/Collection/StacSummaryValueSet.cs @@ -43,7 +43,7 @@ public StacSummaryValueSet(IEnumerable summarySet) : base(new JArray(summaryS /// value item public void Add(T item) { - ((JArray)summary).Add(item); + ((JArray)this.summary).Add(item); } /// @@ -53,7 +53,7 @@ public void Add(T item) /// /// Summary Value Set total of items /// - public int Count => summary.Count(); + public int Count => this.summary.Count(); /// /// Get the Summary Value Set as an enumerable @@ -61,11 +61,11 @@ public void Add(T item) /// /// Get the Summary Value Set as an enumerable /// - public IEnumerable SummarySet { get => summary.ToObject>(); } + public IEnumerable SummarySet { get => this.summary.ToObject>(); } IEnumerator IEnumerable.GetEnumerator() { - return SummarySet.GetEnumerator(); + return this.SummarySet.GetEnumerator(); } /// diff --git a/src/DotNetStac/Collection/StacTemporalExtent.cs b/src/DotNetStac/Collection/StacTemporalExtent.cs index fd56e7a0..ab30c75a 100644 --- a/src/DotNetStac/Collection/StacTemporalExtent.cs +++ b/src/DotNetStac/Collection/StacTemporalExtent.cs @@ -15,7 +15,6 @@ namespace Stac.Collection public class StacTemporalExtent { - /// /// Initialize a new instance of the class with a single extent. /// @@ -24,7 +23,7 @@ public class StacTemporalExtent [JsonConstructor] public StacTemporalExtent(DateTime? start, DateTime? end) { - Interval = new DateTime?[1][] { new DateTime?[2] { start, end } }; + this.Interval = new DateTime?[1][] { new DateTime?[2] { start, end } }; } /// diff --git a/src/DotNetStac/Common/JsonMergeUtils.cs b/src/DotNetStac/Common/JsonMergeUtils.cs index 16347d24..809edeb2 100644 --- a/src/DotNetStac/Common/JsonMergeUtils.cs +++ b/src/DotNetStac/Common/JsonMergeUtils.cs @@ -55,7 +55,6 @@ public static string Merge(string original, string patch, JsonWriterOptions? wri MergeObjects(jsonWriter, originalDoc.RootElement, patchDoc.RootElement); } - return Encoding.UTF8.GetString(memStream.ToArray()); } diff --git a/src/DotNetStac/Common/PropertyObservableCollection.cs b/src/DotNetStac/Common/PropertyObservableCollection.cs index 95c3c044..5a2b3d78 100644 --- a/src/DotNetStac/Common/PropertyObservableCollection.cs +++ b/src/DotNetStac/Common/PropertyObservableCollection.cs @@ -12,9 +12,9 @@ public class PropertyObservableCollection : ObservableCollection { public PropertyObservableCollection(IStacPropertiesContainer propertiesContainer, string key) : base() { - PropertiesContainer = propertiesContainer; - Key = key; - this.CollectionChanged += ObservableCollectionInPropertiesChanged; + this.PropertiesContainer = propertiesContainer; + this.Key = key; + this.CollectionChanged += this.ObservableCollectionInPropertiesChanged; } public IStacPropertiesContainer PropertiesContainer { get; } @@ -22,9 +22,9 @@ public PropertyObservableCollection(IStacPropertiesContainer propertiesContainer private void ObservableCollectionInPropertiesChanged(object sender, NotifyCollectionChangedEventArgs e) { - PropertiesContainer.RemoveProperty(Key); + this.PropertiesContainer.RemoveProperty(this.Key); if (this.Count == 0) return; - PropertiesContainer.SetProperty(Key, this.ToList()); + this.PropertiesContainer.SetProperty(this.Key, this.ToList()); } } } diff --git a/src/DotNetStac/Common/Statistics.cs b/src/DotNetStac/Common/Statistics.cs index 5f69713a..4bf3f857 100644 --- a/src/DotNetStac/Common/Statistics.cs +++ b/src/DotNetStac/Common/Statistics.cs @@ -21,12 +21,12 @@ public class Statistics [JsonConstructor] public Statistics(double? minimum, double? maximum, double? mean, double? stdev, double? validPercent) { - Mean = mean; - Minimum = minimum; - Maximum = maximum; - Stdev = stdev; - ValidPercent = validPercent; - properties = new Dictionary(); + this.Mean = mean; + this.Minimum = minimum; + this.Maximum = maximum; + this.Stdev = stdev; + this.ValidPercent = validPercent; + this.properties = new Dictionary(); } /// @@ -69,7 +69,7 @@ public Statistics(double? minimum, double? maximum, double? mean, double? stdev, /// /// [JsonExtensionData] - public IDictionary Properties { get => properties; set => properties = value; } + public IDictionary Properties { get => this.properties; set => this.properties = value; } } } diff --git a/src/DotNetStac/Common/TolerantEnumConverter.cs b/src/DotNetStac/Common/TolerantEnumConverter.cs index da31e108..7c4f7ac1 100644 --- a/src/DotNetStac/Common/TolerantEnumConverter.cs +++ b/src/DotNetStac/Common/TolerantEnumConverter.cs @@ -12,13 +12,13 @@ internal class TolerantEnumConverter : JsonConverter { public override bool CanConvert(Type objectType) { - Type type = IsNullableType(objectType) ? Nullable.GetUnderlyingType(objectType) : objectType; + Type type = this.IsNullableType(objectType) ? Nullable.GetUnderlyingType(objectType) : objectType; return type.IsEnum; } public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { - bool isNullable = IsNullableType(objectType); + bool isNullable = this.IsNullableType(objectType); Type enumType = isNullable ? Nullable.GetUnderlyingType(objectType) : objectType; string[] names = Enum.GetNames(enumType); diff --git a/src/DotNetStac/Extensions/Alternate/AlternateAssetObject.cs b/src/DotNetStac/Extensions/Alternate/AlternateAssetObject.cs index d80f6e51..612906c5 100644 --- a/src/DotNetStac/Extensions/Alternate/AlternateAssetObject.cs +++ b/src/DotNetStac/Extensions/Alternate/AlternateAssetObject.cs @@ -32,10 +32,10 @@ public class AlternateAssetObject : IStacPropertiesContainer public AlternateAssetObject(string href, IStacObject parent = null, string title = null, string description = null) { this.href = href; - _parent = parent; + this._parent = parent; this.title = title; this.description = description; - properties = new Dictionary(); + this.properties = new Dictionary(); } /// @@ -46,7 +46,7 @@ public AlternateAssetObject(string href, IStacObject parent = null, string title /// [JsonProperty("href")] [JsonRequired] - public string Href { get => href; set => href = value; } + public string Href { get => this.href; set => this.href = value; } /// /// The displayed title for clients and users. @@ -55,7 +55,7 @@ public AlternateAssetObject(string href, IStacObject parent = null, string title /// The displayed title for clients and users. /// [JsonProperty("title")] - public string Title { get => title; set => title = value; } + public string Title { get => this.title; set => this.title = value; } /// /// A description of the Asset providing additional details, such as how it was processed or created. CommonMark 0.29 syntax MAY be used for rich text representation. @@ -64,14 +64,14 @@ public AlternateAssetObject(string href, IStacObject parent = null, string title /// A description of the Asset providing additional details, such as how it was processed or created. CommonMark 0.29 syntax MAY be used for rich text representation. /// [JsonProperty("description")] - public string Description { get => description; set => description = value; } + public string Description { get => this.description; set => this.description = value; } /// /// Additional fields /// /// [JsonExtensionData] - public IDictionary Properties { get => properties; set => properties = value; } + public IDictionary Properties { get => this.properties; set => this.properties = value; } /// /// Parent Stac Object @@ -81,7 +81,7 @@ public AlternateAssetObject(string href, IStacObject parent = null, string title /// Parent Stac Object /// [JsonIgnore] - public IStacObject StacObjectContainer => _parent; + public IStacObject StacObjectContainer => this._parent; /// /// Uri @@ -91,6 +91,6 @@ public AlternateAssetObject(string href, IStacObject parent = null, string title /// Uri /// [JsonIgnore] - public Uri Uri => new Uri(href); + public Uri Uri => new Uri(this.href); } } diff --git a/src/DotNetStac/Extensions/Alternate/AlternateStacExtension.cs b/src/DotNetStac/Extensions/Alternate/AlternateStacExtension.cs index a047f87c..7bef6550 100644 --- a/src/DotNetStac/Extensions/Alternate/AlternateStacExtension.cs +++ b/src/DotNetStac/Extensions/Alternate/AlternateStacExtension.cs @@ -35,15 +35,15 @@ internal AlternateStacExtension(StacAsset stacAsset) : base(JsonSchemaUrl, stacA /// public IDictionary AlternateAssets { - get { return StacPropertiesContainer.GetProperty>(AlternateField); } + get { return this.StacPropertiesContainer.GetProperty>(AlternateField); } set { if (value == null || value.Count() == 0) - StacPropertiesContainer.RemoveProperty(AlternateField); + this.StacPropertiesContainer.RemoveProperty(AlternateField); else { - StacPropertiesContainer.SetProperty(AlternateField, value); - DeclareStacExtension(); + this.StacPropertiesContainer.SetProperty(AlternateField, value); + this.DeclareStacExtension(); } } } @@ -57,7 +57,7 @@ public IDictionary AlternateAssets public override IDictionary ItemFields => assetFields; /// - public StacAsset StacAsset => StacPropertiesContainer as StacAsset; + public StacAsset StacAsset => this.StacPropertiesContainer as StacAsset; /// public override IDictionary GetSummaryFunctions() @@ -68,15 +68,13 @@ public override IDictionary GetSummaryFunctions() public AlternateAssetObject AddAlternate(string key, Uri uri, string title = null, string description = null) { - AlternateAssetObject alternateAssetObject = new AlternateAssetObject(uri.ToString(), StacAsset.ParentStacObject, title, description); - var alternateAssets = AlternateAssets ?? new Dictionary(); + AlternateAssetObject alternateAssetObject = new AlternateAssetObject(uri.ToString(), this.StacAsset.ParentStacObject, title, description); + var alternateAssets = this.AlternateAssets ?? new Dictionary(); alternateAssets.Add(key, alternateAssetObject); - AlternateAssets = alternateAssets; + this.AlternateAssets = alternateAssets; return alternateAssetObject; } - - } /// diff --git a/src/DotNetStac/Extensions/Datacube/DatacubeDimensionObject.cs b/src/DotNetStac/Extensions/Datacube/DatacubeDimensionObject.cs index 663dce8e..8aa5fb64 100644 --- a/src/DotNetStac/Extensions/Datacube/DatacubeDimensionObject.cs +++ b/src/DotNetStac/Extensions/Datacube/DatacubeDimensionObject.cs @@ -28,7 +28,7 @@ public class DatacubeDimension : IStacPropertiesContainer /// Type of the dimension. /// [JsonProperty("type")] - public string Type { get => type; set => type = value; } + public string Type { get => this.type; set => this.type = value; } /// /// Detailed multi-line description to explain the dimension. CommonMark 0.29 syntax MAY be used for rich text representation. @@ -37,7 +37,7 @@ public class DatacubeDimension : IStacPropertiesContainer /// Detailed multi-line description to explain the dimension. CommonMark 0.29 syntax MAY be used for rich text representation. /// [JsonProperty("description")] - public string Description { get => description; set => description = value; } + public string Description { get => this.description; set => this.description = value; } /// /// Extent (lower and upper bounds) of the dimension as two-element array. Open intervals with null are not allowed. @@ -46,7 +46,7 @@ public class DatacubeDimension : IStacPropertiesContainer /// Extent (lower and upper bounds) of the dimension as two-element array. Open intervals with null are not allowed. /// [JsonProperty("extent")] - public double[] Extent { get => extent; set => extent = value; } + public double[] Extent { get => this.extent; set => this.extent = value; } /// /// Optionally, an ordered list of all values. @@ -55,7 +55,7 @@ public class DatacubeDimension : IStacPropertiesContainer /// Optionally, an ordered list of all values. /// [JsonProperty("values")] - public object Values { get => values; set => values = value; } + public object Values { get => this.values; set => this.values = value; } /// /// The space between the values. Use null for irregularly spaced steps. @@ -64,23 +64,22 @@ public class DatacubeDimension : IStacPropertiesContainer /// The space between the values. Use null for irregularly spaced steps. /// [JsonProperty("step")] - public double? Step { get => step; set => step = value; } + public double? Step { get => this.step; set => this.step = value; } /// /// Additional fields /// /// [JsonExtensionData] - public IDictionary Properties { get => properties; set => properties = value; } + public IDictionary Properties { get => this.properties; set => this.properties = value; } /// [JsonIgnore] public IStacObject StacObjectContainer => null; - public DatacubeDimension() { - properties = new Dictionary(); + this.properties = new Dictionary(); } } @@ -96,7 +95,7 @@ public class DatacubeDimensionSpatial : DatacubeDimension /// Axis of the spatial dimension. /// [JsonProperty("axis")] - public DatacubeAxis? Axis { get => axis; set => axis = value; } + public DatacubeAxis? Axis { get => this.axis; set => this.axis = value; } /// /// The spatial reference system for the data, specified as numerical EPSG code, WKT2 (ISO 19162) string or PROJJSON object. Defaults to EPSG code 4326. @@ -105,7 +104,7 @@ public class DatacubeDimensionSpatial : DatacubeDimension /// The spatial reference system for the data, specified as numerical EPSG code, WKT2 (ISO 19162) string or PROJJSON object. Defaults to EPSG code 4326. /// [JsonProperty("reference_system")] - public object ReferenceSystem { get => reference_system; set => reference_system = value; } + public object ReferenceSystem { get => this.reference_system; set => this.reference_system = value; } public DatacubeDimensionSpatial() : base() { @@ -116,7 +115,7 @@ public class DatacubeDimensionSpatialHorizontal : DatacubeDimensionSpatial { public DatacubeDimensionSpatialHorizontal() : base() { - axis = DatacubeAxis.x; + this.axis = DatacubeAxis.x; } } @@ -131,11 +130,11 @@ public class DatacubeDimensionSpatialVertical : DatacubeDimensionSpatial /// The unit of measurement for the data, preferably compliant to UDUNITS-2 units (singular). /// [JsonProperty("unit")] - public string Unit { get => unit; set => unit = value; } + public string Unit { get => this.unit; set => this.unit = value; } public DatacubeDimensionSpatialVertical() : base() { - axis = DatacubeAxis.z; + this.axis = DatacubeAxis.z; } } @@ -161,7 +160,7 @@ public class DatacubeDimensionAdditional : DatacubeDimension /// The unit of measurement for the data, preferably compliant to UDUNITS-2 units (singular). /// [JsonProperty("unit")] - public string Unit { get => unit; set => unit = value; } + public string Unit { get => this.unit; set => this.unit = value; } /// /// The spatial reference system for the data, specified as numerical EPSG code, WKT2 (ISO 19162) string or PROJJSON object. Defaults to EPSG code 4326. @@ -170,7 +169,7 @@ public class DatacubeDimensionAdditional : DatacubeDimension /// The spatial reference system for the data, specified as numerical EPSG code, WKT2 (ISO 19162) string or PROJJSON object. Defaults to EPSG code 4326. /// [JsonProperty("reference_system")] - public object ReferenceSystem { get => reference_system; set => reference_system = value; } + public object ReferenceSystem { get => this.reference_system; set => this.reference_system = value; } public DatacubeDimensionAdditional() : base() { diff --git a/src/DotNetStac/Extensions/Datacube/DatacubeStacExtension.cs b/src/DotNetStac/Extensions/Datacube/DatacubeStacExtension.cs index b1decfef..d72f99dd 100644 --- a/src/DotNetStac/Extensions/Datacube/DatacubeStacExtension.cs +++ b/src/DotNetStac/Extensions/Datacube/DatacubeStacExtension.cs @@ -23,9 +23,9 @@ public class DatacubeStacExtension : StacPropertiesContainerExtension, IStacExte private DatacubeStacExtension(IStacPropertiesContainer stacPropertiesContainer) : base(JsonSchemaUrl, stacPropertiesContainer) { - itemFields = new Dictionary(); - itemFields.Add(DimensionField, typeof(IDictionary)); - itemFields.Add(VariableField, typeof(IDictionary)); + this.itemFields = new Dictionary(); + this.itemFields.Add(DimensionField, typeof(IDictionary)); + this.itemFields.Add(VariableField, typeof(IDictionary)); } internal DatacubeStacExtension(StacCollection stacCollection) : this((IStacPropertiesContainer)stacCollection) @@ -50,21 +50,21 @@ public IDictionary Dimensions { get { - Dictionary existingDimensions = StacPropertiesContainer.GetProperty>(DimensionField); + Dictionary existingDimensions = this.StacPropertiesContainer.GetProperty>(DimensionField); ObservableDictionary dimensions = null; if (existingDimensions == null) dimensions = new ObservableDictionary(); else dimensions = new ObservableDictionary(existingDimensions); - dimensions.CollectionChanged += UpdateDimensionField; + dimensions.CollectionChanged += this.UpdateDimensionField; return dimensions; } } private void UpdateDimensionField(object sender, NotifyCollectionChangedEventArgs e) { - StacPropertiesContainer.SetProperty(DimensionField, new Dictionary(sender as IDictionary)); - DeclareStacExtension(); + this.StacPropertiesContainer.SetProperty(DimensionField, new Dictionary(sender as IDictionary)); + this.DeclareStacExtension(); } /// @@ -77,21 +77,21 @@ public IDictionary Variables { get { - Dictionary existingVariables = StacPropertiesContainer.GetProperty>(VariableField); + Dictionary existingVariables = this.StacPropertiesContainer.GetProperty>(VariableField); ObservableDictionary variables = null; if (existingVariables == null) variables = new ObservableDictionary(); else variables = new ObservableDictionary(existingVariables); - variables.CollectionChanged += UpdateVariableField; + variables.CollectionChanged += this.UpdateVariableField; return variables; } } private void UpdateVariableField(object sender, NotifyCollectionChangedEventArgs e) { - StacPropertiesContainer.SetProperty(VariableField, new Dictionary(sender as IDictionary)); - DeclareStacExtension(); + this.StacPropertiesContainer.SetProperty(VariableField, new Dictionary(sender as IDictionary)); + this.DeclareStacExtension(); } /// @@ -100,7 +100,7 @@ private void UpdateVariableField(object sender, NotifyCollectionChangedEventArgs /// /// Potential fields and their types /// - public override IDictionary ItemFields => itemFields; + public override IDictionary ItemFields => this.itemFields; /// public override IDictionary GetSummaryFunctions() diff --git a/src/DotNetStac/Extensions/Datacube/DatacubeVariableObject.cs b/src/DotNetStac/Extensions/Datacube/DatacubeVariableObject.cs index 61e717a6..904fd910 100644 --- a/src/DotNetStac/Extensions/Datacube/DatacubeVariableObject.cs +++ b/src/DotNetStac/Extensions/Datacube/DatacubeVariableObject.cs @@ -29,7 +29,7 @@ public class DatacubeVariable : IStacPropertiesContainer /// The dimensions of the variable. This should refer to keys in the cube:dimensions object or be an empty list if the variable has no dimensions. /// [JsonProperty("dimensions")] - public string[] Dimensions { get => dimensions; set => dimensions = value; } + public string[] Dimensions { get => this.dimensions; set => this.dimensions = value; } /// /// Type of the variable. @@ -38,7 +38,7 @@ public class DatacubeVariable : IStacPropertiesContainer /// Type of the variable. /// [JsonProperty("type")] - public DatacubeVariableType? Type { get => type; set => type = value; } + public DatacubeVariableType? Type { get => this.type; set => this.type = value; } /// /// Detailed multi-line description to explain the variable. CommonMark 0.29 syntax MAY be used for rich text representation. @@ -47,7 +47,7 @@ public class DatacubeVariable : IStacPropertiesContainer /// Detailed multi-line description to explain the variable. CommonMark 0.29 syntax MAY be used for rich text representation. /// [JsonProperty("description")] - public string Description { get => description; set => description = value; } + public string Description { get => this.description; set => this.description = value; } /// /// If the variable consists of ordinal values, the extent (lower and upper bounds) of the values as two-element array. Use null for open intervals. @@ -56,7 +56,7 @@ public class DatacubeVariable : IStacPropertiesContainer /// If the variable consists of ordinal values, the extent (lower and upper bounds) of the values as two-element array. Use null for open intervals. /// [JsonProperty("extent")] - public double[] Extent { get => extent; set => extent = value; } + public double[] Extent { get => this.extent; set => this.extent = value; } /// /// An (ordered) list of all values, especially useful for nominal values. @@ -65,7 +65,7 @@ public class DatacubeVariable : IStacPropertiesContainer /// An (ordered) list of all values, especially useful for nominal values. /// [JsonProperty("values")] - public string[] Values { get => values; set => values = value; } + public string[] Values { get => this.values; set => this.values = value; } /// /// The unit of measurement for the data, preferably compliant to UDUNITS-2 units (singular). @@ -74,23 +74,22 @@ public class DatacubeVariable : IStacPropertiesContainer /// The unit of measurement for the data, preferably compliant to UDUNITS-2 units (singular). /// [JsonProperty("unit")] - public string Unit { get => unit; set => unit = value; } + public string Unit { get => this.unit; set => this.unit = value; } /// /// Additional fields /// /// [JsonExtensionData] - public IDictionary Properties { get => properties; set => properties = value; } + public IDictionary Properties { get => this.properties; set => this.properties = value; } /// [JsonIgnore] public IStacObject StacObjectContainer => null; - public DatacubeVariable() { - properties = new Dictionary(); + this.properties = new Dictionary(); } } } diff --git a/src/DotNetStac/Extensions/Eo/EoBandObject.cs b/src/DotNetStac/Extensions/Eo/EoBandObject.cs index 4229c79a..a412a21a 100644 --- a/src/DotNetStac/Extensions/Eo/EoBandObject.cs +++ b/src/DotNetStac/Extensions/Eo/EoBandObject.cs @@ -30,7 +30,7 @@ public EoBandObject(string name, EoBandCommonName? commonName) { this.name = name; this.commonName = commonName; - properties = new Dictionary(); + this.properties = new Dictionary(); } /// @@ -40,7 +40,7 @@ public EoBandObject(string name, EoBandCommonName? commonName) /// The name of the band (e.g., "B01", "B8", "band2", "red"). /// [JsonProperty("name")] - public string Name { get => name; set => name = value; } + public string Name { get => this.name; set => this.name = value; } /// /// Description to fully explain the band. CommonMark 0.29 syntax MAY be used for rich text representation. @@ -49,14 +49,14 @@ public EoBandObject(string name, EoBandCommonName? commonName) /// Description to fully explain the band. CommonMark 0.29 syntax MAY be used for rich text representation. /// [JsonProperty("description")] - public string Description { get => description; set => description = value; } + public string Description { get => this.description; set => this.description = value; } /// /// The name commonly used to refer to the band to make it easier to search for bands across instruments. /// /// [JsonProperty("common_name")] - public EoBandCommonName? CommonName { get => commonName; set => commonName = value; } + public EoBandCommonName? CommonName { get => this.commonName; set => this.commonName = value; } /// /// The center wavelength of the band, in micrometers (μm). @@ -84,7 +84,7 @@ public EoBandObject(string name, EoBandCommonName? commonName) /// /// [JsonExtensionData] - public IDictionary Properties { get => properties; set => properties = value; } + public IDictionary Properties { get => this.properties; set => this.properties = value; } } } diff --git a/src/DotNetStac/Extensions/Eo/EoStacExtension.cs b/src/DotNetStac/Extensions/Eo/EoStacExtension.cs index ee14e007..0da8f533 100644 --- a/src/DotNetStac/Extensions/Eo/EoStacExtension.cs +++ b/src/DotNetStac/Extensions/Eo/EoStacExtension.cs @@ -23,9 +23,9 @@ public class EoStacExtension : StacPropertiesContainerExtension, IStacExtension internal EoStacExtension(IStacPropertiesContainer stacpropertiesContainer) : base(JsonSchemaUrl, stacpropertiesContainer) { - itemFields = new Dictionary(); - itemFields.Add(BandsField, typeof(EoBandObject[])); - itemFields.Add(CloudCoverField, typeof(double)); + this.itemFields = new Dictionary(); + this.itemFields.Add(BandsField, typeof(EoBandObject[])); + this.itemFields.Add(CloudCoverField, typeof(double)); } /// @@ -36,14 +36,14 @@ internal EoStacExtension(IStacPropertiesContainer stacpropertiesContainer) : bas /// public double? CloudCover { - get { return StacPropertiesContainer.GetProperty(CloudCoverField); } + get { return this.StacPropertiesContainer.GetProperty(CloudCoverField); } set { if (value == null) - StacPropertiesContainer.RemoveProperty(CloudCoverField); + this.StacPropertiesContainer.RemoveProperty(CloudCoverField); else { - StacPropertiesContainer.SetProperty(CloudCoverField, value); DeclareStacExtension(); + this.StacPropertiesContainer.SetProperty(CloudCoverField, value); this.DeclareStacExtension(); } } } @@ -56,15 +56,15 @@ public double? CloudCover /// public EoBandObject[] Bands { - get { return StacPropertiesContainer.GetProperty(BandsField); } + get { return this.StacPropertiesContainer.GetProperty(BandsField); } set { if (value == null || value.Count() == 0) - StacPropertiesContainer.RemoveProperty(BandsField); + this.StacPropertiesContainer.RemoveProperty(BandsField); else { - StacPropertiesContainer.SetProperty(BandsField, value); - DeclareStacExtension(); + this.StacPropertiesContainer.SetProperty(BandsField, value); + this.DeclareStacExtension(); } } } @@ -75,7 +75,7 @@ public EoBandObject[] Bands /// /// Potential fields and their types /// - public override IDictionary ItemFields => itemFields; + public override IDictionary ItemFields => this.itemFields; /// public override IDictionary GetSummaryFunctions() diff --git a/src/DotNetStac/Extensions/File/FileStacExtension.cs b/src/DotNetStac/Extensions/File/FileStacExtension.cs index 3f8ebe3b..3b0ea86c 100644 --- a/src/DotNetStac/Extensions/File/FileStacExtension.cs +++ b/src/DotNetStac/Extensions/File/FileStacExtension.cs @@ -26,11 +26,11 @@ public class FileStacExtension : StacPropertiesContainerExtension, IStacExtensio internal FileStacExtension(StacAsset stacAsset) : base(JsonSchemaUrl, stacAsset) { - itemFields = new Dictionary(); - itemFields.Add(ByteOrderField, typeof(string)); - itemFields.Add(ChecksumField, typeof(string)); - itemFields.Add(HeaderSizeField, typeof(string)); - itemFields.Add(SizeField, typeof(IDictionary)); + this.itemFields = new Dictionary(); + this.itemFields.Add(ByteOrderField, typeof(string)); + this.itemFields.Add(ChecksumField, typeof(string)); + this.itemFields.Add(HeaderSizeField, typeof(string)); + this.itemFields.Add(SizeField, typeof(IDictionary)); } /// @@ -39,8 +39,8 @@ internal FileStacExtension(StacAsset stacAsset) : base(JsonSchemaUrl, stacAsset) /// public ByteOrder ByteOrder { - get { return StacPropertiesContainer.GetProperty(ByteOrderField); } - set { StacPropertiesContainer.SetProperty(ByteOrderField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(ByteOrderField); } + set { this.StacPropertiesContainer.SetProperty(ByteOrderField, value); this.DeclareStacExtension(); } } /// @@ -49,8 +49,8 @@ public ByteOrder ByteOrder /// public Multihash Checksum { - get { return Multihash.Parse(StacPropertiesContainer.GetProperty(ChecksumField)); } - set { StacPropertiesContainer.SetProperty(ChecksumField, value.ToString()); DeclareStacExtension(); } + get { return Multihash.Parse(this.StacPropertiesContainer.GetProperty(ChecksumField)); } + set { this.StacPropertiesContainer.SetProperty(ChecksumField, value.ToString()); this.DeclareStacExtension(); } } /// @@ -59,8 +59,8 @@ public Multihash Checksum /// public uint? HeaderSize { - get { return StacPropertiesContainer.GetProperty(HeaderSizeField); } - set { StacPropertiesContainer.SetProperty(HeaderSizeField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(HeaderSizeField); } + set { this.StacPropertiesContainer.SetProperty(HeaderSizeField, value); this.DeclareStacExtension(); } } /// @@ -69,8 +69,8 @@ public uint? HeaderSize /// public ulong? Size { - get { return StacPropertiesContainer.GetProperty(SizeField); } - set { StacPropertiesContainer.SetProperty(SizeField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(SizeField); } + set { this.StacPropertiesContainer.SetProperty(SizeField, value); this.DeclareStacExtension(); } } /// @@ -79,7 +79,7 @@ public ulong? Size /// /// Potential fields and their types /// - public override IDictionary ItemFields => itemFields; + public override IDictionary ItemFields => this.itemFields; /// /// Get the STAC asset @@ -87,7 +87,7 @@ public ulong? Size /// /// Get the STAC asset /// - public StacAsset StacAsset => StacPropertiesContainer as StacAsset; + public StacAsset StacAsset => this.StacPropertiesContainer as StacAsset; /// public override IDictionary GetSummaryFunctions() diff --git a/src/DotNetStac/Extensions/ItemCollection/ItemCollection.cs b/src/DotNetStac/Extensions/ItemCollection/ItemCollection.cs index 04890280..879632ea 100644 --- a/src/DotNetStac/Extensions/ItemCollection/ItemCollection.cs +++ b/src/DotNetStac/Extensions/ItemCollection/ItemCollection.cs @@ -24,8 +24,8 @@ public ItemCollection(string id, { if (stacItems != null) { - Features = new List(stacItems); - Extent = StacExtent.Create(stacItems); + this.Features = new List(stacItems); + this.Extent = StacExtent.Create(stacItems); } } diff --git a/src/DotNetStac/Extensions/Processing/ProcessingStacExtension.cs b/src/DotNetStac/Extensions/Processing/ProcessingStacExtension.cs index b5471503..61b7e8d8 100644 --- a/src/DotNetStac/Extensions/Processing/ProcessingStacExtension.cs +++ b/src/DotNetStac/Extensions/Processing/ProcessingStacExtension.cs @@ -24,11 +24,11 @@ public class ProcessingStacExtension : StacPropertiesContainerExtension, IStacEx internal ProcessingStacExtension(StacItem stacItem) : base(JsonSchemaUrl, stacItem) { - itemFields = new Dictionary(); - itemFields.Add(LineageField, typeof(string)); - itemFields.Add(LevelField, typeof(string)); - itemFields.Add(FacilityField, typeof(string)); - itemFields.Add(SoftwareField, typeof(IDictionary)); + this.itemFields = new Dictionary(); + this.itemFields.Add(LineageField, typeof(string)); + this.itemFields.Add(LevelField, typeof(string)); + this.itemFields.Add(FacilityField, typeof(string)); + this.itemFields.Add(SoftwareField, typeof(IDictionary)); } /// @@ -37,8 +37,8 @@ internal ProcessingStacExtension(StacItem stacItem) : base(JsonSchemaUrl, stacIt /// public string Lineage { - get { return StacPropertiesContainer.GetProperty(LineageField); } - set { StacPropertiesContainer.SetProperty(LineageField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(LineageField); } + set { this.StacPropertiesContainer.SetProperty(LineageField, value); this.DeclareStacExtension(); } } /// @@ -47,8 +47,8 @@ public string Lineage /// public string Level { - get { return StacPropertiesContainer.GetProperty(LevelField); } - set { StacPropertiesContainer.SetProperty(LevelField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(LevelField); } + set { this.StacPropertiesContainer.SetProperty(LevelField, value); this.DeclareStacExtension(); } } /// @@ -57,8 +57,8 @@ public string Level /// public string Facility { - get { return StacPropertiesContainer.GetProperty(FacilityField); } - set { StacPropertiesContainer.SetProperty(FacilityField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(FacilityField); } + set { this.StacPropertiesContainer.SetProperty(FacilityField, value); this.DeclareStacExtension(); } } /// @@ -69,13 +69,13 @@ public IDictionary Software { get { - Dictionary existingSoftware = StacPropertiesContainer.GetProperty>(SoftwareField); + Dictionary existingSoftware = this.StacPropertiesContainer.GetProperty>(SoftwareField); ObservableDictionary software = null; if (existingSoftware == null) software = new ObservableDictionary(); else software = new ObservableDictionary(existingSoftware); - software.CollectionChanged += UpdateSoftwareField; + software.CollectionChanged += this.UpdateSoftwareField; return software; } } @@ -86,13 +86,12 @@ public IDictionary Software /// /// Potential fields and their types /// - public override IDictionary ItemFields => itemFields; - + public override IDictionary ItemFields => this.itemFields; private void UpdateSoftwareField(object sender, NotifyCollectionChangedEventArgs e) { - StacPropertiesContainer.SetProperty(SoftwareField, new Dictionary(sender as IDictionary)); - DeclareStacExtension(); + this.StacPropertiesContainer.SetProperty(SoftwareField, new Dictionary(sender as IDictionary)); + this.DeclareStacExtension(); } } diff --git a/src/DotNetStac/Extensions/Projection/ProjectionStacExtension.cs b/src/DotNetStac/Extensions/Projection/ProjectionStacExtension.cs index c68dda35..3200ff7b 100644 --- a/src/DotNetStac/Extensions/Projection/ProjectionStacExtension.cs +++ b/src/DotNetStac/Extensions/Projection/ProjectionStacExtension.cs @@ -27,96 +27,96 @@ public class ProjectionStacExtension : StacPropertiesContainerExtension, IStacEx internal ProjectionStacExtension(StacItem stacItem) : base(JsonSchemaUrl, stacItem) { - itemFields = new Dictionary(); - itemFields.Add(EpsgField, typeof(int)); - itemFields.Add(Wkt2Field, typeof(string)); - itemFields.Add(ProjJsonField, typeof(string)); - itemFields.Add(ProjGeometryField, typeof(IGeometryObject)); - itemFields.Add(ProjBboxField, typeof(double[])); - itemFields.Add(ProjCentroidField, typeof(CentroidObject)); - itemFields.Add(ProjShapeField, typeof(int[])); - itemFields.Add(ProjTransformField, typeof(double[])); + this.itemFields = new Dictionary(); + this.itemFields.Add(EpsgField, typeof(int)); + this.itemFields.Add(Wkt2Field, typeof(string)); + this.itemFields.Add(ProjJsonField, typeof(string)); + this.itemFields.Add(ProjGeometryField, typeof(IGeometryObject)); + this.itemFields.Add(ProjBboxField, typeof(double[])); + this.itemFields.Add(ProjCentroidField, typeof(CentroidObject)); + this.itemFields.Add(ProjShapeField, typeof(int[])); + this.itemFields.Add(ProjTransformField, typeof(double[])); } internal ProjectionStacExtension(StacAsset stacAsset) : base(JsonSchemaUrl, stacAsset) { - itemFields = new Dictionary(); - itemFields.Add(EpsgField, typeof(int)); - itemFields.Add(Wkt2Field, typeof(string)); - itemFields.Add(ProjJsonField, typeof(string)); - itemFields.Add(ProjGeometryField, typeof(IGeometryObject)); - itemFields.Add(ProjBboxField, typeof(double[])); - itemFields.Add(ProjCentroidField, typeof(CentroidObject)); - itemFields.Add(ProjShapeField, typeof(int[])); - itemFields.Add(ProjTransformField, typeof(double[])); + this.itemFields = new Dictionary(); + this.itemFields.Add(EpsgField, typeof(int)); + this.itemFields.Add(Wkt2Field, typeof(string)); + this.itemFields.Add(ProjJsonField, typeof(string)); + this.itemFields.Add(ProjGeometryField, typeof(IGeometryObject)); + this.itemFields.Add(ProjBboxField, typeof(double[])); + this.itemFields.Add(ProjCentroidField, typeof(CentroidObject)); + this.itemFields.Add(ProjShapeField, typeof(int[])); + this.itemFields.Add(ProjTransformField, typeof(double[])); } public long? Epsg { - get { return StacPropertiesContainer.GetProperty(EpsgField); } - set { StacPropertiesContainer.SetProperty(EpsgField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(EpsgField); } + set { this.StacPropertiesContainer.SetProperty(EpsgField, value); this.DeclareStacExtension(); } } public string Wkt2 { - get { return StacPropertiesContainer.GetProperty(Wkt2Field); } - set { StacPropertiesContainer.SetProperty(Wkt2Field, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(Wkt2Field); } + set { this.StacPropertiesContainer.SetProperty(Wkt2Field, value); this.DeclareStacExtension(); } } public string ProjJson { - get { return StacPropertiesContainer.GetProperty(ProjJsonField); } - set { StacPropertiesContainer.SetProperty(ProjJsonField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(ProjJsonField); } + set { this.StacPropertiesContainer.SetProperty(ProjJsonField, value); this.DeclareStacExtension(); } } public IGeometryObject Geometry { - get { return StacPropertiesContainer.GetProperty(Wkt2Field); } - set { StacPropertiesContainer.SetProperty(Wkt2Field, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(Wkt2Field); } + set { this.StacPropertiesContainer.SetProperty(Wkt2Field, value); this.DeclareStacExtension(); } } public double[] Bbox { - get { return StacPropertiesContainer.GetProperty(ProjBboxField); } - set { StacPropertiesContainer.SetProperty(ProjBboxField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(ProjBboxField); } + set { this.StacPropertiesContainer.SetProperty(ProjBboxField, value); this.DeclareStacExtension(); } } public CentroidObject Centroid { - get { return StacPropertiesContainer.GetProperty(ProjCentroidField); } - set { StacPropertiesContainer.SetProperty(ProjCentroidField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(ProjCentroidField); } + set { this.StacPropertiesContainer.SetProperty(ProjCentroidField, value); this.DeclareStacExtension(); } } public int[] Shape { - get { return StacPropertiesContainer.GetProperty(ProjShapeField); } - set { StacPropertiesContainer.SetProperty(ProjShapeField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(ProjShapeField); } + set { this.StacPropertiesContainer.SetProperty(ProjShapeField, value); this.DeclareStacExtension(); } } public double[] Transform { - get { return StacPropertiesContainer.GetProperty(ProjTransformField); } - set { StacPropertiesContainer.SetProperty(ProjTransformField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(ProjTransformField); } + set { this.StacPropertiesContainer.SetProperty(ProjTransformField, value); this.DeclareStacExtension(); } } /// - public override IDictionary ItemFields => itemFields; + public override IDictionary ItemFields => this.itemFields; public void SetCoordinateSystem(CoordinateSystem coordinateSystem) { if (coordinateSystem.AuthorityCode > 0) - Epsg = coordinateSystem.AuthorityCode; + this.Epsg = coordinateSystem.AuthorityCode; else - Epsg = null; - Wkt2 = coordinateSystem.WKT; + this.Epsg = null; + this.Wkt2 = coordinateSystem.WKT; } public void SetCoordinateSystem(int srid) { var cs = SRIDReader.GetCSbyID(srid); if (cs == null) return; - Wkt2 = cs.WKT; - Epsg = srid; + this.Wkt2 = cs.WKT; + this.Epsg = srid; } /// diff --git a/src/DotNetStac/Extensions/Raster/RasterBandObject.cs b/src/DotNetStac/Extensions/Raster/RasterBandObject.cs index aa8f41a3..a78f1d85 100644 --- a/src/DotNetStac/Extensions/Raster/RasterBandObject.cs +++ b/src/DotNetStac/Extensions/Raster/RasterBandObject.cs @@ -29,7 +29,7 @@ public class RasterBand : IStacPropertiesContainer /// public RasterBand() { - properties = new Dictionary(); + this.properties = new Dictionary(); } /// @@ -39,7 +39,7 @@ public RasterBand() /// Pixel values used to identify pixels that are nodata in the assets. /// [JsonProperty("nodata")] - public double? Nodata { get => nodata; set => nodata = value; } + public double? Nodata { get => this.nodata; set => this.nodata = value; } /// /// One of area or point. Indicates whether a pixel value should be assumed to represent @@ -51,7 +51,7 @@ public RasterBand() /// [JsonProperty("sampling")] [JsonConverter(typeof(StringEnumConverter))] - public RasterSampling? Sampling { get => sampling; set => sampling = value; } + public RasterSampling? Sampling { get => this.sampling; set => this.sampling = value; } /// /// The data type of the band. @@ -59,7 +59,7 @@ public RasterBand() /// [JsonProperty("data_type")] [JsonConverter(typeof(StringEnumConverter))] - public DataType? DataType { get => dataType; set => dataType = value; } + public DataType? DataType { get => this.dataType; set => this.dataType = value; } /// /// The actual number of bits used for this band. @@ -89,7 +89,7 @@ public RasterBand() /// Unit denomination of the pixel value. /// [JsonProperty("unit")] - public string Unit { get => unit; set => unit = value; } + public string Unit { get => this.unit; set => this.unit = value; } /// /// multiplicator factor of the pixel value to transform into the value (i.e. translate digital number to reflectance). @@ -98,7 +98,7 @@ public RasterBand() /// multiplicator factor of the pixel value to transform into the value (i.e. translate digital number to reflectance). /// [JsonProperty("scale")] - public double? Scale { get => scale; set => scale = value; } + public double? Scale { get => this.scale; set => this.scale = value; } /// /// number to be added to the pixel value (after scaling) to transform into the value (i.e. translate digital number to reflectance). @@ -107,7 +107,7 @@ public RasterBand() /// number to be added to the pixel value (after scaling) to transform into the value (i.e. translate digital number to reflectance). /// [JsonProperty("offset")] - public double? Offset { get => offset; set => offset = value; } + public double? Offset { get => this.offset; set => this.offset = value; } /// /// Histogram distribution information of the pixels values in the band @@ -121,7 +121,7 @@ public RasterBand() /// /// [JsonExtensionData] - public IDictionary Properties { get => properties; set => properties = value; } + public IDictionary Properties { get => this.properties; set => this.properties = value; } /// [JsonIgnore] diff --git a/src/DotNetStac/Extensions/Raster/RasterStacExtension.cs b/src/DotNetStac/Extensions/Raster/RasterStacExtension.cs index f9cd40aa..33d11e40 100644 --- a/src/DotNetStac/Extensions/Raster/RasterStacExtension.cs +++ b/src/DotNetStac/Extensions/Raster/RasterStacExtension.cs @@ -20,8 +20,8 @@ public class RasterStacExtension : StacPropertiesContainerExtension, IStacExtens internal RasterStacExtension(StacAsset stacAsset) : base(JsonSchemaUrl, stacAsset) { - itemFields = new Dictionary(); - itemFields.Add(BandsField, typeof(RasterBand[])); + this.itemFields = new Dictionary(); + this.itemFields.Add(BandsField, typeof(RasterBand[])); } /// @@ -32,8 +32,8 @@ internal RasterStacExtension(StacAsset stacAsset) : base(JsonSchemaUrl, stacAsse /// public RasterBand[] Bands { - get { return StacPropertiesContainer.GetProperty(BandsField); } - set { StacPropertiesContainer.SetProperty(BandsField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(BandsField); } + set { this.StacPropertiesContainer.SetProperty(BandsField, value); this.DeclareStacExtension(); } } /// @@ -42,7 +42,7 @@ public RasterBand[] Bands /// /// Potential fields and their types /// - public override IDictionary ItemFields => itemFields; + public override IDictionary ItemFields => this.itemFields; /// public override IDictionary GetSummaryFunctions() diff --git a/src/DotNetStac/Extensions/Sar/SarStacExtension.cs b/src/DotNetStac/Extensions/Sar/SarStacExtension.cs index e47a5f43..7984a9f6 100644 --- a/src/DotNetStac/Extensions/Sar/SarStacExtension.cs +++ b/src/DotNetStac/Extensions/Sar/SarStacExtension.cs @@ -29,102 +29,102 @@ public class SarStacExtension : StacPropertiesContainerExtension, IStacExtension internal SarStacExtension(IStacPropertiesContainer stacPropertiesContainer) : base(JsonSchemaUrl, stacPropertiesContainer) { - itemFields = new Dictionary(); - itemFields.Add(InstrumentModeField, typeof(string[])); - itemFields.Add(FrequencyBandField, typeof(SarCommonFrequencyBandName)); - itemFields.Add(CenterFrequencyField, typeof(double)); - itemFields.Add(PolarizationsField, typeof(string[])); - itemFields.Add(ProductTypeField, typeof(string)); - itemFields.Add(ResolutionRangeField, typeof(double)); - itemFields.Add(ResolutionAzimuthField, typeof(double)); - itemFields.Add(PixelSpacingRangeField, typeof(double)); - itemFields.Add(PixelSpacingAzimuthField, typeof(double)); - itemFields.Add(LooksRangeField, typeof(double)); - itemFields.Add(LooksAzimuthField, typeof(double)); - itemFields.Add(LooksEquivalentNumberField, typeof(double)); - itemFields.Add(ObservationDirectionField, typeof(string)); + this.itemFields = new Dictionary(); + this.itemFields.Add(InstrumentModeField, typeof(string[])); + this.itemFields.Add(FrequencyBandField, typeof(SarCommonFrequencyBandName)); + this.itemFields.Add(CenterFrequencyField, typeof(double)); + this.itemFields.Add(PolarizationsField, typeof(string[])); + this.itemFields.Add(ProductTypeField, typeof(string)); + this.itemFields.Add(ResolutionRangeField, typeof(double)); + this.itemFields.Add(ResolutionAzimuthField, typeof(double)); + this.itemFields.Add(PixelSpacingRangeField, typeof(double)); + this.itemFields.Add(PixelSpacingAzimuthField, typeof(double)); + this.itemFields.Add(LooksRangeField, typeof(double)); + this.itemFields.Add(LooksAzimuthField, typeof(double)); + this.itemFields.Add(LooksEquivalentNumberField, typeof(double)); + this.itemFields.Add(ObservationDirectionField, typeof(string)); } public string InstrumentMode { - get { return StacPropertiesContainer.GetProperty(InstrumentModeField); } - set { StacPropertiesContainer.SetProperty(InstrumentModeField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(InstrumentModeField); } + set { this.StacPropertiesContainer.SetProperty(InstrumentModeField, value); this.DeclareStacExtension(); } } public SarCommonFrequencyBandName FrequencyBand { - get { return StacPropertiesContainer.GetProperty(FrequencyBandField); } - set { StacPropertiesContainer.SetProperty(FrequencyBandField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(FrequencyBandField); } + set { this.StacPropertiesContainer.SetProperty(FrequencyBandField, value); this.DeclareStacExtension(); } } public double CenterFrequency { - get { return StacPropertiesContainer.GetProperty(CenterFrequencyField); } - set { StacPropertiesContainer.SetProperty(CenterFrequencyField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(CenterFrequencyField); } + set { this.StacPropertiesContainer.SetProperty(CenterFrequencyField, value); this.DeclareStacExtension(); } } public string[] Polarizations { - get { return StacPropertiesContainer.GetProperty(PolarizationsField); } - set { StacPropertiesContainer.SetProperty(PolarizationsField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(PolarizationsField); } + set { this.StacPropertiesContainer.SetProperty(PolarizationsField, value); this.DeclareStacExtension(); } } public string ProductType { - get { return StacPropertiesContainer.GetProperty(ProductTypeField); } - set { StacPropertiesContainer.SetProperty(ProductTypeField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(ProductTypeField); } + set { this.StacPropertiesContainer.SetProperty(ProductTypeField, value); this.DeclareStacExtension(); } } public double ResolutionRange { - get { return StacPropertiesContainer.GetProperty(ResolutionRangeField); } - set { StacPropertiesContainer.SetProperty(ResolutionRangeField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(ResolutionRangeField); } + set { this.StacPropertiesContainer.SetProperty(ResolutionRangeField, value); this.DeclareStacExtension(); } } public double ResolutionAzimuth { - get { return StacPropertiesContainer.GetProperty(ResolutionAzimuthField); } - set { StacPropertiesContainer.SetProperty(ResolutionAzimuthField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(ResolutionAzimuthField); } + set { this.StacPropertiesContainer.SetProperty(ResolutionAzimuthField, value); this.DeclareStacExtension(); } } public double PixelSpacingRange { - get { return StacPropertiesContainer.GetProperty(PixelSpacingRangeField); } - set { StacPropertiesContainer.SetProperty(PixelSpacingRangeField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(PixelSpacingRangeField); } + set { this.StacPropertiesContainer.SetProperty(PixelSpacingRangeField, value); this.DeclareStacExtension(); } } public double PixelSpacingAzimuth { - get { return StacPropertiesContainer.GetProperty(PixelSpacingAzimuthField); } - set { StacPropertiesContainer.SetProperty(PixelSpacingAzimuthField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(PixelSpacingAzimuthField); } + set { this.StacPropertiesContainer.SetProperty(PixelSpacingAzimuthField, value); this.DeclareStacExtension(); } } public double LooksRange { - get { return StacPropertiesContainer.GetProperty(LooksRangeField); } - set { StacPropertiesContainer.SetProperty(LooksRangeField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(LooksRangeField); } + set { this.StacPropertiesContainer.SetProperty(LooksRangeField, value); this.DeclareStacExtension(); } } public double LooksAzimuth { - get { return StacPropertiesContainer.GetProperty(LooksAzimuthField); } - set { StacPropertiesContainer.SetProperty(LooksAzimuthField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(LooksAzimuthField); } + set { this.StacPropertiesContainer.SetProperty(LooksAzimuthField, value); this.DeclareStacExtension(); } } public double LooksEquivalentNumber { - get { return StacPropertiesContainer.GetProperty(LooksEquivalentNumberField); } - set { StacPropertiesContainer.SetProperty(LooksEquivalentNumberField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(LooksEquivalentNumberField); } + set { this.StacPropertiesContainer.SetProperty(LooksEquivalentNumberField, value); this.DeclareStacExtension(); } } public ObservationDirection? ObservationDirection { - get { return StacPropertiesContainer.GetProperty(ObservationDirectionField); } - set { StacPropertiesContainer.SetProperty(ObservationDirectionField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(ObservationDirectionField); } + set { this.StacPropertiesContainer.SetProperty(ObservationDirectionField, value); this.DeclareStacExtension(); } } /// - public override IDictionary ItemFields => itemFields; + public override IDictionary ItemFields => this.itemFields; } public static class SarStacExtensionExtensions @@ -157,5 +157,4 @@ public static void Required(this SarStacExtension sarStacExtension, } } - } diff --git a/src/DotNetStac/Extensions/Sat/BaselineCalculation.cs b/src/DotNetStac/Extensions/Sat/BaselineCalculation.cs index f7b4703e..5c28c513 100644 --- a/src/DotNetStac/Extensions/Sat/BaselineCalculation.cs +++ b/src/DotNetStac/Extensions/Sat/BaselineCalculation.cs @@ -15,7 +15,6 @@ namespace Stac.Extensions.Sat public class BaselineCalculation { - /// Synchronizes the vector. /// The vector. /// T0. @@ -119,7 +118,6 @@ public static double SynchronizeVector2( return t; } - public static BaselineVector CalculateBaseline(DateTime[] time, SatOrbitStateVector[] master, SatOrbitStateVector[] slave, IPosition groundPoint) { @@ -310,5 +308,4 @@ public static IInterpolation[] PolyInterpol(DateTime time0, SatOrbitStateVector[ } - } diff --git a/src/DotNetStac/Extensions/Sat/BaselineVector.cs b/src/DotNetStac/Extensions/Sat/BaselineVector.cs index e3149e3d..2d768ee6 100644 --- a/src/DotNetStac/Extensions/Sat/BaselineVector.cs +++ b/src/DotNetStac/Extensions/Sat/BaselineVector.cs @@ -11,17 +11,17 @@ public struct BaselineVector public double Perpendicular { - get { return perpendicular; } + get { return this.perpendicular; } } public double Parallel { - get { return parallel; } + get { return this.parallel; } } public double Along { - get { return along; } + get { return this.along; } } public BaselineVector(double perpendicular, double parallel, double along) diff --git a/src/DotNetStac/Extensions/Sat/SatOrbitStateVector.cs b/src/DotNetStac/Extensions/Sat/SatOrbitStateVector.cs index 0312e044..5fab2a80 100644 --- a/src/DotNetStac/Extensions/Sat/SatOrbitStateVector.cs +++ b/src/DotNetStac/Extensions/Sat/SatOrbitStateVector.cs @@ -18,10 +18,10 @@ public class SatOrbitStateVector public SatOrbitStateVector(DateTime time, double[] position, double[] velocity, double[] acceleration) { - Time = time; - Position = position; - Velocity = velocity; - Acceleration = acceleration; + this.Time = time; + this.Position = position; + this.Velocity = velocity; + this.Acceleration = acceleration; } } } diff --git a/src/DotNetStac/Extensions/Sat/SatStacExtension.cs b/src/DotNetStac/Extensions/Sat/SatStacExtension.cs index fec1c51a..8c92517c 100644 --- a/src/DotNetStac/Extensions/Sat/SatStacExtension.cs +++ b/src/DotNetStac/Extensions/Sat/SatStacExtension.cs @@ -23,13 +23,13 @@ public class SatStacExtension : StacPropertiesContainerExtension, IStacExtension public SatStacExtension(StacItem stacItem) : base(JsonSchemaUrl, stacItem) { - itemFields = new Dictionary(); - itemFields.Add(AscendingNodeCrossingDateTimeField, typeof(DateTime)); - itemFields.Add(SceneCenterCoordinatesField, typeof(double[])); - itemFields.Add(RelativeOrbitField, typeof(int)); - itemFields.Add(AbsoluteOrbitField, typeof(int)); - itemFields.Add(OrbitStateField, typeof(string)); - itemFields.Add(PlatformInternationalDesignatorField, typeof(string)); + this.itemFields = new Dictionary(); + this.itemFields.Add(AscendingNodeCrossingDateTimeField, typeof(DateTime)); + this.itemFields.Add(SceneCenterCoordinatesField, typeof(double[])); + this.itemFields.Add(RelativeOrbitField, typeof(int)); + this.itemFields.Add(AbsoluteOrbitField, typeof(int)); + this.itemFields.Add(OrbitStateField, typeof(string)); + this.itemFields.Add(PlatformInternationalDesignatorField, typeof(string)); } public SortedDictionary OrbitStateVectors @@ -37,9 +37,9 @@ public SortedDictionary OrbitStateVectors get { SortedDictionary orbitStateVectors = new SortedDictionary(); - var osvarray = StacPropertiesContainer.GetProperty(OrbitStateVectorField); + var osvarray = this.StacPropertiesContainer.GetProperty(OrbitStateVectorField); if (osvarray == null) return null; - orbitStateVectors = SortOrbitStateVectors(osvarray as JToken); + orbitStateVectors = this.SortOrbitStateVectors(osvarray as JToken); return orbitStateVectors; } @@ -47,44 +47,44 @@ public SortedDictionary OrbitStateVectors public DateTime AscendingNodeCrossingDateTime { - get { return StacPropertiesContainer.GetProperty(AscendingNodeCrossingDateTimeField); } - set { StacPropertiesContainer.SetProperty(AscendingNodeCrossingDateTimeField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(AscendingNodeCrossingDateTimeField); } + set { this.StacPropertiesContainer.SetProperty(AscendingNodeCrossingDateTimeField, value); this.DeclareStacExtension(); } } public string PlatformInternationalDesignator { - get { return StacPropertiesContainer.GetProperty(PlatformInternationalDesignatorField); } - set { StacPropertiesContainer.SetProperty(PlatformInternationalDesignatorField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(PlatformInternationalDesignatorField); } + set { this.StacPropertiesContainer.SetProperty(PlatformInternationalDesignatorField, value); this.DeclareStacExtension(); } } public double[] SceneCenterCoordinates { - get { return StacPropertiesContainer.GetProperty(SceneCenterCoordinatesField); } - set { StacPropertiesContainer.SetProperty(SceneCenterCoordinatesField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(SceneCenterCoordinatesField); } + set { this.StacPropertiesContainer.SetProperty(SceneCenterCoordinatesField, value); this.DeclareStacExtension(); } } public int RelativeOrbit { - get { return StacPropertiesContainer.GetProperty(RelativeOrbitField); } - set { StacPropertiesContainer.SetProperty(RelativeOrbitField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(RelativeOrbitField); } + set { this.StacPropertiesContainer.SetProperty(RelativeOrbitField, value); this.DeclareStacExtension(); } } public int AbsoluteOrbit { - get { return StacPropertiesContainer.GetProperty(AbsoluteOrbitField); } - set { StacPropertiesContainer.SetProperty(AbsoluteOrbitField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(AbsoluteOrbitField); } + set { this.StacPropertiesContainer.SetProperty(AbsoluteOrbitField, value); this.DeclareStacExtension(); } } public string OrbitState { - get { return StacPropertiesContainer.GetProperty(OrbitStateField); } - set { StacPropertiesContainer.SetProperty(OrbitStateField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(OrbitStateField); } + set { this.StacPropertiesContainer.SetProperty(OrbitStateField, value); this.DeclareStacExtension(); } } - public StacItem StacItem => StacPropertiesContainer as StacItem; + public StacItem StacItem => this.StacPropertiesContainer as StacItem; /// - public override IDictionary ItemFields => itemFields; + public override IDictionary ItemFields => this.itemFields; private SortedDictionary SortOrbitStateVectors(JToken osvarray) { diff --git a/src/DotNetStac/Extensions/SchemaBasedStacExtension.cs b/src/DotNetStac/Extensions/SchemaBasedStacExtension.cs index 56117ce7..bb21ab3a 100644 --- a/src/DotNetStac/Extensions/SchemaBasedStacExtension.cs +++ b/src/DotNetStac/Extensions/SchemaBasedStacExtension.cs @@ -19,7 +19,7 @@ public SchemaBasedStacExtension(Uri jsonSchema, stacObject) { Preconditions.CheckNotNull(jsonSchema, "jsonSchema"); - JsonSchema = jsonSchema; + this.JsonSchema = jsonSchema; this.stacObject = stacObject; } @@ -30,10 +30,9 @@ public SchemaBasedStacExtension(Uri schemaUri, { Preconditions.CheckNotNull(schemaUri, "schemaUri"); this.stacObject = stacObject; - JsonSchema = schemaUri; + this.JsonSchema = schemaUri; } - public static SchemaBasedStacExtension Create(string shortcut, StacSchemaResolver stacSchemaResolver, IStacObject stacObject) @@ -46,7 +45,7 @@ public static SchemaBasedStacExtension Create(string shortcut, } /// - public override string Identifier => JsonSchema.ToString(); + public override string Identifier => this.JsonSchema.ToString(); public Uri JsonSchema { get; } diff --git a/src/DotNetStac/Extensions/StacPropertiesContainerExtension.cs b/src/DotNetStac/Extensions/StacPropertiesContainerExtension.cs index d38d7148..6772d475 100644 --- a/src/DotNetStac/Extensions/StacPropertiesContainerExtension.cs +++ b/src/DotNetStac/Extensions/StacPropertiesContainerExtension.cs @@ -29,7 +29,7 @@ public abstract class StacPropertiesContainerExtension : IStacExtension protected StacPropertiesContainerExtension(string identifier, IStacPropertiesContainer stacPropertiesContainer) { this.identifier = identifier; - StacPropertiesContainer = stacPropertiesContainer; + this.StacPropertiesContainer = stacPropertiesContainer; } /// @@ -38,7 +38,7 @@ protected StacPropertiesContainerExtension(string identifier, IStacPropertiesCon /// /// Identifier of the extension /// - public virtual string Identifier => identifier; + public virtual string Identifier => this.identifier; /// /// Stac Object extended by the extension @@ -62,7 +62,7 @@ protected StacPropertiesContainerExtension(string identifier, IStacPropertiesCon /// /// Indicate if the extension is already declared /// - public bool IsDeclared => StacPropertiesContainer.GetDeclaredExtensions().Any(e => e.Identifier == Identifier); + public bool IsDeclared => this.StacPropertiesContainer.GetDeclaredExtensions().Any(e => e.Identifier == this.Identifier); /// /// Get he potential summary functions for each field that can be summarized @@ -145,9 +145,9 @@ public static StacSummaryValueSet CreateSummaryValueSet(IEnumerable arg /// protected void DeclareStacExtension() { - if (StacPropertiesContainer.StacObjectContainer == null) return; - if (!StacPropertiesContainer.StacObjectContainer.StacExtensions.Contains(Identifier)) - StacPropertiesContainer.StacObjectContainer.StacExtensions.Add(Identifier); + if (this.StacPropertiesContainer.StacObjectContainer == null) return; + if (!this.StacPropertiesContainer.StacObjectContainer.StacExtensions.Contains(this.Identifier)) + this.StacPropertiesContainer.StacObjectContainer.StacExtensions.Add(this.Identifier); } /// @@ -155,22 +155,22 @@ protected void DeclareStacExtension() /// protected void RemoveStacExtension() { - if (StacPropertiesContainer.StacObjectContainer == null) return; - if (StacPropertiesContainer.StacObjectContainer.StacExtensions.Contains(Identifier)) - StacPropertiesContainer.StacObjectContainer.StacExtensions.Remove(Identifier); + if (this.StacPropertiesContainer.StacObjectContainer == null) return; + if (this.StacPropertiesContainer.StacObjectContainer.StacExtensions.Contains(this.Identifier)) + this.StacPropertiesContainer.StacObjectContainer.StacExtensions.Remove(this.Identifier); } public void SetProperty(string key, object value) { this.SetProperty(key, value); - DeclareStacExtension(); + this.DeclareStacExtension(); } public void RemoveProperty(string key) { this.RemoveProperty(key); - if (!StacPropertiesContainer.Properties.Any(p => ItemFields.ContainsKey(p.Key))) - RemoveStacExtension(); + if (!this.StacPropertiesContainer.Properties.Any(p => this.ItemFields.ContainsKey(p.Key))) + this.RemoveStacExtension(); } } } diff --git a/src/DotNetStac/Extensions/Storage/StorageStacExtension.cs b/src/DotNetStac/Extensions/Storage/StorageStacExtension.cs index 9257367b..9930d63a 100644 --- a/src/DotNetStac/Extensions/Storage/StorageStacExtension.cs +++ b/src/DotNetStac/Extensions/Storage/StorageStacExtension.cs @@ -22,11 +22,11 @@ public class StorageStacExtension : StacPropertiesContainerExtension, IStacExten internal StorageStacExtension(IStacPropertiesContainer stacObject) : base(JsonSchemaUrl, stacObject) { - itemFields = new Dictionary(); - itemFields.Add(PlatformField, typeof(string)); - itemFields.Add(RegionField, typeof(string)); - itemFields.Add(RequesterPaysField, typeof(bool)); - itemFields.Add(TierField, typeof(string)); + this.itemFields = new Dictionary(); + this.itemFields.Add(PlatformField, typeof(string)); + this.itemFields.Add(RegionField, typeof(string)); + this.itemFields.Add(RequesterPaysField, typeof(bool)); + this.itemFields.Add(TierField, typeof(string)); } /// @@ -35,8 +35,8 @@ internal StorageStacExtension(IStacPropertiesContainer stacObject) : base(JsonSc /// public string Platform { - get { return StacPropertiesContainer.GetProperty(PlatformField); } - set { StacPropertiesContainer.SetProperty(PlatformField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(PlatformField); } + set { this.StacPropertiesContainer.SetProperty(PlatformField, value); this.DeclareStacExtension(); } } /// @@ -45,8 +45,8 @@ public string Platform /// public string Region { - get { return StacPropertiesContainer.GetProperty(RegionField); } - set { StacPropertiesContainer.SetProperty(RegionField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(RegionField); } + set { this.StacPropertiesContainer.SetProperty(RegionField, value); this.DeclareStacExtension(); } } /// @@ -55,8 +55,8 @@ public string Region /// public bool? RequesterPays { - get { return StacPropertiesContainer.GetProperty(RequesterPaysField); } - set { StacPropertiesContainer.SetProperty(RequesterPaysField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(RequesterPaysField); } + set { this.StacPropertiesContainer.SetProperty(RequesterPaysField, value); this.DeclareStacExtension(); } } /// @@ -65,8 +65,8 @@ public bool? RequesterPays /// public string Tier { - get { return StacPropertiesContainer.GetProperty(TierField); } - set { StacPropertiesContainer.SetProperty(TierField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(TierField); } + set { this.StacPropertiesContainer.SetProperty(TierField, value); this.DeclareStacExtension(); } } /// @@ -75,8 +75,7 @@ public string Tier /// /// Potential fields and their types /// - public override IDictionary ItemFields => itemFields; - + public override IDictionary ItemFields => this.itemFields; /// public override IDictionary GetSummaryFunctions() diff --git a/src/DotNetStac/Extensions/SummaryFunction.cs b/src/DotNetStac/Extensions/SummaryFunction.cs index 7d69d0bf..339e659f 100644 --- a/src/DotNetStac/Extensions/SummaryFunction.cs +++ b/src/DotNetStac/Extensions/SummaryFunction.cs @@ -23,7 +23,7 @@ public class SummaryFunction : ISummaryFunction /// public IStacSummaryItem Summarize(IEnumerable items) { - return summaryFunction(items.SelectMany(i => + return this.summaryFunction(items.SelectMany(i => { try { @@ -41,8 +41,8 @@ public IStacSummaryItem Summarize(IEnumerable items) public SummaryFunction(IStacExtension extension, string propertyName, CreateSummary summaryFunction) { - Extension = extension; - PropertyName = propertyName; + this.Extension = extension; + this.PropertyName = propertyName; this.summaryFunction = summaryFunction; } } diff --git a/src/DotNetStac/Extensions/Version/VersionStacExtension.cs b/src/DotNetStac/Extensions/Version/VersionStacExtension.cs index 39c1669b..992be480 100644 --- a/src/DotNetStac/Extensions/Version/VersionStacExtension.cs +++ b/src/DotNetStac/Extensions/Version/VersionStacExtension.cs @@ -30,9 +30,9 @@ public class VersionStacExtension : StacPropertiesContainerExtension, IStacExten internal VersionStacExtension(IStacObject stacObject) : base(JsonSchemaUrl, stacObject) { - itemFields = new Dictionary(); - itemFields.Add(VersionField, typeof(string)); - itemFields.Add(DeprecatedField, typeof(bool)); + this.itemFields = new Dictionary(); + this.itemFields.Add(VersionField, typeof(string)); + this.itemFields.Add(DeprecatedField, typeof(bool)); } /// @@ -41,8 +41,8 @@ internal VersionStacExtension(IStacObject stacObject) : base(JsonSchemaUrl, stac /// public string Version { - get { return StacPropertiesContainer.GetProperty(VersionField); } - set { StacPropertiesContainer.SetProperty(VersionField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(VersionField); } + set { this.StacPropertiesContainer.SetProperty(VersionField, value); this.DeclareStacExtension(); } } /// @@ -51,8 +51,8 @@ public string Version /// public bool Deprecated { - get { return StacPropertiesContainer.GetProperty(DeprecatedField); } - set { StacPropertiesContainer.SetProperty(DeprecatedField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(DeprecatedField); } + set { this.StacPropertiesContainer.SetProperty(DeprecatedField, value); this.DeclareStacExtension(); } } /// @@ -61,7 +61,7 @@ public bool Deprecated /// /// Potential fields and their types /// - public override IDictionary ItemFields => itemFields; + public override IDictionary ItemFields => this.itemFields; /// public override IDictionary GetSummaryFunctions() diff --git a/src/DotNetStac/Extensions/View/ViewStacExtension.cs b/src/DotNetStac/Extensions/View/ViewStacExtension.cs index f4157ac7..9454d9e9 100644 --- a/src/DotNetStac/Extensions/View/ViewStacExtension.cs +++ b/src/DotNetStac/Extensions/View/ViewStacExtension.cs @@ -21,46 +21,46 @@ public class ViewStacExtension : StacPropertiesContainerExtension, IStacExtensio public ViewStacExtension(IStacObject stacObject) : base(JsonSchemaUrl, stacObject) { - itemFields = new Dictionary(); - itemFields.Add(OffNadirField, typeof(double)); - itemFields.Add(IncidenceAngleField, typeof(double)); - itemFields.Add(AzimuthField, typeof(double)); - itemFields.Add(SunAzimuthField, typeof(double)); - itemFields.Add(SunElevationField, typeof(double)); + this.itemFields = new Dictionary(); + this.itemFields.Add(OffNadirField, typeof(double)); + this.itemFields.Add(IncidenceAngleField, typeof(double)); + this.itemFields.Add(AzimuthField, typeof(double)); + this.itemFields.Add(SunAzimuthField, typeof(double)); + this.itemFields.Add(SunElevationField, typeof(double)); } public double OffNadir { - get { return StacPropertiesContainer.GetProperty(OffNadirField); } - set { StacPropertiesContainer.SetProperty(OffNadirField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(OffNadirField); } + set { this.StacPropertiesContainer.SetProperty(OffNadirField, value); this.DeclareStacExtension(); } } public double IncidenceAngle { - get { return StacPropertiesContainer.GetProperty(IncidenceAngleField); } - set { StacPropertiesContainer.SetProperty(IncidenceAngleField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(IncidenceAngleField); } + set { this.StacPropertiesContainer.SetProperty(IncidenceAngleField, value); this.DeclareStacExtension(); } } public double Azimuth { - get { return StacPropertiesContainer.GetProperty(AzimuthField); } - set { StacPropertiesContainer.SetProperty(AzimuthField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(AzimuthField); } + set { this.StacPropertiesContainer.SetProperty(AzimuthField, value); this.DeclareStacExtension(); } } public double SunAzimuth { - get { return StacPropertiesContainer.GetProperty(SunAzimuthField); } - set { StacPropertiesContainer.SetProperty(SunAzimuthField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(SunAzimuthField); } + set { this.StacPropertiesContainer.SetProperty(SunAzimuthField, value); this.DeclareStacExtension(); } } public double SunElevation { - get { return StacPropertiesContainer.GetProperty(SunElevationField); } - set { StacPropertiesContainer.SetProperty(SunElevationField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty(SunElevationField); } + set { this.StacPropertiesContainer.SetProperty(SunElevationField, value); this.DeclareStacExtension(); } } /// - public override IDictionary ItemFields => itemFields; + public override IDictionary ItemFields => this.itemFields; } public static class ViewStacExtensionExtensions diff --git a/src/DotNetStac/Extensions/VirtualAssets/VirtualAsset.cs b/src/DotNetStac/Extensions/VirtualAssets/VirtualAsset.cs index 5015b4e7..08885ae7 100644 --- a/src/DotNetStac/Extensions/VirtualAssets/VirtualAsset.cs +++ b/src/DotNetStac/Extensions/VirtualAssets/VirtualAsset.cs @@ -38,7 +38,7 @@ public static VirtualAsset Create(StacItem stacItem, IList assetsKey, IS /// public VirtualAsset(IStacObject stacObject, IList uris) : base(stacObject, null) { - Uris = uris; + this.Uris = uris; } /// diff --git a/src/DotNetStac/Extensions/VirtualAssets/VirtualAssetsStacExtension.cs b/src/DotNetStac/Extensions/VirtualAssets/VirtualAssetsStacExtension.cs index 78a2bb81..fbbf6bda 100644 --- a/src/DotNetStac/Extensions/VirtualAssets/VirtualAssetsStacExtension.cs +++ b/src/DotNetStac/Extensions/VirtualAssets/VirtualAssetsStacExtension.cs @@ -20,8 +20,8 @@ public class VirtualAssetsStacExtension : StacPropertiesContainerExtension, ISta internal VirtualAssetsStacExtension(IStacObject stacObject) : base(JsonSchemaUrl, stacObject) { - itemFields = new Dictionary(); - itemFields.Add(VirtualAssetsField, typeof(VirtualAsset)); + this.itemFields = new Dictionary(); + this.itemFields.Add(VirtualAssetsField, typeof(VirtualAsset)); } /// @@ -32,8 +32,8 @@ internal VirtualAssetsStacExtension(IStacObject stacObject) : base(JsonSchemaUrl /// public IDictionary Assets { - get { return StacPropertiesContainer.GetProperty>(VirtualAssetsField); } - set { StacPropertiesContainer.SetProperty(VirtualAssetsField, value); DeclareStacExtension(); } + get { return this.StacPropertiesContainer.GetProperty>(VirtualAssetsField); } + set { this.StacPropertiesContainer.SetProperty(VirtualAssetsField, value); this.DeclareStacExtension(); } } /// @@ -42,7 +42,7 @@ public IDictionary Assets /// /// Potential fields and their types /// - public override IDictionary ItemFields => itemFields; + public override IDictionary ItemFields => this.itemFields; } /// diff --git a/src/DotNetStac/Model/ObservableDictionary.cs b/src/DotNetStac/Model/ObservableDictionary.cs index 79f52e92..a47c4978 100644 --- a/src/DotNetStac/Model/ObservableDictionary.cs +++ b/src/DotNetStac/Model/ObservableDictionary.cs @@ -30,14 +30,14 @@ public class ObservableDictionary : /// public ObservableDictionary() { - _context = AsyncOperationManager.SynchronizationContext; - _dictionary = new ConcurrentDictionary(); + this._context = AsyncOperationManager.SynchronizationContext; + this._dictionary = new ConcurrentDictionary(); } public ObservableDictionary(IDictionary init) : this() { - _context = AsyncOperationManager.SynchronizationContext; - _dictionary = new ConcurrentDictionary(init); + this._context = AsyncOperationManager.SynchronizationContext; + this._dictionary = new ConcurrentDictionary(init); } /// Event raised when the collection changes. @@ -51,11 +51,11 @@ public ObservableDictionary(IDictionary init) : this() /// private void NotifyObserversOfChange() { - var collectionHandler = CollectionChanged; - var propertyHandler = PropertyChanged; + var collectionHandler = this.CollectionChanged; + var propertyHandler = this.PropertyChanged; if (collectionHandler != null || propertyHandler != null) { - _context.Send(s => + this._context.Send(s => { collectionHandler?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); propertyHandler?.Invoke(this, new PropertyChangedEventArgs("Count")); @@ -72,11 +72,11 @@ private void NotifyObserversOfChange() /// The item involved with the change private void NotifyObserversOfChange(NotifyCollectionChangedAction actionType, object changedItem) { - var collectionHandler = CollectionChanged; - var propertyHandler = PropertyChanged; + var collectionHandler = this.CollectionChanged; + var propertyHandler = this.PropertyChanged; if (collectionHandler != null || propertyHandler != null) { - _context.Send(s => + this._context.Send(s => { collectionHandler?.Invoke(this, new NotifyCollectionChangedEventArgs(actionType, changedItem)); propertyHandler?.Invoke(this, new PropertyChangedEventArgs("Count")); @@ -94,11 +94,11 @@ private void NotifyObserversOfChange(NotifyCollectionChangedAction actionType, o /// The position of the item in the collection private void NotifyObserversOfChange(NotifyCollectionChangedAction actionType, object item, int index) { - var collectionHandler = CollectionChanged; - var propertyHandler = PropertyChanged; + var collectionHandler = this.CollectionChanged; + var propertyHandler = this.PropertyChanged; if (collectionHandler != null || propertyHandler != null) { - _context.Send(s => + this._context.Send(s => { collectionHandler?.Invoke(this, new NotifyCollectionChangedEventArgs(actionType, item, index)); propertyHandler?.Invoke(this, new PropertyChangedEventArgs("Count")); @@ -112,7 +112,7 @@ private void NotifyObserversOfChange(NotifyCollectionChangedAction actionType, o /// The item to be added. /// Whether the add was successful. private bool TryAddWithNotification(KeyValuePair item) - => TryAddWithNotification(item.Key, item.Value); + => this.TryAddWithNotification(item.Key, item.Value); /// Attempts to add an item to the dictionary, notifying observers of any changes. /// The key of the item to be added. @@ -120,9 +120,9 @@ private bool TryAddWithNotification(KeyValuePair item) /// Whether the add was successful. private bool TryAddWithNotification(TKey key, TValue value) { - bool result = _dictionary.TryAdd(key, value); - int index = IndexOf(key); - if (result) NotifyObserversOfChange(NotifyCollectionChangedAction.Add, value, index); + bool result = this._dictionary.TryAdd(key, value); + int index = this.IndexOf(key); + if (result) this.NotifyObserversOfChange(NotifyCollectionChangedAction.Add, value, index); return result; } @@ -132,9 +132,9 @@ private bool TryAddWithNotification(TKey key, TValue value) /// Whether the removal was successful. private bool TryRemoveWithNotification(TKey key, out TValue value) { - int index = IndexOf(key); - bool result = _dictionary.TryRemove(key, out value); - if (result) NotifyObserversOfChange(NotifyCollectionChangedAction.Remove, value, index); + int index = this.IndexOf(key); + bool result = this._dictionary.TryRemove(key, out value); + if (result) this.NotifyObserversOfChange(NotifyCollectionChangedAction.Remove, value, index); return result; } @@ -144,8 +144,8 @@ private bool TryRemoveWithNotification(TKey key, out TValue value) /// Whether the update was successful. private void UpdateWithNotification(TKey key, TValue value) { - _dictionary[key] = value; - NotifyObserversOfChange(NotifyCollectionChangedAction.Replace, value); + this._dictionary[key] = value; + this.NotifyObserversOfChange(NotifyCollectionChangedAction.Replace, value); } /// @@ -154,7 +154,7 @@ private void UpdateWithNotification(TKey key, TValue value) /// private int IndexOf(TKey key) { - var keys = _dictionary.Keys; + var keys = this._dictionary.Keys; int index = -1; foreach (TKey k in keys) { @@ -166,82 +166,77 @@ private int IndexOf(TKey key) // ICollection> Members - void ICollection>.Add(KeyValuePair item) - => TryAddWithNotification(item); + => this.TryAddWithNotification(item); void ICollection>.Clear() { - _dictionary.Clear(); - NotifyObserversOfChange(); + this._dictionary.Clear(); + this.NotifyObserversOfChange(); } bool ICollection>.Contains(KeyValuePair item) - => ((ICollection>)_dictionary).Contains(item); + => ((ICollection>)this._dictionary).Contains(item); void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) - => ((ICollection>)_dictionary).CopyTo(array, arrayIndex); + => ((ICollection>)this._dictionary).CopyTo(array, arrayIndex); int ICollection>.Count { - get => _dictionary.Count; + get => this._dictionary.Count; } bool ICollection>.IsReadOnly { - get => ((ICollection>)_dictionary).IsReadOnly; + get => ((ICollection>)this._dictionary).IsReadOnly; } bool ICollection>.Remove(KeyValuePair item) - => TryRemoveWithNotification(item.Key, out TValue temp); - + => this.TryRemoveWithNotification(item.Key, out TValue temp); // IEnumerable> Members - IEnumerator> IEnumerable>.GetEnumerator() - => _dictionary.GetEnumerator(); + => this._dictionary.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() - => _dictionary.GetEnumerator(); - + => this._dictionary.GetEnumerator(); // IDictionary Members - /// public void Add(TKey key, TValue value) - => TryAddWithNotification(key, value); + => this.TryAddWithNotification(key, value); /// public bool ContainsKey(TKey key) - => _dictionary.ContainsKey(key); + => this._dictionary.ContainsKey(key); /// public ICollection Keys { - get { return _dictionary.Keys; } + get { return this._dictionary.Keys; } } /// public bool Remove(TKey key) - => TryRemoveWithNotification(key, out TValue temp); + => this.TryRemoveWithNotification(key, out TValue temp); /// public bool TryGetValue(TKey key, out TValue value) - => _dictionary.TryGetValue(key, out value); + => this._dictionary.TryGetValue(key, out value); /// public ICollection Values { - get => _dictionary.Values; + get => this._dictionary.Values; } /// public TValue this[TKey key] { - get => _dictionary[key]; - set => UpdateWithNotification(key, value); + get => this._dictionary[key]; + set => this.UpdateWithNotification(key, value); } } } diff --git a/src/DotNetStac/Schemas/StacSchemaResolver.cs b/src/DotNetStac/Schemas/StacSchemaResolver.cs index 79d66990..f5776d48 100644 --- a/src/DotNetStac/Schemas/StacSchemaResolver.cs +++ b/src/DotNetStac/Schemas/StacSchemaResolver.cs @@ -60,24 +60,24 @@ public JSchema LoadSchema(string baseUrl = null, string version = null, string s schemaUri = schemaMap[baseUrl]; } - if (_schemaCompiled.ContainsKey(schemaUri.ToString())) + if (this._schemaCompiled.ContainsKey(schemaUri.ToString())) { - return _schemaCompiled[schemaUri.ToString()]; + return this._schemaCompiled[schemaUri.ToString()]; } else { Stream stream = null; try { - stream = _jSchemaResolver.GetSchemaResource(null, new SchemaReference() { BaseUri = schemaUri }); + stream = this._jSchemaResolver.GetSchemaResource(null, new SchemaReference() { BaseUri = schemaUri }); } catch (Exception e) { throw new Exceptions.InvalidStacSchemaException(string.Format("Error getting schema at Uri '{0}'", schemaUri), e); } var sr = new StreamReader(stream); - _schemaCompiled[schemaUri.ToString()] = JSchema.Parse(sr.ReadToEnd(), _jSchemaResolver); - return _schemaCompiled[schemaUri.ToString()]; + this._schemaCompiled[schemaUri.ToString()] = JSchema.Parse(sr.ReadToEnd(), this._jSchemaResolver); + return this._schemaCompiled[schemaUri.ToString()]; } } } diff --git a/src/DotNetStac/Schemas/StacValidator.cs b/src/DotNetStac/Schemas/StacValidator.cs index 883b5e6e..2d69e9e8 100644 --- a/src/DotNetStac/Schemas/StacValidator.cs +++ b/src/DotNetStac/Schemas/StacValidator.cs @@ -38,11 +38,11 @@ public StacValidator(JSchemaUrlResolver jSchemaUrlResolver) public bool ValidateJson(string jsonstr) { using (var reader = new JsonTextReader(new StringReader(jsonstr)) { DateTimeZoneHandling = DateTimeZoneHandling.Utc }) - DetectDuplicateKeys(reader); + this.DetectDuplicateKeys(reader); JObject jobject; using (var reader = new JsonTextReader(new StringReader(jsonstr)) { DateTimeZoneHandling = DateTimeZoneHandling.Utc }) jobject = JObject.Load(reader); - return ValidateJObject(jobject); + return this.ValidateJObject(jobject); } private bool DetectDuplicateKeys(JsonReader jobject) @@ -53,7 +53,7 @@ private bool DetectDuplicateKeys(JsonReader jobject) switch (jobject.TokenType) { case JsonToken.StartObject: - DetectDuplicateKeys(jobject); + this.DetectDuplicateKeys(jobject); break; case JsonToken.PropertyName: var propertyName = jobject.Value.ToString(); @@ -73,7 +73,7 @@ private bool ValidateJObject(JObject jObject) Type stacType = Utils.IdentifyStacType(jObject); // Get all schema to validate against - List schemas = new List() { stacTypes[stacType] }; + List schemas = new List() { this.stacTypes[stacType] }; if (jObject.Value("stac_extensions") != null) schemas.AddRange(jObject.Value("stac_extensions").Select(a => a.Value())); @@ -88,7 +88,7 @@ private bool ValidateJObject(JObject jObject) if (!jObject.ContainsKey("stac_version")) throw new InvalidStacDataException("Missing 'stac_version' property"); - var jsonSchema = schemaResolver.LoadSchema(baseUrl: baseUrl, shortcut: shortcut, version: jObject["stac_version"].Value()); + var jsonSchema = this.schemaResolver.LoadSchema(baseUrl: baseUrl, shortcut: shortcut, version: jObject["stac_version"].Value()); if (jObject.IsValid(jsonSchema, out IList errorMessages)) continue; diff --git a/src/DotNetStac/SimpleLinksCollectionObject.cs b/src/DotNetStac/SimpleLinksCollectionObject.cs index 08117554..ad634222 100644 --- a/src/DotNetStac/SimpleLinksCollectionObject.cs +++ b/src/DotNetStac/SimpleLinksCollectionObject.cs @@ -10,7 +10,7 @@ public class SimpleLinksCollectionObject : ILinksCollectionObject { public SimpleLinksCollectionObject() { - Links = new List(); + this.Links = new List(); } /// diff --git a/src/DotNetStac/StacAccessorsHelpers.cs b/src/DotNetStac/StacAccessorsHelpers.cs index f4fd2aba..d683ed1b 100644 --- a/src/DotNetStac/StacAccessorsHelpers.cs +++ b/src/DotNetStac/StacAccessorsHelpers.cs @@ -86,8 +86,6 @@ public static PropertyObservableCollection GetObservableCollectionProperty return observableCollection; } - - public static T ChangeType(object value) { var t = typeof(T); diff --git a/src/DotNetStac/StacAsset.cs b/src/DotNetStac/StacAsset.cs index d70aed4c..1dd966d2 100644 --- a/src/DotNetStac/StacAsset.cs +++ b/src/DotNetStac/StacAsset.cs @@ -80,8 +80,8 @@ public static StacAsset CreateMetadataAsset(IStacObject stacObject, Uri uri, Con [JsonConstructor] internal StacAsset() { - _properties = new Dictionary(); - Roles = new SortedSet(); + this._properties = new Dictionary(); + this.Roles = new SortedSet(); } /// @@ -93,8 +93,8 @@ public StacAsset(IStacObject stacObject, Uri uri) : this() { if (!(stacObject == null || stacObject is StacItem || stacObject is StacCollection)) throw new InvalidOperationException("An asset cannot be defined in " + stacObject.GetType().Name); - _parentStacObject = stacObject; - Uri = uri; + this._parentStacObject = stacObject; + this.Uri = uri; } /// @@ -107,9 +107,9 @@ public StacAsset(IStacObject stacObject, Uri uri) : this() /// media-type of the asset public StacAsset(IStacObject stacObject, Uri uri, IEnumerable roles, string title, ContentType mediaType) : this(stacObject, uri) { - Roles = roles == null ? new SortedSet() : new SortedSet(roles.ToList()); - Title = title; - MediaType = mediaType; + this.Roles = roles == null ? new SortedSet() : new SortedSet(roles.ToList()); + this.Title = title; + this.MediaType = mediaType; } /// @@ -123,18 +123,18 @@ public StacAsset(StacAsset source, IStacObject stacObject) throw new InvalidOperationException("An asset cannot be defined in " + stacObject.GetType().Name); if (source == null) throw new ArgumentNullException("source"); - _base_uri = source._base_uri; - _href = source._href; + this._base_uri = source._base_uri; + this._href = source._href; if (source.Roles != null) - Roles = new SortedSet(source.Roles); + this.Roles = new SortedSet(source.Roles); else - Roles = new SortedSet(); - _title = source._title; - _type = source._type; - _description = source._description; + this.Roles = new SortedSet(); + this._title = source._title; + this._type = source._type; + this._description = source._description; if (source._properties != null) - _properties = new Dictionary(source._properties); - _parentStacObject = stacObject; + this._properties = new Dictionary(source._properties); + this._parentStacObject = stacObject; } /// @@ -145,8 +145,8 @@ public StacAsset(StacAsset source, IStacObject stacObject) [JsonConverter(typeof(ContentTypeConverter))] public ContentType MediaType { - get { return _type; } - set { _type = value; } + get { return this._type; } + set { this._type = value; } } /// @@ -167,8 +167,8 @@ public ICollection Roles [JsonProperty("title")] public string Title { - get { return _title; } - set { _title = value; } + get { return this._title; } + set { this._title = value; } } /// @@ -178,8 +178,8 @@ public string Title [JsonProperty("href")] public Uri Uri { - get { return _href; } - set { _href = value; } + get { return this._href; } + set { this._href = value; } } /// @@ -189,8 +189,8 @@ public Uri Uri [JsonProperty("description")] public string Description { - get { return _description; } - set { _description = value; } + get { return this._description; } + set { this._description = value; } } /// @@ -202,12 +202,12 @@ public IDictionary Properties { get { - return _properties; + return this._properties; } set { - _properties = new Dictionary(value); + this._properties = new Dictionary(value); } } @@ -218,27 +218,27 @@ public IDictionary Properties /// Object container /// [JsonIgnore] - public IStacObject StacObjectContainer => ParentStacObject; + public IStacObject StacObjectContainer => this.ParentStacObject; /// /// parent stac object /// /// [JsonIgnore] - public IStacObject ParentStacObject { get => _parentStacObject; internal set => _parentStacObject = value; } + public IStacObject ParentStacObject { get => this._parentStacObject; internal set => this._parentStacObject = value; } #pragma warning disable 1591 [ExcludeFromCodeCoverage] public bool ShouldSerializeStacExtensions() { // don't serialize the Manager property if an employee is their own manager - return Roles.Count > 0; + return this.Roles.Count > 0; } [OnDeserialized] internal void OnDeserializedMethod(StreamingContext context) { - Roles = new SortedSet(Roles); + this.Roles = new SortedSet(this.Roles); } } } diff --git a/src/DotNetStac/StacCatalog.cs b/src/DotNetStac/StacCatalog.cs index 1b3dfa3f..3e6d1e8c 100644 --- a/src/DotNetStac/StacCatalog.cs +++ b/src/DotNetStac/StacCatalog.cs @@ -137,24 +137,24 @@ public ICollection Links [OnDeserialized] internal void OnDeserializedMethod(StreamingContext context) { - foreach (StacLink link in Links) + foreach (StacLink link in this.Links) { link.Parent = this; } - StacExtensions = new SortedSet(StacExtensions); + this.StacExtensions = new SortedSet(this.StacExtensions); } #pragma warning disable 1591 public bool ShouldSerializeSummaries() { // don't serialize the Manager property if an employee is their own manager - return Summaries.Count > 0; + return this.Summaries.Count > 0; } public bool ShouldSerializeStacExtensions() { // don't serialize the Manager property if an employee is their own manager - return StacExtensions.Count > 0; + return this.StacExtensions.Count > 0; } } diff --git a/src/DotNetStac/StacCollection.cs b/src/DotNetStac/StacCollection.cs index f142f07c..2ace4abf 100644 --- a/src/DotNetStac/StacCollection.cs +++ b/src/DotNetStac/StacCollection.cs @@ -25,7 +25,6 @@ public partial class StacCollection : IStacObject, IStacParent, IStacCatalog, IC public const string MEDIATYPE = "application/json"; public static readonly ContentType COLLECTION_MEDIATYPE = new ContentType(MEDIATYPE); - [JsonConstructor] public StacCollection(string id, string description, @@ -161,32 +160,32 @@ public ICollection Links [OnDeserialized] internal void OnDeserializedMethod(StreamingContext context) { - foreach (StacLink link in Links) + foreach (StacLink link in this.Links) { link.Parent = this; } - StacExtensions = new SortedSet(StacExtensions); + this.StacExtensions = new SortedSet(this.StacExtensions); } #pragma warning disable 1591 public bool ShouldSerializeSummaries() { // don't serialize the Manager property if an employee is their own manager - return Summaries.Count > 0; + return this.Summaries.Count > 0; } #pragma warning disable 1591 public bool ShouldSerializeStacExtensions() { // don't serialize the Manager property if an employee is their own manager - return StacExtensions.Count > 0; + return this.StacExtensions.Count > 0; } #pragma warning disable 1591 public bool ShouldSerializeAssets() { // don't serialize the Manager property if an employee is their own manager - return Assets.Count > 0; + return this.Assets.Count > 0; } #region Static Methods diff --git a/src/DotNetStac/StacItem.cs b/src/DotNetStac/StacItem.cs index 8f0783a6..634eb1c5 100644 --- a/src/DotNetStac/StacItem.cs +++ b/src/DotNetStac/StacItem.cs @@ -33,12 +33,12 @@ public StacItem(string id, base(geometry, properties, id) { Preconditions.CheckNotNull(id, "id"); - StacExtensions = new SortedSet(); - Root = new StacItemRootPropertyContainer(this); - StacVersion = Versions.StacVersionList.Current; - Links = new ObservableCollection(); - (Links as ObservableCollection).CollectionChanged += LinksCollectionChanged; - Assets = new Dictionary(); + this.StacExtensions = new SortedSet(); + this.Root = new StacItemRootPropertyContainer(this); + this.StacVersion = Versions.StacVersionList.Current; + this.Links = new ObservableCollection(); + (this.Links as ObservableCollection).CollectionChanged += this.LinksCollectionChanged; + this.Assets = new Dictionary(); } @@ -50,7 +50,7 @@ public StacItem(StacItem stacItem) : base(Preconditions.CheckNotNull(stacItem, " this.Root = new StacItemRootPropertyContainer(this); this.StacVersion = stacItem.StacVersion; this.Links = new ObservableCollection(stacItem.Links.Select(l => new StacLink(l))); - (Links as ObservableCollection).CollectionChanged += LinksCollectionChanged; + (this.Links as ObservableCollection).CollectionChanged += this.LinksCollectionChanged; this.Assets = new Dictionary(stacItem.Assets.Select(a => new KeyValuePair(a.Key, new StacAsset(a.Value, this))) .ToDictionary(kvp => kvp.Key, kvp => kvp.Value)); this.Collection = stacItem.Collection; @@ -66,7 +66,7 @@ private void LinksCollectionChanged(object sender, NotifyCollectionChangedEventA { if (oldLink.RelationshipType == "collection") { - Collection = null; + this.Collection = null; } } } @@ -74,9 +74,9 @@ private void LinksCollectionChanged(object sender, NotifyCollectionChangedEventA { foreach (var newLink in e.NewItems.Cast()) { - if (newLink.RelationshipType == "collection" && string.IsNullOrEmpty(Collection)) + if (newLink.RelationshipType == "collection" && string.IsNullOrEmpty(this.Collection)) { - Collection = Path.GetFileNameWithoutExtension(newLink.Uri.ToString()); + this.Collection = Path.GetFileNameWithoutExtension(newLink.Uri.ToString()); } } } @@ -127,11 +127,11 @@ public ICollection Links [JsonIgnore] public string Collection { - get => Root.GetProperty("collection"); + get => this.Root.GetProperty("collection"); set { - if (value != null) Root.SetProperty("collection", value); - else Root.RemoveProperty("collection"); + if (value != null) this.Root.SetProperty("collection", value); + else this.Root.RemoveProperty("collection"); } } @@ -140,36 +140,36 @@ public string Collection /// /// [JsonExtensionData] - public IDictionary RootProperties { get => Root.Properties; internal set => Root.Properties = value; } + public IDictionary RootProperties { get => this.Root.Properties; internal set => this.Root.Properties = value; } private readonly StacItemRootPropertyContainer Root; [OnDeserialized] internal void OnDeserializedMethod(StreamingContext context) { - foreach (StacLink link in Links) + foreach (StacLink link in this.Links) { link.Parent = this; } - foreach (StacAsset asset in Assets.Values) + foreach (StacAsset asset in this.Assets.Values) { asset.ParentStacObject = this; } - StacExtensions = new SortedSet(StacExtensions); + this.StacExtensions = new SortedSet(this.StacExtensions); } [OnSerializing] internal void OnSerializingMethod(StreamingContext context) { - if (BoundingBoxes == null && Geometry != null) - BoundingBoxes = this.GetBoundingBoxFromGeometryExtent(); + if (this.BoundingBoxes == null && this.Geometry != null) + this.BoundingBoxes = this.GetBoundingBoxFromGeometryExtent(); } public bool ShouldSerializeStacExtensions() { // don't serialize the Manager property if an employee is their own manager - return StacExtensions.Count > 0; + return this.StacExtensions.Count > 0; } /// diff --git a/src/DotNetStac/StacItemRootPropertyContainer.cs b/src/DotNetStac/StacItemRootPropertyContainer.cs index 28bb8a7e..ab9c2d2f 100644 --- a/src/DotNetStac/StacItemRootPropertyContainer.cs +++ b/src/DotNetStac/StacItemRootPropertyContainer.cs @@ -15,12 +15,12 @@ internal class StacItemRootPropertyContainer : IStacPropertiesContainer public StacItemRootPropertyContainer(StacItem stacItem) { this.stacItem = stacItem; - properties = new Dictionary(); + this.properties = new Dictionary(); } - public IDictionary Properties { get => properties; internal set => properties = value; } + public IDictionary Properties { get => this.properties; internal set => this.properties = value; } [ExcludeFromCodeCoverage] - public IStacObject StacObjectContainer => stacItem; + public IStacObject StacObjectContainer => this.stacItem; } } diff --git a/src/DotNetStac/StacLink.cs b/src/DotNetStac/StacLink.cs index a70ebdde..01ce261a 100644 --- a/src/DotNetStac/StacLink.cs +++ b/src/DotNetStac/StacLink.cs @@ -63,7 +63,6 @@ public static StacLink CreateObjectLink(IStacObject stacObject, Uri uri) #endregion - public StacLink() { } @@ -88,20 +87,20 @@ public StacLink(StacLink source) { throw new ArgumentNullException("source"); } - Uri = source.Uri; - RelationshipType = source.RelationshipType; - Title = source.Title; - ContentType = source.ContentType; - Parent = source.Parent; - Length = source.Length; + this.Uri = source.Uri; + this.RelationshipType = source.RelationshipType; + this.Title = source.Title; + this.ContentType = source.ContentType; + this.Parent = source.Parent; + this.Length = source.Length; } [JsonProperty("type")] [DataMember(Name = "type")] public string Type { - get => ContentType?.ToString(); - set => ContentType = value == null ? null : new ContentType(value); + get => this.ContentType?.ToString(); + set => this.ContentType = value == null ? null : new ContentType(value); } [JsonIgnore] diff --git a/src/DotNetStac/StacObjectLink.cs b/src/DotNetStac/StacObjectLink.cs index 0d26d3f1..1b90f880 100644 --- a/src/DotNetStac/StacObjectLink.cs +++ b/src/DotNetStac/StacObjectLink.cs @@ -23,7 +23,7 @@ internal StacObjectLink(IStacObject stacObject, Uri uri) { this.RelationshipType = "child"; } - Uri = uri; + this.Uri = uri; } /// @@ -31,7 +31,7 @@ internal StacObjectLink(IStacObject stacObject, Uri uri) [JsonConverter(typeof(ContentTypeConverter))] public override ContentType ContentType { - get => stacObject.MediaType; + get => this.stacObject.MediaType; set { throw new InvalidOperationException("Cannot set MediaType on an STAC Object link"); @@ -50,7 +50,7 @@ public override string RelationshipType [JsonProperty("title")] public override string Title { - get => stacObject.Title; + get => this.stacObject.Title; set { throw new InvalidOperationException("Cannot set Title on an STAC Object link"); @@ -66,6 +66,6 @@ public override Uri Uri } [JsonIgnore] - public IStacObject StacObject => stacObject; + public IStacObject StacObject => this.stacObject; } } diff --git a/src/DotNetStac/StacProvider.cs b/src/DotNetStac/StacProvider.cs index c03136bf..dfa77efd 100644 --- a/src/DotNetStac/StacProvider.cs +++ b/src/DotNetStac/StacProvider.cs @@ -29,9 +29,9 @@ public StacProvider(string name, IEnumerable providerRoles = n { this.Name = name; if (providerRoles != null) - Roles = new Collection(providerRoles.ToList()); + this.Roles = new Collection(providerRoles.ToList()); else - Roles = new Collection(); + this.Roles = new Collection(); } /// @@ -68,7 +68,7 @@ public StacProvider(string name, IEnumerable providerRoles = n public bool ShouldSerializeRoles() { // don't serialize the Manager property if an employee is their own manager - return Roles.Count > 0; + return this.Roles.Count > 0; } } }