diff --git a/Geo.Tests/CoordinateTests.cs b/Geo.Tests/CoordinateTests.cs index 2ac3f0f..6c98854 100644 --- a/Geo.Tests/CoordinateTests.cs +++ b/Geo.Tests/CoordinateTests.cs @@ -28,40 +28,80 @@ public void Parse(string coordinate, double latitude, double longitude) [Fact] public void Equality_Elevation() { - Assert.True(new CoordinateZ(0, 0, 0).Equals(new CoordinateZ(0, 0, 0), - new SpatialEqualityOptions { UseElevation = true })); - Assert.False(new CoordinateZ(0, 0, 0).Equals(new CoordinateZ(0, 0, 10), - new SpatialEqualityOptions { UseElevation = true })); - Assert.True(new CoordinateZ(0, 0, 0).Equals(new CoordinateZ(0, 0, 10), - new SpatialEqualityOptions { UseElevation = false })); + Assert.True( + new CoordinateZ(0, 0, 0).Equals( + new CoordinateZ(0, 0, 0), + new SpatialEqualityOptions { UseElevation = true } + ) + ); + Assert.False( + new CoordinateZ(0, 0, 0).Equals( + new CoordinateZ(0, 0, 10), + new SpatialEqualityOptions { UseElevation = true } + ) + ); + Assert.True( + new CoordinateZ(0, 0, 0).Equals( + new CoordinateZ(0, 0, 10), + new SpatialEqualityOptions { UseElevation = false } + ) + ); } [Fact] public void Equality_M() { - Assert.True(new CoordinateZM(0, 0, 0, 0).Equals(new CoordinateZM(0, 0, 0, 0), - new SpatialEqualityOptions { UseM = true })); - Assert.False(new CoordinateZM(0, 0, 0, 0).Equals(new CoordinateZM(0, 0, 0, 10), - new SpatialEqualityOptions { UseM = true })); - Assert.True(new CoordinateZM(0, 0, 0, 0).Equals(new CoordinateZM(0, 0, 0, 10), - new SpatialEqualityOptions { UseM = false })); + Assert.True( + new CoordinateZM(0, 0, 0, 0).Equals( + new CoordinateZM(0, 0, 0, 0), + new SpatialEqualityOptions { UseM = true } + ) + ); + Assert.False( + new CoordinateZM(0, 0, 0, 0).Equals( + new CoordinateZM(0, 0, 0, 10), + new SpatialEqualityOptions { UseM = true } + ) + ); + Assert.True( + new CoordinateZM(0, 0, 0, 0).Equals( + new CoordinateZM(0, 0, 0, 10), + new SpatialEqualityOptions { UseM = false } + ) + ); } [Fact] public void Equality_PoleCoordinates() { - Assert.True(new CoordinateZM(90, 0, 0, 0).Equals(new CoordinateZM(90, 180, 0, 0), - new SpatialEqualityOptions { PoleCoordiantesAreEqual = true })); - Assert.False(new CoordinateZM(90, 0, 0, 0).Equals(new CoordinateZM(90, 180, 0, 0), - new SpatialEqualityOptions { PoleCoordiantesAreEqual = false })); + Assert.True( + new CoordinateZM(90, 0, 0, 0).Equals( + new CoordinateZM(90, 180, 0, 0), + new SpatialEqualityOptions { PoleCoordiantesAreEqual = true } + ) + ); + Assert.False( + new CoordinateZM(90, 0, 0, 0).Equals( + new CoordinateZM(90, 180, 0, 0), + new SpatialEqualityOptions { PoleCoordiantesAreEqual = false } + ) + ); } [Fact] public void Equality_AntiMeridianCoordinates() { - Assert.True(new Coordinate(4, 180).Equals(new Coordinate(4, -180), - new SpatialEqualityOptions { AntiMeridianCoordinatesAreEqual = true })); - Assert.False(new Coordinate(4, 180).Equals(new Coordinate(4, -180), - new SpatialEqualityOptions { AntiMeridianCoordinatesAreEqual = false })); + Assert.True( + new Coordinate(4, 180).Equals( + new Coordinate(4, -180), + new SpatialEqualityOptions { AntiMeridianCoordinatesAreEqual = true } + ) + ); + Assert.False( + new Coordinate(4, 180).Equals( + new Coordinate(4, -180), + new SpatialEqualityOptions { AntiMeridianCoordinatesAreEqual = false } + ) + ); } -} \ No newline at end of file +} diff --git a/Geo.Tests/Geodesy/SpheroidCalculatorTests.cs b/Geo.Tests/Geodesy/SpheroidCalculatorTests.cs index bed5ef8..c10af0a 100644 --- a/Geo.Tests/Geodesy/SpheroidCalculatorTests.cs +++ b/Geo.Tests/Geodesy/SpheroidCalculatorTests.cs @@ -31,28 +31,56 @@ public void MeridionalDistance(double latitude, double parts) [Theory] [InlineData(0, 0, 10, 10, 845.100058)] - public void CalculateLoxodromicLineDistance(double lat1, double lon1, double lat2, double lon2, double distance) + public void CalculateLoxodromicLineDistance( + double lat1, + double lon1, + double lat2, + double lon2, + double distance + ) { var calculator = new SpheroidCalculator(Spheroid.Wgs84); - var result = calculator.CalculateLoxodromicLine(new Point(lat1, lon1), new Point(lat2, lon2)); + var result = calculator.CalculateLoxodromicLine( + new Point(lat1, lon1), + new Point(lat2, lon2) + ); Assert.Equal(distance, result.Distance.ConvertTo(DistanceUnit.Nm).Value, Millionth); } [Theory] [InlineData(0, 0, 10, 10, 45.044293)] - public void CalculateLoxodromicCourse(double lat1, double lon1, double lat2, double lon2, double distance) + public void CalculateLoxodromicCourse( + double lat1, + double lon1, + double lat2, + double lon2, + double distance + ) { var calculator = new SpheroidCalculator(Spheroid.Wgs84); - var result = calculator.CalculateLoxodromicLine(new Point(lat1, lon1), new Point(lat2, lon2)); + var result = calculator.CalculateLoxodromicLine( + new Point(lat1, lon1), + new Point(lat2, lon2) + ); Assert.Equal(distance, result.Bearing12, Millionth); } [Theory] [InlineData(0, 0, 10, 10, 44.751910, 225.629037)] - public void CalculateOrthodromicCourse(double lat1, double lon1, double lat2, double lon2, double c12, double c21) + public void CalculateOrthodromicCourse( + double lat1, + double lon1, + double lat2, + double lon2, + double c12, + double c21 + ) { var calculator = new SpheroidCalculator(Spheroid.Wgs84); - var result = calculator.CalculateOrthodromicLine(new Point(lat1, lon1), new Point(lat2, lon2)); + var result = calculator.CalculateOrthodromicLine( + new Point(lat1, lon1), + new Point(lat2, lon2) + ); Assert.Equal(c12, result.Bearing12, Millionth); Assert.Equal(c21, result.Bearing21, Millionth); } @@ -60,25 +88,37 @@ public void CalculateOrthodromicCourse(double lat1, double lon1, double lat2, do [Theory] [InlineData(0, 0, 56, 34, 0.318436, 0.468951)] [InlineData(-9.443333, 147.216667, 327.912522, 50, -8.733717, 146.769644)] - public void CalculateOrthodromicDestination(double lat1, double lon1, double angle, double distance, double lat2, - double lon2) + public void CalculateOrthodromicDestination( + double lat1, + double lon1, + double angle, + double distance, + double lat2, + double lon2 + ) { var calculator = new SpheroidCalculator(Spheroid.Wgs84); - var result = calculator.CalculateOrthodromicLine(new Point(lat1, lon1), angle, - new Distance(distance, DistanceUnit.Nm).SiValue); + var result = calculator.CalculateOrthodromicLine( + new Point(lat1, lon1), + angle, + new Distance(distance, DistanceUnit.Nm).SiValue + ); Assert.Equal(lat2, result.Coordinate2.Latitude, Millionth); Assert.Equal(lon2, result.Coordinate2.Longitude, Millionth); } - + [Theory(Skip = "Need to re-visit")] [InlineData(30, 175, -30, -3.5)] [InlineData(30, 176, -30, -3.5)] public void Bug7(double lat1, double lon1, double lat2, double lon2) { var calculator = new SpheroidCalculator(Spheroid.Wgs84); - var result = calculator.CalculateOrthodromicLine(new Point(lat1, lon1), new Point(lat2, lon2)); + var result = calculator.CalculateOrthodromicLine( + new Point(lat1, lon1), + new Point(lat2, lon2) + ); Console.WriteLine(result.Distance); Console.WriteLine(result.Bearing12); Console.WriteLine(result.Bearing21); } -} \ No newline at end of file +} diff --git a/Geo.Tests/Geomagnetism/GeomagnetismCalculatorTests.cs b/Geo.Tests/Geomagnetism/GeomagnetismCalculatorTests.cs index 8ff5468..2784b55 100644 --- a/Geo.Tests/Geomagnetism/GeomagnetismCalculatorTests.cs +++ b/Geo.Tests/Geomagnetism/GeomagnetismCalculatorTests.cs @@ -13,4 +13,4 @@ public void Test() var b = a.TryCalculate(new Coordinate(51.8, -0.15), DateTime.UtcNow.Date); Console.WriteLine(b); } -} \ No newline at end of file +} diff --git a/Geo.Tests/Geometries/CircleTests.cs b/Geo.Tests/Geometries/CircleTests.cs index 062e461..bb4a9ad 100644 --- a/Geo.Tests/Geometries/CircleTests.cs +++ b/Geo.Tests/Geometries/CircleTests.cs @@ -58,9 +58,8 @@ public void An_60Degree_CircleWith_111000M_RadiusShouldBeAboutOneDegreeWide() Assert.True(maxLonError <= 0.002); } - public double Distance(double nr1, double nr2) { return Math.Abs(nr1 - nr2); } -} \ No newline at end of file +} diff --git a/Geo.Tests/Gps/Serialization/GarminFlightplanDeSerializerTests.cs b/Geo.Tests/Gps/Serialization/GarminFlightplanDeSerializerTests.cs index cca8d16..628482e 100644 --- a/Geo.Tests/Gps/Serialization/GarminFlightplanDeSerializerTests.cs +++ b/Geo.Tests/Gps/Serialization/GarminFlightplanDeSerializerTests.cs @@ -10,14 +10,15 @@ public class GarminFlightplanDeSerializerTests : SerializerTestFixtureBase [Fact] public void CanParse() { - var fileInfo = - GetReferenceFileDirectory("garmin").EnumerateFiles().First(x => x.Name == "garmin.fpl"); + var fileInfo = GetReferenceFileDirectory("garmin") + .EnumerateFiles() + .First(x => x.Name == "garmin.fpl"); using var stream = new FileStream(fileInfo.FullName, FileMode.Open); var file = new GarminFlightplanDeSerializer().DeSerialize(new StreamWrapper(stream)); - + Assert.NotNull(file); Assert.Single(file.Routes); Assert.Equal(5, file.Routes[0].Waypoints.Count); } -} \ No newline at end of file +} diff --git a/Geo.Tests/Gps/Serialization/GpsDeSerializerTests.cs b/Geo.Tests/Gps/Serialization/GpsDeSerializerTests.cs index 5c088c5..ac456d2 100644 --- a/Geo.Tests/Gps/Serialization/GpsDeSerializerTests.cs +++ b/Geo.Tests/Gps/Serialization/GpsDeSerializerTests.cs @@ -16,4 +16,4 @@ public void ImageFileTest() Assert.Null(data); } -} \ No newline at end of file +} diff --git a/Geo.Tests/Gps/Serialization/GpxSerializerTests.cs b/Geo.Tests/Gps/Serialization/GpxSerializerTests.cs index 890b289..f668b54 100644 --- a/Geo.Tests/Gps/Serialization/GpxSerializerTests.cs +++ b/Geo.Tests/Gps/Serialization/GpxSerializerTests.cs @@ -61,7 +61,8 @@ private void Compare(Gpx11Serializer serializer, GpsData data, string gpxData) private void Compare(GpsData data, GpsData data2) { Assert.Equal(data.Metadata.Count, data2.Metadata.Count); - foreach (var entry in data.Metadata) Assert.Equal(entry.Value, data2.Metadata[entry.Key]); + foreach (var entry in data.Metadata) + Assert.Equal(entry.Value, data2.Metadata[entry.Key]); Assert.Equal(data.Tracks.Count, data2.Tracks.Count); for (var i = 0; i < data.Tracks.Count; i++) @@ -70,7 +71,8 @@ private void Compare(GpsData data, GpsData data2) var track2 = data2.Tracks[i]; Assert.Equal(track1.Metadata.Count, track2.Metadata.Count); - foreach (var entry in track1.Metadata) Assert.Equal(entry.Value, track2.Metadata[entry.Key]); + foreach (var entry in track1.Metadata) + Assert.Equal(entry.Value, track2.Metadata[entry.Key]); Assert.Equal(track1.Segments.Count, track2.Segments.Count); for (var s = 0; s < track1.Segments.Count; s++) @@ -109,10 +111,12 @@ private void Compare(GpsData data, GpsData data2) var r2 = data2.Routes[i]; Assert.Equal(r1.Metadata.Count, r2.Metadata.Count); - foreach (var entry in r1.Metadata) Assert.Equal(entry.Value, r2.Metadata[entry.Key]); + foreach (var entry in r1.Metadata) + Assert.Equal(entry.Value, r2.Metadata[entry.Key]); Assert.Equal(r1.Waypoints.Count, r2.Waypoints.Count); - for (var c = 0; c < r1.Waypoints.Count; c++) Compare(r1.Waypoints[c], r2.Waypoints[c]); + for (var c = 0; c < r1.Waypoints.Count; c++) + Compare(r1.Waypoints[c], r2.Waypoints[c]); } } @@ -138,4 +142,4 @@ private static void Compare(Coordinate coord1, Coordinate coord2) if (coord1.IsMeasured) Assert.Equal(((IsMeasured)coord1).Measure, ((IsMeasured)coord2).Measure); } -} \ No newline at end of file +} diff --git a/Geo.Tests/Gps/Serialization/IgcDeSerializerTests.cs b/Geo.Tests/Gps/Serialization/IgcDeSerializerTests.cs index c2af44e..f6cc0d4 100644 --- a/Geo.Tests/Gps/Serialization/IgcDeSerializerTests.cs +++ b/Geo.Tests/Gps/Serialization/IgcDeSerializerTests.cs @@ -23,4 +23,4 @@ public void igc2() Assert.Single(result.Tracks[0].Segments); Assert.Equal(9, result.Tracks[0].Segments[0].Waypoints.Count); } -} \ No newline at end of file +} diff --git a/Geo.Tests/Gps/Serialization/NmeaDeSerializerTests.cs b/Geo.Tests/Gps/Serialization/NmeaDeSerializerTests.cs index 9d97415..174b506 100644 --- a/Geo.Tests/Gps/Serialization/NmeaDeSerializerTests.cs +++ b/Geo.Tests/Gps/Serialization/NmeaDeSerializerTests.cs @@ -10,7 +10,9 @@ public class NmeaDeSerializerTests : SerializerTestFixtureBase [Fact] public void Stockholm_Walk() { - var file = GetReferenceFileDirectory("nmea").GetFiles().First(x => x.Name == "Stockholm_Walk.nmea"); + var file = GetReferenceFileDirectory("nmea") + .GetFiles() + .First(x => x.Name == "Stockholm_Walk.nmea"); using var stream = new FileStream(file.FullName, FileMode.Open); var streamWrapper = new StreamWrapper(stream); var parser = new NmeaDeSerializer(); @@ -23,4 +25,4 @@ public void Stockholm_Walk() Assert.Single(result.Tracks[0].Segments); Assert.Equal(674, result.Tracks[0].Segments[0].Waypoints.Count); } -} \ No newline at end of file +} diff --git a/Geo.Tests/Gps/Serialization/PocketFmsFlightplanDeSerializerTests.cs b/Geo.Tests/Gps/Serialization/PocketFmsFlightplanDeSerializerTests.cs index facd326..3cac811 100644 --- a/Geo.Tests/Gps/Serialization/PocketFmsFlightplanDeSerializerTests.cs +++ b/Geo.Tests/Gps/Serialization/PocketFmsFlightplanDeSerializerTests.cs @@ -10,11 +10,12 @@ public class PocketFmsFlightplanDeSerializerTests : SerializerTestFixtureBase [Fact] public void CanParse() { - var fileInfo = - GetReferenceFileDirectory("pocketfms").EnumerateFiles().First(x => x.Name == "pocketfms_fp.xml"); + var fileInfo = GetReferenceFileDirectory("pocketfms") + .EnumerateFiles() + .First(x => x.Name == "pocketfms_fp.xml"); using var stream = new FileStream(fileInfo.FullName, FileMode.Open); var file = new PocketFmsFlightplanDeSerializer().DeSerialize(new StreamWrapper(stream)); Assert.NotNull(file); } -} \ No newline at end of file +} diff --git a/Geo.Tests/Gps/Serialization/SerializerTestFixtureBase.cs b/Geo.Tests/Gps/Serialization/SerializerTestFixtureBase.cs index d3bb6ea..2284080 100644 --- a/Geo.Tests/Gps/Serialization/SerializerTestFixtureBase.cs +++ b/Geo.Tests/Gps/Serialization/SerializerTestFixtureBase.cs @@ -9,7 +9,9 @@ public abstract class SerializerTestFixtureBase { protected DirectoryInfo GetReferenceFileDirectory(params string[] subDirectories) { - var filePath = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().Location).LocalPath); + var filePath = Path.GetDirectoryName( + new Uri(Assembly.GetExecutingAssembly().Location).LocalPath + ); filePath = Path.Combine(filePath, "..", ".."); var dir = new DirectoryInfo(filePath); @@ -27,7 +29,9 @@ protected DirectoryInfo GetReferenceFileDirectory(params string[] subDirectories { foreach (var directory in subDirectories) if (refDir != null) - refDir = refDir.EnumerateDirectories().FirstOrDefault(x => x.Name == directory); + refDir = refDir + .EnumerateDirectories() + .FirstOrDefault(x => x.Name == directory); dir = refDir; } @@ -39,4 +43,4 @@ protected DirectoryInfo GetReferenceFileDirectory(params string[] subDirectories return dir; } -} \ No newline at end of file +} diff --git a/Geo.Tests/Gps/Serialization/SkyDemonFlightplanDeSerializerTests.cs b/Geo.Tests/Gps/Serialization/SkyDemonFlightplanDeSerializerTests.cs index 7f9ee7e..4a54b41 100644 --- a/Geo.Tests/Gps/Serialization/SkyDemonFlightplanDeSerializerTests.cs +++ b/Geo.Tests/Gps/Serialization/SkyDemonFlightplanDeSerializerTests.cs @@ -10,14 +10,15 @@ public class SkyDemonFlightplanDeSerializerTests : SerializerTestFixtureBase [Fact] public void CanParse() { - var fileInfo = - GetReferenceFileDirectory("skydemon").EnumerateFiles().First(x => x.Name == "skydemon.flightplan"); + var fileInfo = GetReferenceFileDirectory("skydemon") + .EnumerateFiles() + .First(x => x.Name == "skydemon.flightplan"); using var stream = new FileStream(fileInfo.FullName, FileMode.Open); var file = new SkyDemonFlightplanDeSerializer().DeSerialize(new StreamWrapper(stream)); - + Assert.NotNull(file); Assert.Single(file.Routes); Assert.Equal(4, file.Routes[0].Waypoints.Count); } -} \ No newline at end of file +} diff --git a/Geo.Tests/IO/GeoJson/GeoJsonTests.cs b/Geo.Tests/IO/GeoJson/GeoJsonTests.cs index d17a334..4437344 100644 --- a/Geo.Tests/IO/GeoJson/GeoJsonTests.cs +++ b/Geo.Tests/IO/GeoJson/GeoJsonTests.cs @@ -22,8 +22,7 @@ public void LineString() { var reader = new GeoJsonReader(); var geo = new LineString(new Coordinate(0, 0), new Coordinate(1, 1)); - Assert.Equal(@"{""type"":""LineString"",""coordinates"":[[0,0],[1,1]]}", - geo.ToGeoJson()); + Assert.Equal(@"{""type"":""LineString"",""coordinates"":[[0,0],[1,1]]}", geo.ToGeoJson()); Assert.Equal(geo, reader.Read(geo.ToGeoJson())); } @@ -31,11 +30,18 @@ public void LineString() public void Polygon() { var reader = new GeoJsonReader(); - var geo = - new Polygon(new LinearRing(new Coordinate(0, 0), new Coordinate(1, 1), new Coordinate(2, 0), - new Coordinate(0, 0))); - Assert.Equal(@"{""type"":""Polygon"",""coordinates"":[[[0,0],[1,1],[0,2],[0,0]]]}", - geo.ToGeoJson()); + var geo = new Polygon( + new LinearRing( + new Coordinate(0, 0), + new Coordinate(1, 1), + new Coordinate(2, 0), + new Coordinate(0, 0) + ) + ); + Assert.Equal( + @"{""type"":""Polygon"",""coordinates"":[[[0,0],[1,1],[0,2],[0,0]]]}", + geo.ToGeoJson() + ); Assert.Equal(geo, reader.Read(geo.ToGeoJson())); } @@ -44,8 +50,7 @@ public void MultiPoint() { var reader = new GeoJsonReader(); var geo = new MultiPoint(new Point(0, 0)); - Assert.Equal(@"{""type"":""MultiPoint"",""coordinates"":[[0,0]]}", - geo.ToGeoJson()); + Assert.Equal(@"{""type"":""MultiPoint"",""coordinates"":[[0,0]]}", geo.ToGeoJson()); Assert.Equal(geo, reader.Read(geo.ToGeoJson())); } @@ -54,8 +59,10 @@ public void MultiLineString() { var reader = new GeoJsonReader(); var geo = new MultiLineString(new LineString(new Coordinate(0, 0), new Coordinate(1, 1))); - Assert.Equal(@"{""type"":""MultiLineString"",""coordinates"":[[[0,0],[1,1]]]}", - geo.ToGeoJson()); + Assert.Equal( + @"{""type"":""MultiLineString"",""coordinates"":[[[0,0],[1,1]]]}", + geo.ToGeoJson() + ); Assert.Equal(geo, reader.Read(geo.ToGeoJson())); } @@ -63,12 +70,20 @@ public void MultiLineString() public void MultiPolygon() { var reader = new GeoJsonReader(); - var geo = - new MultiPolygon( - new Polygon(new LinearRing(new Coordinate(0, 0), new Coordinate(1, 1), new Coordinate(2, 0), - new Coordinate(0, 0)))); - Assert.Equal(@"{""type"":""MultiPolygon"",""coordinates"":[[[[0,0],[1,1],[0,2],[0,0]]]]}", - geo.ToGeoJson()); + var geo = new MultiPolygon( + new Polygon( + new LinearRing( + new Coordinate(0, 0), + new Coordinate(1, 1), + new Coordinate(2, 0), + new Coordinate(0, 0) + ) + ) + ); + Assert.Equal( + @"{""type"":""MultiPolygon"",""coordinates"":[[[[0,0],[1,1],[0,2],[0,0]]]]}", + geo.ToGeoJson() + ); Assert.Equal(geo, reader.Read(geo.ToGeoJson())); } @@ -79,7 +94,8 @@ public void GeometryCollection() var geo = new GeometryCollection(new Point(0, 0), new Point(1, 0)); Assert.Equal( @"{""type"":""GeometryCollection"",""geometries"":[{""type"":""Point"",""coordinates"":[0,0]},{""type"":""Point"",""coordinates"":[0,1]}]}", - geo.ToGeoJson()); + geo.ToGeoJson() + ); Assert.Equal(geo, reader.Read(geo.ToGeoJson())); } @@ -94,13 +110,19 @@ public void Feature() Assert.Equal( @"{""type"":""Feature"",""geometry"":{""type"":""Point"",""coordinates"":[0,0]},""properties"":null,""id"":""test-id""}", - new Feature(new Point(0, 0), new Dictionary()) { Id = "test-id" }.ToGeoJson() + new Feature(new Point(0, 0), new Dictionary()) + { + Id = "test-id", + }.ToGeoJson() ); - var feature = new Feature(new Point(0, 0), new Dictionary + var feature = new Feature( + new Point(0, 0), + new Dictionary { { "name", "test" } } + ) { - { "name", "test" } - }) { Id = "test-id" }; + Id = "test-id", + }; Assert.Equal( @"{""type"":""Feature"",""geometry"":{""type"":""Point"",""coordinates"":[0,0]},""properties"":{""name"":""test""},""id"":""test-id""}", feature.ToGeoJson() @@ -124,4 +146,4 @@ public void FeatureCollection() var features2 = (FeatureCollection)reader.Read(features.ToGeoJson()); Assert.Equal(features.Features.Single().Geometry, features2.Features.Single().Geometry); } -} \ No newline at end of file +} diff --git a/Geo.Tests/IO/Google/GooglePolylineEncoderTests.cs b/Geo.Tests/IO/Google/GooglePolylineEncoderTests.cs index a7d678a..bbb3be0 100644 --- a/Geo.Tests/IO/Google/GooglePolylineEncoderTests.cs +++ b/Geo.Tests/IO/Google/GooglePolylineEncoderTests.cs @@ -9,9 +9,11 @@ public class GooglePolylineEncoderTests [Fact] public void Encode() { - var lineString = new LineString(new Coordinate(38.5, -120.2), + var lineString = new LineString( + new Coordinate(38.5, -120.2), new Coordinate(40.7, -120.95), - new Coordinate(43.252, -126.453)); + new Coordinate(43.252, -126.453) + ); var result = new GooglePolylineEncoder().Encode(lineString); @@ -21,12 +23,14 @@ public void Encode() [Fact] public void Decode() { - var lineString = new LineString(new Coordinate(38.5, -120.2), + var lineString = new LineString( + new Coordinate(38.5, -120.2), new Coordinate(40.7, -120.95), - new Coordinate(43.252, -126.453)); + new Coordinate(43.252, -126.453) + ); var result = new GooglePolylineEncoder().Decode("_p~iF~ps|U_ulLnnqC_mqNvxq`@"); Assert.Equal(lineString, result); } -} \ No newline at end of file +} diff --git a/Geo.Tests/IO/Wkb/WkbTests.cs b/Geo.Tests/IO/Wkb/WkbTests.cs index b745332..83204af 100644 --- a/Geo.Tests/IO/Wkb/WkbTests.cs +++ b/Geo.Tests/IO/Wkb/WkbTests.cs @@ -51,10 +51,15 @@ public void GeometryCollection() { Test("GEOMETRYCOLLECTION (LINESTRING EMPTY, POLYGON EMPTY)"); Test("GEOMETRYCOLLECTION (LINESTRING (45.89 23.9, 0 0), POLYGON ((0 0, 1 0, 0 1, 0 0)))"); - Test("GEOMETRYCOLLECTION (LINESTRING Z (45.89 23.9 0.45, 0 0 0.45), POLYGON Z ((0 0 2, 1 0 2, 0 1 2, 0 0 2)))"); - Test("GEOMETRYCOLLECTION (LINESTRING M (45.89 23.9 34, 0 0 34), POLYGON M ((0 0 -1, 1 0 -1, 0 1 -1, 0 0 -1)))"); Test( - "GEOMETRYCOLLECTION (LINESTRING ZM (45.89 23.9 0.45 34, 0 0 0.45 34), POLYGON ZM ((0 0 2 -1, 1 0 2 -1, 0 1 2 -1, 0 0 2 -1)))"); + "GEOMETRYCOLLECTION (LINESTRING Z (45.89 23.9 0.45, 0 0 0.45), POLYGON Z ((0 0 2, 1 0 2, 0 1 2, 0 0 2)))" + ); + Test( + "GEOMETRYCOLLECTION (LINESTRING M (45.89 23.9 34, 0 0 34), POLYGON M ((0 0 -1, 1 0 -1, 0 1 -1, 0 0 -1)))" + ); + Test( + "GEOMETRYCOLLECTION (LINESTRING ZM (45.89 23.9 0.45 34, 0 0 0.45 34), POLYGON ZM ((0 0 2 -1, 1 0 2 -1, 0 1 2 -1, 0 0 2 -1)))" + ); } private void Test(string wkt) @@ -69,11 +74,13 @@ private void Test(string wkt) Assert.Equal(geometry, geometry2); } { - var wkbWriter = new WkbWriter(new WkbWriterSettings { Encoding = WkbEncoding.BigEndian, Triangle = true }); + var wkbWriter = new WkbWriter( + new WkbWriterSettings { Encoding = WkbEncoding.BigEndian, Triangle = true } + ); var wkb = wkbWriter.Write(geometry); var wkbReader = new WkbReader(); var geometry2 = wkbReader.Read(wkb); Assert.Equal(geometry, geometry2); } } -} \ No newline at end of file +} diff --git a/Geo.Tests/IO/Wkt/WktReaderTests.cs b/Geo.Tests/IO/Wkt/WktReaderTests.cs index 7379223..16e3228 100644 --- a/Geo.Tests/IO/Wkt/WktReaderTests.cs +++ b/Geo.Tests/IO/Wkt/WktReaderTests.cs @@ -97,8 +97,14 @@ public void LinearRing() var xy = reader.Read("LINEARRING (0.0 65.9, -34.5 9, 5.0 65.9, 0.0 65.9)"); Assert.Equal( - new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), new Coordinate(65.9, 5), - new Coordinate(65.9, 0)), xy); + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(65.9, 5), + new Coordinate(65.9, 0) + ), + xy + ); var empty = reader.Read("LINEARRING ZM EMPTY"); Assert.Equal(new LinearRing(), empty); @@ -111,8 +117,16 @@ public void Polygon() var xy = reader.Read("POLYGON ((0.0 65.9, -34.5 9, -20 40, 0 65.9))"); Assert.Equal( - new Polygon(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), new Coordinate(40, -20), - new Coordinate(65.9, 0))), xy); + new Polygon( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ), + xy + ); var empty = reader.Read("POLYGON ZM EMPTY"); Assert.Equal(Geo.Geometries.Polygon.Empty, empty); @@ -125,8 +139,16 @@ public void Triangle() var xy = reader.Read("TRIANGLE ((0.0 65.9, -34.5 9, -20 40, 0 65.9))"); Assert.Equal( - new Triangle(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), new Coordinate(40, -20), - new Coordinate(65.9, 0))), xy); + new Triangle( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ), + xy + ); var empty = reader.Read("Triangle ZM EMPTY"); Assert.Equal(Geo.Geometries.Triangle.Empty, empty); @@ -137,11 +159,18 @@ public void GeometryCollection() { var reader = new WktReader(); - var points = - reader.Read("GEOMETRYCOLLECTION (POINT (0.0 65.9), POINT (-34.5 9), POINT (-20 40), POINT (0 65.9))"); + var points = reader.Read( + "GEOMETRYCOLLECTION (POINT (0.0 65.9), POINT (-34.5 9), POINT (-20 40), POINT (0 65.9))" + ); Assert.Equal( - new GeometryCollection(new Point(65.9, 0), new Point(9, -34.5), new Point(40, -20), new Point(65.9, 0)), - points); + new GeometryCollection( + new Point(65.9, 0), + new Point(9, -34.5), + new Point(40, -20), + new Point(65.9, 0) + ), + points + ); var empty = reader.Read("GEOMETRYCOLLECTION ZM EMPTY"); Assert.Equal(new GeometryCollection(), empty); @@ -153,13 +182,27 @@ public void MultiPoint() var reader = new WktReader(); var none = reader.Read("MULTIPOINT (0.0 65.9, -34.5 9, -20 40, 0 65.9)"); - Assert.Equal(new MultiPoint(new Point(65.9, 0), new Point(9, -34.5), new Point(40, -20), new Point(65.9, 0)), - none); + Assert.Equal( + new MultiPoint( + new Point(65.9, 0), + new Point(9, -34.5), + new Point(40, -20), + new Point(65.9, 0) + ), + none + ); var brackets = reader.Read("MULTIPOINT (EMPTY, (0.0 65.9), (-34.5 9), (-20 40), (0 65.9))"); Assert.Equal( - new MultiPoint(new Point(), new Point(65.9, 0), new Point(9, -34.5), new Point(40, -20), - new Point(65.9, 0)), brackets); + new MultiPoint( + new Point(), + new Point(65.9, 0), + new Point(9, -34.5), + new Point(40, -20), + new Point(65.9, 0) + ), + brackets + ); var empty = reader.Read("MULTIPOINT ZM EMPTY"); Assert.Equal(new MultiPoint(), empty); @@ -172,18 +215,37 @@ public void MultiLineString() var one = reader.Read("MULTILINESTRING ((0.0 65.9, -34.5 9, -20 40, 0 65.9))"); Assert.Equal( - new MultiLineString(new LineString(new Coordinate(65.9, 0), new Coordinate(9, -34.5), - new Coordinate(40, -20), new Coordinate(65.9, 0))), one); - + new MultiLineString( + new LineString( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ), + one + ); var two = reader.Read( - "MULTILINESTRING ((0.0 65.9, -34.5 9, -20 40, 0 65.9), (0.0 65.9, -34.5 9, -20 40, 0 65.9))"); + "MULTILINESTRING ((0.0 65.9, -34.5 9, -20 40, 0 65.9), (0.0 65.9, -34.5 9, -20 40, 0 65.9))" + ); Assert.Equal( new MultiLineString( - new LineString(new Coordinate(65.9, 0), new Coordinate(9, -34.5), new Coordinate(40, -20), - new Coordinate(65.9, 0)), - new LineString(new Coordinate(65.9, 0), new Coordinate(9, -34.5), new Coordinate(40, -20), - new Coordinate(65.9, 0))), two); + new LineString( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ), + new LineString( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ), + two + ); var empty = reader.Read("MULTILINESTRING ZM EMPTY"); Assert.Equal(new MultiLineString(), empty); @@ -196,20 +258,45 @@ public void MultiPolygon() var one = reader.Read("MULTIPOLYGON (((0.0 65.9, -34.5 9, -20 40, 0 65.9)))"); Assert.Equal( - new MultiPolygon(new Polygon(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), - new Coordinate(40, -20), new Coordinate(65.9, 0)))), one); - + new MultiPolygon( + new Polygon( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ) + ), + one + ); var two = reader.Read( - "MULTIPOLYGON (((0.0 65.9, -34.5 9, -20 40, 0 65.9)),((0.0 65.9, -34.5 9, -20 40, 0 65.9)))"); + "MULTIPOLYGON (((0.0 65.9, -34.5 9, -20 40, 0 65.9)),((0.0 65.9, -34.5 9, -20 40, 0 65.9)))" + ); Assert.Equal( new MultiPolygon( - new Polygon(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), new Coordinate(40, -20), - new Coordinate(65.9, 0))), - new Polygon(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), new Coordinate(40, -20), - new Coordinate(65.9, 0)))), two); + new Polygon( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ), + new Polygon( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ) + ), + two + ); var empty = reader.Read("MULTIPOLYGON ZM EMPTY"); Assert.Equal(new MultiPolygon(), empty); } -} \ No newline at end of file +} diff --git a/Geo.Tests/IO/Wkt/WktWriterTests.cs b/Geo.Tests/IO/Wkt/WktWriterTests.cs index 8e3c53a..0f0a9cc 100644 --- a/Geo.Tests/IO/Wkt/WktWriterTests.cs +++ b/Geo.Tests/IO/Wkt/WktWriterTests.cs @@ -44,14 +44,26 @@ public void LinearRing() { var writer = new WktWriter(); - var lineString = writer.Write(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), - new Coordinate(50, 0), new Coordinate(65.9, 0))); + var lineString = writer.Write( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(50, 0), + new Coordinate(65.9, 0) + ) + ); Assert.Equal("LINESTRING (0 65.9, -34.5 9, 0 50, 0 65.9)", lineString); var writer2 = new WktWriter(new WktWriterSettings { LinearRing = true }); - var linearRing = writer2.Write(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), - new Coordinate(50, 0), new Coordinate(65.9, 0))); + var linearRing = writer2.Write( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(50, 0), + new Coordinate(65.9, 0) + ) + ); Assert.Equal("LINEARRING (0 65.9, -34.5 9, 0 50, 0 65.9)", linearRing); var empty = writer2.Write(Geo.Geometries.LinearRing.Empty); @@ -63,8 +75,16 @@ public void Polygon() { var writer = new WktWriter(); - var xy = writer.Write(new Polygon(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), - new Coordinate(40, -20), new Coordinate(65.9, 0)))); + var xy = writer.Write( + new Polygon( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ) + ); Assert.Equal("POLYGON ((0 65.9, -34.5 9, -20 40, 0 65.9))", xy); var empty = writer.Write(Geo.Geometries.Polygon.Empty); @@ -76,14 +96,30 @@ public void Triangle() { var writer = new WktWriter(); - var polygon = writer.Write(new Triangle(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), - new Coordinate(40, -20), new Coordinate(65.9, 0)))); + var polygon = writer.Write( + new Triangle( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ) + ); Assert.Equal("POLYGON ((0 65.9, -34.5 9, -20 40, 0 65.9))", polygon); var writer2 = new WktWriter(new WktWriterSettings { Triangle = true }); - var triangle = writer2.Write(new Triangle(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), - new Coordinate(40, -20), new Coordinate(65.9, 0)))); + var triangle = writer2.Write( + new Triangle( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ) + ); Assert.Equal("TRIANGLE ((0 65.9, -34.5 9, -20 40, 0 65.9))", triangle); var empty = writer2.Write(Geo.Geometries.Triangle.Empty); @@ -95,10 +131,18 @@ public void GeometryCollection() { var writer = new WktWriter(); - var brackets = writer.Write(new GeometryCollection(new Point(65.9, 0), new Point(9, -34.5), new Point(40, -20), - new Point(65.9, 0))); - Assert.Equal("GEOMETRYCOLLECTION (POINT (0 65.9), POINT (-34.5 9), POINT (-20 40), POINT (0 65.9))", - brackets); + var brackets = writer.Write( + new GeometryCollection( + new Point(65.9, 0), + new Point(9, -34.5), + new Point(40, -20), + new Point(65.9, 0) + ) + ); + Assert.Equal( + "GEOMETRYCOLLECTION (POINT (0 65.9), POINT (-34.5 9), POINT (-20 40), POINT (0 65.9))", + brackets + ); var empty = writer.Write(new GeometryCollection()); Assert.Equal("GEOMETRYCOLLECTION EMPTY", empty); @@ -109,8 +153,14 @@ public void MultiPoint() { var writer = new WktWriter(); - var brackets = writer.Write(new MultiPoint(new Point(65.9, 0), new Point(9, -34.5), new Point(40, -20), - new Point(65.9, 0))); + var brackets = writer.Write( + new MultiPoint( + new Point(65.9, 0), + new Point(9, -34.5), + new Point(40, -20), + new Point(65.9, 0) + ) + ); Assert.Equal("MULTIPOINT ((0 65.9), (-34.5 9), (-20 40), (0 65.9))", brackets); var empty = writer.Write(new MultiPoint()); @@ -122,17 +172,38 @@ public void MultiLineString() { var writer = new WktWriter(); - var one = writer.Write(new MultiLineString(new LineString(new Coordinate(65.9, 0), new Coordinate(9, -34.5), - new Coordinate(40, -20), new Coordinate(65.9, 0)))); + var one = writer.Write( + new MultiLineString( + new LineString( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ) + ); Assert.Equal("MULTILINESTRING ((0 65.9, -34.5 9, -20 40, 0 65.9))", one); - - var two = writer.Write(new MultiLineString( - new LineString(new Coordinate(65.9, 0), new Coordinate(9, -34.5), new Coordinate(40, -20), - new Coordinate(65.9, 0)), - new LineString(new Coordinate(65.9, 0), new Coordinate(9, -34.5), new Coordinate(40, -20), - new Coordinate(65.9, 0)))); - Assert.Equal("MULTILINESTRING ((0 65.9, -34.5 9, -20 40, 0 65.9), (0 65.9, -34.5 9, -20 40, 0 65.9))", two); + var two = writer.Write( + new MultiLineString( + new LineString( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ), + new LineString( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ) + ); + Assert.Equal( + "MULTILINESTRING ((0 65.9, -34.5 9, -20 40, 0 65.9), (0 65.9, -34.5 9, -20 40, 0 65.9))", + two + ); var empty = writer.Write(new MultiLineString()); Assert.Equal("MULTILINESTRING EMPTY", empty); @@ -143,19 +214,46 @@ public void MultiPolygon() { var writer = new WktWriter(); - var one = writer.Write(new MultiPolygon(new Polygon(new LinearRing(new Coordinate(65.9, 0), - new Coordinate(9, -34.5), new Coordinate(40, -20), new Coordinate(65.9, 0))))); + var one = writer.Write( + new MultiPolygon( + new Polygon( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ) + ) + ); Assert.Equal("MULTIPOLYGON (((0 65.9, -34.5 9, -20 40, 0 65.9)))", one); - - var two = writer.Write(new MultiPolygon( - new Polygon(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), new Coordinate(40, -20), - new Coordinate(65.9, 0))), - new Polygon(new LinearRing(new Coordinate(65.9, 0), new Coordinate(9, -34.5), new Coordinate(40, -20), - new Coordinate(65.9, 0))))); - Assert.Equal("MULTIPOLYGON (((0 65.9, -34.5 9, -20 40, 0 65.9)), ((0 65.9, -34.5 9, -20 40, 0 65.9)))", two); + var two = writer.Write( + new MultiPolygon( + new Polygon( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ), + new Polygon( + new LinearRing( + new Coordinate(65.9, 0), + new Coordinate(9, -34.5), + new Coordinate(40, -20), + new Coordinate(65.9, 0) + ) + ) + ) + ); + Assert.Equal( + "MULTIPOLYGON (((0 65.9, -34.5 9, -20 40, 0 65.9)), ((0 65.9, -34.5 9, -20 40, 0 65.9)))", + two + ); var empty = writer.Write(new MultiPolygon()); Assert.Equal("MULTIPOLYGON EMPTY", empty); } -} \ No newline at end of file +} diff --git a/Geo/Abstractions/Geometry.cs b/Geo/Abstractions/Geometry.cs index 4ca4e92..0b1c2ff 100644 --- a/Geo/Abstractions/Geometry.cs +++ b/Geo/Abstractions/Geometry.cs @@ -36,4 +36,4 @@ public string ToGeoJson() { return GeoJson.Serialize(this); } -} \ No newline at end of file +} diff --git a/Geo/Abstractions/Interfaces/IGeoJsonObject.cs b/Geo/Abstractions/Interfaces/IGeoJsonObject.cs index 2a53dbc..dd53cfe 100644 --- a/Geo/Abstractions/Interfaces/IGeoJsonObject.cs +++ b/Geo/Abstractions/Interfaces/IGeoJsonObject.cs @@ -3,4 +3,4 @@ namespace Geo.Abstractions.Interfaces; public interface IGeoJsonObject { string ToGeoJson(); -} \ No newline at end of file +} diff --git a/Geo/Abstractions/Interfaces/IGeodeticCalculator.cs b/Geo/Abstractions/Interfaces/IGeodeticCalculator.cs index 676a968..00dd3e2 100644 --- a/Geo/Abstractions/Interfaces/IGeodeticCalculator.cs +++ b/Geo/Abstractions/Interfaces/IGeodeticCalculator.cs @@ -20,4 +20,4 @@ public interface IGeodeticCalculator double CalculateMeridionalParts(double latitude); double CalculateMeridionalDistance(double latitude); -} \ No newline at end of file +} diff --git a/Geo/Abstractions/Interfaces/IGeometry.cs b/Geo/Abstractions/Interfaces/IGeometry.cs index 2afffd6..c1bea2c 100644 --- a/Geo/Abstractions/Interfaces/IGeometry.cs +++ b/Geo/Abstractions/Interfaces/IGeometry.cs @@ -21,14 +21,8 @@ public interface ICurve : IGeometry, IHasLength bool IsClosed { get; } } -public interface ISurface : IGeometry, IHasArea -{ -} +public interface ISurface : IGeometry, IHasArea { } -public interface IMultiCurve : IGeometry, IHasLength -{ -} +public interface IMultiCurve : IGeometry, IHasLength { } -public interface IMultiSurface : IGeometry, IHasArea -{ -} \ No newline at end of file +public interface IMultiSurface : IGeometry, IHasArea { } diff --git a/Geo/Abstractions/Interfaces/IHasArea.cs b/Geo/Abstractions/Interfaces/IHasArea.cs index 4641fc4..c425b35 100644 --- a/Geo/Abstractions/Interfaces/IHasArea.cs +++ b/Geo/Abstractions/Interfaces/IHasArea.cs @@ -5,4 +5,4 @@ namespace Geo.Abstractions.Interfaces; public interface IHasArea { Area GetArea(); -} \ No newline at end of file +} diff --git a/Geo/Abstractions/Interfaces/IHasLength.cs b/Geo/Abstractions/Interfaces/IHasLength.cs index de99108..4437f17 100644 --- a/Geo/Abstractions/Interfaces/IHasLength.cs +++ b/Geo/Abstractions/Interfaces/IHasLength.cs @@ -5,4 +5,4 @@ namespace Geo.Abstractions.Interfaces; public interface IHasLength { Distance GetLength(); -} \ No newline at end of file +} diff --git a/Geo/Abstractions/Interfaces/IMeasure.cs b/Geo/Abstractions/Interfaces/IMeasure.cs index 8b7f3ff..8d339a9 100644 --- a/Geo/Abstractions/Interfaces/IMeasure.cs +++ b/Geo/Abstractions/Interfaces/IMeasure.cs @@ -3,4 +3,4 @@ namespace Geo.Abstractions.Interfaces; public interface IMeasure { double SiValue { get; } -} \ No newline at end of file +} diff --git a/Geo/Abstractions/Interfaces/IPosition.cs b/Geo/Abstractions/Interfaces/IPosition.cs index e2c4913..16943c4 100644 --- a/Geo/Abstractions/Interfaces/IPosition.cs +++ b/Geo/Abstractions/Interfaces/IPosition.cs @@ -3,4 +3,4 @@ namespace Geo.Abstractions.Interfaces; public interface IPosition { Coordinate GetCoordinate(); -} \ No newline at end of file +} diff --git a/Geo/Abstractions/Interfaces/ISpatialEquatable.cs b/Geo/Abstractions/Interfaces/ISpatialEquatable.cs index 2f3a91a..f5ce549 100644 --- a/Geo/Abstractions/Interfaces/ISpatialEquatable.cs +++ b/Geo/Abstractions/Interfaces/ISpatialEquatable.cs @@ -6,4 +6,4 @@ public interface ISpatialEquatable bool Equals2D(object obj); bool Equals3D(object obj); int GetHashCode(SpatialEqualityOptions options); -} \ No newline at end of file +} diff --git a/Geo/Abstractions/Interfaces/Is3D.cs b/Geo/Abstractions/Interfaces/Is3D.cs index a69e5eb..6220179 100644 --- a/Geo/Abstractions/Interfaces/Is3D.cs +++ b/Geo/Abstractions/Interfaces/Is3D.cs @@ -3,4 +3,4 @@ public interface Is3D { double Elevation { get; } -} \ No newline at end of file +} diff --git a/Geo/Abstractions/Interfaces/IsMeasured.cs b/Geo/Abstractions/Interfaces/IsMeasured.cs index 8ecffe7..1811299 100644 --- a/Geo/Abstractions/Interfaces/IsMeasured.cs +++ b/Geo/Abstractions/Interfaces/IsMeasured.cs @@ -3,4 +3,4 @@ public interface IsMeasured { double Measure { get; } -} \ No newline at end of file +} diff --git a/Geo/Abstractions/SpatialObject.cs b/Geo/Abstractions/SpatialObject.cs index a5448c4..8f7a46d 100644 --- a/Geo/Abstractions/SpatialObject.cs +++ b/Geo/Abstractions/SpatialObject.cs @@ -46,4 +46,4 @@ public static bool Equals3D(object obj1, object obj2) { return Equals(obj1, obj2, GeoContext.Current.EqualityOptions.To3D()); } -} \ No newline at end of file +} diff --git a/Geo/Abstractions/SpatialReadOnlyCollection.cs b/Geo/Abstractions/SpatialReadOnlyCollection.cs index aa38306..dbca556 100644 --- a/Geo/Abstractions/SpatialReadOnlyCollection.cs +++ b/Geo/Abstractions/SpatialReadOnlyCollection.cs @@ -8,9 +8,8 @@ namespace Geo.Abstractions; public class SpatialReadOnlyCollection : ReadOnlyCollection, ISpatialEquatable where TElement : ISpatialEquatable { - public SpatialReadOnlyCollection(IEnumerable list) : base(list.ToList()) - { - } + public SpatialReadOnlyCollection(IEnumerable list) + : base(list.ToList()) { } public bool IsEmpty => Count == 0; @@ -24,15 +23,12 @@ public bool Equals(object obj, SpatialEqualityOptions options) if (Count != other.Count) return false; - return !this - .Where((t, i) => !SpatialObject.Equals(t, other[i], options)) - .Any(); + return !this.Where((t, i) => !SpatialObject.Equals(t, other[i], options)).Any(); } public int GetHashCode(SpatialEqualityOptions options) { - return this - .Select(x => x.GetHashCode(options)) + return this.Select(x => x.GetHashCode(options)) .Aggregate(0, (current, result) => (current * 397) ^ result); } @@ -64,4 +60,4 @@ public static bool Equals(object obj1, object obj2, SpatialEqualityOptions optio return Equals(obj1, obj2); } -} \ No newline at end of file +} diff --git a/Geo/Constants.cs b/Geo/Constants.cs index 5b95ef0..c957618 100644 --- a/Geo/Constants.cs +++ b/Geo/Constants.cs @@ -4,4 +4,4 @@ internal class Constants { public const double NauticalMile = 1852d; public const double EarthMeanRadius = 6371008.7714d; -} \ No newline at end of file +} diff --git a/Geo/Coordinate.cs b/Geo/Coordinate.cs index 9e70fc7..5b02ce4 100644 --- a/Geo/Coordinate.cs +++ b/Geo/Coordinate.cs @@ -8,16 +8,15 @@ namespace Geo; public class Coordinate : SpatialObject, IPosition { - private const string CoordinateRegex - = @"^[\(\[\{\s]*" - + @"(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)[°Dd\s]*(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)?[°'′Mm\s]*(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)?[\""″\s]*(?[NnSsEeWw])?" - + @"[,\s]+" - + @"(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)[°Dd\s]*(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)?[°'′Mm\s]*(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)?[\""″\s]*(?[NnSsEeWw])?" - + @"[\)\]\}\s]*$"; - - public Coordinate() : this(0, 0) - { - } + private const string CoordinateRegex = + @"^[\(\[\{\s]*" + + @"(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)[°Dd\s]*(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)?[°'′Mm\s]*(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)?[\""″\s]*(?[NnSsEeWw])?" + + @"[,\s]+" + + @"(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)[°Dd\s]*(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)?[°'′Mm\s]*(?[+-]?(?:\d+\.?\d*|\d*\.?\d+)[\r\n]*)?[\""″\s]*(?[NnSsEeWw])?" + + @"[\)\]\}\s]*$"; + + public Coordinate() + : this(0, 0) { } public Coordinate(double latitude, double longitude) { @@ -152,8 +151,10 @@ public override bool Equals(object obj, SpatialEqualityOptions options) return true; if (options.AntiMeridianCoordinatesAreEqual) - if ((Longitude.Equals(180) && other.Longitude.Equals(-180)) || - (Longitude.Equals(-180) && other.Longitude.Equals(180))) + if ( + (Longitude.Equals(180) && other.Longitude.Equals(-180)) + || (Longitude.Equals(-180) && other.Longitude.Equals(180)) + ) return true; } @@ -201,4 +202,4 @@ public override int GetHashCode(SpatialEqualityOptions options) } #endregion -} \ No newline at end of file +} diff --git a/Geo/CoordinateM.cs b/Geo/CoordinateM.cs index 0efde5d..172e78a 100644 --- a/Geo/CoordinateM.cs +++ b/Geo/CoordinateM.cs @@ -5,7 +5,8 @@ namespace Geo; public class CoordinateM : Coordinate, IsMeasured { - public CoordinateM(double latitude, double longitude, double measure) : base(latitude, longitude) + public CoordinateM(double latitude, double longitude, double measure) + : base(latitude, longitude) { if (double.IsNaN(measure) || double.IsInfinity(measure)) throw new ArgumentOutOfRangeException("measure"); @@ -42,8 +43,10 @@ public override bool Equals(object obj, SpatialEqualityOptions options) return true; if (options.AntiMeridianCoordinatesAreEqual) - if ((Longitude.Equals(180) && other.Longitude.Equals(-180)) || - (Longitude.Equals(-180) && other.Longitude.Equals(180))) + if ( + (Longitude.Equals(180) && other.Longitude.Equals(-180)) + || (Longitude.Equals(-180) && other.Longitude.Equals(180)) + ) return true; } @@ -81,4 +84,4 @@ public override int GetHashCode(SpatialEqualityOptions options) } #endregion -} \ No newline at end of file +} diff --git a/Geo/CoordinateSequence.cs b/Geo/CoordinateSequence.cs index 6758864..dc5c536 100644 --- a/Geo/CoordinateSequence.cs +++ b/Geo/CoordinateSequence.cs @@ -6,17 +6,14 @@ namespace Geo; public class CoordinateSequence : SpatialReadOnlyCollection { - public CoordinateSequence() : base(new List()) - { - } + public CoordinateSequence() + : base(new List()) { } - public CoordinateSequence(IEnumerable coordinates) : base(coordinates.ToList()) - { - } + public CoordinateSequence(IEnumerable coordinates) + : base(coordinates.ToList()) { } - public CoordinateSequence(params Coordinate[] coordinates) : base(coordinates.ToList()) - { - } + public CoordinateSequence(params Coordinate[] coordinates) + : base(coordinates.ToList()) { } public bool HasElevation { @@ -34,8 +31,12 @@ public Envelope GetBounds() { return IsEmpty ? null - : new Envelope(this.Min(x => x.Latitude), this.Min(x => x.Longitude), this.Max(x => x.Latitude), - this.Max(x => x.Longitude)); + : new Envelope( + this.Min(x => x.Latitude), + this.Min(x => x.Longitude), + this.Max(x => x.Latitude), + this.Max(x => x.Longitude) + ); } public IEnumerable ToLineSegments() @@ -74,4 +75,4 @@ public override int GetHashCode() } #endregion -} \ No newline at end of file +} diff --git a/Geo/CoordinateZ.cs b/Geo/CoordinateZ.cs index 57b18dd..9937675 100644 --- a/Geo/CoordinateZ.cs +++ b/Geo/CoordinateZ.cs @@ -5,7 +5,8 @@ namespace Geo; public class CoordinateZ : Coordinate, Is3D { - public CoordinateZ(double latitude, double longitude, double elevation) : base(latitude, longitude) + public CoordinateZ(double latitude, double longitude, double elevation) + : base(latitude, longitude) { if (double.IsNaN(elevation) || double.IsInfinity(elevation)) throw new ArgumentOutOfRangeException("elevation"); @@ -42,8 +43,10 @@ public override bool Equals(object obj, SpatialEqualityOptions options) return true; if (options.AntiMeridianCoordinatesAreEqual) - if ((Longitude.Equals(180) && other.Longitude.Equals(-180)) || - (Longitude.Equals(-180) && other.Longitude.Equals(180))) + if ( + (Longitude.Equals(180) && other.Longitude.Equals(-180)) + || (Longitude.Equals(-180) && other.Longitude.Equals(180)) + ) return true; } @@ -81,4 +84,4 @@ public override int GetHashCode(SpatialEqualityOptions options) } #endregion -} \ No newline at end of file +} diff --git a/Geo/CoordinateZM.cs b/Geo/CoordinateZM.cs index 6023554..57eedbc 100644 --- a/Geo/CoordinateZM.cs +++ b/Geo/CoordinateZM.cs @@ -53,8 +53,10 @@ public override bool Equals(object obj, SpatialEqualityOptions options) return true; if (options.AntiMeridianCoordinatesAreEqual) - if ((Longitude.Equals(180) && other.Longitude.Equals(-180)) || - (Longitude.Equals(-180) && other.Longitude.Equals(180))) + if ( + (Longitude.Equals(180) && other.Longitude.Equals(-180)) + || (Longitude.Equals(-180) && other.Longitude.Equals(180)) + ) return true; } @@ -94,4 +96,4 @@ public override int GetHashCode(SpatialEqualityOptions options) } #endregion -} \ No newline at end of file +} diff --git a/Geo/Envelope.cs b/Geo/Envelope.cs index b6fe0eb..aff16b9 100644 --- a/Geo/Envelope.cs +++ b/Geo/Envelope.cs @@ -47,24 +47,24 @@ public Envelope Combine(Envelope other) public bool Intersects(Envelope envelope) { return envelope.GetExtremeCoordinates().Any(Contains) - || GetExtremeCoordinates().Any(envelope.Contains); + || GetExtremeCoordinates().Any(envelope.Contains); } public bool Contains(Envelope envelope) { return envelope != null - && envelope.MinLat > MinLat - && envelope.MaxLat < MaxLat - && envelope.MinLon > MinLon - && envelope.MaxLon < MaxLon; + && envelope.MinLat > MinLat + && envelope.MaxLat < MaxLat + && envelope.MinLon > MinLon + && envelope.MaxLon < MaxLon; } public bool Contains(Coordinate coordinate) { return coordinate.Latitude > MinLat - && coordinate.Latitude < MaxLat - && coordinate.Longitude > MinLon - && coordinate.Longitude < MaxLon; + && coordinate.Latitude < MaxLat + && coordinate.Longitude > MinLon + && coordinate.Longitude < MaxLon; } public bool Contains(IGeometry geometry) @@ -80,7 +80,7 @@ private IEnumerable GetExtremeCoordinates() new Coordinate(MaxLat, MinLon), new Coordinate(MaxLat, MaxLon), new Coordinate(MinLat, MaxLon), - new Coordinate(MinLat, MinLon) + new Coordinate(MinLat, MinLon), }; } @@ -88,15 +88,21 @@ private IEnumerable GetExtremeCoordinates() public bool Equals(Envelope other) { - return !ReferenceEquals(null, other) && MinLat.Equals(other.MinLat) && MinLon.Equals(other.MinLon) && - MaxLat.Equals(other.MaxLat) && MaxLon.Equals(other.MaxLon); + return !ReferenceEquals(null, other) + && MinLat.Equals(other.MinLat) + && MinLon.Equals(other.MinLon) + && MaxLat.Equals(other.MaxLat) + && MaxLon.Equals(other.MaxLon); } public override bool Equals(object obj) { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != GetType()) return false; + if (ReferenceEquals(null, obj)) + return false; + if (ReferenceEquals(this, obj)) + return true; + if (obj.GetType() != GetType()) + return false; return Equals((Envelope)obj); } @@ -125,4 +131,4 @@ public override int GetHashCode() } #endregion -} \ No newline at end of file +} diff --git a/Geo/GeoContext.cs b/Geo/GeoContext.cs index 19f51ca..542179c 100644 --- a/Geo/GeoContext.cs +++ b/Geo/GeoContext.cs @@ -8,9 +8,8 @@ public class GeoContext { private static GeoContext _current; - public GeoContext() : this(Spheroid.Default) - { - } + public GeoContext() + : this(Spheroid.Default) { } public GeoContext(Spheroid spheroid) { @@ -32,4 +31,4 @@ public static GeoContext Current public GeomagnetismCalculator GeomagnetismCalculator { get; set; } public SpatialEqualityOptions EqualityOptions { get; set; } public bool LongitudeWrapping { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Geodesy/GeodeticCalculations.cs b/Geo/Geodesy/GeodeticCalculations.cs index c8ffe44..cb2e167 100644 --- a/Geo/Geodesy/GeodeticCalculations.cs +++ b/Geo/Geodesy/GeodeticCalculations.cs @@ -7,13 +7,18 @@ public static class GeodeticCalculations { public static double CalculateMeridionalParts(this IPosition point) { - return GeoContext.Current.GeodeticCalculator.CalculateMeridionalParts(point.GetCoordinate().Latitude); + return GeoContext.Current.GeodeticCalculator.CalculateMeridionalParts( + point.GetCoordinate().Latitude + ); } public static Distance CalculateMeridionalDistance(this IPosition point) { return new Distance( - GeoContext.Current.GeodeticCalculator.CalculateMeridionalDistance(point.GetCoordinate().Latitude)); + GeoContext.Current.GeodeticCalculator.CalculateMeridionalDistance( + point.GetCoordinate().Latitude + ) + ); } public static GeodeticLine CalculateShortestLine(this IPosition point1, IPosition point2) @@ -30,4 +35,4 @@ public static GeodeticLine CalculateRhumbLine(this IPosition point1, IPosition p { return GeoContext.Current.GeodeticCalculator.CalculateLoxodromicLine(point1, point2); } -} \ No newline at end of file +} diff --git a/Geo/Geodesy/GeodeticLine.cs b/Geo/Geodesy/GeodeticLine.cs index 252a3eb..f5a3a9e 100644 --- a/Geo/Geodesy/GeodeticLine.cs +++ b/Geo/Geodesy/GeodeticLine.cs @@ -4,8 +4,14 @@ namespace Geo.Geodesy; public class GeodeticLine : LineSegment { - public GeodeticLine(Coordinate coordinate1, Coordinate coordinate2, double distance, double bearing12, - double bearing21) : base(coordinate1, coordinate2) + public GeodeticLine( + Coordinate coordinate1, + Coordinate coordinate2, + double distance, + double bearing12, + double bearing21 + ) + : base(coordinate1, coordinate2) { Bearing12 = bearing12.NormalizeDegrees(); Bearing21 = bearing21.NormalizeDegrees(); @@ -21,9 +27,12 @@ public GeodeticLine(Coordinate coordinate1, Coordinate coordinate2, double dista public override bool Equals(object obj, SpatialEqualityOptions options) { var other = obj as GeodeticLine; - return !ReferenceEquals(null, other) && Equals(Coordinate1, other.Coordinate1, options) && - Equals(Coordinate2, other.Coordinate2, options) && Distance.Equals(other.Distance) && - Bearing12.Equals(other.Bearing12) && Bearing21.Equals(other.Bearing21); + return !ReferenceEquals(null, other) + && Equals(Coordinate1, other.Coordinate1, options) + && Equals(Coordinate2, other.Coordinate2, options) + && Distance.Equals(other.Distance) + && Bearing12.Equals(other.Bearing12) + && Bearing21.Equals(other.Bearing21); } public override int GetHashCode(SpatialEqualityOptions options) @@ -31,7 +40,8 @@ public override int GetHashCode(SpatialEqualityOptions options) unchecked { var hashCode = Coordinate1 != null ? Coordinate1.GetHashCode(options) : 0; - hashCode = (hashCode * 397) ^ (Coordinate2 != null ? Coordinate2.GetHashCode(options) : 0); + hashCode = + (hashCode * 397) ^ (Coordinate2 != null ? Coordinate2.GetHashCode(options) : 0); hashCode = (hashCode * 397) ^ Distance.GetHashCode(); hashCode = (hashCode * 397) ^ Bearing12.GetHashCode(); hashCode = (hashCode * 397) ^ Bearing21.GetHashCode(); @@ -62,4 +72,4 @@ public override int GetHashCode() } #endregion -} \ No newline at end of file +} diff --git a/Geo/Geodesy/SphereCalculator.cs b/Geo/Geodesy/SphereCalculator.cs index ec32b73..4dff723 100644 --- a/Geo/Geodesy/SphereCalculator.cs +++ b/Geo/Geodesy/SphereCalculator.cs @@ -7,9 +7,8 @@ namespace Geo.Geodesy; public class SphereCalculator : IGeodeticCalculator { - public SphereCalculator() : this(Constants.EarthMeanRadius) - { - } + public SphereCalculator() + : this(Constants.EarthMeanRadius) { } public SphereCalculator(double radius) { @@ -18,7 +17,6 @@ public SphereCalculator(double radius) public double Radius { get; protected set; } - public GeodeticLine CalculateOrthodromicLine(IPosition point, double heading, double distance) { throw new NotImplementedException(); @@ -75,9 +73,9 @@ public Area CalculateArea(CoordinateSequence coordinates) { var p1 = coordinates[i]; var p2 = coordinates[i + 1]; - area += (p2.Longitude - p1.Longitude).ToRadians() * - (2 + Math.Sin(p1.Latitude.ToRadians()) + - Math.Sin(p2.Latitude.ToRadians())); + area += + (p2.Longitude - p1.Longitude).ToRadians() + * (2 + Math.Sin(p1.Latitude.ToRadians()) + Math.Sin(p2.Latitude.ToRadians())); } area = area * Radius * Radius / 2.0; @@ -117,4 +115,4 @@ public double CalculateMeridionalDistance(double latitude) { throw new NotImplementedException(); } -} \ No newline at end of file +} diff --git a/Geo/Geodesy/Spheroid.cs b/Geo/Geodesy/Spheroid.cs index 29b7f6a..fba4e55 100644 --- a/Geo/Geodesy/Spheroid.cs +++ b/Geo/Geodesy/Spheroid.cs @@ -34,4 +34,4 @@ public Spheroid(string name, double equatorialAxis, double inverseFlattening) public double Eccentricity { get; } public double MeanRadius { get; } public bool IsSphere { get; } -} \ No newline at end of file +} diff --git a/Geo/Geodesy/SpheroidCalculator.cs b/Geo/Geodesy/SpheroidCalculator.cs index 979c39c..efb1fa5 100644 --- a/Geo/Geodesy/SpheroidCalculator.cs +++ b/Geo/Geodesy/SpheroidCalculator.cs @@ -13,9 +13,8 @@ public class SpheroidCalculator : IGeodeticCalculator { private readonly SphereCalculator _sphereCalculator = new(); - public SpheroidCalculator() : this(Spheroid.Default) - { - } + public SpheroidCalculator() + : this(Spheroid.Default) { } public SpheroidCalculator(Spheroid spheroid) { @@ -30,8 +29,8 @@ public GeodeticLine CalculateOrthodromicLine(IPosition point, double heading, do var lon1 = point.GetCoordinate().Longitude.ToRadians(); var faz = heading.ToRadians(); - // glat1 initial geodetic latitude in radians N positive - // glon1 initial geodetic longitude in radians E positive + // glat1 initial geodetic latitude in radians N positive + // glon1 initial geodetic longitude in radians E positive // faz forward azimuth in radians // s distance in units of a (=nm) @@ -66,8 +65,10 @@ public GeodeticLine CalculateOrthodromicLine(IPosition point, double heading, do var y = tu; c = y + 1; - double sy = 0, cy = 0, cz = 0, e = 0; - + double sy = 0, + cy = 0, + cz = 0, + e = 0; while (Math.Abs(y - c) > EPS) { @@ -78,8 +79,7 @@ public GeodeticLine CalculateOrthodromicLine(IPosition point, double heading, do c = y; x = e * cy; y = e + e - 1; - y = (((sy * sy * 4 - 3) * y * cz * d / 6 + x) * - d / 4 - cz) * sy * d + tu; + y = (((sy * sy * 4 - 3) * y * cz * d / 6 + x) * d / 4 - cz) * sy * d + tu; } b = cu * cy * cf - su * sy; @@ -90,12 +90,16 @@ public GeodeticLine CalculateOrthodromicLine(IPosition point, double heading, do x = Math.Atan2(sy * sf, c); c = ((-3 * c2a + 4) * Spheroid.Flattening + 4) * c2a * Spheroid.Flattening / 16; d = ((e * cy * c + cz) * sy * c + y) * sa; - var glon2 = modlon(lon1 + x - (1 - c) * d * Spheroid.Flattening); // fix date line problems + var glon2 = modlon(lon1 + x - (1 - c) * d * Spheroid.Flattening); // fix date line problems var baz = modcrs(Math.Atan2(sa, b) + Math.PI); - return new GeodeticLine(new Coordinate(point.GetCoordinate().Latitude, point.GetCoordinate().Longitude), + return new GeodeticLine( + new Coordinate(point.GetCoordinate().Latitude, point.GetCoordinate().Longitude), new Coordinate(glat2.ToDegrees(), glon2.ToDegrees()), - distance, heading, baz); + distance, + heading, + baz + ); } public GeodeticLine CalculateOrthodromicLine(IPosition position1, IPosition position2) @@ -103,7 +107,13 @@ public GeodeticLine CalculateOrthodromicLine(IPosition position1, IPosition posi var result = CalculateOrthodromicLineInternal(position1, position2); if (result == null) return null; - return new GeodeticLine(position1.GetCoordinate(), position2.GetCoordinate(), result[0], result[1], result[2]); + return new GeodeticLine( + position1.GetCoordinate(), + position2.GetCoordinate(), + result[0], + result[1], + result[2] + ); } public GeodeticLine CalculateLoxodromicLine(IPosition position1, IPosition position2) @@ -120,7 +130,8 @@ public GeodeticLine CalculateLoxodromicLine(IPosition position1, IPosition posit double distance; var latDeltaRad = (lat2 - lat1).ToRadians(); - var meridionalDistance = CalculateMeridionalDistance(lat2) - CalculateMeridionalDistance(lat1); + var meridionalDistance = + CalculateMeridionalDistance(lat2) - CalculateMeridionalDistance(lat1); var course = LoxodromicLineCourse(lat1, lon1, lat2, lon2); if (Math.Abs(latDeltaRad) < 0.0008) @@ -137,22 +148,37 @@ public GeodeticLine CalculateLoxodromicLine(IPosition position1, IPosition posit var midLatRad = (0.5 * (lat1 + lat2)).ToRadians(); // expand merid_dist/dmp about lat_mid_rad to order e2*dlat_rad^2 var e2 = Math.Pow(Spheroid.Eccentricity, 2); - var ratio = Math.Cos(midLatRad) / - Math.Sqrt(1 - e2 * Math.Pow(Math.Sin(midLatRad), 2)) * - (1.0 + (e2 * Math.Cos(2 * midLatRad) / 8 - - (1 + 2 * Math.Pow(Math.Tan(midLatRad), 2)) / 24 - - e2 / 12) * latDeltaRad * latDeltaRad); - - distance = Math.Sqrt(Math.Pow(meridionalDistance, 2) + - Math.Pow(Spheroid.EquatorialAxis * ratio * lonDeltaRad, 2)); + var ratio = + Math.Cos(midLatRad) + / Math.Sqrt(1 - e2 * Math.Pow(Math.Sin(midLatRad), 2)) + * ( + 1.0 + + ( + e2 * Math.Cos(2 * midLatRad) / 8 + - (1 + 2 * Math.Pow(Math.Tan(midLatRad), 2)) / 24 + - e2 / 12 + ) + * latDeltaRad + * latDeltaRad + ); + + distance = Math.Sqrt( + Math.Pow(meridionalDistance, 2) + + Math.Pow(Spheroid.EquatorialAxis * ratio * lonDeltaRad, 2) + ); } else { distance = Math.Abs(meridionalDistance / Math.Cos(course.ToRadians())); } - return new GeodeticLine(new Coordinate(lat1, lon1), new Coordinate(lat2, lon2), distance, course, - course > 180 ? course - 180 : course + 180); + return new GeodeticLine( + new Coordinate(lat1, lon1), + new Coordinate(lat2, lon2), + distance, + course, + course > 180 ? course - 180 : course + 180 + ); } public Distance CalculateLength(Circle circle) @@ -181,10 +207,17 @@ public Distance CalculateLength(Envelope envelope) public double CalculateMeridionalParts(double latitude) { var lat = latitude.ToRadians(); - var a = Spheroid.EquatorialAxis * (Math.Log(Math.Tan(0.5 * lat + Math.PI / 4.0)) + - Spheroid.Eccentricity / 2.0 * - Math.Log((1 - Spheroid.Eccentricity * Math.Sin(lat)) / - (1 + Spheroid.Eccentricity * Math.Sin(lat)))); + var a = + Spheroid.EquatorialAxis + * ( + Math.Log(Math.Tan(0.5 * lat + Math.PI / 4.0)) + + Spheroid.Eccentricity + / 2.0 + * Math.Log( + (1 - Spheroid.Eccentricity * Math.Sin(lat)) + / (1 + Spheroid.Eccentricity * Math.Sin(lat)) + ) + ); return a / Constants.NauticalMile; } @@ -197,11 +230,17 @@ public double CalculateMeridionalDistance(double latitude) var b4 = 15 / 256.0 * (1 + 3 * e2 / 4 * (1 + 35 * e2 / 48)); var b6 = -(35 / 3072.0) * (1 + 5 * e2 / 4); const double b8 = 315 / 131072.0; - var dist = b0 * lat + - e2 * (b2 * Math.Sin(2 * lat) + - e2 * (b4 * Math.Sin(4 * lat) + - e2 * (b6 * Math.Sin(6 * lat) + - e2 * (b8 * Math.Sin(8 * lat))))); + var dist = + b0 * lat + + e2 + * ( + b2 * Math.Sin(2 * lat) + + e2 + * ( + b4 * Math.Sin(4 * lat) + + e2 * (b6 * Math.Sin(6 * lat) + e2 * (b8 * Math.Sin(8 * lat))) + ) + ); return dist * Spheroid.EquatorialAxis; } @@ -245,8 +284,10 @@ private double[] CalculateOrthodromicLineInternal(IPosition position1, IPosition var point1 = position1.GetCoordinate(); var point2 = position2.GetCoordinate(); - if (Math.Abs(point1.Latitude - point2.Latitude) < double.Epsilon && - Math.Abs(point1.Longitude - point2.Longitude) < double.Epsilon) + if ( + Math.Abs(point1.Latitude - point2.Latitude) < double.Epsilon + && Math.Abs(point1.Longitude - point2.Longitude) < double.Epsilon + ) return null; var lon1 = point1.Longitude.ToRadians(); @@ -295,7 +336,8 @@ private double[] CalculateOrthodromicLineInternal(IPosition position1, IPosition var SA = s * sx / sy; var c2a = 1 - SA * SA; var cz = faz + faz; - if (c2a > 0) cz = -cz / c2a + cy; + if (c2a > 0) + cz = -cz / c2a + cy; var e = cz * cz * 2 - 1; var c = ((-3 * c2a + 4) * Spheroid.Flattening + 4) * c2a * Spheroid.Flattening / 16; var d = x; @@ -322,8 +364,11 @@ private double[] CalculateOrthodromicLineInternal(IPosition position1, IPosition d = (0.375 * x * x - 1) * x; x = e * cy; s = 1 - 2 * e; - s = ((((sy * sy * 4 - 3) * s * cz * d / 6 - x) * d / 4 + cz) * sy * d + y) * c * R * - Spheroid.EquatorialAxis; + s = + ((((sy * sy * 4 - 3) * s * cz * d / 6 - x) * d / 4 + cz) * sy * d + y) + * c + * R + * Spheroid.EquatorialAxis; // 'faz' and 'baz' are forward azimuths at both points. faz = Math.Atan2(tu1, tu2); baz = Math.Atan2(cu1 * sx, baz * cx - su1 * cu2) + Math.PI; @@ -339,7 +384,12 @@ private double[] CalculateOrthodromicLineInternal(IPosition position1, IPosition return null; if (Math.Abs(lat1) <= leps && Math.Abs(lat2) <= leps) // Points are on the equator. - return new[] { Math.Abs(lon1 - lon2) * Spheroid.EquatorialAxis, faz.ToDegrees(), baz.ToDegrees() }; + return new[] + { + Math.Abs(lon1 - lon2) * Spheroid.EquatorialAxis, + faz.ToDegrees(), + baz.ToDegrees(), + }; // Other cases: no solution for this algorithm. throw new ArithmeticException(); } @@ -357,7 +407,9 @@ private double LoxodromicLineCourse(double lat1, double lon1, double lat2, doubl var lonDeltaRad = lonDelta.ToRadians(); // Calculate course and distance - var course = Math.Atan(Spheroid.EquatorialAxis / Constants.NauticalMile * lonDeltaRad / mpDelta); + var course = Math.Atan( + Spheroid.EquatorialAxis / Constants.NauticalMile * lonDeltaRad / mpDelta + ); var courseDeg = course.ToDegrees(); if (latDelta >= 0) @@ -368,4 +420,4 @@ private double LoxodromicLineCourse(double lat1, double lon1, double lat2, doubl courseDeg = courseDeg - 360; return courseDeg; } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/GeomagnetismCalculator.cs b/Geo/Geomagnetism/GeomagnetismCalculator.cs index fd757f0..5204aa6 100644 --- a/Geo/Geomagnetism/GeomagnetismCalculator.cs +++ b/Geo/Geomagnetism/GeomagnetismCalculator.cs @@ -10,20 +10,19 @@ public class GeomagnetismCalculator { private readonly Spheroid _spheroid; - public GeomagnetismCalculator() : this(Spheroid.Default, null) - { - } + public GeomagnetismCalculator() + : this(Spheroid.Default, null) { } - public GeomagnetismCalculator(IEnumerable geomagneticModels) : this(Spheroid.Default, - geomagneticModels) - { - } + public GeomagnetismCalculator(IEnumerable geomagneticModels) + : this(Spheroid.Default, geomagneticModels) { } - public GeomagnetismCalculator(Spheroid spheroid) : this(spheroid, null) - { - } + public GeomagnetismCalculator(Spheroid spheroid) + : this(spheroid, null) { } - public GeomagnetismCalculator(Spheroid spheroid, IEnumerable geomagneticModels) + public GeomagnetismCalculator( + Spheroid spheroid, + IEnumerable geomagneticModels + ) { _spheroid = spheroid; if (geomagneticModels != null) @@ -52,14 +51,18 @@ public bool TryCalculate(IPosition position, DateTimeOffset date, out Geomagneti public bool TryCalculate(IPosition position, DateTime utcDate, out GeomagnetismResult result) { var coordinate = position.GetCoordinate(); - var coordinateZ = coordinate as CoordinateZ ?? new CoordinateZ(coordinate.Latitude, coordinate.Longitude, 0); + var coordinateZ = + coordinate as CoordinateZ + ?? new CoordinateZ(coordinate.Latitude, coordinate.Longitude, 0); double lat = coordinateZ.Latitude.ToRadians(), lon = coordinateZ.Longitude.ToRadians(), ele = coordinateZ.Elevation / 1000, dat = JulianDate.JD(utcDate); - var model = Models.SingleOrDefault(mod => mod.ValidFrom <= utcDate && mod.ValidTo > utcDate); + var model = Models.SingleOrDefault(mod => + mod.ValidFrom <= utcDate && mod.ValidTo > utcDate + ); if (model == null) { @@ -84,7 +87,8 @@ public bool TryCalculate(IPosition position, DateTime utcDate, out GeomagnetismR var sr = Math.Sqrt(a2 * cosLat2 + b2 * sinLat2); var theta = Math.Atan2(cosLat * (ele * sr + a2), sinLat * (ele * sr + b2)); - var r = ele * ele + 2.0 * ele * sr + (a4 - (a4 - b4) * sinLat2) / (a2 - (a2 - b2) * sinLat2); + var r = + ele * ele + 2.0 * ele * sr + (a4 - (a4 - b4) * sinLat2) / (a2 - (a2 - b2) * sinLat2); r = Math.Sqrt(r); @@ -97,7 +101,6 @@ public bool TryCalculate(IPosition position, DateTime utcDate, out GeomagnetismR else invS = 1.0 / (s + 0.0); - var p = new double[bound, bound]; var dp = new double[bound, bound]; @@ -123,16 +126,22 @@ public bool TryCalculate(IPosition position, DateTime utcDate, out GeomagnetismR var root1 = Math.Sqrt((j - 1) * (j - 1) - i2); var root2 = 1.0 / Math.Sqrt(j * j - i2); p[j, i] = (p[j - 1, i] * c * (2.0 * j - 1) - p[j - 2, i] * root1) * root2; - dp[j, i] = ((dp[j - 1, i] * c - p[j - 1, i] * s) * (2.0 * j - 1) - dp[j - 2, i] * root1) * root2; + dp[j, i] = + ((dp[j - 1, i] * c - p[j - 1, i] * s) * (2.0 * j - 1) - dp[j - 2, i] * root1) + * root2; } } - double[,] g = new double[bound, bound], h = new double[bound, bound]; - double bRadial = 0.0, bTheta = 0.0, bPhi = 0.0; + double[,] g = new double[bound, bound], + h = new double[bound, bound]; + double bRadial = 0.0, + bTheta = 0.0, + bPhi = 0.0; var fn0 = _spheroid.MeanRadius / 1000 / r; var fn = fn0 * fn0; - double[] sm = new double[bound], cm = new double[bound]; + double[] sm = new double[bound], + cm = new double[bound]; sm[0] = Math.Sin(0); cm[0] = Math.Cos(0); @@ -144,11 +153,15 @@ public bool TryCalculate(IPosition position, DateTime utcDate, out GeomagnetismR for (var j = 0; j < bound; j++) { - g[i, j] = model.MainCoefficientsG[i, j] + yearfrac * model.SecularCoefficientsG[i, j]; - h[i, j] = model.MainCoefficientsH[i, j] + yearfrac * model.SecularCoefficientsH[i, j]; + g[i, j] = + model.MainCoefficientsG[i, j] + yearfrac * model.SecularCoefficientsG[i, j]; + h[i, j] = + model.MainCoefficientsH[i, j] + yearfrac * model.SecularCoefficientsH[i, j]; } - double c1 = 0, c2 = 0, c3 = 0; + double c1 = 0, + c2 = 0, + c3 = 0; for (var j = 0; j <= i; j++) { var c0 = g[i, j] * cm[j] + h[i, j] * sm[j]; @@ -163,7 +176,6 @@ public bool TryCalculate(IPosition position, DateTime utcDate, out GeomagnetismR bPhi += c3 * fn * invS; } - var psi = theta - (Math.PI / 2.0 - lat); var sinPsi = Math.Sin(psi); var cosPsi = Math.Cos(psi); @@ -171,7 +183,13 @@ public bool TryCalculate(IPosition position, DateTime utcDate, out GeomagnetismR var x = -bTheta * cosPsi - bRadial * sinPsi; var y = bPhi; var z = bTheta * sinPsi - bRadial * cosPsi; - result = new GeomagnetismResult(coordinateZ, new DateTime(utcDate.Ticks, DateTimeKind.Utc), x, y, z); + result = new GeomagnetismResult( + coordinateZ, + new DateTime(utcDate.Ticks, DateTimeKind.Utc), + x, + y, + z + ); return true; } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/GeomagnetismResult.cs b/Geo/Geomagnetism/GeomagnetismResult.cs index e317c53..87493a4 100644 --- a/Geo/Geomagnetism/GeomagnetismResult.cs +++ b/Geo/Geomagnetism/GeomagnetismResult.cs @@ -35,8 +35,16 @@ public GeomagnetismResult(CoordinateZ coordinate, DateTime date, double x, doubl public override string ToString() { - return string.Format(CultureInfo.InvariantCulture, - "Magnetic Field[D={0}, I={1}, H={2}, F={3}, X={4}, Y={5}, Z={6}]", Declination, Inclination, - HorizontalIntensity, TotalIntensity, X, Y, Z); + return string.Format( + CultureInfo.InvariantCulture, + "Magnetic Field[D={0}, I={1}, H={2}, F={3}, X={4}, Y={5}, Z={6}]", + Declination, + Inclination, + HorizontalIntensity, + TotalIntensity, + X, + Y, + Z + ); } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/IGeomagneticModel.cs b/Geo/Geomagnetism/IGeomagneticModel.cs index fecc069..899b287 100644 --- a/Geo/Geomagnetism/IGeomagneticModel.cs +++ b/Geo/Geomagnetism/IGeomagneticModel.cs @@ -26,4 +26,4 @@ public interface IGeomagneticModel /// H Gauss coefficients of secular geomagnetic model (nT/yr) /// double[,] SecularCoefficientsH { get; } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/IgrfGeomagnetismCalculator.cs b/Geo/Geomagnetism/IgrfGeomagnetismCalculator.cs index c99334f..97e84af 100644 --- a/Geo/Geomagnetism/IgrfGeomagnetismCalculator.cs +++ b/Geo/Geomagnetism/IgrfGeomagnetismCalculator.cs @@ -5,11 +5,9 @@ namespace Geo.Geomagnetism; public class IgrfGeomagnetismCalculator : GeomagnetismCalculator { - public IgrfGeomagnetismCalculator() : base(IgrfModelFactory.GetModels()) - { - } + public IgrfGeomagnetismCalculator() + : base(IgrfModelFactory.GetModels()) { } - public IgrfGeomagnetismCalculator(Spheroid spheroid) : base(spheroid, IgrfModelFactory.GetModels()) - { - } -} \ No newline at end of file + public IgrfGeomagnetismCalculator(Spheroid spheroid) + : base(spheroid, IgrfModelFactory.GetModels()) { } +} diff --git a/Geo/Geomagnetism/JulianDate.cs b/Geo/Geomagnetism/JulianDate.cs index 2c6c2c6..2f73271 100644 --- a/Geo/Geomagnetism/JulianDate.cs +++ b/Geo/Geomagnetism/JulianDate.cs @@ -26,12 +26,21 @@ public static bool IsJulianDate(int year, int month, int day) if (day > 14) return false; - // Any date in the range 10/5/1582 to 10/14/1582 is invalid + // Any date in the range 10/5/1582 to 10/14/1582 is invalid throw new NotSupportedException( - "Date is not valid as it does not exist in either the Julian or the Gregorian calendars."); + "Date is not valid as it does not exist in either the Julian or the Gregorian calendars." + ); } - private static double DateToJD(int year, int month, int day, int hour, int minute, int second, int millisecond) + private static double DateToJD( + int year, + int month, + int day, + int hour, + int minute, + int second, + int millisecond + ) { // Determine correct calendar based on date var isJulianDate = IsJulianDate(year, month, day); @@ -44,13 +53,29 @@ private static double DateToJD(int year, int month, int day, int hour, int minut return (int)(365.25 * (y + 4716)) + (int)(30.6001 * (m + 1)) + d + b - 1524.5; } - public static double JD(int year, int month, int day, int hour, int minute, int second, int millisecond) + public static double JD( + int year, + int month, + int day, + int hour, + int minute, + int second, + int millisecond + ) { return DateToJD(year, month, day, hour, minute, second, millisecond); } public static double JD(DateTime date) { - return DateToJD(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, date.Millisecond); + return DateToJD( + date.Year, + date.Month, + date.Day, + date.Hour, + date.Minute, + date.Second, + date.Millisecond + ); } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/Models/IgrfModelFactory.cs b/Geo/Geomagnetism/Models/IgrfModelFactory.cs index 466e3fb..8bec880 100644 --- a/Geo/Geomagnetism/Models/IgrfModelFactory.cs +++ b/Geo/Geomagnetism/Models/IgrfModelFactory.cs @@ -15,560 +15,5269 @@ public static List GetModels() var coefficientss = new double[14, 14, 2][]; coefficientss[1, 0, 0] = new[] { - -31543, -31464, -31354, -31212, -31060, -30926, -30805, -30715, -30654, -30594, -30554, -30500, -30421, - -30334, -30220, -30100, -29992, -29873, -29775, -29692, -29619.4, -29554.63, -29496.5, 11.4 + -31543, + -31464, + -31354, + -31212, + -31060, + -30926, + -30805, + -30715, + -30654, + -30594, + -30554, + -30500, + -30421, + -30334, + -30220, + -30100, + -29992, + -29873, + -29775, + -29692, + -29619.4, + -29554.63, + -29496.5, + 11.4, }; coefficientss[1, 1, 0] = new[] { - -2298, -2298, -2297, -2306, -2317, -2318, -2316, -2306, -2292, -2285, -2250, -2215, -2169, -2119, -2068, - -2013, -1956, -1905, -1848, -1784, -1728.2, -1669.05, -1585.9, 16.7 + -2298, + -2298, + -2297, + -2306, + -2317, + -2318, + -2316, + -2306, + -2292, + -2285, + -2250, + -2215, + -2169, + -2119, + -2068, + -2013, + -1956, + -1905, + -1848, + -1784, + -1728.2, + -1669.05, + -1585.9, + 16.7, }; coefficientss[1, 1, 1] = new[] { - 5922, 5909, 5898, 5875, 5845, 5817, 5808, 5812, 5821, 5810, 5815, 5820, 5791, 5776, 5737, 5675, 5604, 5500, - 5406, 5306, 5186.1, 5077.99, 4945.1, -28.8 + 5922, + 5909, + 5898, + 5875, + 5845, + 5817, + 5808, + 5812, + 5821, + 5810, + 5815, + 5820, + 5791, + 5776, + 5737, + 5675, + 5604, + 5500, + 5406, + 5306, + 5186.1, + 5077.99, + 4945.1, + -28.8, }; coefficientss[2, 0, 0] = new[] { - -677, -728, -769, -802, -839, -893, -951, -1018, -1106, -1244, -1341, -1440, -1555, -1662, -1781, -1902, - -1997, -2072, -2131, -2200, -2267.7, -2337.24, -2396.6, -11.3 + -677, + -728, + -769, + -802, + -839, + -893, + -951, + -1018, + -1106, + -1244, + -1341, + -1440, + -1555, + -1662, + -1781, + -1902, + -1997, + -2072, + -2131, + -2200, + -2267.7, + -2337.24, + -2396.6, + -11.3, }; coefficientss[2, 1, 0] = new[] { - 2905, 2928, 2948, 2956, 2959, 2969, 2980, 2984, 2981, 2990, 2998, 3003, 3002, 2997, 3000, 3010, 3027, 3044, - 3059, 3070, 3068.4, 3047.69, 3026.0, -3.9 + 2905, + 2928, + 2948, + 2956, + 2959, + 2969, + 2980, + 2984, + 2981, + 2990, + 2998, + 3003, + 3002, + 2997, + 3000, + 3010, + 3027, + 3044, + 3059, + 3070, + 3068.4, + 3047.69, + 3026.0, + -3.9, }; coefficientss[2, 1, 1] = new[] { - -1061, -1086, -1128, -1191, -1259, -1334, -1424, -1520, -1614, -1702, -1810, -1898, -1967, -2016, -2047, - -2067, -2129, -2197, -2279, -2366, -2481.6, -2594.50, -2707.7, -23.0 + -1061, + -1086, + -1128, + -1191, + -1259, + -1334, + -1424, + -1520, + -1614, + -1702, + -1810, + -1898, + -1967, + -2016, + -2047, + -2067, + -2129, + -2197, + -2279, + -2366, + -2481.6, + -2594.50, + -2707.7, + -23.0, }; coefficientss[2, 2, 0] = new[] { - 924, 1041, 1176, 1309, 1407, 1471, 1517, 1550, 1566, 1578, 1576, 1581, 1590, 1594, 1611, 1632, 1663, 1687, - 1686, 1681, 1670.9, 1657.76, 1668.6, 2.7 + 924, + 1041, + 1176, + 1309, + 1407, + 1471, + 1517, + 1550, + 1566, + 1578, + 1576, + 1581, + 1590, + 1594, + 1611, + 1632, + 1663, + 1687, + 1686, + 1681, + 1670.9, + 1657.76, + 1668.6, + 2.7, }; coefficientss[2, 2, 1] = new[] { - 1121, 1065, 1000, 917, 823, 728, 644, 586, 528, 477, 381, 291, 206, 114, 25, -68, -200, -306, -373, -413, - -458.0, -515.43, -575.4, -12.9 + 1121, + 1065, + 1000, + 917, + 823, + 728, + 644, + 586, + 528, + 477, + 381, + 291, + 206, + 114, + 25, + -68, + -200, + -306, + -373, + -413, + -458.0, + -515.43, + -575.4, + -12.9, }; coefficientss[3, 0, 0] = new[] { - 1022, 1037, 1058, 1084, 1111, 1140, 1172, 1206, 1240, 1282, 1297, 1302, 1302, 1297, 1287, 1276, 1281, 1296, - 1314, 1335, 1339.6, 1336.30, 1339.7, 1.3 + 1022, + 1037, + 1058, + 1084, + 1111, + 1140, + 1172, + 1206, + 1240, + 1282, + 1297, + 1302, + 1302, + 1297, + 1287, + 1276, + 1281, + 1296, + 1314, + 1335, + 1339.6, + 1336.30, + 1339.7, + 1.3, }; coefficientss[3, 1, 0] = new[] { - -1469, -1494, -1524, -1559, -1600, -1645, -1692, -1740, -1790, -1834, -1889, -1944, -1992, -2038, -2091, - -2144, -2180, -2208, -2239, -2267, -2288.0, -2305.83, -2326.3, -3.9 + -1469, + -1494, + -1524, + -1559, + -1600, + -1645, + -1692, + -1740, + -1790, + -1834, + -1889, + -1944, + -1992, + -2038, + -2091, + -2144, + -2180, + -2208, + -2239, + -2267, + -2288.0, + -2305.83, + -2326.3, + -3.9, }; coefficientss[3, 1, 1] = new[] { - -330, -357, -389, -421, -445, -462, -480, -494, -499, -499, -476, -462, -414, -404, -366, -333, -336, -310, - -284, -262, -227.6, -198.86, -160.5, 8.6 + -330, + -357, + -389, + -421, + -445, + -462, + -480, + -494, + -499, + -499, + -476, + -462, + -414, + -404, + -366, + -333, + -336, + -310, + -284, + -262, + -227.6, + -198.86, + -160.5, + 8.6, }; coefficientss[3, 2, 0] = new[] { - 1256, 1239, 1223, 1212, 1205, 1202, 1205, 1215, 1232, 1255, 1274, 1288, 1289, 1292, 1278, 1260, 1251, 1247, - 1248, 1249, 1252.1, 1246.39, 1231.7, -2.9 + 1256, + 1239, + 1223, + 1212, + 1205, + 1202, + 1205, + 1215, + 1232, + 1255, + 1274, + 1288, + 1289, + 1292, + 1278, + 1260, + 1251, + 1247, + 1248, + 1249, + 1252.1, + 1246.39, + 1231.7, + -2.9, }; coefficientss[3, 2, 1] = new[] { - 3, 34, 62, 84, 103, 119, 133, 146, 163, 186, 206, 216, 224, 240, 251, 262, 271, 284, 293, 302, 293.4, - 269.72, 251.7, -2.9 + 3, + 34, + 62, + 84, + 103, + 119, + 133, + 146, + 163, + 186, + 206, + 216, + 224, + 240, + 251, + 262, + 271, + 284, + 293, + 302, + 293.4, + 269.72, + 251.7, + -2.9, }; coefficientss[3, 3, 0] = new[] { - 572, 635, 705, 778, 839, 881, 907, 918, 916, 913, 896, 882, 878, 856, 838, 830, 833, 829, 802, 759, 714.5, - 672.51, 634.2, -8.1 + 572, + 635, + 705, + 778, + 839, + 881, + 907, + 918, + 916, + 913, + 896, + 882, + 878, + 856, + 838, + 830, + 833, + 829, + 802, + 759, + 714.5, + 672.51, + 634.2, + -8.1, }; coefficientss[3, 3, 1] = new[] { - 523, 480, 425, 360, 293, 229, 166, 101, 43, -11, -46, -83, -130, -165, -196, -223, -252, -297, -352, -427, - -491.1, -524.72, -536.8, -2.1 + 523, + 480, + 425, + 360, + 293, + 229, + 166, + 101, + 43, + -11, + -46, + -83, + -130, + -165, + -196, + -223, + -252, + -297, + -352, + -427, + -491.1, + -524.72, + -536.8, + -2.1, }; coefficientss[4, 0, 0] = new[] { - 876, 880, 884, 887, 889, 891, 896, 903, 914, 944, 954, 958, 957, 957, 952, 946, 938, 936, 939, 940, 932.3, - 920.55, 912.6, -1.4 + 876, + 880, + 884, + 887, + 889, + 891, + 896, + 903, + 914, + 944, + 954, + 958, + 957, + 957, + 952, + 946, + 938, + 936, + 939, + 940, + 932.3, + 920.55, + 912.6, + -1.4, }; coefficientss[4, 1, 0] = new[] { - 628, 643, 660, 678, 695, 711, 727, 744, 762, 776, 792, 796, 800, 804, 800, 791, 782, 780, 780, 780, 786.8, - 797.96, 809.0, 2.0 + 628, + 643, + 660, + 678, + 695, + 711, + 727, + 744, + 762, + 776, + 792, + 796, + 800, + 804, + 800, + 791, + 782, + 780, + 780, + 780, + 786.8, + 797.96, + 809.0, + 2.0, }; coefficientss[4, 1, 1] = new[] { - 195, 203, 211, 218, 220, 216, 205, 188, 169, 144, 136, 133, 135, 148, 167, 191, 212, 232, 247, 262, 272.6, - 282.07, 286.4, 0.4 + 195, + 203, + 211, + 218, + 220, + 216, + 205, + 188, + 169, + 144, + 136, + 133, + 135, + 148, + 167, + 191, + 212, + 232, + 247, + 262, + 272.6, + 282.07, + 286.4, + 0.4, }; coefficientss[4, 2, 0] = new[] { - 660, 653, 644, 631, 616, 601, 584, 565, 550, 544, 528, 510, 504, 479, 461, 438, 398, 361, 325, 290, 250.0, - 210.65, 166.6, -8.9 + 660, + 653, + 644, + 631, + 616, + 601, + 584, + 565, + 550, + 544, + 528, + 510, + 504, + 479, + 461, + 438, + 398, + 361, + 325, + 290, + 250.0, + 210.65, + 166.6, + -8.9, }; coefficientss[4, 2, 1] = new[] { - -69, -77, -90, -109, -134, -163, -195, -226, -252, -276, -278, -274, -278, -269, -266, -265, -257, -249, - -240, -236, -231.9, -225.23, -211.2, 3.2 + -69, + -77, + -90, + -109, + -134, + -163, + -195, + -226, + -252, + -276, + -278, + -274, + -278, + -269, + -266, + -265, + -257, + -249, + -240, + -236, + -231.9, + -225.23, + -211.2, + 3.2, }; coefficientss[4, 3, 0] = new[] { - -361, -380, -400, -416, -424, -426, -422, -415, -405, -421, -408, -397, -394, -390, -395, -405, -419, -424, - -423, -418, -403.0, -379.86, -357.1, 4.4 + -361, + -380, + -400, + -416, + -424, + -426, + -422, + -415, + -405, + -421, + -408, + -397, + -394, + -390, + -395, + -405, + -419, + -424, + -423, + -418, + -403.0, + -379.86, + -357.1, + 4.4, }; coefficientss[4, 3, 1] = new[] { - -210, -201, -189, -173, -153, -130, -109, -90, -72, -55, -37, -23, 3, 13, 26, 39, 53, 69, 84, 97, 119.8, - 145.15, 164.4, 3.6 + -210, + -201, + -189, + -173, + -153, + -130, + -109, + -90, + -72, + -55, + -37, + -23, + 3, + 13, + 26, + 39, + 53, + 69, + 84, + 97, + 119.8, + 145.15, + 164.4, + 3.6, }; coefficientss[4, 4, 0] = new[] { - 134, 146, 160, 178, 199, 217, 234, 249, 265, 304, 303, 290, 269, 252, 234, 216, 199, 170, 141, 122, 111.3, - 100.00, 89.7, -2.3 + 134, + 146, + 160, + 178, + 199, + 217, + 234, + 249, + 265, + 304, + 303, + 290, + 269, + 252, + 234, + 216, + 199, + 170, + 141, + 122, + 111.3, + 100.00, + 89.7, + -2.3, }; coefficientss[4, 4, 1] = new[] { - -75, -65, -55, -51, -57, -70, -90, -114, -141, -178, -210, -230, -255, -269, -279, -288, -297, -297, -299, - -306, -303.8, -305.36, -309.2, -0.8 + -75, + -65, + -55, + -51, + -57, + -70, + -90, + -114, + -141, + -178, + -210, + -230, + -255, + -269, + -279, + -288, + -297, + -297, + -299, + -306, + -303.8, + -305.36, + -309.2, + -0.8, }; coefficientss[5, 0, 0] = new[] { - -184, -192, -201, -211, -221, -230, -237, -241, -241, -253, -240, -229, -222, -219, -216, -218, -218, -214, - -214, -214, -218.8, -227.00, -231.1, -0.5 + -184, + -192, + -201, + -211, + -221, + -230, + -237, + -241, + -241, + -253, + -240, + -229, + -222, + -219, + -216, + -218, + -218, + -214, + -214, + -214, + -218.8, + -227.00, + -231.1, + -0.5, }; coefficientss[5, 1, 0] = new[] { - 328, 328, 327, 327, 326, 326, 327, 329, 334, 346, 349, 360, 362, 358, 359, 356, 357, 355, 353, 352, 351.4, - 354.41, 357.2, 0.5 + 328, + 328, + 327, + 327, + 326, + 326, + 327, + 329, + 334, + 346, + 349, + 360, + 362, + 358, + 359, + 356, + 357, + 355, + 353, + 352, + 351.4, + 354.41, + 357.2, + 0.5, }; coefficientss[5, 1, 1] = new[] { - -210, -193, -172, -148, -122, -96, -72, -51, -33, -12, 3, 15, 16, 19, 26, 31, 46, 47, 46, 46, 43.8, 42.72, - 44.7, 0.5 + -210, + -193, + -172, + -148, + -122, + -96, + -72, + -51, + -33, + -12, + 3, + 15, + 16, + 19, + 26, + 31, + 46, + 47, + 46, + 46, + 43.8, + 42.72, + 44.7, + 0.5, }; coefficientss[5, 2, 0] = new[] { - 264, 259, 253, 245, 236, 226, 218, 211, 208, 194, 211, 230, 242, 254, 262, 264, 261, 253, 245, 235, 222.3, - 208.95, 200.3, -1.5 + 264, + 259, + 253, + 245, + 236, + 226, + 218, + 211, + 208, + 194, + 211, + 230, + 242, + 254, + 262, + 264, + 261, + 253, + 245, + 235, + 222.3, + 208.95, + 200.3, + -1.5, }; coefficientss[5, 2, 1] = new[] { - 53, 56, 57, 58, 58, 58, 60, 64, 71, 95, 103, 110, 125, 128, 139, 148, 150, 150, 154, 165, 171.9, 180.25, - 188.9, 1.5 + 53, + 56, + 57, + 58, + 58, + 58, + 60, + 64, + 71, + 95, + 103, + 110, + 125, + 128, + 139, + 148, + 150, + 150, + 154, + 165, + 171.9, + 180.25, + 188.9, + 1.5, }; coefficientss[5, 3, 0] = new[] { - 5, -1, -9, -16, -23, -28, -32, -33, -33, -20, -20, -23, -26, -31, -42, -59, -74, -93, -109, -118, -130.4, - -136.54, -141.2, -0.7 + 5, + -1, + -9, + -16, + -23, + -28, + -32, + -33, + -33, + -20, + -20, + -23, + -26, + -31, + -42, + -59, + -74, + -93, + -109, + -118, + -130.4, + -136.54, + -141.2, + -0.7, }; coefficientss[5, 3, 1] = new[] { - -33, -32, -33, -34, -38, -44, -53, -64, -75, -67, -87, -98, -117, -126, -139, -152, -151, -154, -153, -143, - -133.1, -123.45, -118.1, 0.9 + -33, + -32, + -33, + -34, + -38, + -44, + -53, + -64, + -75, + -67, + -87, + -98, + -117, + -126, + -139, + -152, + -151, + -154, + -153, + -143, + -133.1, + -123.45, + -118.1, + 0.9, }; coefficientss[5, 4, 0] = new[] { - -86, -93, -102, -111, -119, -125, -131, -136, -141, -142, -147, -152, -156, -157, -160, -159, -162, -164, - -165, -166, -168.6, -168.05, -163.1, 1.3 + -86, + -93, + -102, + -111, + -119, + -125, + -131, + -136, + -141, + -142, + -147, + -152, + -156, + -157, + -160, + -159, + -162, + -164, + -165, + -166, + -168.6, + -168.05, + -163.1, + 1.3, }; coefficientss[5, 4, 1] = new[] { - -124, -125, -126, -126, -125, -122, -118, -115, -113, -119, -122, -121, -114, -97, -91, -83, -78, -75, -69, - -55, -39.3, -19.57, 0.1, 3.7 + -124, + -125, + -126, + -126, + -125, + -122, + -118, + -115, + -113, + -119, + -122, + -121, + -114, + -97, + -91, + -83, + -78, + -75, + -69, + -55, + -39.3, + -19.57, + 0.1, + 3.7, }; coefficientss[5, 5, 0] = new[] { - -16, -26, -38, -51, -62, -69, -74, -76, -76, -82, -76, -69, -63, -62, -56, -49, -48, -46, -36, -17, -12.9, - -13.55, -7.7, 1.4 + -16, + -26, + -38, + -51, + -62, + -69, + -74, + -76, + -76, + -82, + -76, + -69, + -63, + -62, + -56, + -49, + -48, + -46, + -36, + -17, + -12.9, + -13.55, + -7.7, + 1.4, }; coefficientss[5, 5, 1] = new[] { - 3, 11, 21, 32, 43, 51, 58, 64, 69, 82, 80, 78, 81, 81, 83, 88, 92, 95, 97, 107, 106.3, 103.85, 100.9, -0.6 + 3, + 11, + 21, + 32, + 43, + 51, + 58, + 64, + 69, + 82, + 80, + 78, + 81, + 81, + 83, + 88, + 92, + 95, + 97, + 107, + 106.3, + 103.85, + 100.9, + -0.6, }; coefficientss[6, 0, 0] = new[] - { 63, 62, 62, 61, 61, 61, 60, 59, 57, 59, 54, 47, 46, 45, 43, 45, 48, 53, 61, 68, 72.3, 73.60, 72.8, -0.3 }; + { + 63, + 62, + 62, + 61, + 61, + 61, + 60, + 59, + 57, + 59, + 54, + 47, + 46, + 45, + 43, + 45, + 48, + 53, + 61, + 68, + 72.3, + 73.60, + 72.8, + -0.3, + }; coefficientss[6, 1, 0] = new[] - { 61, 60, 58, 57, 55, 54, 53, 53, 54, 57, 57, 57, 58, 61, 64, 66, 66, 65, 65, 67, 68.2, 69.56, 68.6, -0.3 }; + { + 61, + 60, + 58, + 57, + 55, + 54, + 53, + 53, + 54, + 57, + 57, + 57, + 58, + 61, + 64, + 66, + 66, + 65, + 65, + 67, + 68.2, + 69.56, + 68.6, + -0.3, + }; coefficientss[6, 1, 1] = new[] { - -9, -7, -5, -2, 0, 3, 4, 4, 4, 6, -1, -9, -10, -11, -12, -13, -15, -16, -16, -17, -17.4, -20.33, -20.8, -0.1 + -9, + -7, + -5, + -2, + 0, + 3, + 4, + 4, + 4, + 6, + -1, + -9, + -10, + -11, + -12, + -13, + -15, + -16, + -16, + -17, + -17.4, + -20.33, + -20.8, + -0.1, }; coefficientss[6, 2, 0] = new[] - { -11, -11, -11, -10, -10, -9, -9, -8, -7, 6, 4, 3, 1, 8, 15, 28, 42, 51, 59, 68, 74.2, 76.74, 76.0, -0.3 }; + { + -11, + -11, + -11, + -10, + -10, + -9, + -9, + -8, + -7, + 6, + 4, + 3, + 1, + 8, + 15, + 28, + 42, + 51, + 59, + 68, + 74.2, + 76.74, + 76.0, + -0.3, + }; coefficientss[6, 2, 1] = new[] { - 83, 86, 89, 93, 96, 99, 102, 104, 105, 100, 99, 96, 99, 100, 100, 99, 93, 88, 82, 72, 63.7, 54.75, 44.2, - -2.1 + 83, + 86, + 89, + 93, + 96, + 99, + 102, + 104, + 105, + 100, + 99, + 96, + 99, + 100, + 100, + 99, + 93, + 88, + 82, + 72, + 63.7, + 54.75, + 44.2, + -2.1, }; coefficientss[6, 3, 0] = new[] { - -217, -221, -224, -228, -233, -238, -242, -246, -249, -246, -247, -247, -237, -228, -212, -198, -192, -185, - -178, -170, -160.9, -151.34, -141.4, 1.9 + -217, + -221, + -224, + -228, + -233, + -238, + -242, + -246, + -249, + -246, + -247, + -247, + -237, + -228, + -212, + -198, + -192, + -185, + -178, + -170, + -160.9, + -151.34, + -141.4, + 1.9, }; coefficientss[6, 3, 1] = new[] - { 2, 4, 5, 8, 11, 14, 19, 25, 33, 16, 33, 48, 60, 68, 72, 75, 71, 69, 69, 67, 65.1, 63.63, 61.5, -0.4 }; + { + 2, + 4, + 5, + 8, + 11, + 14, + 19, + 25, + 33, + 16, + 33, + 48, + 60, + 68, + 72, + 75, + 71, + 69, + 69, + 67, + 65.1, + 63.63, + 61.5, + -0.4, + }; coefficientss[6, 4, 0] = new[] { - -58, -57, -54, -51, -46, -40, -32, -25, -18, -25, -16, -8, -1, 4, 2, 1, 4, 4, 3, -1, -5.9, -14.58, -22.9, - -1.6 + -58, + -57, + -54, + -51, + -46, + -40, + -32, + -25, + -18, + -25, + -16, + -8, + -1, + 4, + 2, + 1, + 4, + 4, + 3, + -1, + -5.9, + -14.58, + -22.9, + -1.6, }; coefficientss[6, 4, 1] = new[] { - -35, -32, -29, -26, -22, -18, -16, -15, -15, -9, -12, -16, -20, -32, -37, -41, -43, -48, -52, -58, -61.2, - -63.53, -66.3, -0.5 + -35, + -32, + -29, + -26, + -22, + -18, + -16, + -15, + -15, + -9, + -12, + -16, + -20, + -32, + -37, + -41, + -43, + -48, + -52, + -58, + -61.2, + -63.53, + -66.3, + -0.5, }; coefficientss[6, 5, 0] = new[] - { 59, 57, 54, 49, 44, 39, 32, 25, 18, 21, 12, 7, -2, 1, 3, 6, 14, 16, 18, 19, 16.9, 14.58, 13.1, -0.2 }; + { + 59, + 57, + 54, + 49, + 44, + 39, + 32, + 25, + 18, + 21, + 12, + 7, + -2, + 1, + 3, + 6, + 14, + 16, + 18, + 19, + 16.9, + 14.58, + 13.1, + -0.2, + }; coefficientss[6, 5, 1] = new[] - { 36, 32, 28, 23, 18, 13, 8, 4, 0, -16, -12, -12, -11, -8, -6, -4, -2, -1, 1, 1, 0.7, 0.24, 3.1, 0.8 }; + { + 36, + 32, + 28, + 23, + 18, + 13, + 8, + 4, + 0, + -16, + -12, + -12, + -11, + -8, + -6, + -4, + -2, + -1, + 1, + 1, + 0.7, + 0.24, + 3.1, + 0.8, + }; coefficientss[6, 6, 0] = new[] { - -90, -92, -95, -98, -101, -103, -104, -106, -107, -104, -105, -107, -113, -111, -112, -111, -108, -102, -96, - -93, -90.4, -86.36, -77.9, 1.8 + -90, + -92, + -95, + -98, + -101, + -103, + -104, + -106, + -107, + -104, + -105, + -107, + -113, + -111, + -112, + -111, + -108, + -102, + -96, + -93, + -90.4, + -86.36, + -77.9, + 1.8, }; coefficientss[6, 6, 1] = new[] { - -69, -67, -65, -62, -57, -52, -46, -40, -33, -39, -30, -24, -17, -7, 1, 11, 17, 21, 24, 36, 43.8, 50.94, - 54.9, 0.5 + -69, + -67, + -65, + -62, + -57, + -52, + -46, + -40, + -33, + -39, + -30, + -24, + -17, + -7, + 1, + 11, + 17, + 21, + 24, + 36, + 43.8, + 50.94, + 54.9, + 0.5, }; coefficientss[7, 0, 0] = new[] - { 70, 70, 71, 72, 73, 73, 74, 74, 74, 70, 65, 65, 67, 75, 72, 71, 72, 74, 77, 77, 79.0, 79.88, 80.4, 0.2 }; + { + 70, + 70, + 71, + 72, + 73, + 73, + 74, + 74, + 74, + 70, + 65, + 65, + 67, + 75, + 72, + 71, + 72, + 74, + 77, + 77, + 79.0, + 79.88, + 80.4, + 0.2, + }; coefficientss[7, 1, 0] = new[] { - -55, -54, -54, -54, -54, -54, -54, -53, -53, -40, -55, -56, -56, -57, -57, -56, -59, -62, -64, -72, -74.0, - -74.46, -75.0, -0.1 + -55, + -54, + -54, + -54, + -54, + -54, + -54, + -53, + -53, + -40, + -55, + -56, + -56, + -57, + -57, + -56, + -59, + -62, + -64, + -72, + -74.0, + -74.46, + -75.0, + -0.1, }; coefficientss[7, 1, 1] = new[] { - -45, -46, -47, -48, -49, -50, -51, -52, -52, -45, -35, -50, -55, -61, -70, -77, -82, -83, -80, -69, -64.6, - -61.14, -57.8, 0.6 + -45, + -46, + -47, + -48, + -49, + -50, + -51, + -52, + -52, + -45, + -35, + -50, + -55, + -61, + -70, + -77, + -82, + -83, + -80, + -69, + -64.6, + -61.14, + -57.8, + 0.6, }; coefficientss[7, 2, 0] = new[] - { 0, 0, 1, 2, 2, 3, 4, 4, 4, 0, 2, 2, 5, 4, 1, 1, 2, 3, 2, 1, 0.0, -1.65, -4.7, -0.6 }; + { + 0, + 0, + 1, + 2, + 2, + 3, + 4, + 4, + 4, + 0, + 2, + 2, + 5, + 4, + 1, + 1, + 2, + 3, + 2, + 1, + 0.0, + -1.65, + -4.7, + -0.6, + }; coefficientss[7, 2, 1] = new[] { - -13, -14, -14, -14, -14, -14, -15, -17, -18, -18, -17, -24, -28, -27, -27, -26, -27, -27, -26, -25, -24.2, - -22.57, -21.2, 0.3 + -13, + -14, + -14, + -14, + -14, + -14, + -15, + -17, + -18, + -18, + -17, + -24, + -28, + -27, + -27, + -26, + -27, + -27, + -26, + -25, + -24.2, + -22.57, + -21.2, + 0.3, }; coefficientss[7, 3, 0] = new[] - { 34, 33, 32, 31, 29, 27, 25, 23, 20, 0, 1, 10, 15, 13, 14, 16, 21, 24, 26, 28, 33.3, 38.73, 45.3, 1.4 }; + { + 34, + 33, + 32, + 31, + 29, + 27, + 25, + 23, + 20, + 0, + 1, + 10, + 15, + 13, + 14, + 16, + 21, + 24, + 26, + 28, + 33.3, + 38.73, + 45.3, + 1.4, + }; coefficientss[7, 3, 1] = new[] { - -10, -11, -12, -12, -13, -14, -14, -14, -14, 2, 0, -4, -6, -2, -4, -5, -5, -2, 0, 4, 6.2, 6.82, 6.6, -0.2 + -10, + -11, + -12, + -12, + -13, + -14, + -14, + -14, + -14, + 2, + 0, + -4, + -6, + -2, + -4, + -5, + -5, + -2, + 0, + 4, + 6.2, + 6.82, + 6.6, + -0.2, }; coefficientss[7, 4, 0] = new[] { - -41, -41, -40, -38, -37, -35, -34, -33, -31, -29, -40, -32, -32, -26, -22, -14, -12, -6, -1, 5, 9.1, 12.30, - 14.0, 0.3 + -41, + -41, + -40, + -38, + -37, + -35, + -34, + -33, + -31, + -29, + -40, + -32, + -32, + -26, + -22, + -14, + -12, + -6, + -1, + 5, + 9.1, + 12.30, + 14.0, + 0.3, }; coefficientss[7, 4, 1] = new[] - { -1, 0, 1, 2, 4, 5, 6, 7, 7, 6, 10, 8, 7, 6, 8, 10, 16, 20, 21, 24, 24.0, 25.35, 24.9, -0.1 }; + { + -1, + 0, + 1, + 2, + 4, + 5, + 6, + 7, + 7, + 6, + 10, + 8, + 7, + 6, + 8, + 10, + 16, + 20, + 21, + 24, + 24.0, + 25.35, + 24.9, + -0.1, + }; coefficientss[7, 5, 0] = new[] { - -21, -20, -19, -18, -16, -14, -12, -11, -9, -10, -7, -11, -7, -6, -2, 0, 1, 4, 5, 4, 6.9, 9.37, 10.4, 0.1 + -21, + -20, + -19, + -18, + -16, + -14, + -12, + -11, + -9, + -10, + -7, + -11, + -7, + -6, + -2, + 0, + 1, + 4, + 5, + 4, + 6.9, + 9.37, + 10.4, + 0.1, }; coefficientss[7, 5, 1] = new[] - { 28, 28, 28, 28, 28, 29, 29, 29, 29, 28, 36, 28, 23, 26, 23, 22, 18, 17, 17, 17, 14.8, 10.93, 7.0, -0.8 }; + { + 28, + 28, + 28, + 28, + 28, + 29, + 29, + 29, + 29, + 28, + 36, + 28, + 23, + 26, + 23, + 22, + 18, + 17, + 17, + 17, + 14.8, + 10.93, + 7.0, + -0.8, + }; coefficientss[7, 6, 0] = new[] - { 18, 18, 18, 19, 19, 19, 18, 18, 17, 15, 5, 9, 17, 13, 13, 12, 11, 10, 9, 8, 7.3, 5.42, 1.6, -0.8 }; + { + 18, + 18, + 18, + 19, + 19, + 19, + 18, + 18, + 17, + 15, + 5, + 9, + 17, + 13, + 13, + 12, + 11, + 10, + 9, + 8, + 7.3, + 5.42, + 1.6, + -0.8, + }; coefficientss[7, 6, 1] = new[] { - -12, -12, -13, -15, -16, -17, -18, -19, -20, -17, -18, -20, -18, -23, -23, -23, -23, -23, -23, -24, -25.4, - -26.32, -27.7, -0.3 + -12, + -12, + -13, + -15, + -16, + -17, + -18, + -19, + -20, + -17, + -18, + -20, + -18, + -23, + -23, + -23, + -23, + -23, + -23, + -24, + -25.4, + -26.32, + -27.7, + -0.3, }; coefficientss[7, 7, 0] = new[] - { 6, 6, 6, 6, 6, 6, 6, 6, 5, 29, 19, 18, 8, 1, -2, -5, -2, 0, 0, -2, -1.2, 1.94, 4.9, 0.4 }; + { + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 5, + 29, + 19, + 18, + 8, + 1, + -2, + -5, + -2, + 0, + 0, + -2, + -1.2, + 1.94, + 4.9, + 0.4, + }; coefficientss[7, 7, 1] = new[] { - -22, -22, -22, -22, -22, -21, -20, -19, -19, -22, -16, -18, -17, -12, -11, -12, -10, -7, -4, -6, -5.8, - -4.64, -3.4, 0.2 + -22, + -22, + -22, + -22, + -22, + -21, + -20, + -19, + -19, + -22, + -16, + -18, + -17, + -12, + -11, + -12, + -10, + -7, + -4, + -6, + -5.8, + -4.64, + -3.4, + 0.2, }; coefficientss[8, 0, 0] = new[] - { 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 22, 11, 15, 13, 14, 14, 18, 21, 23, 25, 24.4, 24.80, 24.3, -0.1 }; + { + 11, + 11, + 11, + 11, + 11, + 11, + 11, + 11, + 11, + 13, + 22, + 11, + 15, + 13, + 14, + 14, + 18, + 21, + 23, + 25, + 24.4, + 24.80, + 24.3, + -0.1, + }; coefficientss[8, 1, 0] = new[] - { 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 15, 9, 6, 5, 6, 6, 6, 6, 5, 6, 6.6, 7.62, 8.2, 0.1 }; + { + 8, + 8, + 8, + 8, + 7, + 7, + 7, + 7, + 7, + 7, + 15, + 9, + 6, + 5, + 6, + 6, + 6, + 6, + 5, + 6, + 6.6, + 7.62, + 8.2, + 0.1, + }; coefficientss[8, 1, 1] = new[] - { 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 5, 10, 11, 7, 7, 6, 7, 8, 10, 11, 11.9, 11.20, 10.9, 0.0 }; + { + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 12, + 5, + 10, + 11, + 7, + 7, + 6, + 7, + 8, + 10, + 11, + 11.9, + 11.20, + 10.9, + 0.0, + }; coefficientss[8, 2, 0] = new[] - { -4, -4, -4, -4, -3, -3, -3, -3, -3, -8, -4, -6, -4, -4, -2, -1, 0, 0, -1, -6, -9.2, -11.73, -14.5, -0.5 }; + { + -4, + -4, + -4, + -4, + -3, + -3, + -3, + -3, + -3, + -8, + -4, + -6, + -4, + -4, + -2, + -1, + 0, + 0, + -1, + -6, + -9.2, + -11.73, + -14.5, + -0.5, + }; coefficientss[8, 2, 1] = new[] { - -14, -15, -15, -15, -15, -15, -15, -15, -14, -21, -22, -15, -14, -12, -15, -16, -18, -19, -19, -21, -21.5, - -20.88, -20.0, 0.2 + -14, + -15, + -15, + -15, + -15, + -15, + -15, + -15, + -14, + -21, + -22, + -15, + -14, + -12, + -15, + -16, + -18, + -19, + -19, + -21, + -21.5, + -20.88, + -20.0, + 0.2, }; coefficientss[8, 3, 0] = new[] { - -9, -9, -9, -9, -9, -9, -9, -9, -10, -5, -1, -14, -11, -14, -13, -12, -11, -11, -10, -9, -7.9, -6.88, -5.7, - 0.3 + -9, + -9, + -9, + -9, + -9, + -9, + -9, + -9, + -10, + -5, + -1, + -14, + -11, + -14, + -13, + -12, + -11, + -11, + -10, + -9, + -7.9, + -6.88, + -5.7, + 0.3, }; coefficientss[8, 3, 1] = new[] - { 7, 7, 6, 6, 6, 6, 5, 5, 5, -12, 0, 5, 7, 9, 6, 4, 4, 5, 6, 8, 8.5, 9.83, 11.9, 0.5 }; + { + 7, + 7, + 6, + 6, + 6, + 6, + 5, + 5, + 5, + -12, + 0, + 5, + 7, + 9, + 6, + 4, + 4, + 5, + 6, + 8, + 8.5, + 9.83, + 11.9, + 0.5, + }; coefficientss[8, 4, 0] = new[] - { 1, 1, 1, 2, 2, 2, 2, 1, 1, 9, 11, 6, 2, 0, -3, -8, -7, -9, -12, -14, -16.6, -18.11, -19.3, -0.3 }; + { + 1, + 1, + 1, + 2, + 2, + 2, + 2, + 1, + 1, + 9, + 11, + 6, + 2, + 0, + -3, + -8, + -7, + -9, + -12, + -14, + -16.6, + -18.11, + -19.3, + -0.3, + }; coefficientss[8, 4, 1] = new[] { - -13, -13, -13, -13, -14, -14, -14, -15, -15, -7, -21, -23, -18, -16, -17, -19, -22, -23, -22, -23, -21.5, - -19.71, -17.4, 0.4 + -13, + -13, + -13, + -13, + -14, + -14, + -14, + -15, + -15, + -7, + -21, + -23, + -18, + -16, + -17, + -19, + -22, + -23, + -22, + -23, + -21.5, + -19.71, + -17.4, + 0.4, }; coefficientss[8, 5, 0] = new[] - { 2, 2, 2, 3, 4, 4, 5, 6, 6, 7, 15, 10, 10, 8, 5, 4, 4, 4, 3, 9, 9.1, 10.17, 11.6, 0.3 }; + { + 2, + 2, + 2, + 3, + 4, + 4, + 5, + 6, + 6, + 7, + 15, + 10, + 10, + 8, + 5, + 4, + 4, + 4, + 3, + 9, + 9.1, + 10.17, + 11.6, + 0.3, + }; coefficientss[8, 5, 1] = new[] - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 2, -8, 3, 4, 4, 6, 6, 9, 11, 12, 15, 15.5, 16.22, 16.7, 0.1 }; + { + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 2, + -8, + 3, + 4, + 4, + 6, + 6, + 9, + 11, + 12, + 15, + 15.5, + 16.22, + 16.7, + 0.1, + }; coefficientss[8, 6, 0] = new[] - { -9, -8, -8, -8, -7, -7, -6, -6, -5, -10, -13, -7, -5, -1, 0, 0, 3, 4, 4, 6, 7.0, 9.36, 10.9, 0.2 }; + { + -9, + -8, + -8, + -8, + -7, + -7, + -6, + -6, + -5, + -10, + -13, + -7, + -5, + -1, + 0, + 0, + 3, + 4, + 4, + 6, + 7.0, + 9.36, + 10.9, + 0.2, + }; coefficientss[8, 6, 1] = new[] - { 16, 16, 16, 16, 17, 17, 18, 18, 19, 18, 17, 23, 23, 24, 21, 18, 16, 14, 12, 11, 8.9, 7.61, 7.1, -0.1 }; + { + 16, + 16, + 16, + 16, + 17, + 17, + 18, + 18, + 19, + 18, + 17, + 23, + 23, + 24, + 21, + 18, + 16, + 14, + 12, + 11, + 8.9, + 7.61, + 7.1, + -0.1, + }; coefficientss[8, 7, 0] = new[] - { 5, 5, 5, 6, 6, 7, 8, 8, 9, 7, 5, 6, 10, 11, 11, 10, 6, 4, 2, -5, -7.9, -11.25, -14.1, -0.5 }; + { + 5, + 5, + 5, + 6, + 6, + 7, + 8, + 8, + 9, + 7, + 5, + 6, + 10, + 11, + 11, + 10, + 6, + 4, + 2, + -5, + -7.9, + -11.25, + -14.1, + -0.5, + }; coefficientss[8, 7, 1] = new[] { - -5, -5, -5, -5, -5, -5, -5, -5, -5, 3, -4, -4, 1, -3, -6, -10, -13, -15, -16, -16, -14.9, -12.76, -10.8, 0.4 + -5, + -5, + -5, + -5, + -5, + -5, + -5, + -5, + -5, + 3, + -4, + -4, + 1, + -3, + -6, + -10, + -13, + -15, + -16, + -16, + -14.9, + -12.76, + -10.8, + 0.4, }; coefficientss[8, 8, 0] = new[] - { 8, 8, 8, 8, 8, 8, 8, 7, 7, 2, -1, 9, 8, 4, 3, 1, -1, -4, -6, -7, -7.0, -4.87, -3.7, 0.2 }; + { + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 7, + 7, + 2, + -1, + 9, + 8, + 4, + 3, + 1, + -1, + -4, + -6, + -7, + -7.0, + -4.87, + -3.7, + 0.2, + }; coefficientss[8, 8, 1] = new[] { - -18, -18, -18, -18, -19, -19, -19, -19, -19, -11, -17, -13, -20, -17, -16, -17, -15, -11, -10, -4, -2.1, - -0.06, 1.7, 0.4 + -18, + -18, + -18, + -18, + -19, + -19, + -19, + -19, + -19, + -11, + -17, + -13, + -20, + -17, + -16, + -17, + -15, + -11, + -10, + -4, + -2.1, + -0.06, + 1.7, + 0.4, }; coefficientss[9, 0, 0] = new[] - { 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 3, 4, 4, 8, 8, 7, 5, 5, 4, 4, 5.0, 5.58, 5.4, 0.0 }; + { + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 5, + 3, + 4, + 4, + 8, + 8, + 7, + 5, + 5, + 4, + 4, + 5.0, + 5.58, + 5.4, + 0.0, + }; coefficientss[9, 1, 0] = new[] - { 10, 10, 10, 10, 10, 10, 10, 10, 10, -21, -7, 9, 6, 10, 10, 10, 10, 10, 9, 9, 9.4, 9.76, 9.4, 0.0 }; + { + 10, + 10, + 10, + 10, + 10, + 10, + 10, + 10, + 10, + -21, + -7, + 9, + 6, + 10, + 10, + 10, + 10, + 10, + 9, + 9, + 9.4, + 9.76, + 9.4, + 0.0, + }; coefficientss[9, 1, 1] = new[] { - -20, -20, -20, -20, -20, -20, -20, -20, -21, -27, -24, -11, -18, -22, -21, -21, -21, -21, -20, -20, -19.7, - -20.11, -20.5, 0.0 + -20, + -20, + -20, + -20, + -20, + -20, + -20, + -20, + -21, + -27, + -24, + -11, + -18, + -22, + -21, + -21, + -21, + -21, + -20, + -20, + -19.7, + -20.11, + -20.5, + 0.0, }; coefficientss[9, 2, 0] = new[] - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -4, 0, 2, 2, 2, 1, 1, 1, 3, 3.0, 3.58, 3.4, 0.0 }; + { + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + -1, + -4, + 0, + 2, + 2, + 2, + 1, + 1, + 1, + 3, + 3.0, + 3.58, + 3.4, + 0.0, + }; coefficientss[9, 2, 1] = new[] - { 14, 14, 14, 14, 14, 14, 14, 15, 15, 17, 19, 12, 12, 15, 16, 16, 16, 15, 15, 15, 13.4, 12.69, 11.6, 0.0 }; + { + 14, + 14, + 14, + 14, + 14, + 14, + 14, + 15, + 15, + 17, + 19, + 12, + 12, + 15, + 16, + 16, + 16, + 15, + 15, + 15, + 13.4, + 12.69, + 11.6, + 0.0, + }; coefficientss[9, 3, 0] = new[] { - -11, -11, -11, -11, -11, -11, -12, -12, -12, -11, -25, -5, -9, -13, -12, -12, -12, -12, -12, -10, -8.4, - -6.94, -5.3, 0.0 + -11, + -11, + -11, + -11, + -11, + -11, + -12, + -12, + -12, + -11, + -25, + -5, + -9, + -13, + -12, + -12, + -12, + -12, + -12, + -10, + -8.4, + -6.94, + -5.3, + 0.0, }; coefficientss[9, 3, 1] = new[] - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 29, 12, 7, 2, 7, 6, 7, 9, 9, 11, 12, 12.5, 12.67, 12.8, 0.0 }; + { + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 29, + 12, + 7, + 2, + 7, + 6, + 7, + 9, + 9, + 11, + 12, + 12.5, + 12.67, + 12.8, + 0.0, + }; coefficientss[9, 4, 0] = new[] - { 12, 12, 12, 12, 12, 12, 12, 11, 11, 3, 10, 2, 1, 10, 10, 10, 9, 9, 9, 8, 6.3, 5.01, 3.1, 0.0 }; + { + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 11, + 11, + 3, + 10, + 2, + 1, + 10, + 10, + 10, + 9, + 9, + 9, + 8, + 6.3, + 5.01, + 3.1, + 0.0, + }; coefficientss[9, 4, 1] = new[] - { -3, -3, -3, -3, -3, -3, -3, -3, -3, -9, 2, 6, 0, -4, -4, -4, -5, -6, -7, -6, -6.2, -6.72, -7.2, 0.0 }; + { + -3, + -3, + -3, + -3, + -3, + -3, + -3, + -3, + -3, + -9, + 2, + 6, + 0, + -4, + -4, + -4, + -5, + -6, + -7, + -6, + -6.2, + -6.72, + -7.2, + 0.0, + }; coefficientss[9, 5, 0] = new[] - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 5, 4, 4, -1, -1, -1, -3, -3, -4, -8, -8.9, -10.76, -12.4, 0.0 }; + { + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 16, + 5, + 4, + 4, + -1, + -1, + -1, + -3, + -3, + -4, + -8, + -8.9, + -10.76, + -12.4, + 0.0, + }; coefficientss[9, 5, 1] = new[] - { -2, -2, -2, -2, -2, -2, -2, -3, -3, 4, 2, -2, -3, -5, -5, -5, -6, -6, -7, -8, -8.4, -8.16, -7.4, 0.0 }; + { + -2, + -2, + -2, + -2, + -2, + -2, + -2, + -3, + -3, + 4, + 2, + -2, + -3, + -5, + -5, + -5, + -6, + -6, + -7, + -8, + -8.4, + -8.16, + -7.4, + 0.0, + }; coefficientss[9, 6, 0] = new[] - { -2, -2, -2, -2, -2, -2, -2, -2, -2, -3, -5, 1, -1, -1, 0, -1, -1, -1, -2, -1, -1.5, -1.25, -0.8, 0.0 }; + { + -2, + -2, + -2, + -2, + -2, + -2, + -2, + -2, + -2, + -3, + -5, + 1, + -1, + -1, + 0, + -1, + -1, + -1, + -2, + -1, + -1.5, + -1.25, + -0.8, + 0.0, + }; coefficientss[9, 6, 1] = new[] - { 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 8, 10, 9, 10, 10, 10, 9, 9, 9, 8, 8.4, 8.10, 8.0, 0.0 }; + { + 8, + 8, + 8, + 8, + 9, + 9, + 9, + 9, + 9, + 9, + 8, + 10, + 9, + 10, + 10, + 10, + 9, + 9, + 9, + 8, + 8.4, + 8.10, + 8.0, + 0.0, + }; coefficientss[9, 7, 0] = new[] - { 2, 2, 2, 2, 2, 2, 3, 3, 3, -4, -2, 2, -2, 5, 3, 4, 7, 7, 7, 10, 9.3, 8.76, 8.4, 0.0 }; + { + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + -4, + -2, + 2, + -2, + 5, + 3, + 4, + 7, + 7, + 7, + 10, + 9.3, + 8.76, + 8.4, + 0.0, + }; coefficientss[9, 7, 1] = new[] - { 10, 10, 10, 10, 10, 10, 10, 11, 11, 6, 8, 7, 8, 10, 11, 11, 10, 9, 8, 5, 3.8, 2.92, 2.2, 0.0 }; + { + 10, + 10, + 10, + 10, + 10, + 10, + 10, + 11, + 11, + 6, + 8, + 7, + 8, + 10, + 11, + 11, + 10, + 9, + 8, + 5, + 3.8, + 2.92, + 2.2, + 0.0, + }; coefficientss[9, 8, 0] = new[] - { -1, 0, 0, 0, 0, 0, 0, 0, 1, -3, 3, 2, 3, 1, 1, 1, 2, 1, 1, -2, -4.3, -6.66, -8.4, 0.0 }; + { + -1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + -3, + 3, + 2, + 3, + 1, + 1, + 1, + 2, + 1, + 1, + -2, + -4.3, + -6.66, + -8.4, + 0.0, + }; coefficientss[9, 8, 1] = new[] - { -2, -2, -2, -2, -2, -2, -2, -2, -2, 1, -11, -6, 0, -4, -2, -3, -6, -7, -7, -8, -8.2, -7.73, -6.1, 0.0 }; + { + -2, + -2, + -2, + -2, + -2, + -2, + -2, + -2, + -2, + 1, + -11, + -6, + 0, + -4, + -2, + -3, + -6, + -7, + -7, + -8, + -8.2, + -7.73, + -6.1, + 0.0, + }; coefficientss[9, 9, 0] = new[] - { -1, -1, -1, -1, -1, -1, -2, -2, -2, -4, 8, 5, -1, -2, -1, -2, -5, -5, -6, -8, -8.2, -9.22, -10.1, 0.0 }; + { + -1, + -1, + -1, + -1, + -1, + -1, + -2, + -2, + -2, + -4, + 8, + 5, + -1, + -2, + -1, + -2, + -5, + -5, + -6, + -8, + -8.2, + -9.22, + -10.1, + 0.0, + }; coefficientss[9, 9, 1] = new[] - { 2, 2, 2, 2, 2, 2, 2, 2, 2, 8, -7, 5, 5, 1, 1, 1, 2, 2, 2, 3, 4.8, 6.01, 7.0, 0.0 }; + { + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 8, + -7, + 5, + 5, + 1, + 1, + 1, + 2, + 2, + 2, + 3, + 4.8, + 6.01, + 7.0, + 0.0, + }; coefficientss[10, 0, 0] = new[] - { -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -8, -3, 1, -2, -3, -3, -4, -4, -3, -3, -2.6, -2.17, -2.0, 0.0 }; + { + -3, + -3, + -3, + -3, + -3, + -3, + -3, + -3, + -3, + -3, + -8, + -3, + 1, + -2, + -3, + -3, + -4, + -4, + -3, + -3, + -2.6, + -2.17, + -2.0, + 0.0, + }; coefficientss[10, 1, 0] = new[] - { -4, -4, -4, -4, -4, -4, -4, -4, -4, 11, 4, -5, -3, -3, -3, -3, -4, -4, -4, -6, -6.0, -6.12, -6.3, 0.0 }; + { + -4, + -4, + -4, + -4, + -4, + -4, + -4, + -4, + -4, + 11, + 4, + -5, + -3, + -3, + -3, + -3, + -4, + -4, + -4, + -6, + -6.0, + -6.12, + -6.3, + 0.0, + }; coefficientss[10, 1, 1] = new[] - { 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 13, -4, 4, 2, 1, 1, 1, 1, 2, 1, 1.7, 2.19, 2.8, 0.0 }; + { + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 5, + 13, + -4, + 4, + 2, + 1, + 1, + 1, + 1, + 2, + 1, + 1.7, + 2.19, + 2.8, + 0.0, + }; coefficientss[10, 2, 0] = new[] - { 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, -1, -1, 4, 2, 2, 2, 2, 3, 2, 2, 1.7, 1.42, 0.9, 0.0 }; + { + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + -1, + -1, + 4, + 2, + 2, + 2, + 2, + 3, + 2, + 2, + 1.7, + 1.42, + 0.9, + 0.0, + }; coefficientss[10, 2, 1] = new[] - { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -2, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0.0, 0.10, -0.1, 0.0 }; + { + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + -2, + 0, + 1, + 1, + 1, + 1, + 0, + 0, + 1, + 0, + 0.0, + 0.10, + -0.1, + 0.0, + }; coefficientss[10, 3, 0] = new[] - { -5, -5, -5, -5, -5, -5, -5, -5, -5, 2, 13, 2, 0, -5, -5, -5, -5, -5, -5, -4, -3.1, -2.35, -1.1, 0.0 }; + { + -5, + -5, + -5, + -5, + -5, + -5, + -5, + -5, + -5, + 2, + 13, + 2, + 0, + -5, + -5, + -5, + -5, + -5, + -5, + -4, + -3.1, + -2.35, + -1.1, + 0.0, + }; coefficientss[10, 3, 1] = new[] - { 2, 2, 2, 2, 2, 2, 2, 2, 2, -20, -10, -8, 0, 2, 3, 3, 3, 3, 3, 4, 4.0, 4.46, 4.7, 0.0 }; + { + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + -20, + -10, + -8, + 0, + 2, + 3, + 3, + 3, + 3, + 3, + 4, + 4.0, + 4.46, + 4.7, + 0.0, + }; coefficientss[10, 4, 0] = new[] - { -2, -2, -2, -2, -2, -2, -2, -2, -2, -5, -4, -3, -1, -2, -1, -2, -2, -2, -2, -1, -0.5, -0.15, -0.2, 0.0 }; + { + -2, + -2, + -2, + -2, + -2, + -2, + -2, + -2, + -2, + -5, + -4, + -3, + -1, + -2, + -1, + -2, + -2, + -2, + -2, + -1, + -0.5, + -0.15, + -0.2, + 0.0, + }; coefficientss[10, 4, 1] = new[] - { 6, 6, 6, 6, 6, 6, 6, 6, 6, -1, 2, -2, 2, 6, 4, 4, 6, 6, 6, 5, 4.9, 4.76, 4.4, 0.0 }; + { + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + -1, + 2, + -2, + 2, + 6, + 4, + 4, + 6, + 6, + 6, + 5, + 4.9, + 4.76, + 4.4, + 0.0, + }; coefficientss[10, 5, 0] = new[] - { 6, 6, 6, 6, 6, 6, 6, 6, 6, -1, 4, 7, 4, 4, 6, 5, 5, 5, 4, 4, 3.7, 3.06, 2.5, 0.0 }; + { + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + -1, + 4, + 7, + 4, + 4, + 6, + 5, + 5, + 5, + 4, + 4, + 3.7, + 3.06, + 2.5, + 0.0, + }; coefficientss[10, 5, 1] = new[] - { -4, -4, -4, -4, -4, -4, -4, -4, -4, -6, -3, -4, -5, -4, -4, -4, -4, -4, -4, -5, -5.9, -6.58, -7.2, 0.0 }; + { + -4, + -4, + -4, + -4, + -4, + -4, + -4, + -4, + -4, + -6, + -3, + -4, + -5, + -4, + -4, + -4, + -4, + -4, + -4, + -5, + -5.9, + -6.58, + -7.2, + 0.0, + }; coefficientss[10, 6, 0] = new[] - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 12, 4, 6, 4, 4, 4, 3, 3, 3, 2, 1.0, 0.29, -0.3, 0.0 }; + { + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 8, + 12, + 4, + 6, + 4, + 4, + 4, + 3, + 3, + 3, + 2, + 1.0, + 0.29, + -0.3, + 0.0, + }; coefficientss[10, 6, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 1, 1, 0, 0, -1, 0, 0, 0, -1, -1.2, -1.01, -1.0, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 6, + 6, + 1, + 1, + 0, + 0, + -1, + 0, + 0, + 0, + -1, + -1.2, + -1.01, + -1.0, + 0.0, + }; coefficientss[10, 7, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 3, -2, 1, 0, 1, 1, 1, 1, 1, 2, 2.0, 2.06, 2.2, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1, + 3, + -2, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 2, + 2.0, + 2.06, + 2.2, + 0.0, + }; coefficientss[10, 7, 1] = new[] - { -2, -2, -2, -2, -2, -2, -2, -1, -1, -4, -3, -3, -1, -2, -1, -1, -1, -1, -2, -2, -2.9, -3.47, -4.0, 0.0 }; + { + -2, + -2, + -2, + -2, + -2, + -2, + -2, + -1, + -1, + -4, + -3, + -3, + -1, + -2, + -1, + -1, + -1, + -1, + -2, + -2, + -2.9, + -3.47, + -4.0, + 0.0, + }; coefficientss[10, 8, 0] = new[] - { 2, 2, 2, 1, 1, 1, 1, 2, 2, -3, 2, 6, -1, 2, 0, 0, 2, 2, 3, 5, 4.2, 3.77, 3.1, 0.0 }; + { + 2, + 2, + 2, + 1, + 1, + 1, + 1, + 2, + 2, + -3, + 2, + 6, + -1, + 2, + 0, + 0, + 2, + 2, + 3, + 5, + 4.2, + 3.77, + 3.1, + 0.0, + }; coefficientss[10, 8, 1] = new[] - { 4, 4, 4, 4, 4, 4, 4, 4, 4, -2, 6, 7, 6, 3, 3, 3, 4, 4, 3, 1, 0.2, -0.86, -2.0, 0.0 }; + { + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + -2, + 6, + 7, + 6, + 3, + 3, + 3, + 4, + 4, + 3, + 1, + 0.2, + -0.86, + -2.0, + 0.0, + }; coefficientss[10, 9, 0] = new[] - { 2, 2, 2, 2, 3, 3, 3, 3, 3, 5, 10, -2, 2, 2, 3, 3, 3, 3, 3, 1, 0.3, -0.21, -1.0, 0.0 }; + { + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 5, + 10, + -2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 1, + 0.3, + -0.21, + -1.0, + 0.0, + }; coefficientss[10, 9, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, -1, 0, 0, 1, 1, 0, 0, -1, -2, -2.2, -2.31, -2.0, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 11, + -1, + 0, + 0, + 1, + 1, + 0, + 0, + -1, + -2, + -2.2, + -2.31, + -2.0, + 0.0, + }; coefficientss[10, 10, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 3, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1.1, -2.09, -2.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -2, + 3, + 0, + 0, + 0, + -1, + -1, + 0, + 0, + 0, + 0, + -1.1, + -2.09, + -2.8, + 0.0, + }; coefficientss[10, 10, 1] = new[] - { -6, -6, -6, -6, -6, -6, -6, -6, -6, -2, 8, -3, -7, -6, -4, -5, -6, -6, -6, -7, -7.4, -7.93, -8.3, 0.0 }; + { + -6, + -6, + -6, + -6, + -6, + -6, + -6, + -6, + -6, + -2, + 8, + -3, + -7, + -6, + -4, + -5, + -6, + -6, + -6, + -7, + -7.4, + -7.93, + -8.3, + 0.0, + }; coefficientss[11, 0, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.7, 2.95, 3.0, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2.7, + 2.95, + 3.0, + 0.0, + }; coefficientss[11, 1, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.7, -1.60, -1.5, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1.7, + -1.60, + -1.5, + 0.0, + }; coefficientss[11, 1, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0.26, 0.1, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.1, + 0.26, + 0.1, + 0.0, + }; coefficientss[11, 2, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.9, -1.88, -2.1, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1.9, + -1.88, + -2.1, + 0.0, + }; coefficientss[11, 2, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.3, 1.44, 1.7, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1.3, + 1.44, + 1.7, + 0.0, + }; coefficientss[11, 3, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.5, 1.44, 1.6, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1.5, + 1.44, + 1.6, + 0.0, + }; coefficientss[11, 3, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.9, -0.77, -0.6, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.9, + -0.77, + -0.6, + 0.0, + }; coefficientss[11, 4, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.1, -0.31, -0.5, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.1, + -0.31, + -0.5, + 0.0, + }; coefficientss[11, 4, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.6, -2.27, -1.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -2.6, + -2.27, + -1.8, + 0.0, + }; coefficientss[11, 5, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0.29, 0.5, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.1, + 0.29, + 0.5, + 0.0, + }; coefficientss[11, 5, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9, 0.90, 0.9, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9, + 0.90, + 0.9, + 0.0, + }; coefficientss[11, 6, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.7, -0.79, -0.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.7, + -0.79, + -0.8, + 0.0, + }; coefficientss[11, 6, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.7, -0.58, -0.4, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.7, + -0.58, + -0.4, + 0.0, + }; coefficientss[11, 7, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.7, 0.53, 0.4, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.7, + 0.53, + 0.4, + 0.0, + }; coefficientss[11, 7, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.8, -2.69, -2.5, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -2.8, + -2.69, + -2.5, + 0.0, + }; coefficientss[11, 8, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.7, 1.80, 1.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1.7, + 1.80, + 1.8, + 0.0, + }; coefficientss[11, 8, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.9, -1.08, -1.3, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.9, + -1.08, + -1.3, + 0.0, + }; coefficientss[11, 9, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0.16, 0.2, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.1, + 0.16, + 0.2, + 0.0, + }; coefficientss[11, 9, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.2, -1.58, -2.1, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1.2, + -1.58, + -2.1, + 0.0, + }; coefficientss[11, 10, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.2, 0.96, 0.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1.2, + 0.96, + 0.8, + 0.0, + }; coefficientss[11, 10, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.9, -1.90, -1.9, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1.9, + -1.90, + -1.9, + 0.0, + }; coefficientss[11, 11, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4.0, 3.99, 3.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 4.0, + 3.99, + 3.8, + 0.0, + }; coefficientss[11, 11, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.9, -1.39, -1.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.9, + -1.39, + -1.8, + 0.0, + }; coefficientss[12, 0, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.2, -2.15, -2.1, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -2.2, + -2.15, + -2.1, + 0.0, + }; coefficientss[12, 1, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.3, -0.29, -0.2, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.3, + -0.29, + -0.2, + 0.0, + }; coefficientss[12, 1, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.4, -0.55, -0.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.4, + -0.55, + -0.8, + 0.0, + }; coefficientss[12, 2, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2, 0.21, 0.3, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.2, + 0.21, + 0.3, + 0.0, + }; coefficientss[12, 2, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3, 0.23, 0.3, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.3, + 0.23, + 0.3, + 0.0, + }; coefficientss[12, 3, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9, 0.89, 1.0, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9, + 0.89, + 1.0, + 0.0, + }; coefficientss[12, 3, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2.5, 2.38, 2.2, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2.5, + 2.38, + 2.2, + 0.0, + }; coefficientss[12, 4, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.2, -0.38, -0.7, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.2, + -0.38, + -0.7, + 0.0, + }; coefficientss[12, 4, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.6, -2.63, -2.5, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -2.6, + -2.63, + -2.5, + 0.0, + }; coefficientss[12, 5, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.9, 0.96, 0.9, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.9, + 0.96, + 0.9, + 0.0, + }; coefficientss[12, 5, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.7, 0.61, 0.5, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.7, + 0.61, + 0.5, + 0.0, + }; coefficientss[12, 6, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.5, -0.30, -0.1, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.5, + -0.30, + -0.1, + 0.0, + }; coefficientss[12, 6, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3, 0.40, 0.6, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.3, + 0.40, + 0.6, + 0.0, + }; coefficientss[12, 7, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3, 0.46, 0.5, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.3, + 0.46, + 0.5, + 0.0, + }; coefficientss[12, 7, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.01, 0.0, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0, + 0.01, + 0.0, + 0.0, + }; coefficientss[12, 8, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.3, -0.35, -0.4, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.3, + -0.35, + -0.4, + 0.0, + }; coefficientss[12, 8, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, 0.02, 0.1, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0, + 0.02, + 0.1, + 0.0, + }; coefficientss[12, 9, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.4, -0.36, -0.4, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.4, + -0.36, + -0.4, + 0.0, + }; coefficientss[12, 9, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3, 0.28, 0.3, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.3, + 0.28, + 0.3, + 0.0, + }; coefficientss[12, 10, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.1, 0.08, 0.2, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.1, + 0.08, + 0.2, + 0.0, + }; coefficientss[12, 10, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.9, -0.87, -0.9, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.9, + -0.87, + -0.9, + 0.0, + }; coefficientss[12, 11, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.2, -0.49, -0.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.2, + -0.49, + -0.8, + 0.0, + }; coefficientss[12, 11, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.4, -0.34, -0.2, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.4, + -0.34, + -0.2, + 0.0, + }; coefficientss[12, 12, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.4, -0.08, 0.0, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.4, + -0.08, + 0.0, + 0.0, + }; coefficientss[12, 12, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.8, 0.88, 0.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.8, + 0.88, + 0.8, + 0.0, + }; coefficientss[13, 0, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.2, -0.16, -0.2, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.2, + -0.16, + -0.2, + 0.0, + }; coefficientss[13, 1, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.9, -0.88, -0.9, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.9, + -0.88, + -0.9, + 0.0, + }; coefficientss[13, 1, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.9, -0.76, -0.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.9, + -0.76, + -0.8, + 0.0, + }; coefficientss[13, 2, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3, 0.30, 0.3, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.3, + 0.30, + 0.3, + 0.0, + }; coefficientss[13, 2, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2, 0.33, 0.3, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.2, + 0.33, + 0.3, + 0.0, + }; coefficientss[13, 3, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1, 0.28, 0.4, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.1, + 0.28, + 0.4, + 0.0, + }; coefficientss[13, 3, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.8, 1.72, 1.7, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1.8, + 1.72, + 1.7, + 0.0, + }; coefficientss[13, 4, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.4, -0.43, -0.4, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.4, + -0.43, + -0.4, + 0.0, + }; coefficientss[13, 4, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.4, -0.54, -0.6, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.4, + -0.54, + -0.6, + 0.0, + }; coefficientss[13, 5, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.3, 1.18, 1.1, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1.3, + 1.18, + 1.1, + 0.0, + }; coefficientss[13, 5, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.0, -1.07, -1.2, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -1.0, + -1.07, + -1.2, + 0.0, + }; coefficientss[13, 6, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.4, -0.37, -0.3, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.4, + -0.37, + -0.3, + 0.0, + }; coefficientss[13, 6, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.1, -0.04, -0.1, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.1, + -0.04, + -0.1, + 0.0, + }; coefficientss[13, 7, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.7, 0.75, 0.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.7, + 0.75, + 0.8, + 0.0, + }; coefficientss[13, 7, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.7, 0.63, 0.5, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.7, + 0.63, + 0.5, + 0.0, + }; coefficientss[13, 8, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.4, -0.26, -0.2, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.4, + -0.26, + -0.2, + 0.0, + }; coefficientss[13, 8, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3, 0.21, 0.1, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.3, + 0.21, + 0.1, + 0.0, + }; coefficientss[13, 9, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3, 0.35, 0.4, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.3, + 0.35, + 0.4, + 0.0, + }; coefficientss[13, 9, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.6, 0.53, 0.5, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.6, + 0.53, + 0.5, + 0.0, + }; coefficientss[13, 10, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.1, -0.05, 0.0, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.1, + -0.05, + 0.0, + 0.0, + }; coefficientss[13, 10, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.3, 0.38, 0.4, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.3, + 0.38, + 0.4, + 0.0, + }; coefficientss[13, 11, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.4, 0.41, 0.4, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.4, + 0.41, + 0.4, + 0.0, + }; coefficientss[13, 11, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.2, -0.22, -0.2, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.2, + -0.22, + -0.2, + 0.0, + }; coefficientss[13, 12, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0, -0.10, -0.3, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.0, + -0.10, + -0.3, + 0.0, + }; coefficientss[13, 12, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.5, -0.57, -0.5, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.5, + -0.57, + -0.5, + 0.0, + }; coefficientss[13, 13, 0] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1, -0.18, -0.3, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0.1, + -0.18, + -0.3, + 0.0, + }; coefficientss[13, 13, 1] = new[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.9, -0.82, -0.8, 0.0 }; + { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + -0.9, + -0.82, + -0.8, + 0.0, + }; var models = new IgrfGeomagneticModel[23]; for (var i = 0; i < 23; i++) @@ -587,7 +5296,8 @@ public static List GetModels() if (i == 22) gtnm[j, k] = coefficientss[j, k, 0][i + 1]; else - gtnm[j, k] = (coefficientss[j, k, 0][i + 1] - coefficientss[j, k, 0][i]) / 5; + gtnm[j, k] = + (coefficientss[j, k, 0][i + 1] - coefficientss[j, k, 0][i]) / 5; } if (coefficientss[j, k, 1] != null && coefficientss[j, k, 1].Length > 0) @@ -596,11 +5306,11 @@ public static List GetModels() if (i == 22) htnm[j, k] = coefficientss[j, k, 1][i + 1]; else - htnm[j, k] = (coefficientss[j, k, 1][i + 1] - coefficientss[j, k, 1][i]) / 5; + htnm[j, k] = + (coefficientss[j, k, 1][i + 1] - coefficientss[j, k, 1][i]) / 5; } } - models[i] = new IgrfGeomagneticModel { ValidFrom = new DateTime(1900 + i * 5, 1, 1, 0, 0, 0, DateTimeKind.Utc), @@ -608,7 +5318,7 @@ public static List GetModels() MainCoefficientsG = gnm, MainCoefficientsH = hnm, SecularCoefficientsG = gtnm, - SecularCoefficientsH = htnm + SecularCoefficientsH = htnm, }; } @@ -624,4 +5334,4 @@ private class IgrfGeomagneticModel : IGeomagneticModel public double[,] SecularCoefficientsG { get; set; } public double[,] SecularCoefficientsH { get; set; } } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/Models/Wmm1985.cs b/Geo/Geomagnetism/Models/Wmm1985.cs index 94589c5..ee624d4 100644 --- a/Geo/Geomagnetism/Models/Wmm1985.cs +++ b/Geo/Geomagnetism/Models/Wmm1985.cs @@ -25,7 +25,7 @@ public class Wmm1985 : IGeomagneticModel { 5.7, 10.9, 0.9, -12.2, 9.5, -3.3, -1, 6.5, 1.5, -4.8, 0.0, 0.0, 0.0 }, { -3.4, -4.7, 2.5, -5.5, -2.1, 4.6, 3.2, 0.6, 1.9, 2.8, -0.2, 0.0, 0.0 }, { 2.3, -0.8, -2, 2.1, 0.2, -0.4, -0.4, 1.6, 1.5, -0.7, 2.3, 3.5, 0.0 }, - { -1.8, 0.0, 0.1, -0.3, 0.5, 0.5, -0.6, -0.4, 0.0, -0.5, 0.0, 0.7, -0.2 } + { -1.8, 0.0, 0.1, -0.3, 0.5, 0.5, -0.6, -0.4, 0.0, -0.5, 0.0, 0.7, -0.2 }, }; } } @@ -48,7 +48,7 @@ public class Wmm1985 : IGeomagneticModel { 0.0, -20.8, 15.8, 9, -5, -6.4, 9.1, 9.9, -5.8, 2.3, 0.0, 0.0, 0.0 }, { 0.0, 1.2, 0.4, 2.5, 5.6, -4.4, -0.5, -1.6, 3.7, -0.5, -6.1, 0.0, 0.0 }, { 0.0, 1.3, 2, -1.1, -2.8, 0.7, -0.1, -2.4, -0.4, -1.5, -1.5, 0.7, 0.0 }, - { 0.0, 0.3, 0.6, 2.5, -1.7, 0.3, 0.2, -0.1, 0.1, 0.1, -1.4, 0.4, 0.7 } + { 0.0, 0.3, 0.6, 2.5, -1.7, 0.3, 0.2, -0.1, 0.1, 0.1, -1.4, 0.4, 0.7 }, }; } } @@ -71,7 +71,7 @@ public class Wmm1985 : IGeomagneticModel { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } @@ -94,8 +94,8 @@ public class Wmm1985 : IGeomagneticModel { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/Models/Wmm1990.cs b/Geo/Geomagnetism/Models/Wmm1990.cs index fdd235c..f572c33 100644 --- a/Geo/Geomagnetism/Models/Wmm1990.cs +++ b/Geo/Geomagnetism/Models/Wmm1990.cs @@ -25,7 +25,7 @@ public class Wmm1990 : IGeomagneticModel { 3.6, 9.5, -0.9, -10.7, 10.7, -3.2, -1.4, 6.3, 0.8, -5.5, 0.0, 0.0, 0.0 }, { -3.3, -2.6, 4.5, -5.6, -3.6, 3.9, 3.2, 1.7, 3, 3.7, 0.7, 0.0, 0.0 }, { 1.3, -1.4, -2.5, 3.2, 0.2, -1.1, 0.3, -0.3, 0.9, -1.1, 2.4, 3, 0.0 }, - { -1.3, 0.1, 0.5, 0.7, 0.4, -0.2, -1.1, 0.9, -0.6, 0.8, 0.2, 0.4, 0.2 } + { -1.3, 0.1, 0.5, 0.7, 0.4, -0.2, -1.1, 0.9, -0.6, 0.8, 0.2, 0.4, 0.2 }, }; } } @@ -48,7 +48,7 @@ public class Wmm1990 : IGeomagneticModel { 0.0, -21.9, 14.3, 9.5, -6.7, -6.4, 9.1, 8.9, -8, 2.1, 0.0, 0.0, 0.0 }, { 0.0, 2.6, 1.2, 2.6, 5.7, -4, -0.4, -1.7, 3.8, -0.8, -6.5, 0.0, 0.0 }, { 0.0, 0.0, 1, -1.6, -2.2, 1.1, -0.7, -1.7, -1.5, -1.3, -1.1, 0.6, 0.0 }, - { 0.0, 0.7, 0.7, 1.3, -1.5, 0.3, 0.2, -1.1, 1.2, -0.2, -1.3, 0.6, 0.6 } + { 0.0, 0.7, 0.7, 1.3, -1.5, 0.3, 0.2, -1.1, 1.2, -0.2, -1.3, 0.6, 0.6 }, }; } } @@ -71,7 +71,7 @@ public class Wmm1990 : IGeomagneticModel { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } @@ -94,8 +94,8 @@ public class Wmm1990 : IGeomagneticModel { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/Models/Wmm1995.cs b/Geo/Geomagnetism/Models/Wmm1995.cs index 53530d2..f266134 100644 --- a/Geo/Geomagnetism/Models/Wmm1995.cs +++ b/Geo/Geomagnetism/Models/Wmm1995.cs @@ -25,7 +25,7 @@ public class Wmm1995 : IGeomagneticModel { 2.9, 7.5, 0.4, -10.3, 9.7, -2.3, -2.4, 6.8, -0.5, -6.5, 0.0, 0.0, 0.0 }, { -2.9, -3.3, 2.8, -4.3, -3.1, 2.4, 2.8, 0.7, 4.1, 3.6, 0.6, 0.0, 0.0 }, { 1.7, -1.6, -3.6, 1.2, -0.6, 0.1, -0.7, -0.8, 1.3, -0.3, 2.2, 4.2, 0.0 }, - { -1.8, 0.9, -0.1, -0.5, 0.8, 0.2, 0.5, 0.4, -0.4, 0.3, 0.2, 0.4, 0.6 } + { -1.8, 0.9, -0.1, -0.5, 0.8, 0.2, 0.5, 0.4, -0.4, 0.3, 0.2, 0.4, 0.6 }, }; } } @@ -48,7 +48,7 @@ public class Wmm1995 : IGeomagneticModel { 0.0, -19.8, 14.6, 10.9, -7.5, -6.8, 9.3, 7.7, -8.1, 2.6, 0.0, 0.0, 0.0 }, { 0.0, 3.2, 1.7, 2.9, 5.6, -3.4, -0.7, -2.9, 2.3, -1.6, -6.6, 0.0, 0.0 }, { 0.0, 0.3, 1, -3.6, -1.4, 1.9, 0.2, -1.3, -2.4, -0.6, -2.2, 1.3, 0.0 }, - { 0.0, 0.3, 1.4, 0.8, -3, 0.7, 0.5, -0.8, 0.6, 0.1, -1.3, -0.4, 0.9 } + { 0.0, 0.3, 1.4, 0.8, -3, 0.7, 0.5, -0.8, 0.6, 0.1, -1.3, -0.4, 0.9 }, }; } } @@ -71,7 +71,7 @@ public class Wmm1995 : IGeomagneticModel { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } @@ -94,8 +94,8 @@ public class Wmm1995 : IGeomagneticModel { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/Models/Wmm2000.cs b/Geo/Geomagnetism/Models/Wmm2000.cs index 7bee746..f12eab2 100644 --- a/Geo/Geomagnetism/Models/Wmm2000.cs +++ b/Geo/Geomagnetism/Models/Wmm2000.cs @@ -25,7 +25,7 @@ public class Wmm2000 : IGeomagneticModel { 5.7, 8.5, 2.0, -9.8, 7.6, -7.0, -2.0, 9.2, -2.2, -6.6, 0.0, 0.0, 0.0 }, { -2.2, -5.7, 1.6, -3.7, -0.6, 4.1, 2.2, 2.2, 4.6, 2.3, 0.1, 0.0, 0.0 }, { 3.3, -1.1, -2.4, 2.6, -1.3, -1.7, -0.6, 0.4, 0.7, -0.3, 2.3, 4.2, 0.0 }, - { -1.5, -0.2, -0.3, 0.5, 0.2, 0.9, -1.4, 0.6, -0.6, -1.0, -0.3, 0.3, 0.4 } + { -1.5, -0.2, -0.3, 0.5, 0.2, 0.9, -1.4, 0.6, -0.6, -1.0, -0.3, 0.3, 0.4 }, }; } } @@ -48,7 +48,7 @@ public class Wmm2000 : IGeomagneticModel { 0.0, -20.4, 13.9, 12.0, -6.2, -8.6, 9.4, 5.0, -8.4, 3.2, 0.0, 0.0, 0.0 }, { 0.0, 0.9, -0.7, 3.9, 4.8, -5.3, -1.0, -2.4, 1.3, -2.3, -6.4, 0.0, 0.0 }, { 0.0, -1.5, 0.7, -1.1, -2.3, 1.3, -0.6, -2.8, -1.6, -0.1, -1.9, 1.4, 0.0 }, - { 0.0, -1.0, 0.7, 2.2, -2.5, -0.2, 0.0, -0.2, 0.0, 0.2, -0.9, -0.2, 1.0 } + { 0.0, -1.0, 0.7, 2.2, -2.5, -0.2, 0.0, -0.2, 0.0, 0.2, -0.9, -0.2, 1.0 }, }; } } @@ -71,7 +71,7 @@ public class Wmm2000 : IGeomagneticModel { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } @@ -94,8 +94,8 @@ public class Wmm2000 : IGeomagneticModel { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/Models/Wmm2005.cs b/Geo/Geomagnetism/Models/Wmm2005.cs index 3cd2dd6..0a0c3ac 100644 --- a/Geo/Geomagnetism/Models/Wmm2005.cs +++ b/Geo/Geomagnetism/Models/Wmm2005.cs @@ -25,7 +25,7 @@ public class Wmm2005 : IGeomagneticModel { 5.6, 9.9, 3.5, -7.0, 5.1, -10.8, -1.3, 8.8, -6.7, -9.1, 0.0, 0.0, 0.0 }, { -2.3, -6.3, 1.6, -2.6, 0.0, 3.1, 0.4, 2.1, 3.9, -0.1, -2.3, 0.0, 0.0 }, { 2.8, -1.6, -1.7, 1.7, -0.1, 0.1, -0.7, 0.7, 1.8, 0.0, 1.1, 4.1, 0.0 }, - { -2.4, -0.4, 0.2, 0.8, -0.3, 1.1, -0.5, 0.4, -0.3, -0.3, -0.1, -0.3, -0.1 } + { -2.4, -0.4, 0.2, 0.8, -0.3, 1.1, -0.5, 0.4, -0.3, -0.3, -0.1, -0.3, -0.1 }, }; } } @@ -48,7 +48,7 @@ public class Wmm2005 : IGeomagneticModel { 0.0, -20.1, 12.9, 12.6, -6.7, -8.1, 8.0, 2.9, -7.9, 6.0, 0.0, 0.0, 0.0 }, { 0.0, 2.4, 0.2, 4.4, 4.8, -6.5, -1.1, -3.4, -0.8, -2.3, -7.9, 0.0, 0.0 }, { 0.0, 0.3, 1.2, -0.8, -2.5, 0.9, -0.6, -2.7, -0.9, -1.3, -2.0, -1.2, 0.0 }, - { 0.0, -0.4, 0.3, 2.4, -2.6, 0.6, 0.3, 0.0, 0.0, 0.3, -0.9, -0.4, 0.8 } + { 0.0, -0.4, 0.3, 2.4, -2.6, 0.6, 0.3, 0.0, 0.0, 0.3, -0.9, -0.4, 0.8 }, }; } } @@ -71,7 +71,7 @@ public class Wmm2005 : IGeomagneticModel { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } @@ -94,8 +94,8 @@ public class Wmm2005 : IGeomagneticModel { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/Models/Wmm2010.cs b/Geo/Geomagnetism/Models/Wmm2010.cs index ef7c791..e86516a 100644 --- a/Geo/Geomagnetism/Models/Wmm2010.cs +++ b/Geo/Geomagnetism/Models/Wmm2010.cs @@ -25,7 +25,7 @@ public class Wmm2010 : IGeomagneticModel { 5.4, 9.4, 3.4, -5.2, 3.1, -12.4, -0.7, 8.4, -8.5, -10.1, 0.0, 0.0, 0.0 }, { -2, -6.3, 0.9, -1.1, -0.2, 2.5, -0.3, 2.2, 3.1, -1, -2.8, 0.0, 0.0 }, { 3, -1.5, -2.1, 1.7, -0.5, 0.5, -0.8, 0.4, 1.8, 0.1, 0.7, 3.8, 0.0 }, - { -2.2, -0.2, 0.3, 1, -0.6, 0.9, -0.1, 0.5, -0.4, -0.4, 0.2, -0.8, 0.0 } + { -2.2, -0.2, 0.3, 1, -0.6, 0.9, -0.1, 0.5, -0.4, -0.4, 0.2, -0.8, 0.0 }, }; } } @@ -48,7 +48,7 @@ public class Wmm2010 : IGeomagneticModel { 0.0, -20.5, 11.5, 12.8, -7.2, -7.4, 8, 2.1, -6.1, 7, 0.0, 0.0, 0.0 }, { 0.0, 2.8, -0.1, 4.7, 4.4, -7.2, -1, -3.9, -2, -2, -8.3, 0.0, 0.0 }, { 0.0, 0.2, 1.7, -0.6, -1.8, 0.9, -0.4, -2.5, -1.3, -2.1, -1.9, -1.8, 0.0 }, - { 0.0, -0.9, 0.3, 2.1, -2.5, 0.5, 0.6, 0.0, 0.1, 0.3, -0.9, -0.2, 0.9 } + { 0.0, -0.9, 0.3, 2.1, -2.5, 0.5, 0.6, 0.0, 0.1, 0.3, -0.9, -0.2, 0.9 }, }; } } @@ -71,7 +71,7 @@ public class Wmm2010 : IGeomagneticModel { 0.0, -0.1, 0.0, 0.3, -0.4, -0.3, 0.1, -0.1, -0.4, -0.2, 0.0, 0.0, 0.0 }, { 0.0, 0.0, -0.1, 0.2, 0.0, -0.1, -0.2, 0.0, -0.1, -0.2, -0.2, 0.0, 0.0 }, { 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.0, 0.0 }, - { 0.0, 0.0, 0.1, 0.1, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.1 } + { 0.0, 0.0, 0.1, 0.1, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, 0.1 }, }; } } @@ -94,8 +94,8 @@ public class Wmm2010 : IGeomagneticModel { 0.0, 0.0, -0.2, 0.0, -0.1, 0.1, 0.0, -0.2, 0.3, 0.2, 0.0, 0.0, 0.0 }, { 0.0, 0.1, -0.1, 0.0, -0.1, -0.1, 0.0, -0.1, -0.2, 0.0, -0.1, 0.0, 0.0 }, { 0.0, 0.0, 0.1, 0.0, 0.1, 0.0, 0.1, 0.0, -0.1, -0.1, 0.0, -0.1, 0.0 }, - { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/Models/Wmm2015.cs b/Geo/Geomagnetism/Models/Wmm2015.cs index 32abfc1..e3c1dbb 100644 --- a/Geo/Geomagnetism/Models/Wmm2015.cs +++ b/Geo/Geomagnetism/Models/Wmm2015.cs @@ -25,7 +25,7 @@ public class Wmm2015 : IGeomagneticModel { 5.4, 8.8, 3.1, -3.1, 0.6, -13.3, -0.1, 8.7, -9.1, -10.5, 0.0, 0.0, 0.0 }, { -1.9, -6.5, 0.2, 0.6, -0.6, 1.7, -0.7, 2.1, 2.3, -1.8, -3.6, 0.0, 0.0 }, { 3.1, -1.5, -2.3, 2.1, -0.9, 0.6, -0.7, 0.2, 1.7, -0.2, 0.4, 3.5, 0.0 }, - { -2.0, -0.3, 0.4, 1.3, -0.9, 0.9, 0.1, 0.5, -0.4, -0.4, 0.2, -0.9, 0.0 } + { -2.0, -0.3, 0.4, 1.3, -0.9, 0.9, 0.1, 0.5, -0.4, -0.4, 0.2, -0.9, 0.0 }, }; } } @@ -48,7 +48,7 @@ public class Wmm2015 : IGeomagneticModel { 0.0, -21.6, 10.8, 11.7, -6.8, -6.9, 7.8, 1.0, -3.9, 8.5, 0.0, 0.0, 0.0 }, { 0.0, 3.3, -0.3, 4.6, 4.4, -7.9, -0.6, -4.1, -2.8, -1.1, -8.7, 0.0, 0.0 }, { 0.0, -0.1, 2.1, -0.7, -1.1, 0.7, -0.2, -2.1, -1.5, -2.5, -2.0, -2.3, 0.0 }, - { 0.0, -1.0, 0.5, 1.8, -2.2, 0.3, 0.7, -0.1, 0.3, 0.2, -0.9, -0.2, 0.7 } + { 0.0, -1.0, 0.5, 1.8, -2.2, 0.3, 0.7, -0.1, 0.3, 0.2, -0.9, -0.2, 0.7 }, }; } } @@ -71,7 +71,7 @@ public class Wmm2015 : IGeomagneticModel { 0.0, -0.1, -0.1, 0.4, -0.5, -0.2, 0.1, 0.0, -0.2, -0.1, 0.0, 0.0, 0.0 }, { 0.0, 0.0, -0.1, 0.3, -0.1, -0.1, -0.1, 0.0, -0.2, -0.1, -0.2, 0.0, 0.0 }, { 0.0, 0.0, -0.1, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -0.1, -0.1, 0.0 }, - { 0.1, 0.0, 0.0, 0.1, -0.1, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.1, 0.0, 0.0, 0.1, -0.1, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } @@ -94,8 +94,8 @@ public class Wmm2015 : IGeomagneticModel { 0.0, -0.2, -0.1, -0.2, 0.1, 0.1, 0.0, -0.2, 0.4, 0.3, 0.0, 0.0, 0.0 }, { 0.0, 0.1, -0.1, 0.0, 0.0, -0.2, 0.1, -0.1, -0.2, 0.1, -0.1, 0.0, 0.0 }, { 0.0, 0.0, 0.1, 0.0, 0.1, 0.0, 0.0, 0.1, 0.0, -0.1, 0.0, -0.1, 0.0 }, - { 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } + { 0.0, 0.0, 0.0, -0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, }; } } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/Models/Wmm2020.cs b/Geo/Geomagnetism/Models/Wmm2020.cs index f806c89..21f3b9d 100644 --- a/Geo/Geomagnetism/Models/Wmm2020.cs +++ b/Geo/Geomagnetism/Models/Wmm2020.cs @@ -25,7 +25,7 @@ public class Wmm2020 : IGeomagneticModel { 5.0, 8.2, 2.9, -1.4, -1.1, -13.3, 1.1, 8.9, -9.3, -11.9, 0.0, 0.0, 0.0 }, { -1.9, -6.2, -0.1, 1.7, -0.9, 0.6, -0.9, 1.9, 1.4, -2.4, -3.9, 0.0, 0.0 }, { 3.0, -1.4, -2.5, 2.4, -0.9, 0.3, -0.7, -0.1, 1.4, -0.6, 0.2, 3.1, 0.0 }, - { -2.0, -0.1, 0.5, 1.3, -1.2, 0.7, 0.3, 0.5, -0.2, -0.5, 0.1, -1.1, -0.3 } + { -2.0, -0.1, 0.5, 1.3, -1.2, 0.7, 0.3, 0.5, -0.2, -0.5, 0.1, -1.1, -0.3 }, }; } } @@ -48,7 +48,7 @@ public class Wmm2020 : IGeomagneticModel { 0.0, -23.3, 11.1, 9.8, -5.1, -6.2, 7.8, 0.4, -1.5, 9.7, 0.0, 0.0, 0.0 }, { 0.0, 3.4, -0.2, 3.5, 4.8, -8.6, -0.1, -4.2, -3.4, -0.1, -8.8, 0.0, 0.0 }, { 0.0, -0.0, 2.6, -0.5, -0.4, 0.6, -0.2, -1.7, -1.6, -3.0, -2.0, -2.6, 0.0 }, - { 0.0, -1.2, 0.5, 1.3, -1.8, 0.1, 0.7, -0.1, 0.6, 0.2, -0.9, -0.0, 0.5 } + { 0.0, -1.2, 0.5, 1.3, -1.8, 0.1, 0.7, -0.1, 0.6, 0.2, -0.9, -0.0, 0.5 }, }; } } @@ -71,7 +71,7 @@ public class Wmm2020 : IGeomagneticModel { -0.1, -0.2, -0.0, 0.4, -0.3, -0.0, 0.3, -0.0, -0.0, -0.4, 0.0, 0.0, 0.0 }, { 0.0, -0.0, -0.0, 0.2, -0.1, -0.2, -0.0, -0.1, -0.2, -0.1, -0.0, 0.0, 0.0 }, { -0.0, -0.1, -0.0, 0.0, -0.0, -0.1, 0.0, -0.0, -0.1, -0.1, -0.1, -0.1, 0.0 }, - { 0.0, -0.0, -0.0, 0.0, -0.0, -0.0, 0.0, -0.0, 0.0, -0.0, -0.0, -0.0, -0.1 } + { 0.0, -0.0, -0.0, 0.0, -0.0, -0.0, 0.0, -0.0, 0.0, -0.0, -0.0, -0.0, -0.1 }, }; } } @@ -94,8 +94,8 @@ public class Wmm2020 : IGeomagneticModel { 0.0, -0.3, 0.2, -0.4, 0.4, 0.1, -0.0, -0.2, 0.5, 0.2, 0.0, 0.0, 0.0 }, { 0.0, -0.0, 0.1, -0.3, 0.1, -0.2, 0.1, -0.0, -0.1, 0.2, -0.0, 0.0, 0.0 }, { 0.0, -0.0, 0.1, 0.0, 0.2, -0.0, 0.0, 0.1, -0.0, -0.1, 0.0, -0.0, 0.0 }, - { 0.0, -0.0, 0.0, -0.1, 0.1, -0.0, 0.0, -0.0, 0.1, -0.0, -0.0, 0.0, -0.1 } + { 0.0, -0.0, 0.0, -0.1, 0.1, -0.0, 0.0, -0.0, 0.1, -0.0, -0.0, 0.0, -0.1 }, }; } } -} \ No newline at end of file +} diff --git a/Geo/Geomagnetism/WmmGeomagnetismCalculator.cs b/Geo/Geomagnetism/WmmGeomagnetismCalculator.cs index 4bbfab1..8450615 100644 --- a/Geo/Geomagnetism/WmmGeomagnetismCalculator.cs +++ b/Geo/Geomagnetism/WmmGeomagnetismCalculator.cs @@ -14,14 +14,12 @@ public class WmmGeomagnetismCalculator : GeomagnetismCalculator new Wmm2005(), new Wmm2010(), new Wmm2015(), - new Wmm2020() + new Wmm2020(), }; - public WmmGeomagnetismCalculator() : base(GeomagneticModels) - { - } + public WmmGeomagnetismCalculator() + : base(GeomagneticModels) { } - public WmmGeomagnetismCalculator(Spheroid spheroid) : base(spheroid, GeomagneticModels) - { - } -} \ No newline at end of file + public WmmGeomagnetismCalculator(Spheroid spheroid) + : base(spheroid, GeomagneticModels) { } +} diff --git a/Geo/Geometries/Circle.cs b/Geo/Geometries/Circle.cs index 7f35f83..516ac8a 100644 --- a/Geo/Geometries/Circle.cs +++ b/Geo/Geometries/Circle.cs @@ -34,7 +34,13 @@ public Circle(double latitiude, double longitude, double elevation, double radiu Radius = radius; } - public Circle(double latitiude, double longitude, double elevation, double measure, double radius) + public Circle( + double latitiude, + double longitude, + double elevation, + double measure, + double radius + ) { Center = new CoordinateZM(latitiude, longitude, elevation, measure); Radius = radius; @@ -46,7 +52,8 @@ public Circle(double latitiude, double longitude, double elevation, double measu public override Envelope GetBounds() { var latitudinalRadiusDeg = Radius / (Constants.NauticalMile * 60); - var longditudinalRadiusDeg = Radius / (Constants.NauticalMile * 60) * Math.Cos(Center.Latitude.ToRadians()); + var longditudinalRadiusDeg = + Radius / (Constants.NauticalMile * 60) * Math.Cos(Center.Latitude.ToRadians()); return new Envelope( Center.Latitude - latitudinalRadiusDeg, @@ -82,7 +89,8 @@ public Polygon ToPolygon(int sides = 36) Coordinate first = null; for (var i = 0; i < sides; i++) { - var coord = GeoContext.Current.GeodeticCalculator.CalculateOrthodromicLine(Center, angle * i, Radius) + var coord = GeoContext + .Current.GeodeticCalculator.CalculateOrthodromicLine(Center, angle * i, Radius) .Coordinate2; if (i == 0) first = coord; @@ -98,7 +106,9 @@ public Polygon ToPolygon(int sides = 36) public override bool Equals(object obj, SpatialEqualityOptions options) { var other = obj as Circle; - return !ReferenceEquals(null, other) && Radius.Equals(other.Radius) && Equals(Center, other.Center, options); + return !ReferenceEquals(null, other) + && Radius.Equals(other.Radius) + && Equals(Center, other.Center, options); } public override bool Equals(object obj) @@ -115,7 +125,8 @@ public override int GetHashCode(SpatialEqualityOptions options) { unchecked { - return (Radius.GetHashCode() * 397) ^ (Center != null ? Center.GetHashCode(options) : 0); + return (Radius.GetHashCode() * 397) + ^ (Center != null ? Center.GetHashCode(options) : 0); } } @@ -132,4 +143,4 @@ public override int GetHashCode(SpatialEqualityOptions options) } #endregion -} \ No newline at end of file +} diff --git a/Geo/Geometries/GeometryCollection.cs b/Geo/Geometries/GeometryCollection.cs index b494cd5..71ae72e 100644 --- a/Geo/Geometries/GeometryCollection.cs +++ b/Geo/Geometries/GeometryCollection.cs @@ -21,9 +21,7 @@ public GeometryCollection(IEnumerable geometries) } public GeometryCollection(params IGeometry[] geometries) - : this((IEnumerable)geometries) - { - } + : this((IEnumerable)geometries) { } public SpatialReadOnlyCollection Geometries { get; } @@ -62,9 +60,7 @@ public override bool Equals(object obj, SpatialEqualityOptions options) if (Geometries.Count != other.Geometries.Count) return false; - return !Geometries - .Where((t, i) => !t.Equals(other.Geometries[i], options)) - .Any(); + return !Geometries.Where((t, i) => !t.Equals(other.Geometries[i], options)).Any(); } public override bool Equals(object obj) @@ -85,4 +81,4 @@ public override int GetHashCode(SpatialEqualityOptions options) } #endregion -} \ No newline at end of file +} diff --git a/Geo/Geometries/LineString.cs b/Geo/Geometries/LineString.cs index 43c0256..3fd9ba4 100644 --- a/Geo/Geometries/LineString.cs +++ b/Geo/Geometries/LineString.cs @@ -10,17 +10,14 @@ public class LineString : Geometry, ICurve { public static readonly LineString Empty = new(); - public LineString() : this(new CoordinateSequence()) - { - } + public LineString() + : this(new CoordinateSequence()) { } - public LineString(IEnumerable coordinates) : this(new CoordinateSequence(coordinates)) - { - } + public LineString(IEnumerable coordinates) + : this(new CoordinateSequence(coordinates)) { } - public LineString(params Coordinate[] coordinates) : this(new CoordinateSequence(coordinates)) - { - } + public LineString(params Coordinate[] coordinates) + : this(new CoordinateSequence(coordinates)) { } public LineString(CoordinateSequence coordinates) { @@ -35,8 +32,12 @@ public override Envelope GetBounds() { return IsEmpty ? null - : new Envelope(Coordinates.Min(x => x.Latitude), Coordinates.Min(x => x.Longitude), - Coordinates.Max(x => x.Latitude), Coordinates.Max(x => x.Longitude)); + : new Envelope( + Coordinates.Min(x => x.Latitude), + Coordinates.Min(x => x.Longitude), + Coordinates.Max(x => x.Latitude), + Coordinates.Max(x => x.Longitude) + ); } public override bool IsEmpty => Coordinates.IsEmpty; @@ -88,4 +89,4 @@ public override int GetHashCode(SpatialEqualityOptions options) } #endregion -} \ No newline at end of file +} diff --git a/Geo/Geometries/LinearRing.cs b/Geo/Geometries/LinearRing.cs index 95a804c..b3b975a 100644 --- a/Geo/Geometries/LinearRing.cs +++ b/Geo/Geometries/LinearRing.cs @@ -5,23 +5,23 @@ namespace Geo.Geometries; public class LinearRing : LineString { - public new static readonly LinearRing Empty = new(); + public static new readonly LinearRing Empty = new(); - public LinearRing() : this(new CoordinateSequence()) - { - } + public LinearRing() + : this(new CoordinateSequence()) { } - public LinearRing(IEnumerable coordinates) : this(new CoordinateSequence(coordinates)) - { - } + public LinearRing(IEnumerable coordinates) + : this(new CoordinateSequence(coordinates)) { } - public LinearRing(params Coordinate[] coordinates) : this(new CoordinateSequence(coordinates)) - { - } + public LinearRing(params Coordinate[] coordinates) + : this(new CoordinateSequence(coordinates)) { } - public LinearRing(CoordinateSequence coordinates) : base(coordinates) + public LinearRing(CoordinateSequence coordinates) + : base(coordinates) { if (coordinates != null && !coordinates.IsEmpty && !coordinates.IsClosed) - throw new ArgumentException("The Coordinate Sequence must be closed to form a Linear Ring"); + throw new ArgumentException( + "The Coordinate Sequence must be closed to form a Linear Ring" + ); } -} \ No newline at end of file +} diff --git a/Geo/Geometries/MultiLineString.cs b/Geo/Geometries/MultiLineString.cs index e6ffd7f..c3d7136 100644 --- a/Geo/Geometries/MultiLineString.cs +++ b/Geo/Geometries/MultiLineString.cs @@ -8,24 +8,18 @@ namespace Geo.Geometries; public class MultiLineString : GeometryCollection, IMultiCurve { - public new static readonly MultiLineString Empty = new(); + public static new readonly MultiLineString Empty = new(); - public MultiLineString() - { - } + public MultiLineString() { } public MultiLineString(IEnumerable lineStrings) - : base(lineStrings) - { - } + : base(lineStrings) { } public MultiLineString(params LineString[] lineStrings) - : base(lineStrings.Cast()) - { - } + : base(lineStrings.Cast()) { } public Distance GetLength() { return Geometries.Cast().Sum(x => x.GetLength()); } -} \ No newline at end of file +} diff --git a/Geo/Geometries/MultiPoint.cs b/Geo/Geometries/MultiPoint.cs index 6879f83..b63f520 100644 --- a/Geo/Geometries/MultiPoint.cs +++ b/Geo/Geometries/MultiPoint.cs @@ -6,19 +6,13 @@ namespace Geo.Geometries; public class MultiPoint : GeometryCollection { - public new static readonly MultiPoint Empty = new(); + public static new readonly MultiPoint Empty = new(); - public MultiPoint() - { - } + public MultiPoint() { } public MultiPoint(IEnumerable points) - : base(points) - { - } + : base(points) { } public MultiPoint(params Point[] points) - : base(points.Cast()) - { - } -} \ No newline at end of file + : base(points.Cast()) { } +} diff --git a/Geo/Geometries/MultiPolygon.cs b/Geo/Geometries/MultiPolygon.cs index 07eb31c..6302570 100644 --- a/Geo/Geometries/MultiPolygon.cs +++ b/Geo/Geometries/MultiPolygon.cs @@ -8,24 +8,18 @@ namespace Geo.Geometries; public class MultiPolygon : GeometryCollection, IMultiSurface { - public new static readonly MultiPolygon Empty = new(); + public static new readonly MultiPolygon Empty = new(); - public MultiPolygon() - { - } + public MultiPolygon() { } public MultiPolygon(IEnumerable polygons) - : base(polygons) - { - } + : base(polygons) { } public MultiPolygon(params Polygon[] polygons) - : base(polygons.Cast()) - { - } + : base(polygons.Cast()) { } public Area GetArea() { return Geometries.Cast().Sum(x => x.GetArea()); } -} \ No newline at end of file +} diff --git a/Geo/Geometries/Point.cs b/Geo/Geometries/Point.cs index 11eae4b..88f1335 100644 --- a/Geo/Geometries/Point.cs +++ b/Geo/Geometries/Point.cs @@ -7,9 +7,8 @@ public class Point : Geometry, IPosition { public static readonly Point Empty = new(); - public Point() : this(null) - { - } + public Point() + : this(null) { } public Point(double latitude, double longitude) { @@ -85,4 +84,4 @@ public override int GetHashCode(SpatialEqualityOptions options) } #endregion -} \ No newline at end of file +} diff --git a/Geo/Geometries/Polygon.cs b/Geo/Geometries/Polygon.cs index 2d78bb7..0860638 100644 --- a/Geo/Geometries/Polygon.cs +++ b/Geo/Geometries/Polygon.cs @@ -10,9 +10,8 @@ public class Polygon : Geometry, ISurface { public static readonly Polygon Empty = new(); - public Polygon() : this((LinearRing)null) - { - } + public Polygon() + : this((LinearRing)null) { } public Polygon(LinearRing shell, IEnumerable holes) { @@ -20,17 +19,14 @@ public Polygon(LinearRing shell, IEnumerable holes) Holes = new SpatialReadOnlyCollection(holes ?? new LinearRing[0]); } - public Polygon(LinearRing shell, params LinearRing[] holes) : this(shell, (IEnumerable)holes) - { - } + public Polygon(LinearRing shell, params LinearRing[] holes) + : this(shell, (IEnumerable)holes) { } - public Polygon(params Coordinate[] shell) : this(new LinearRing(shell)) - { - } + public Polygon(params Coordinate[] shell) + : this(new LinearRing(shell)) { } - public Polygon(IEnumerable shell) : this(new LinearRing(shell)) - { - } + public Polygon(IEnumerable shell) + : this(new LinearRing(shell)) { } public LinearRing Shell { get; } public SpatialReadOnlyCollection Holes { get; } @@ -50,7 +46,10 @@ public Area GetArea() { var calculator = GeoContext.Current.GeodeticCalculator; var area = calculator.CalculateArea(Shell.Coordinates); - return Holes.Aggregate(area, (current, hole) => current - calculator.CalculateArea(hole.Coordinates)); + return Holes.Aggregate( + area, + (current, hole) => current - calculator.CalculateArea(hole.Coordinates) + ); } #region Equality methods @@ -76,18 +75,16 @@ public override bool Equals(object obj, SpatialEqualityOptions options) return true; return Shell.Equals(other.Shell, options) - && Holes.Count == other.Holes.Count - && !Holes - .Where((t, i) => !t.Equals(other.Holes[i], options)) - .Any(); + && Holes.Count == other.Holes.Count + && !Holes.Where((t, i) => !t.Equals(other.Holes[i], options)).Any(); } public override int GetHashCode(SpatialEqualityOptions options) { unchecked { - return ((Shell != null ? Shell.GetHashCode(options) : 0) * 397) ^ - (Holes != null ? Holes.GetHashCode(options) : 0); + return ((Shell != null ? Shell.GetHashCode(options) : 0) * 397) + ^ (Holes != null ? Holes.GetHashCode(options) : 0); } } @@ -104,4 +101,4 @@ public override int GetHashCode(SpatialEqualityOptions options) } #endregion -} \ No newline at end of file +} diff --git a/Geo/Geometries/Triangle.cs b/Geo/Geometries/Triangle.cs index 71ef792..f00687c 100644 --- a/Geo/Geometries/Triangle.cs +++ b/Geo/Geometries/Triangle.cs @@ -5,21 +5,15 @@ namespace Geo.Geometries; public class Triangle : Polygon { - public new static readonly Triangle Empty = new(); + public static new readonly Triangle Empty = new(); - public Triangle() - { - } + public Triangle() { } public Triangle(Coordinate p0, Coordinate p1, Coordinate p2) - : base(new LinearRing(p0, p1, p2, p0)) - { - } + : base(new LinearRing(p0, p1, p2, p0)) { } public Triangle(LinearRing shell, params LinearRing[] holes) - : this(shell, (IEnumerable)holes) - { - } + : this(shell, (IEnumerable)holes) { } public Triangle(LinearRing shell, IEnumerable holes) : base(shell, holes) @@ -27,4 +21,4 @@ public Triangle(LinearRing shell, IEnumerable holes) if (!shell.IsClosed && shell.Coordinates.Count != 4) throw new ArgumentException("The Coordinate Sequence is not valid for a triangle."); } -} \ No newline at end of file +} diff --git a/Geo/Gps/GpsData.cs b/Geo/Gps/GpsData.cs index 2f9268e..213d90a 100644 --- a/Geo/Gps/GpsData.cs +++ b/Geo/Gps/GpsData.cs @@ -16,7 +16,7 @@ static GpsData() FileSerializers = new List { new Gpx10Serializer(), - new Gpx11Serializer() + new Gpx11Serializer(), }; FileParsers = new List(FileSerializers.OfType()) { @@ -24,7 +24,7 @@ static GpsData() new NmeaDeSerializer(), new GarminFlightplanDeSerializer(), new PocketFmsFlightplanDeSerializer(), - new SkyDemonFlightplanDeSerializer() + new SkyDemonFlightplanDeSerializer(), }; } @@ -75,4 +75,4 @@ public static GpsData Parse(Stream stream) var parser = FileParsers.FirstOrDefault(x => x.CanDeSerialize(gpsStream)); return parser == null ? null : parser.DeSerialize(gpsStream); } -} \ No newline at end of file +} diff --git a/Geo/Gps/GpsFeatures.cs b/Geo/Gps/GpsFeatures.cs index 9e8d592..00c4ba7 100644 --- a/Geo/Gps/GpsFeatures.cs +++ b/Geo/Gps/GpsFeatures.cs @@ -13,5 +13,5 @@ public enum GpsFeatures RoutesAndWaypoints = 5, TracksAndWaypoints = 6, - All = 7 -} \ No newline at end of file + All = 7, +} diff --git a/Geo/Gps/GpsFeaturesExtensions.cs b/Geo/Gps/GpsFeaturesExtensions.cs index 8b80056..0732afc 100644 --- a/Geo/Gps/GpsFeaturesExtensions.cs +++ b/Geo/Gps/GpsFeaturesExtensions.cs @@ -21,4 +21,4 @@ public static bool Waypoints(this GpsFeatures supportedFeatures) { return (supportedFeatures & GpsFeatures.Waypoints) != 0; } -} \ No newline at end of file +} diff --git a/Geo/Gps/GpsFileFormat.cs b/Geo/Gps/GpsFileFormat.cs index a41cf7c..bab3162 100644 --- a/Geo/Gps/GpsFileFormat.cs +++ b/Geo/Gps/GpsFileFormat.cs @@ -20,4 +20,4 @@ public GpsFileFormat(string extension, string name, string specificationUrl) public string Extension { get; } public string Name { get; } public Uri SpecificationUri { get; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Metadata/GpsMetadata.cs b/Geo/Gps/Metadata/GpsMetadata.cs index 7ce9908..80f0165 100644 --- a/Geo/Gps/Metadata/GpsMetadata.cs +++ b/Geo/Gps/Metadata/GpsMetadata.cs @@ -2,9 +2,8 @@ namespace Geo.Gps.Metadata; public class GpsMetadata : Metadata { - public GpsMetadata() : base(new MetadataKeys()) - { - } + public GpsMetadata() + : base(new MetadataKeys()) { } public class MetadataKeys { @@ -12,9 +11,7 @@ public class MetadataKeys public CopyrightKeys Copyright = new(); public VehicleKeys Vehicle = new(); - internal MetadataKeys() - { - } + internal MetadataKeys() { } public string Name => "name"; public string Description => "description"; @@ -44,4 +41,4 @@ public class VehicleKeys public string Crew2 => "vehicle.crew2"; } } -} \ No newline at end of file +} diff --git a/Geo/Gps/Metadata/Metadata.cs b/Geo/Gps/Metadata/Metadata.cs index e4e528d..e0b4774 100644 --- a/Geo/Gps/Metadata/Metadata.cs +++ b/Geo/Gps/Metadata/Metadata.cs @@ -34,4 +34,4 @@ public void RemoveAttribute(Func attribute) var key = attribute(_metadataKeys); Remove(key); } -} \ No newline at end of file +} diff --git a/Geo/Gps/Metadata/RouteMetadata.cs b/Geo/Gps/Metadata/RouteMetadata.cs index 63936e6..1ecc47c 100644 --- a/Geo/Gps/Metadata/RouteMetadata.cs +++ b/Geo/Gps/Metadata/RouteMetadata.cs @@ -2,18 +2,15 @@ namespace Geo.Gps.Metadata; public class RouteMetadata : Metadata { - public RouteMetadata() : base(new MetadataKeys()) - { - } + public RouteMetadata() + : base(new MetadataKeys()) { } public class MetadataKeys { - internal MetadataKeys() - { - } + internal MetadataKeys() { } public string Name => "name"; public string Description => "description"; public string Comment => "comment"; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Metadata/TrackMetadata.cs b/Geo/Gps/Metadata/TrackMetadata.cs index 4782a68..1320b65 100644 --- a/Geo/Gps/Metadata/TrackMetadata.cs +++ b/Geo/Gps/Metadata/TrackMetadata.cs @@ -2,18 +2,15 @@ namespace Geo.Gps.Metadata; public class TrackMetadata : Metadata { - public TrackMetadata() : base(new MetadataKeys()) - { - } + public TrackMetadata() + : base(new MetadataKeys()) { } public class MetadataKeys { - internal MetadataKeys() - { - } + internal MetadataKeys() { } public string Name => "name"; public string Description => "description"; public string Comment => "comment"; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Route.cs b/Geo/Gps/Route.cs index 3ea4d79..2a8c5a4 100644 --- a/Geo/Gps/Route.cs +++ b/Geo/Gps/Route.cs @@ -27,4 +27,4 @@ public LineString ToLineString() { return new LineString(Waypoints.Select(wp => wp.Coordinate)); } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/GarminFlightplanDeSerializer.cs b/Geo/Gps/Serialization/GarminFlightplanDeSerializer.cs index 9fe8c26..b909d83 100644 --- a/Geo/Gps/Serialization/GarminFlightplanDeSerializer.cs +++ b/Geo/Gps/Serialization/GarminFlightplanDeSerializer.cs @@ -9,13 +9,7 @@ public class GarminFlightplanDeSerializer : GpsXmlDeSerializer { public override GpsFileFormat[] FileFormats { - get - { - return new[] - { - new GpsFileFormat("fpl", "Garmin Flightplan") - }; - } + get { return new[] { new GpsFileFormat("fpl", "Garmin Flightplan") }; } } public override GpsFeatures SupportedFeatures => GpsFeatures.Routes; @@ -43,4 +37,4 @@ protected override GpsData DeSerialize(GarminFlightplan xml) return data; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Gpx10Serializer.cs b/Geo/Gps/Serialization/Gpx10Serializer.cs index 02d3826..2c75cb4 100644 --- a/Geo/Gps/Serialization/Gpx10Serializer.cs +++ b/Geo/Gps/Serialization/Gpx10Serializer.cs @@ -17,7 +17,7 @@ public override GpsFileFormat[] FileFormats { return new[] { - new GpsFileFormat("gps", "GPX 1.0", "http://www.topografix.com/GPX/1/0/gpx.xsd") + new GpsFileFormat("gps", "GPX 1.0", "http://www.topografix.com/GPX/1/0/gpx.xsd"), }; } } @@ -77,7 +77,8 @@ private IEnumerable SerializeTracks(GpsData data) { var segment = track.Segments[i]; var pts = new GpxTrackPoint[segment.Waypoints.Count]; - for (var j = 0; j < segment.Waypoints.Count; j++) pts[j] = ConvertToGpxTrackPoint(segment.Waypoints[j]); + for (var j = 0; j < segment.Waypoints.Count; j++) + pts[j] = ConvertToGpxTrackPoint(segment.Waypoints[j]); trk.trkseg[i] = new GpxTrackSegment { trkpt = pts }; } @@ -96,12 +97,12 @@ private IEnumerable SerializeRoutes(GpsData data) SerializeRouteMetadata(route, rte, x => x.Comment, (gpx, s) => gpx.cmt = s); rte.rtept = new GpxPoint[route.Waypoints.Count]; - for (var j = 0; j < route.Waypoints.Count; j++) rte.rtept[j] = ConvertToGpxPoint(route.Waypoints[j]); + for (var j = 0; j < route.Waypoints.Count; j++) + rte.rtept[j] = ConvertToGpxPoint(route.Waypoints[j]); yield return rte; } } - private static void ParseMetadata(GpxFile xml, GpsData data) { data.Metadata.Attribute(x => x.Software, xml.creator); @@ -128,7 +129,8 @@ private static void ParseTracks(GpxFile xml, GpsData data) foreach (var trksegTrkpt in trkType.trkseg.Where(seg => seg.trkpt != null)) { var segment = new TrackSegment(); - foreach (var wptType in trksegTrkpt.trkpt) segment.Waypoints.Add(ConvertWaypoint(wptType)); + foreach (var wptType in trksegTrkpt.trkpt) + segment.Waypoints.Add(ConvertWaypoint(wptType)); track.Segments.Add(segment); } @@ -146,7 +148,8 @@ private static void ParseRoute(GpxFile xml, GpsData data) route.Metadata.Attribute(x => x.Description, rteType.desc); route.Metadata.Attribute(x => x.Comment, rteType.cmt); - foreach (var wptType in rteType.rtept) route.Waypoints.Add(ConvertWaypoint(wptType)); + foreach (var wptType in rteType.rtept) + route.Waypoints.Add(ConvertWaypoint(wptType)); data.Routes.Add(route); } } @@ -179,7 +182,7 @@ private static GpxTrackPoint ConvertToGpxTrackPoint(Waypoint waypoint) timeSpecified = waypoint.TimeUtc.HasValue, name = waypoint.Name, desc = waypoint.Description, - cmt = waypoint.Comment + cmt = waypoint.Comment, }; } @@ -195,7 +198,7 @@ private static GpxPoint ConvertToGpxPoint(Waypoint waypoint) timeSpecified = waypoint.TimeUtc.HasValue, name = waypoint.Name, desc = waypoint.Description, - cmt = waypoint.Comment + cmt = waypoint.Comment, }; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Gpx11Serializer.cs b/Geo/Gps/Serialization/Gpx11Serializer.cs index 4a681ff..a10eb57 100644 --- a/Geo/Gps/Serialization/Gpx11Serializer.cs +++ b/Geo/Gps/Serialization/Gpx11Serializer.cs @@ -17,7 +17,7 @@ public override GpsFileFormat[] FileFormats { return new[] { - new GpsFileFormat("gps", "GPX 1.1", "http://www.topografix.com/GPX/1/1/gpx.xsd") + new GpsFileFormat("gps", "GPX 1.1", "http://www.topografix.com/GPX/1/1/gpx.xsd"), }; } } @@ -43,91 +43,137 @@ protected override GpxFile SerializeInternal(GpsData data) { var xml = new GpxFile(); SerializeMetadata(data, xml, x => x.Software, (gpx, s) => gpx.creator = s); - SerializeMetadata(data, xml, x => x.Name, (gpx, s) => - { - if (gpx.metadata == null) - gpx.metadata = new GpxMetadata(); - gpx.metadata.name = s; - }); - SerializeMetadata(data, xml, x => x.Description, (gpx, s) => - { - if (gpx.metadata == null) - gpx.metadata = new GpxMetadata(); - gpx.metadata.desc = s; - }); - SerializeMetadata(data, xml, x => x.Keywords, (gpx, s) => - { - if (gpx.metadata == null) - gpx.metadata = new GpxMetadata(); - gpx.metadata.keywords = s; - }); + SerializeMetadata( + data, + xml, + x => x.Name, + (gpx, s) => + { + if (gpx.metadata == null) + gpx.metadata = new GpxMetadata(); + gpx.metadata.name = s; + } + ); + SerializeMetadata( + data, + xml, + x => x.Description, + (gpx, s) => + { + if (gpx.metadata == null) + gpx.metadata = new GpxMetadata(); + gpx.metadata.desc = s; + } + ); + SerializeMetadata( + data, + xml, + x => x.Keywords, + (gpx, s) => + { + if (gpx.metadata == null) + gpx.metadata = new GpxMetadata(); + gpx.metadata.keywords = s; + } + ); - SerializeMetadata(data, xml, x => x.Link, (gpx, s) => - { - if (gpx.metadata == null) - gpx.metadata = new GpxMetadata(); - if (gpx.metadata.link == null) - gpx.metadata.link = new GpxLink[1]; - gpx.metadata.link[0] = new GpxLink { href = s }; - }); - - SerializeMetadata(data, xml, x => x.Copyright.Author, (gpx, s) => - { - if (gpx.metadata == null) - gpx.metadata = new GpxMetadata(); - if (gpx.metadata.copyright == null) - gpx.metadata.copyright = new GpxCopyright(); - gpx.metadata.copyright.author = s; - }); - SerializeMetadata(data, xml, x => x.Copyright.License, (gpx, s) => - { - if (gpx.metadata == null) - gpx.metadata = new GpxMetadata(); - if (gpx.metadata.copyright == null) - gpx.metadata.copyright = new GpxCopyright(); - gpx.metadata.copyright.license = s; - }); - SerializeMetadata(data, xml, x => x.Copyright.Year, (gpx, s) => - { - if (gpx.metadata == null) - gpx.metadata = new GpxMetadata(); - if (gpx.metadata.copyright == null) - gpx.metadata.copyright = new GpxCopyright(); - gpx.metadata.copyright.year = s; - }); - - SerializeMetadata(data, xml, x => x.Author.Name, (gpx, s) => - { - if (gpx.metadata == null) - gpx.metadata = new GpxMetadata(); - if (gpx.metadata.author == null) - gpx.metadata.author = new GpxPerson(); - gpx.metadata.author.name = s; - }); - SerializeMetadata(data, xml, x => x.Author.Email, (gpx, s) => - { - if (gpx.metadata == null) - gpx.metadata = new GpxMetadata(); - if (gpx.metadata.author == null) - gpx.metadata.author = new GpxPerson(); - var parts = s.Split('@'); - gpx.metadata.author.email = new GpxEmail + SerializeMetadata( + data, + xml, + x => x.Link, + (gpx, s) => { - id = parts[0], - domain = parts[1] - }; - }); + if (gpx.metadata == null) + gpx.metadata = new GpxMetadata(); + if (gpx.metadata.link == null) + gpx.metadata.link = new GpxLink[1]; + gpx.metadata.link[0] = new GpxLink { href = s }; + } + ); - SerializeMetadata(data, xml, x => x.Author.Link, (gpx, s) => - { - if (gpx.metadata == null) - gpx.metadata = new GpxMetadata(); - if (gpx.metadata.author == null) - gpx.metadata.author = new GpxPerson(); - if (gpx.metadata.author.link == null) - gpx.metadata.author.link = new GpxLink(); - gpx.metadata.author.link.href = s; - }); + SerializeMetadata( + data, + xml, + x => x.Copyright.Author, + (gpx, s) => + { + if (gpx.metadata == null) + gpx.metadata = new GpxMetadata(); + if (gpx.metadata.copyright == null) + gpx.metadata.copyright = new GpxCopyright(); + gpx.metadata.copyright.author = s; + } + ); + SerializeMetadata( + data, + xml, + x => x.Copyright.License, + (gpx, s) => + { + if (gpx.metadata == null) + gpx.metadata = new GpxMetadata(); + if (gpx.metadata.copyright == null) + gpx.metadata.copyright = new GpxCopyright(); + gpx.metadata.copyright.license = s; + } + ); + SerializeMetadata( + data, + xml, + x => x.Copyright.Year, + (gpx, s) => + { + if (gpx.metadata == null) + gpx.metadata = new GpxMetadata(); + if (gpx.metadata.copyright == null) + gpx.metadata.copyright = new GpxCopyright(); + gpx.metadata.copyright.year = s; + } + ); + + SerializeMetadata( + data, + xml, + x => x.Author.Name, + (gpx, s) => + { + if (gpx.metadata == null) + gpx.metadata = new GpxMetadata(); + if (gpx.metadata.author == null) + gpx.metadata.author = new GpxPerson(); + gpx.metadata.author.name = s; + } + ); + SerializeMetadata( + data, + xml, + x => x.Author.Email, + (gpx, s) => + { + if (gpx.metadata == null) + gpx.metadata = new GpxMetadata(); + if (gpx.metadata.author == null) + gpx.metadata.author = new GpxPerson(); + var parts = s.Split('@'); + gpx.metadata.author.email = new GpxEmail { id = parts[0], domain = parts[1] }; + } + ); + + SerializeMetadata( + data, + xml, + x => x.Author.Link, + (gpx, s) => + { + if (gpx.metadata == null) + gpx.metadata = new GpxMetadata(); + if (gpx.metadata.author == null) + gpx.metadata.author = new GpxPerson(); + if (gpx.metadata.author.link == null) + gpx.metadata.author.link = new GpxLink(); + gpx.metadata.author.link.href = s; + } + ); xml.trk = SerializeTracks(data).ToArray(); xml.rte = SerializeRoutes(data).ToArray(); @@ -156,7 +202,8 @@ private IEnumerable SerializeTracks(GpsData data) { var segment = track.Segments[i]; var pts = new GpxWaypoint[segment.Waypoints.Count]; - for (var j = 0; j < segment.Waypoints.Count; j++) pts[j] = ConvertToGpxWaypoint(segment.Waypoints[j]); + for (var j = 0; j < segment.Waypoints.Count; j++) + pts[j] = ConvertToGpxWaypoint(segment.Waypoints[j]); trk.trkseg[i] = new GpxTrackSegment { trkpt = pts }; } @@ -175,7 +222,8 @@ private IEnumerable SerializeRoutes(GpsData data) SerializeRouteMetadata(route, rte, x => x.Comment, (gpx, s) => gpx.cmt = s); rte.rtept = new GpxWaypoint[route.Waypoints.Count]; - for (var j = 0; j < route.Waypoints.Count; j++) rte.rtept[j] = ConvertToGpxWaypoint(route.Waypoints[j]); + for (var j = 0; j < route.Waypoints.Count; j++) + rte.rtept[j] = ConvertToGpxWaypoint(route.Waypoints[j]); yield return rte; } } @@ -196,8 +244,10 @@ private static void ParseMetadata(GpxFile xml, GpsData data) { data.Metadata.Attribute(x => x.Author.Name, xml.metadata.author.name); if (xml.metadata.author.email != null) - data.Metadata.Attribute(x => x.Author.Email, - xml.metadata.author.email.id + "@" + xml.metadata.author.email.domain); + data.Metadata.Attribute( + x => x.Author.Email, + xml.metadata.author.email.id + "@" + xml.metadata.author.email.domain + ); if (xml.metadata.author.link != null) data.Metadata.Attribute(x => x.Author.Link, xml.metadata.author.link.href); } @@ -226,7 +276,8 @@ private static void ParseTracks(GpxFile xml, GpsData data) foreach (var trksegType in trkType.trkseg.Where(seg => seg.trkpt != null)) { var segment = new TrackSegment(); - foreach (var wptType in trksegType.trkpt) segment.Waypoints.Add(ConvertWaypoint(wptType)); + foreach (var wptType in trksegType.trkpt) + segment.Waypoints.Add(ConvertWaypoint(wptType)); track.Segments.Add(segment); } @@ -244,7 +295,8 @@ private static void ParseRoute(GpxFile xml, GpsData data) route.Metadata.Attribute(x => x.Description, rteType.desc); route.Metadata.Attribute(x => x.Comment, rteType.cmt); - foreach (var wptType in rteType.rtept) route.Waypoints.Add(ConvertWaypoint(wptType)); + foreach (var wptType in rteType.rtept) + route.Waypoints.Add(ConvertWaypoint(wptType)); data.Routes.Add(route); } } @@ -277,7 +329,7 @@ private static GpxWaypoint ConvertToGpxWaypoint(Waypoint waypoint) timeSpecified = waypoint.TimeUtc.HasValue, name = waypoint.Name, desc = waypoint.Description, - cmt = waypoint.Comment + cmt = waypoint.Comment, }; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/IGpsFileDeSerializer.cs b/Geo/Gps/Serialization/IGpsFileDeSerializer.cs index 7d965e4..cc43dd4 100644 --- a/Geo/Gps/Serialization/IGpsFileDeSerializer.cs +++ b/Geo/Gps/Serialization/IGpsFileDeSerializer.cs @@ -14,4 +14,4 @@ public interface IGpsFileSerializer : IGpsFileDeSerializer { string Serialize(GpsData data); void Serialize(GpsData data, Stream stream); -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/IgcDeSerializer.cs b/Geo/Gps/Serialization/IgcDeSerializer.cs index 171f6bb..70c6dfe 100644 --- a/Geo/Gps/Serialization/IgcDeSerializer.cs +++ b/Geo/Gps/Serialization/IgcDeSerializer.cs @@ -26,7 +26,11 @@ public GpsFileFormat[] FileFormats { return new[] { - new GpsFileFormat("igc", "IGC", "http://carrier.csi.cam.ac.uk/forsterlewis/soaring/igc_file_format/") + new GpsFileFormat( + "igc", + "IGC", + "http://carrier.csi.cam.ac.uk/forsterlewis/soaring/igc_file_format/" + ), }; } } @@ -67,7 +71,10 @@ public GpsData DeSerialize(StreamWrapper streamWrapper) var d = int.Parse(match.Groups["d"].Value, CultureInfo.InvariantCulture); var m = int.Parse(match.Groups["m"].Value, CultureInfo.InvariantCulture); var y = int.Parse(match.Groups["y"].Value, CultureInfo.InvariantCulture); - var yn = int.Parse(DateTime.UtcNow.ToString("yy"), CultureInfo.InvariantCulture); + var yn = int.Parse( + DateTime.UtcNow.ToString("yy"), + CultureInfo.InvariantCulture + ); if (y > yn) yn += 100; var yd = yn - y; @@ -102,8 +109,12 @@ public GpsData DeSerialize(StreamWrapper streamWrapper) return data; } - private bool ParseMetadata(GpsData data, Func attribute, string regex, - string line) + private bool ParseMetadata( + GpsData data, + Func attribute, + string regex, + string line + ) { var match = Regex.Match(line, regex); if (match.Success) @@ -132,11 +143,14 @@ private bool ParseFix(string line, TrackSegment trackSegment, DateTime date) var gpsAlt = match.Groups["gpsAlt"].Value; var cood = ParseCoordinate(coord); - var waypoint = new Waypoint(cood.Latitude, cood.Longitude, + var waypoint = new Waypoint( + cood.Latitude, + cood.Longitude, double.Parse(gpsAlt, CultureInfo.InvariantCulture), date.AddHours(int.Parse(h, CultureInfo.InvariantCulture)) .AddMinutes(int.Parse(m, CultureInfo.InvariantCulture)) - .AddSeconds(int.Parse(s, CultureInfo.InvariantCulture))); + .AddSeconds(int.Parse(s, CultureInfo.InvariantCulture)) + ); trackSegment.Waypoints.Add(waypoint); return true; @@ -151,11 +165,13 @@ private Coordinate ParseCoordinate(string coord) if (match.Success) { - var deg1 = double.Parse(match.Groups["d1"].Value, CultureInfo.InvariantCulture) + - double.Parse(match.Groups["m1"].Value, CultureInfo.InvariantCulture) / 1000 / 60; + var deg1 = + double.Parse(match.Groups["d1"].Value, CultureInfo.InvariantCulture) + + double.Parse(match.Groups["m1"].Value, CultureInfo.InvariantCulture) / 1000 / 60; var dir1 = Regex.IsMatch(match.Groups["dir1"].Value, "[Ss]") ? -1d : 1d; - var deg2 = double.Parse(match.Groups["d2"].Value, CultureInfo.InvariantCulture) + - double.Parse(match.Groups["m2"].Value, CultureInfo.InvariantCulture) / 1000 / 60; + var deg2 = + double.Parse(match.Groups["d2"].Value, CultureInfo.InvariantCulture) + + double.Parse(match.Groups["m2"].Value, CultureInfo.InvariantCulture) / 1000 / 60; var dir2 = Regex.IsMatch(match.Groups["dir2"].Value, "[Ww]") ? -1d : 1d; return new Coordinate(deg1 * dir1, deg2 * dir2); @@ -163,4 +179,4 @@ private Coordinate ParseCoordinate(string coord) throw new FormatException("Coordinate (" + coord + ") is not a supported format."); } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/NmeaDeSerializer.cs b/Geo/Gps/Serialization/NmeaDeSerializer.cs index c50484d..2d27823 100644 --- a/Geo/Gps/Serialization/NmeaDeSerializer.cs +++ b/Geo/Gps/Serialization/NmeaDeSerializer.cs @@ -15,13 +15,7 @@ public class NmeaDeSerializer : IGpsFileDeSerializer public GpsFileFormat[] FileFormats { - get - { - return new[] - { - new GpsFileFormat("nmea", "NMEA") - }; - } + get { return new[] { new GpsFileFormat("nmea", "NMEA") }; } } public GpsFeatures SupportedFeatures => GpsFeatures.TracksAndWaypoints; @@ -81,7 +75,12 @@ private bool ParseFix(string line, TrackSegment trackSegment) var lat = ConvertOrd(match.Groups["lat"].Value, match.Groups["latd"].Value); var lon = ConvertOrd(match.Groups["lon"].Value, match.Groups["lond"].Value); - var waypoint = new Waypoint(lat, lon, alt, DateTime.MinValue.AddHours(h).AddMinutes(m).AddSeconds(s)); + var waypoint = new Waypoint( + lat, + lon, + alt, + DateTime.MinValue.AddHours(h).AddMinutes(m).AddSeconds(s) + ); trackSegment.Waypoints.Add(waypoint); return true; @@ -112,7 +111,10 @@ private double ConvertOrd(string ord, string dir) { var d = Regex.IsMatch(dir, "^[NnEe]$") ? 1 : -1; var sub = Regex.IsMatch(dir, "^[NnSs]") ? 2 : 3; - return (double.Parse(ord.Substring(0, sub), CultureInfo.InvariantCulture) + - double.Parse(ord.Substring(sub, ord.Length - sub), CultureInfo.InvariantCulture) / 60) * d; + return ( + double.Parse(ord.Substring(0, sub), CultureInfo.InvariantCulture) + + double.Parse(ord.Substring(sub, ord.Length - sub), CultureInfo.InvariantCulture) + / 60 + ) * d; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/PocketFmsFlightplanDeSerializer.cs b/Geo/Gps/Serialization/PocketFmsFlightplanDeSerializer.cs index 2b1c4e4..5c59d4e 100644 --- a/Geo/Gps/Serialization/PocketFmsFlightplanDeSerializer.cs +++ b/Geo/Gps/Serialization/PocketFmsFlightplanDeSerializer.cs @@ -12,8 +12,11 @@ public override GpsFileFormat[] FileFormats { return new[] { - new GpsFileFormat("xml", "PocketFMS Flightplan", - "http://www.PocketFMS.com/XMLSchema/PocketFMSNavlog-1.2.0.xsd") + new GpsFileFormat( + "xml", + "PocketFMS Flightplan", + "http://www.PocketFMS.com/XMLSchema/PocketFMSNavlog-1.2.0.xsd" + ), }; } } @@ -28,10 +31,16 @@ protected override bool CanDeSerialize(XmlReader xml) protected override GpsData DeSerialize(PocketFmsFlightplan xml) { var route = new Route(); - route.Waypoints.Add(new Waypoint((double)xml.LIB[0].FromPoint.Latitude, - (double)xml.LIB[0].FromPoint.Longitude)); + route.Waypoints.Add( + new Waypoint( + (double)xml.LIB[0].FromPoint.Latitude, + (double)xml.LIB[0].FromPoint.Longitude + ) + ); foreach (var lib in xml.LIB) - route.Waypoints.Add(new Waypoint((double)lib.ToPoint.Latitude, (double)lib.ToPoint.Longitude)); + route.Waypoints.Add( + new Waypoint((double)lib.ToPoint.Latitude, (double)lib.ToPoint.Longitude) + ); var data = new GpsData(); data.Routes.Add(route); @@ -42,4 +51,4 @@ protected override GpsData DeSerialize(PocketFmsFlightplan xml) return data; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/SkyDemonFlightplanDeSerializer.cs b/Geo/Gps/Serialization/SkyDemonFlightplanDeSerializer.cs index d80b065..51d4e30 100644 --- a/Geo/Gps/Serialization/SkyDemonFlightplanDeSerializer.cs +++ b/Geo/Gps/Serialization/SkyDemonFlightplanDeSerializer.cs @@ -13,13 +13,7 @@ public class SkyDemonFlightplanDeSerializer : GpsXmlDeSerializer GpsFeatures.Routes; @@ -28,7 +22,8 @@ private Route ConvertRoute(SkyDemonRoute route) { var result = new Route(); result.Waypoints.Add(ParseWaypoint(route.Start)); - foreach (var rhumbLine in route.RhumbLineRoute) result.Waypoints.Add(ParseWaypoint(rhumbLine.To)); + foreach (var rhumbLine in route.RhumbLineRoute) + result.Waypoints.Add(ParseWaypoint(rhumbLine.To)); return result; } @@ -39,13 +34,15 @@ private Waypoint ParseWaypoint(string c) var match1 = Regex.Match(ord[0], COORD_REGEX1); var match2 = Regex.Match(ord[1], COORD_REGEX2); - var lat = double.Parse(match1.Groups["d"].Value, CultureInfo.InvariantCulture) + - double.Parse(match1.Groups["m"].Value, CultureInfo.InvariantCulture) / 60 + - double.Parse(match1.Groups["s"].Value, CultureInfo.InvariantCulture) / 3600; + var lat = + double.Parse(match1.Groups["d"].Value, CultureInfo.InvariantCulture) + + double.Parse(match1.Groups["m"].Value, CultureInfo.InvariantCulture) / 60 + + double.Parse(match1.Groups["s"].Value, CultureInfo.InvariantCulture) / 3600; - var lon = double.Parse(match2.Groups["d"].Value, CultureInfo.InvariantCulture) + - double.Parse(match2.Groups["m"].Value, CultureInfo.InvariantCulture) / 60 + - double.Parse(match2.Groups["s"].Value, CultureInfo.InvariantCulture) / 3600; + var lon = + double.Parse(match2.Groups["d"].Value, CultureInfo.InvariantCulture) + + double.Parse(match2.Groups["m"].Value, CultureInfo.InvariantCulture) / 60 + + double.Parse(match2.Groups["s"].Value, CultureInfo.InvariantCulture) / 3600; var latd = Regex.IsMatch(match1.Groups["dir"].Value, "[NnEe]") ? 1 : -1; var lond = Regex.IsMatch(match2.Groups["dir"].Value, "[NnEe]") ? 1 : -1; @@ -66,7 +63,8 @@ protected override GpsData DeSerialize(SkyDemonFlightplan xml) //N514807.00 W0000930.00 var data = new GpsData(); - if (xml.PrimaryRoute != null) data.Routes.Add(ConvertRoute(xml.PrimaryRoute)); + if (xml.PrimaryRoute != null) + data.Routes.Add(ConvertRoute(xml.PrimaryRoute)); if (xml.Routes != null) foreach (var route in xml.Routes) @@ -80,4 +78,4 @@ protected override GpsData DeSerialize(SkyDemonFlightplan xml) return data; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/StreamWrapper.cs b/Geo/Gps/Serialization/StreamWrapper.cs index fe0936a..c12cff5 100644 --- a/Geo/Gps/Serialization/StreamWrapper.cs +++ b/Geo/Gps/Serialization/StreamWrapper.cs @@ -59,4 +59,4 @@ public override void Write(byte[] buffer, int offset, int count) { UnderlyingStream.Write(buffer, offset, count); } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminFlightplan.cs b/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminFlightplan.cs index de13791..4fd0ae2 100644 --- a/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminFlightplan.cs +++ b/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminFlightplan.cs @@ -3,7 +3,11 @@ namespace Geo.Gps.Serialization.Xml.Garmin.Flightplan; [XmlType(AnonymousType = true, Namespace = "http://www8.garmin.com/xmlschemas/FlightPlan/v1")] -[XmlRoot("flight-plan", Namespace = "http://www8.garmin.com/xmlschemas/FlightPlan/v1", IsNullable = false)] +[XmlRoot( + "flight-plan", + Namespace = "http://www8.garmin.com/xmlschemas/FlightPlan/v1", + IsNullable = false +)] public class GarminFlightplan { //public string created { get; set; } @@ -12,5 +16,6 @@ public class GarminFlightplan [XmlArrayItem("waypoint", typeof(GarminWaypoint), IsNullable = false)] public GarminWaypoint[] waypointtable { get; set; } - [XmlElement("route")] public GarminRoute[] route { get; set; } -} \ No newline at end of file + [XmlElement("route")] + public GarminRoute[] route { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminRoute.cs b/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminRoute.cs index 6179af9..806cc9c 100644 --- a/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminRoute.cs +++ b/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminRoute.cs @@ -5,10 +5,12 @@ namespace Geo.Gps.Serialization.Xml.Garmin.Flightplan; [XmlType(AnonymousType = true, Namespace = "http://www8.garmin.com/xmlschemas/FlightPlan/v1")] public class GarminRoute { - [XmlElement("route-name")] public string routename { get; set; } + [XmlElement("route-name")] + public string routename { get; set; } //[XmlElement("flight-plan-index")] //public string flightplanindex { get; set; } - [XmlElement("route-point")] public GarminRoutePoint[] routepoint { get; set; } -} \ No newline at end of file + [XmlElement("route-point")] + public GarminRoutePoint[] routepoint { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminRoutePoint.cs b/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminRoutePoint.cs index 1bdf675..b7e2cbc 100644 --- a/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminRoutePoint.cs +++ b/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminRoutePoint.cs @@ -5,11 +5,12 @@ namespace Geo.Gps.Serialization.Xml.Garmin.Flightplan; [XmlType(AnonymousType = true, Namespace = "http://www8.garmin.com/xmlschemas/FlightPlan/v1")] public class GarminRoutePoint { - [XmlElement("waypoint-identifier")] public string waypointidentifier { get; set; } + [XmlElement("waypoint-identifier")] + public string waypointidentifier { get; set; } //[XmlElement("waypoint-type")] //public string waypointtype { get; set; } //[XmlElement("waypoint-country-code")] //public string waypointcountrycode { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminWaypoint.cs b/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminWaypoint.cs index 2aa432c..82fddde 100644 --- a/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminWaypoint.cs +++ b/Geo/Gps/Serialization/Xml/Garmin/Flightplan/GarminWaypoint.cs @@ -17,4 +17,4 @@ public class GarminWaypoint public double lon { get; set; } //public string comment { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/GpsXmlDeSerializer.cs b/Geo/Gps/Serialization/Xml/GpsXmlDeSerializer.cs index dd3c25a..729d9a3 100644 --- a/Geo/Gps/Serialization/Xml/GpsXmlDeSerializer.cs +++ b/Geo/Gps/Serialization/Xml/GpsXmlDeSerializer.cs @@ -15,7 +15,12 @@ public bool CanDeSerialize(StreamWrapper streamWrapper) try { streamWrapper.Position = 0; - using (var reader = XmlReader.Create(streamWrapper, new XmlReaderSettings { CloseInput = false })) + using ( + var reader = XmlReader.Create( + streamWrapper, + new XmlReaderSettings { CloseInput = false } + ) + ) { if (_xmlSerializer.CanDeserialize(reader)) if (reader.MoveToContent() == XmlNodeType.Element) @@ -38,7 +43,12 @@ public GpsData DeSerialize(StreamWrapper streamWrapper) try { streamWrapper.Position = 0; - using (var reader = XmlReader.Create(streamWrapper, new XmlReaderSettings { CloseInput = false })) + using ( + var reader = XmlReader.Create( + streamWrapper, + new XmlReaderSettings { CloseInput = false } + ) + ) { doc = (T)_xmlSerializer.Deserialize(reader); } @@ -53,4 +63,4 @@ public GpsData DeSerialize(StreamWrapper streamWrapper) protected abstract bool CanDeSerialize(XmlReader xml); protected abstract GpsData DeSerialize(T xml); -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/GpsXmlSerializer.cs b/Geo/Gps/Serialization/Xml/GpsXmlSerializer.cs index d15352a..fa5e250 100644 --- a/Geo/Gps/Serialization/Xml/GpsXmlSerializer.cs +++ b/Geo/Gps/Serialization/Xml/GpsXmlSerializer.cs @@ -21,24 +21,36 @@ public string Serialize(GpsData data) protected abstract T SerializeInternal(GpsData data); - protected void SerializeMetadata(GpsData data, T xml, Func attribute, - Action action) + protected void SerializeMetadata( + GpsData data, + T xml, + Func attribute, + Action action + ) { var value = data.Metadata.Attribute(attribute); if (!string.IsNullOrWhiteSpace(value)) action(xml, value); } - protected void SerializeTrackMetadata(Track data, TTrack xml, - Func attribute, Action action) + protected void SerializeTrackMetadata( + Track data, + TTrack xml, + Func attribute, + Action action + ) { var value = data.Metadata.Attribute(attribute); if (!string.IsNullOrWhiteSpace(value)) action(xml, value); } - protected void SerializeRouteMetadata(Route data, TRoute xml, - Func attribute, Action action) + protected void SerializeRouteMetadata( + Route data, + TRoute xml, + Func attribute, + Action action + ) { var value = data.Metadata.Attribute(attribute); if (!string.IsNullOrWhiteSpace(value)) @@ -54,4 +66,4 @@ public EncodingStringWriter(Encoding encoding) public override Encoding Encoding { get; } } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxBounds.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxBounds.cs index 2d68731..c39fc55 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxBounds.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxBounds.cs @@ -3,6 +3,4 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx10; [XmlType(Namespace = "http://www.topografix.com/GPX/1/0")] -public class GpxBounds : GpxBoundsBase -{ -} \ No newline at end of file +public class GpxBounds : GpxBoundsBase { } diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxFile.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxFile.cs index 2ef90c2..f3d0ff7 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxFile.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxFile.cs @@ -15,22 +15,28 @@ public GpxFile() public string email { get; set; } - [XmlElement(DataType = "anyURI")] public string url { get; set; } + [XmlElement(DataType = "anyURI")] + public string url { get; set; } public string urlname { get; set; } public GpxBounds bounds { get; set; } - [XmlElement("wpt")] public GpxPoint[] wpt { get; set; } + [XmlElement("wpt")] + public GpxPoint[] wpt { get; set; } - [XmlElement("rte")] public GpxRoute[] rte { get; set; } + [XmlElement("rte")] + public GpxRoute[] rte { get; set; } - [XmlElement("trk")] public GpxTrack[] trk { get; set; } + [XmlElement("trk")] + public GpxTrack[] trk { get; set; } //[XmlAnyElement] //public XmlElement[] Any { get; set; } - [XmlAttribute] public string version { get; set; } + [XmlAttribute] + public string version { get; set; } - [XmlAttribute] public string creator { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string creator { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxFixType.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxFixType.cs index 8dd147e..5fb4796 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxFixType.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxFixType.cs @@ -6,8 +6,12 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx10; public enum GpxFixType { none, - [XmlEnum("2d")] Item2d, - [XmlEnum("3d")] Item3d, + + [XmlEnum("2d")] + Item2d, + + [XmlEnum("3d")] + Item3d, dgps, - pps -} \ No newline at end of file + pps, +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxPoint.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxPoint.cs index 71572d5..a93c341 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxPoint.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxPoint.cs @@ -5,7 +5,8 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx10; [XmlType(AnonymousType = true, Namespace = "http://www.topografix.com/GPX/1/0")] public class GpxPoint : GpxWaypointBase { - [XmlElement(DataType = "anyURI")] public string url { get; set; } + [XmlElement(DataType = "anyURI")] + public string url { get; set; } public string urlname { get; set; } @@ -13,4 +14,4 @@ public class GpxPoint : GpxWaypointBase //[XmlAnyElement] //public XmlElement[] Any { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxRoute.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxRoute.cs index 2d4ee53..fc72e61 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxRoute.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxRoute.cs @@ -5,12 +5,14 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx10; [XmlType(AnonymousType = true, Namespace = "http://www.topografix.com/GPX/1/0")] public class GpxRoute : GpxRteTrkBase { - [XmlElement(DataType = "anyURI")] public string url { get; set; } + [XmlElement(DataType = "anyURI")] + public string url { get; set; } public string urlname { get; set; } //[XmlAnyElement] //public XmlElement[] Any { get; set; } - [XmlElement("rtept")] public GpxPoint[] rtept { get; set; } -} \ No newline at end of file + [XmlElement("rtept")] + public GpxPoint[] rtept { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrack.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrack.cs index 48a1e1d..31f4643 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrack.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrack.cs @@ -5,12 +5,14 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx10; [XmlType(AnonymousType = true, Namespace = "http://www.topografix.com/GPX/1/0")] public class GpxTrack : GpxRteTrkBase { - [XmlElement(DataType = "anyURI")] public string url { get; set; } + [XmlElement(DataType = "anyURI")] + public string url { get; set; } public string urlname { get; set; } //[XmlAnyElement] //public XmlElement[] Any { get; set; } - [XmlElement("trkseg")] public GpxTrackSegment[] trkseg { get; set; } -} \ No newline at end of file + [XmlElement("trkseg")] + public GpxTrackSegment[] trkseg { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrackPoint.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrackPoint.cs index e5b2c0e..4e277ae 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrackPoint.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrackPoint.cs @@ -7,9 +7,11 @@ public class GpxTrackPoint : GpxPoint { public decimal course { get; set; } - [XmlIgnore] public bool courseSpecified { get; set; } + [XmlIgnore] + public bool courseSpecified { get; set; } public decimal speed { get; set; } - [XmlIgnore] public bool speedSpecified { get; set; } -} \ No newline at end of file + [XmlIgnore] + public bool speedSpecified { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrackSegment.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrackSegment.cs index b98b595..985797e 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrackSegment.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx10/GpxTrackSegment.cs @@ -5,5 +5,6 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx10; [XmlType(AnonymousType = true, Namespace = "http://www.topografix.com/GPX/1/0")] public class GpxTrackSegment { - [XmlElement("trkpt")] public GpxTrackPoint[] trkpt { get; set; } -} \ No newline at end of file + [XmlElement("trkpt")] + public GpxTrackPoint[] trkpt { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxBounds.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxBounds.cs index e7cf665..3b23ca3 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxBounds.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxBounds.cs @@ -3,6 +3,4 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx11; [XmlType(Namespace = "http://www.topografix.com/GPX/1/1")] -public class GpxBounds : GpxBoundsBase -{ -} \ No newline at end of file +public class GpxBounds : GpxBoundsBase { } diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxCopyright.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxCopyright.cs index 6af0256..1d82404 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxCopyright.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxCopyright.cs @@ -5,9 +5,12 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx11; [XmlType(Namespace = "http://www.topografix.com/GPX/1/1")] public class GpxCopyright { - [XmlElement(DataType = "gYear")] public string year { get; set; } + [XmlElement(DataType = "gYear")] + public string year { get; set; } - [XmlElement(DataType = "anyURI")] public string license { get; set; } + [XmlElement(DataType = "anyURI")] + public string license { get; set; } - [XmlAttribute] public string author { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string author { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxEmail.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxEmail.cs index 1e394c2..3e4d9eb 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxEmail.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxEmail.cs @@ -5,7 +5,9 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx11; [XmlType(Namespace = "http://www.topografix.com/GPX/1/1")] public class GpxEmail { - [XmlAttribute] public string id { get; set; } + [XmlAttribute] + public string id { get; set; } - [XmlAttribute] public string domain { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string domain { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxExtensions.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxExtensions.cs index e7910ca..1633683 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxExtensions.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxExtensions.cs @@ -6,5 +6,6 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx11; [XmlType(Namespace = "http://www.topografix.com/GPX/1/1")] public class GpxExtensions { - [XmlAnyElement] public XmlElement[] Any { get; set; } -} \ No newline at end of file + [XmlAnyElement] + public XmlElement[] Any { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxFile.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxFile.cs index 6af9bf9..4477c21 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxFile.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxFile.cs @@ -13,15 +13,20 @@ public GpxFile() public GpxMetadata metadata { get; set; } - [XmlElement("wpt")] public GpxWaypoint[] wpt { get; set; } + [XmlElement("wpt")] + public GpxWaypoint[] wpt { get; set; } - [XmlElement("rte")] public GpxRoute[] rte { get; set; } + [XmlElement("rte")] + public GpxRoute[] rte { get; set; } - [XmlElement("trk")] public GpxTrack[] trk { get; set; } + [XmlElement("trk")] + public GpxTrack[] trk { get; set; } //public extensionsType extensions { get; set; } - [XmlAttribute] public string version { get; set; } + [XmlAttribute] + public string version { get; set; } - [XmlAttribute] public string creator { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string creator { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxFixType.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxFixType.cs index b680908..3394eef 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxFixType.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxFixType.cs @@ -6,8 +6,12 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx11; public enum GpxFixType { none, - [XmlEnum("2d")] Item2d, - [XmlEnum("3d")] Item3d, + + [XmlEnum("2d")] + Item2d, + + [XmlEnum("3d")] + Item3d, dgps, - pps -} \ No newline at end of file + pps, +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxLink.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxLink.cs index 66b5484..79577ac 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxLink.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxLink.cs @@ -9,5 +9,6 @@ public class GpxLink public string type { get; set; } - [XmlAttribute(DataType = "anyURI")] public string href { get; set; } -} \ No newline at end of file + [XmlAttribute(DataType = "anyURI")] + public string href { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxMetadata.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxMetadata.cs index cfe0019..4e75fc6 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxMetadata.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxMetadata.cs @@ -8,9 +8,10 @@ public class GpxMetadata : GpxMetadataBase public GpxPerson author { get; set; } public GpxCopyright copyright { get; set; } - [XmlElement("link")] public GpxLink[] link { get; set; } + [XmlElement("link")] + public GpxLink[] link { get; set; } public GpxBounds bounds { get; set; } //public extensionsType extensions { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxPerson.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxPerson.cs index 698e8f9..02bcd59 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxPerson.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxPerson.cs @@ -10,4 +10,4 @@ public class GpxPerson public GpxEmail email { get; set; } public GpxLink link { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxRoute.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxRoute.cs index 10038e0..4fe98aa 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxRoute.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxRoute.cs @@ -5,11 +5,13 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx11; [XmlType(Namespace = "http://www.topografix.com/GPX/1/1")] public class GpxRoute : GpxRteTrkBase { - [XmlElement("link")] public GpxLink[] link { get; set; } + [XmlElement("link")] + public GpxLink[] link { get; set; } public string type { get; set; } //public extensionsType extensions { get; set; } - [XmlElement("rtept")] public GpxWaypoint[] rtept { get; set; } -} \ No newline at end of file + [XmlElement("rtept")] + public GpxWaypoint[] rtept { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxTrack.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxTrack.cs index 261fa99..816f8a0 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxTrack.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxTrack.cs @@ -5,11 +5,13 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx11; [XmlType(Namespace = "http://www.topografix.com/GPX/1/1")] public class GpxTrack : GpxRteTrkBase { - [XmlElement("link")] public GpxLink[] link { get; set; } + [XmlElement("link")] + public GpxLink[] link { get; set; } public string type { get; set; } //public extensionsType extensions { get; set; } - [XmlElement("trkseg")] public GpxTrackSegment[] trkseg { get; set; } -} \ No newline at end of file + [XmlElement("trkseg")] + public GpxTrackSegment[] trkseg { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxTrackSegment.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxTrackSegment.cs index dadef10..3c9bd77 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxTrackSegment.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxTrackSegment.cs @@ -5,7 +5,8 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx11; [XmlType(Namespace = "http://www.topografix.com/GPX/1/1")] public class GpxTrackSegment { - [XmlElement("trkpt")] public GpxWaypoint[] trkpt { get; set; } + [XmlElement("trkpt")] + public GpxWaypoint[] trkpt { get; set; } //public extensionsType extensions { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxWaypoint.cs b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxWaypoint.cs index c5ded39..7acc3f3 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxWaypoint.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/Gpx11/GpxWaypoint.cs @@ -5,8 +5,9 @@ namespace Geo.Gps.Serialization.Xml.Gpx.Gpx11; [XmlType(Namespace = "http://www.topografix.com/GPX/1/1")] public class GpxWaypoint : GpxWaypointBase { - [XmlElement("link")] public GpxLink[] link { get; set; } + [XmlElement("link")] + public GpxLink[] link { get; set; } public GpxFixType fix { get; set; } //public extensionsType extensions { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/GpxBoundsBase.cs b/Geo/Gps/Serialization/Xml/Gpx/GpxBoundsBase.cs index 71ed1dc..6e6845a 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/GpxBoundsBase.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/GpxBoundsBase.cs @@ -4,11 +4,15 @@ namespace Geo.Gps.Serialization.Xml.Gpx; public abstract class GpxBoundsBase { - [XmlAttribute] public decimal minlat { get; set; } + [XmlAttribute] + public decimal minlat { get; set; } - [XmlAttribute] public decimal minlon { get; set; } + [XmlAttribute] + public decimal minlon { get; set; } - [XmlAttribute] public decimal maxlat { get; set; } + [XmlAttribute] + public decimal maxlat { get; set; } - [XmlAttribute] public decimal maxlon { get; set; } -} \ No newline at end of file + [XmlAttribute] + public decimal maxlon { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/GpxMetadataBase.cs b/Geo/Gps/Serialization/Xml/Gpx/GpxMetadataBase.cs index 776a78e..ed5451a 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/GpxMetadataBase.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/GpxMetadataBase.cs @@ -9,7 +9,8 @@ public abstract class GpxMetadataBase public string desc { get; set; } public DateTime time { get; set; } - [XmlIgnore] public bool timeSpecified { get; set; } + [XmlIgnore] + public bool timeSpecified { get; set; } public string keywords { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/GpxRteTrkBase.cs b/Geo/Gps/Serialization/Xml/Gpx/GpxRteTrkBase.cs index 7283cdc..846663c 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/GpxRteTrkBase.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/GpxRteTrkBase.cs @@ -11,4 +11,4 @@ public abstract class GpxRteTrkBase [XmlElement(DataType = "nonNegativeInteger")] public string number { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/Gpx/GpxWaypointBase.cs b/Geo/Gps/Serialization/Xml/Gpx/GpxWaypointBase.cs index 71a5b9e..677f2fe 100644 --- a/Geo/Gps/Serialization/Xml/Gpx/GpxWaypointBase.cs +++ b/Geo/Gps/Serialization/Xml/Gpx/GpxWaypointBase.cs @@ -7,19 +7,23 @@ public abstract class GpxWaypointBase { public decimal ele { get; set; } - [XmlIgnore] public bool eleSpecified { get; set; } + [XmlIgnore] + public bool eleSpecified { get; set; } public DateTime time { get; set; } - [XmlIgnore] public bool timeSpecified { get; set; } + [XmlIgnore] + public bool timeSpecified { get; set; } public decimal magvar { get; set; } - [XmlIgnore] public bool magvarSpecified { get; set; } + [XmlIgnore] + public bool magvarSpecified { get; set; } public decimal geoidheight { get; set; } - [XmlIgnore] public bool geoidheightSpecified { get; set; } + [XmlIgnore] + public bool geoidheightSpecified { get; set; } public string name { get; set; } @@ -33,30 +37,38 @@ public abstract class GpxWaypointBase public string type { get; set; } - [XmlIgnore] public bool fixSpecified { get; set; } + [XmlIgnore] + public bool fixSpecified { get; set; } [XmlElement(DataType = "nonNegativeInteger")] public string sat { get; set; } public decimal hdop { get; set; } - [XmlIgnore] public bool hdopSpecified { get; set; } + [XmlIgnore] + public bool hdopSpecified { get; set; } public decimal vdop { get; set; } - [XmlIgnore] public bool vdopSpecified { get; set; } + [XmlIgnore] + public bool vdopSpecified { get; set; } public decimal pdop { get; set; } - [XmlIgnore] public bool pdopSpecified { get; set; } + [XmlIgnore] + public bool pdopSpecified { get; set; } public decimal ageofdgpsdata { get; set; } - [XmlIgnore] public bool ageofdgpsdataSpecified { get; set; } + [XmlIgnore] + public bool ageofdgpsdataSpecified { get; set; } - [XmlElement(DataType = "integer")] public string dgpsid { get; set; } + [XmlElement(DataType = "integer")] + public string dgpsid { get; set; } - [XmlAttribute] public decimal lat { get; set; } + [XmlAttribute] + public decimal lat { get; set; } - [XmlAttribute] public decimal lon { get; set; } -} \ No newline at end of file + [XmlAttribute] + public decimal lon { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFMSFlightplanTimeMeasure.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFMSFlightplanTimeMeasure.cs index 7b326a2..045815a 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFMSFlightplanTimeMeasure.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFMSFlightplanTimeMeasure.cs @@ -6,7 +6,9 @@ namespace Geo.Gps.Serialization.Xml.PocketFms; [XmlType(AnonymousType = true)] public class PocketFMSFlightplanTimeMeasure { - [XmlAttribute(DataType = "time")] public DateTime Value { get; set; } + [XmlAttribute(DataType = "time")] + public DateTime Value { get; set; } - [XmlAttribute] public string Unit { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string Unit { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAircraft.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAircraft.cs index bfa2288..a545a93 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAircraft.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAircraft.cs @@ -50,4 +50,4 @@ public class PocketFmsAircraft [XmlElement(Form = XmlSchemaForm.Unqualified)] public PocketFmsWeightAndBalance WeightAndBalance { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirportData.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirportData.cs index df12a1c..eb1931e 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirportData.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirportData.cs @@ -56,4 +56,4 @@ public class PocketFmsAirportData [XmlElement(Form = XmlSchemaForm.Unqualified)] public string VisibleButDestroyedYN { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirspace.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirspace.cs index c480717..5b72f1b 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirspace.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirspace.cs @@ -56,4 +56,4 @@ public class PocketFmsAirspace [XmlElement(Form = XmlSchemaForm.Unqualified)] public string AirspaceActiveUpToDateTime { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirspaceEntryExitPoint.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirspaceEntryExitPoint.cs index 7664854..b170fe7 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirspaceEntryExitPoint.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsAirspaceEntryExitPoint.cs @@ -18,4 +18,4 @@ public class PocketFmsAirspaceEntryExitPoint [XmlElement(Form = XmlSchemaForm.Unqualified, DataType = "time")] public DateTime ETAUTC { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsCgLimit.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsCgLimit.cs index 25a2c80..341c406 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsCgLimit.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsCgLimit.cs @@ -11,4 +11,4 @@ public class PocketFmsCgLimit [XmlElement(Form = XmlSchemaForm.Unqualified)] public PocketFmsMeasure XValue_CG { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsComm.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsComm.cs index e1e02ed..b8989be 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsComm.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsComm.cs @@ -5,21 +5,30 @@ namespace Geo.Gps.Serialization.Xml.PocketFms; [XmlType(AnonymousType = true)] public class PocketFmsComm { - [XmlAttribute] public string Sector { get; set; } + [XmlAttribute] + public string Sector { get; set; } - [XmlAttribute] public string OprHrs { get; set; } + [XmlAttribute] + public string OprHrs { get; set; } - [XmlAttribute] public decimal Freq5 { get; set; } + [XmlAttribute] + public decimal Freq5 { get; set; } - [XmlAttribute] public decimal Freq4 { get; set; } + [XmlAttribute] + public decimal Freq4 { get; set; } - [XmlAttribute] public decimal Freq3 { get; set; } + [XmlAttribute] + public decimal Freq3 { get; set; } - [XmlAttribute] public decimal Freq2 { get; set; } + [XmlAttribute] + public decimal Freq2 { get; set; } - [XmlAttribute] public decimal Freq1 { get; set; } + [XmlAttribute] + public decimal Freq1 { get; set; } - [XmlAttribute] public string CommType { get; set; } + [XmlAttribute] + public string CommType { get; set; } - [XmlAttribute] public string CommRemarks { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string CommRemarks { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsContingencyFuel.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsContingencyFuel.cs index 3b7f53b..552057a 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsContingencyFuel.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsContingencyFuel.cs @@ -5,7 +5,9 @@ namespace Geo.Gps.Serialization.Xml.PocketFms; [XmlType(AnonymousType = true)] public class PocketFmsContingencyFuel : PocketFmsMeasureSpecified { - [XmlAttribute] public short Percentage { get; set; } + [XmlAttribute] + public short Percentage { get; set; } - [XmlIgnore] public bool PercentageSpecified { get; set; } -} \ No newline at end of file + [XmlIgnore] + public bool PercentageSpecified { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsDepartureArrival.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsDepartureArrival.cs index 673fba6..6a05ecd 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsDepartureArrival.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsDepartureArrival.cs @@ -32,4 +32,4 @@ public class PocketFmsDepartureArrival [XmlElement(Form = XmlSchemaForm.Unqualified)] public PocketFmsDetailedObjectInfo DetailedObjectInfo { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsDetailedObjectInfo.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsDetailedObjectInfo.cs index 55c8c0d..c2b6a31 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsDetailedObjectInfo.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsDetailedObjectInfo.cs @@ -16,4 +16,4 @@ public class PocketFmsDetailedObjectInfo [XmlArray(Form = XmlSchemaForm.Unqualified)] [XmlArrayItem("Remark", Form = XmlSchemaForm.Unqualified, IsNullable = false)] public PocketFmsRemark[] Remarks { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsFlightplan.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsFlightplan.cs index 045c555..bd863f3 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsFlightplan.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsFlightplan.cs @@ -21,4 +21,4 @@ public class PocketFmsFlightplan //[XmlElement(Form=XmlSchemaForm.Unqualified)] //public PocketFmsAircraft AIRCRAFT { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsFuel.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsFuel.cs index 455ba96..4addb99 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsFuel.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsFuel.cs @@ -35,4 +35,4 @@ public class PocketFmsFuel [XmlElement(Form = XmlSchemaForm.Unqualified)] public PocketFmsMeasureSpecified LongestAlternateDistance { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsLib.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsLib.cs index 5bf141e..3622381 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsLib.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsLib.cs @@ -102,4 +102,4 @@ public class PocketFmsLib //[XmlAttribute] //public sbyte LibID { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeasure.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeasure.cs index 29ecf06..acf76f1 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeasure.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeasure.cs @@ -5,5 +5,6 @@ namespace Geo.Gps.Serialization.Xml.PocketFms; [XmlType(AnonymousType = true)] public class PocketFmsMeasure : PocketFmsValue { - [XmlAttribute] public string Unit { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string Unit { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeasureSpecified.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeasureSpecified.cs index 523ebd6..eff3178 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeasureSpecified.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeasureSpecified.cs @@ -5,5 +5,6 @@ namespace Geo.Gps.Serialization.Xml.PocketFms; [XmlType(AnonymousType = true)] public class PocketFmsMeasureSpecified : PocketFmsMeasure { - [XmlIgnore] public bool ValueSpecified { get; set; } -} \ No newline at end of file + [XmlIgnore] + public bool ValueSpecified { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeta.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeta.cs index f06e0ba..6082ecf 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeta.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMeta.cs @@ -83,4 +83,4 @@ public class PocketFmsMeta //[XmlElement(Form=XmlSchemaForm.Unqualified)] //public string ICAOCruiseAltitude { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMomentLimit.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMomentLimit.cs index dc6379e..c6a19b0 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMomentLimit.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsMomentLimit.cs @@ -11,4 +11,4 @@ public class PocketFmsMomentLimit [XmlElement(Form = XmlSchemaForm.Unqualified)] public PocketFmsMeasure XValue_Moment { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsPoint.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsPoint.cs index 17ce603..5a9c12c 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsPoint.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsPoint.cs @@ -32,4 +32,4 @@ public class PocketFmsPoint //[XmlElement(Form = XmlSchemaForm.Unqualified)] //public PocketFmsDetailedObjectInfo DetailedObjectInfo { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsRNav.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsRNav.cs index 8c75637..81a3720 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsRNav.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsRNav.cs @@ -5,11 +5,15 @@ namespace Geo.Gps.Serialization.Xml.PocketFms; [XmlType(AnonymousType = true)] public class PocketFmsRNav { - [XmlAttribute] public decimal BEACONRADIAL { get; set; } + [XmlAttribute] + public decimal BEACONRADIAL { get; set; } - [XmlAttribute] public string BEACONIDENT { get; set; } + [XmlAttribute] + public string BEACONIDENT { get; set; } - [XmlAttribute] public decimal BEACONFREQUENCY { get; set; } + [XmlAttribute] + public decimal BEACONFREQUENCY { get; set; } - [XmlAttribute] public decimal BEACONDISTANCENM { get; set; } -} \ No newline at end of file + [XmlAttribute] + public decimal BEACONDISTANCENM { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsRemark.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsRemark.cs index e1975b4..0831683 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsRemark.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsRemark.cs @@ -5,7 +5,9 @@ namespace Geo.Gps.Serialization.Xml.PocketFms; [XmlType(AnonymousType = true)] public class PocketFmsRemark { - [XmlAttribute] public string RemarkType { get; set; } + [XmlAttribute] + public string RemarkType { get; set; } - [XmlAttribute] public string RemarkText { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string RemarkText { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsReserveFuel.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsReserveFuel.cs index 2e90e5e..a9b2554 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsReserveFuel.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsReserveFuel.cs @@ -5,9 +5,12 @@ namespace Geo.Gps.Serialization.Xml.PocketFms; [XmlType(AnonymousType = true)] public class PocketFmsReserveFuel : PocketFmsMeasureSpecified { - [XmlAttribute] public string DurationUnit { get; set; } + [XmlAttribute] + public string DurationUnit { get; set; } - [XmlAttribute] public short Duration { get; set; } + [XmlAttribute] + public short Duration { get; set; } - [XmlIgnore] public bool DurationSpecified { get; set; } -} \ No newline at end of file + [XmlIgnore] + public bool DurationSpecified { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsSuitableDefinitions.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsSuitableDefinitions.cs index efa8961..151f078 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsSuitableDefinitions.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsSuitableDefinitions.cs @@ -44,4 +44,4 @@ public class PocketFmsSuitableDefinitions [XmlElement(Form = XmlSchemaForm.Unqualified)] public PocketFmsMeasure MaximumCrosswind { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsSupplementaryInformation.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsSupplementaryInformation.cs index 2243993..86e2660 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsSupplementaryInformation.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsSupplementaryInformation.cs @@ -68,4 +68,4 @@ public class PocketFmsSupplementaryInformation [XmlElement(Form = XmlSchemaForm.Unqualified)] public string DinghiesCoverColor { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsValue.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsValue.cs index c8065e5..f1aba9a 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsValue.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsValue.cs @@ -5,5 +5,6 @@ namespace Geo.Gps.Serialization.Xml.PocketFms; [XmlType(AnonymousType = true)] public class PocketFmsValue { - [XmlAttribute] public T Value { get; set; } -} \ No newline at end of file + [XmlAttribute] + public T Value { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalance.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalance.cs index ebfe9ff..bc0137c 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalance.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalance.cs @@ -16,4 +16,4 @@ public class PocketFmsWeightAndBalance [XmlArray(Form = XmlSchemaForm.Unqualified)] [XmlArrayItem("WBMomentLimitPoint", Form = XmlSchemaForm.Unqualified, IsNullable = false)] public PocketFmsCgLimit[] WBCGLimits { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalanceData.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalanceData.cs index 4d19035..9523d0b 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalanceData.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalanceData.cs @@ -17,4 +17,4 @@ public class PocketFmsWeightAndBalanceData [XmlElement(Form = XmlSchemaForm.Unqualified)] public PocketFmsMeasure PlaneTotalMoment { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalanceDataRecord.cs b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalanceDataRecord.cs index 7809255..ed10c21 100644 --- a/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalanceDataRecord.cs +++ b/Geo/Gps/Serialization/Xml/PocketFms/PocketFmsWeightAndBalanceDataRecord.cs @@ -15,5 +15,6 @@ public class PocketFmsWeightAndBalanceDataRecord [XmlElement(Form = XmlSchemaForm.Unqualified)] public PocketFmsMeasure Moment { get; set; } - [XmlAttribute] public string WBDescription { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string WBDescription { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonAircraft.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonAircraft.cs index b5671c2..f13f826 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonAircraft.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonAircraft.cs @@ -21,7 +21,8 @@ public class SkyDemonAircraft //[XmlAttribute] //public string Name { get; set; } - [XmlAttribute] public string Registration { get; set; } + [XmlAttribute] + public string Registration { get; set; } //[XmlAttribute] //public string FuelType { get; set; } @@ -53,7 +54,8 @@ public class SkyDemonAircraft //[XmlAttribute] //public string EmptyArmLat { get; set; } - [XmlAttribute] public string Type { get; set; } + [XmlAttribute] + public string Type { get; set; } //[XmlAttribute] //public string ColourMarkings { get; set; } @@ -87,4 +89,4 @@ public class SkyDemonAircraft //[XmlAttribute] //public string Envelope { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonClimbProfile.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonClimbProfile.cs index accc2ae..d2a96ab 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonClimbProfile.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonClimbProfile.cs @@ -5,13 +5,18 @@ namespace Geo.Gps.Serialization.Xml.SkyDemon; [XmlType(AnonymousType = true)] public class SkyDemonClimbProfile { - [XmlAttribute] public string FpmSL { get; set; } + [XmlAttribute] + public string FpmSL { get; set; } - [XmlAttribute] public string FpmSC { get; set; } + [XmlAttribute] + public string FpmSC { get; set; } - [XmlAttribute] public string IndicatedAirspeed { get; set; } + [XmlAttribute] + public string IndicatedAirspeed { get; set; } - [XmlAttribute] public string FuelBurnSL { get; set; } + [XmlAttribute] + public string FuelBurnSL { get; set; } - [XmlAttribute] public string FuelBurnSC { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string FuelBurnSC { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonCruiseProfile.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonCruiseProfile.cs index b6ce42f..4f9a20e 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonCruiseProfile.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonCruiseProfile.cs @@ -5,13 +5,18 @@ namespace Geo.Gps.Serialization.Xml.SkyDemon; [XmlType(AnonymousType = true)] public class SkyDemonCruiseProfile { - [XmlAttribute] public string Name { get; set; } + [XmlAttribute] + public string Name { get; set; } - [XmlAttribute] public string FuelBurn { get; set; } + [XmlAttribute] + public string FuelBurn { get; set; } - [XmlAttribute] public string IndicatedAirspeed { get; set; } + [XmlAttribute] + public string IndicatedAirspeed { get; set; } - [XmlAttribute] public string Airspeed { get; set; } + [XmlAttribute] + public string Airspeed { get; set; } - [XmlAttribute] public string AirspeedType { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string AirspeedType { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonDescentProfile.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonDescentProfile.cs index 9182ea9..4c174e9 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonDescentProfile.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonDescentProfile.cs @@ -5,9 +5,12 @@ namespace Geo.Gps.Serialization.Xml.SkyDemon; [XmlType(AnonymousType = true)] public class SkyDemonDescentProfile { - [XmlAttribute] public string Fpm { get; set; } + [XmlAttribute] + public string Fpm { get; set; } - [XmlAttribute] public string IndicatedAirspeed { get; set; } + [XmlAttribute] + public string IndicatedAirspeed { get; set; } - [XmlAttribute] public string FuelBurn { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string FuelBurn { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonFlightplan.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonFlightplan.cs index 6e462d8..8a8eeff 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonFlightplan.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonFlightplan.cs @@ -19,4 +19,4 @@ public class SkyDemonFlightplan public SkyDemonRoute[] Routes { get; set; } //[XmlElement("WaypointNameHints", typeof (SkyDemonWaypointNameHints), Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] //public SkyDemonWaypointNameHints WaypointNameHints { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonFuelLoadingPoint.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonFuelLoadingPoint.cs index abea1db..bcbcbb0 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonFuelLoadingPoint.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonFuelLoadingPoint.cs @@ -5,13 +5,18 @@ namespace Geo.Gps.Serialization.Xml.SkyDemon; [XmlType(AnonymousType = true)] public class SkyDemonFuelLoadingPoint { - [XmlAttribute] public string Name { get; set; } + [XmlAttribute] + public string Name { get; set; } - [XmlAttribute] public string LeverArm { get; set; } + [XmlAttribute] + public string LeverArm { get; set; } - [XmlAttribute] public string LeverArmLat { get; set; } + [XmlAttribute] + public string LeverArmLat { get; set; } - [XmlAttribute] public string DefaultValue { get; set; } + [XmlAttribute] + public string DefaultValue { get; set; } - [XmlAttribute] public string Capacity { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string Capacity { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonLoadingPoint.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonLoadingPoint.cs index 081d690..958251d 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonLoadingPoint.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonLoadingPoint.cs @@ -6,13 +6,18 @@ namespace Geo.Gps.Serialization.Xml.SkyDemon; [XmlRoot("LoadingPoint", Namespace = "", IsNullable = false)] public class SkyDemonLoadingPoint { - [XmlAttribute] public string Name { get; set; } + [XmlAttribute] + public string Name { get; set; } - [XmlAttribute] public string LeverArm { get; set; } + [XmlAttribute] + public string LeverArm { get; set; } - [XmlAttribute] public string LeverArmLat { get; set; } + [XmlAttribute] + public string LeverArmLat { get; set; } - [XmlAttribute] public string DefaultValue { get; set; } + [XmlAttribute] + public string DefaultValue { get; set; } - [XmlAttribute] public string Weight { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string Weight { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonLoadingPoints.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonLoadingPoints.cs index 1749ec7..1bda749 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonLoadingPoints.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonLoadingPoints.cs @@ -9,5 +9,6 @@ public class SkyDemonLoadingPoints [XmlElement("FuelLoadingPoint", Form = XmlSchemaForm.Unqualified)] public SkyDemonFuelLoadingPoint[] FuelLoadingPoint { get; set; } - [XmlElement("LoadingPoint")] public SkyDemonLoadingPoint[] LoadingPoint { get; set; } -} \ No newline at end of file + [XmlElement("LoadingPoint")] + public SkyDemonLoadingPoint[] LoadingPoint { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonRhumbLine.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonRhumbLine.cs index 83331c4..43e6af2 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonRhumbLine.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonRhumbLine.cs @@ -5,9 +5,12 @@ namespace Geo.Gps.Serialization.Xml.SkyDemon; [XmlType(AnonymousType = true)] public class SkyDemonRhumbLine { - [XmlAttribute] public string To { get; set; } + [XmlAttribute] + public string To { get; set; } - [XmlAttribute] public string Level { get; set; } + [XmlAttribute] + public string Level { get; set; } - [XmlAttribute] public string LevelChange { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string LevelChange { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonRoute.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonRoute.cs index 83ec8d8..0dd1df8 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonRoute.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonRoute.cs @@ -16,9 +16,11 @@ public class SkyDemonRoute //[XmlArrayItem("LoadingPoint", typeof (SkyDemonLoadingPoint[]), IsNullable = false)] //public SkyDemonLoadingPoint[][] WeightBalance { get; set; } - [XmlAttribute] public string Start { get; set; } + [XmlAttribute] + public string Start { get; set; } - [XmlAttribute] public string Level { get; set; } + [XmlAttribute] + public string Level { get; set; } //[XmlAttribute] //public string CruiseProfile { get; set; } @@ -28,4 +30,4 @@ public class SkyDemonRoute //[XmlAttribute] //public string PlannedFuel { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonWaypointNameHint.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonWaypointNameHint.cs index d970f18..b929383 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonWaypointNameHint.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonWaypointNameHint.cs @@ -5,7 +5,9 @@ namespace Geo.Gps.Serialization.Xml.SkyDemon; [XmlType(AnonymousType = true)] public class SkyDemonWaypointNameHint { - [XmlAttribute] public string Location { get; set; } + [XmlAttribute] + public string Location { get; set; } - [XmlAttribute] public string Name { get; set; } -} \ No newline at end of file + [XmlAttribute] + public string Name { get; set; } +} diff --git a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonWaypointNameHints.cs b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonWaypointNameHints.cs index 665fad3..f221b24 100644 --- a/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonWaypointNameHints.cs +++ b/Geo/Gps/Serialization/Xml/SkyDemon/SkyDemonWaypointNameHints.cs @@ -8,4 +8,4 @@ public class SkyDemonWaypointNameHints { [XmlElement("Hint", Form = XmlSchemaForm.Unqualified)] public SkyDemonWaypointNameHint[] Hint { get; set; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Track.cs b/Geo/Gps/Track.cs index c014c12..294e59f 100644 --- a/Geo/Gps/Track.cs +++ b/Geo/Gps/Track.cs @@ -73,4 +73,4 @@ public void Quantize(double seconds = 0) foreach (var segment in Segments) segment.Quantize(seconds); } -} \ No newline at end of file +} diff --git a/Geo/Gps/TrackSegment.cs b/Geo/Gps/TrackSegment.cs index a2170d3..f4d5a4f 100644 --- a/Geo/Gps/TrackSegment.cs +++ b/Geo/Gps/TrackSegment.cs @@ -56,13 +56,18 @@ public TimeSpan GetDuration() public void Quantize(double seconds = 0) { if (Waypoints.Any(x => !x.TimeUtc.HasValue)) - throw new NotSupportedException("All waypoints require a timestamp, for track segment to be quantized."); + throw new NotSupportedException( + "All waypoints require a timestamp, for track segment to be quantized." + ); var waypoints = new List(); Waypoint lastWaypoint = null; foreach (var waypoint in Waypoints) - if (lastWaypoint == null || - Math.Abs((waypoint.TimeUtc.Value - lastWaypoint.TimeUtc.Value).TotalSeconds) >= seconds) + if ( + lastWaypoint == null + || Math.Abs((waypoint.TimeUtc.Value - lastWaypoint.TimeUtc.Value).TotalSeconds) + >= seconds + ) { lastWaypoint = waypoint; waypoints.Add(waypoint); @@ -70,4 +75,4 @@ public void Quantize(double seconds = 0) Waypoints = waypoints; } -} \ No newline at end of file +} diff --git a/Geo/Gps/Waypoint.cs b/Geo/Gps/Waypoint.cs index c779977..a4abd70 100644 --- a/Geo/Gps/Waypoint.cs +++ b/Geo/Gps/Waypoint.cs @@ -37,7 +37,13 @@ public Waypoint(Point point, string name, string comment, string description) Point = point; } - public Waypoint(Point point, DateTime? dateTime, string name, string comment, string description) + public Waypoint( + Point point, + DateTime? dateTime, + string name, + string comment, + string description + ) { Name = name; Comment = comment; @@ -64,4 +70,4 @@ public LineString ToLineString() { return new LineString(Point.Coordinate); } -} \ No newline at end of file +} diff --git a/Geo/IO/GeoJson/Feature.cs b/Geo/IO/GeoJson/Feature.cs index bc405f2..e55a002 100644 --- a/Geo/IO/GeoJson/Feature.cs +++ b/Geo/IO/GeoJson/Feature.cs @@ -19,4 +19,4 @@ public string ToGeoJson() { return new GeoJsonWriter().Write(this); } -} \ No newline at end of file +} diff --git a/Geo/IO/GeoJson/FeatureCollection.cs b/Geo/IO/GeoJson/FeatureCollection.cs index a64eeac..0683260 100644 --- a/Geo/IO/GeoJson/FeatureCollection.cs +++ b/Geo/IO/GeoJson/FeatureCollection.cs @@ -26,4 +26,4 @@ public string ToGeoJson() { return new GeoJsonWriter().Write(this); } -} \ No newline at end of file +} diff --git a/Geo/IO/GeoJson/GeoJson.cs b/Geo/IO/GeoJson/GeoJson.cs index e48421a..a70963e 100644 --- a/Geo/IO/GeoJson/GeoJson.cs +++ b/Geo/IO/GeoJson/GeoJson.cs @@ -22,4 +22,4 @@ public static IGeoJsonObject DeSerialize(Stream stream) { return Reader.Read(stream); } -} \ No newline at end of file +} diff --git a/Geo/IO/GeoJson/GeoJsonReader.cs b/Geo/IO/GeoJson/GeoJsonReader.cs index 12a8dd0..3c6a61c 100644 --- a/Geo/IO/GeoJson/GeoJsonReader.cs +++ b/Geo/IO/GeoJson/GeoJsonReader.cs @@ -64,7 +64,10 @@ private bool TryParseFeatureCollection(JsonObject obj, out object result) { result = null; string typeString; - if (TryParseTypeString(obj, out typeString) && typeString.ToLowerInvariant() == "featurecollection") + if ( + TryParseTypeString(obj, out typeString) + && typeString.ToLowerInvariant() == "featurecollection" + ) { var features = obj["features"] as JsonArray; @@ -96,18 +99,21 @@ private bool TryParseFeature(JsonObject obj, out object result) object prop; Dictionary pr = null; - if (obj.TryGetValue("geometry", out geometry)) TryParseGeometry((JsonObject)geometry, out geo); + if (obj.TryGetValue("geometry", out geometry)) + TryParseGeometry((JsonObject)geometry, out geo); if (obj.TryGetValue("properties", out prop) && prop is JsonObject) { var props = (JsonObject)prop; - if (props.Count > 0) pr = props.ToDictionary(x => x.Key, x => SantizeJsonObjects(x.Value)); + if (props.Count > 0) + pr = props.ToDictionary(x => x.Key, x => SantizeJsonObjects(x.Value)); } result = new Feature((IGeometry)geo, pr); object id; - if (obj.TryGetValue("id", out id)) ((Feature)result).Id = SantizeJsonObjects(id); + if (obj.TryGetValue("id", out id)) + ((Feature)result).Id = SantizeJsonObjects(id); return true; } @@ -182,9 +188,16 @@ private bool TryParsePolygon(JsonObject obj, out object result) var coordinates = obj["coordinates"] as JsonArray; Coordinate[][] temp; - if (coordinates != null && coordinates.Count > 0 && TryParseCoordinateArrayArray(coordinates, out temp)) + if ( + coordinates != null + && coordinates.Count > 0 + && TryParseCoordinateArrayArray(coordinates, out temp) + ) { - result = new Polygon(new LinearRing(temp[0]), temp.Skip(1).Select(x => new LinearRing(x))); + result = new Polygon( + new LinearRing(temp[0]), + temp.Skip(1).Select(x => new LinearRing(x)) + ); return true; } @@ -226,9 +239,12 @@ private bool TryParseMultiPolygon(JsonObject obj, out object result) Coordinate[][][] co; if (coordinates != null && TryParseCoordinateArrayArrayArray(coordinates, out co)) { - result = new MultiPolygon(co.Select(x => - new Polygon(new LinearRing(x.First()), x.Skip(1).Select(c => new LinearRing(c))) - )); + result = new MultiPolygon( + co.Select(x => new Polygon( + new LinearRing(x.First()), + x.Skip(1).Select(c => new LinearRing(c)) + )) + ); return true; } @@ -269,13 +285,23 @@ private bool TryParseCoordinate(JsonArray coordinates, out Coordinate result) return false; if (coordinates.Count == 2) - result = new Coordinate(Convert.ToDouble(coordinates[1]), Convert.ToDouble(coordinates[0])); + result = new Coordinate( + Convert.ToDouble(coordinates[1]), + Convert.ToDouble(coordinates[0]) + ); else if (coordinates.Count == 3) - result = new CoordinateZ(Convert.ToDouble(coordinates[1]), Convert.ToDouble(coordinates[0]), - Convert.ToDouble(coordinates[2])); + result = new CoordinateZ( + Convert.ToDouble(coordinates[1]), + Convert.ToDouble(coordinates[0]), + Convert.ToDouble(coordinates[2]) + ); else - result = new CoordinateZM(Convert.ToDouble(coordinates[1]), Convert.ToDouble(coordinates[0]), - Convert.ToDouble(coordinates[2]), Convert.ToDouble(coordinates[3])); + result = new CoordinateZM( + Convert.ToDouble(coordinates[1]), + Convert.ToDouble(coordinates[0]), + Convert.ToDouble(coordinates[2]), + Convert.ToDouble(coordinates[3]) + ); return true; } @@ -315,7 +341,10 @@ private bool TryParseCoordinateArrayArray(JsonArray coordinates, out Coordinate[ return true; } - private bool TryParseCoordinateArrayArrayArray(JsonArray coordinates, out Coordinate[][][] result) + private bool TryParseCoordinateArrayArrayArray( + JsonArray coordinates, + out Coordinate[][][] result + ) { result = null; if (coordinates == null) @@ -345,4 +374,4 @@ public object SantizeJsonObjects(object obj) return obj; } -} \ No newline at end of file +} diff --git a/Geo/IO/GeoJson/GeoJsonWriter.cs b/Geo/IO/GeoJson/GeoJsonWriter.cs index 7d17021..7d461f8 100644 --- a/Geo/IO/GeoJson/GeoJsonWriter.cs +++ b/Geo/IO/GeoJson/GeoJsonWriter.cs @@ -34,7 +34,9 @@ public string Write(object obj) if (featureCollection != null) return Write(featureCollection); - throw new SerializationException("Object of type '" + obj.GetType().Name + "' is not supported by GeoJSON"); + throw new SerializationException( + "Object of type '" + obj.GetType().Name + "' is not supported by GeoJSON" + ); } public string Write(IGeometry geometry) @@ -87,8 +89,9 @@ private Dictionary WriteGeometry(IGeometry geometry) if (circle != null) return WritePolygon(circle.ToPolygon(_settings.CircleSides)); - throw new SerializationException("Geometry of type '" + geometry.GetType().Name + - "' is not supported by GeoJSON"); + throw new SerializationException( + "Geometry of type '" + geometry.GetType().Name + "' is not supported by GeoJSON" + ); } private Dictionary WritePoint(Point point) @@ -96,7 +99,7 @@ private Dictionary WritePoint(Point point) return new Dictionary { { "type", "Point" }, - { "coordinates", WriteCoordinate(point) } + { "coordinates", WriteCoordinate(point) }, }; } @@ -105,7 +108,7 @@ private Dictionary WriteLineString(LineString lineString) return new Dictionary { { "type", "LineString" }, - { "coordinates", WriteCoordinates(lineString.Coordinates) } + { "coordinates", WriteCoordinates(lineString.Coordinates) }, }; } @@ -114,7 +117,7 @@ private Dictionary WritePolygon(Polygon polygon) return new Dictionary { { "type", "Polygon" }, - { "coordinates", WriteCoordinates(polygon) } + { "coordinates", WriteCoordinates(polygon) }, }; } @@ -123,7 +126,10 @@ private Dictionary WriteMultiPoint(MultiPoint multiPoint) return new Dictionary { { "type", "MultiPoint" }, - { "coordinates", multiPoint.Geometries.Cast().Select(WriteCoordinate).ToArray() } + { + "coordinates", + multiPoint.Geometries.Cast().Select(WriteCoordinate).ToArray() + }, }; } @@ -134,8 +140,11 @@ private Dictionary WriteMultiLineString(MultiLineString multiLin { "type", "MultiLineString" }, { "coordinates", - multiLineString.Geometries.Cast().Select(x => WriteCoordinates(x.Coordinates)).ToArray() - } + multiLineString + .Geometries.Cast() + .Select(x => WriteCoordinates(x.Coordinates)) + .ToArray() + }, }; } @@ -144,16 +153,21 @@ private Dictionary WriteMultiPolygon(MultiPolygon multiPolygon) return new Dictionary { { "type", "MultiPolygon" }, - { "coordinates", multiPolygon.Geometries.Cast().Select(WriteCoordinates).ToArray() } + { + "coordinates", + multiPolygon.Geometries.Cast().Select(WriteCoordinates).ToArray() + }, }; } - private Dictionary WriteGeometryCollection(GeometryCollection geometryCollection) + private Dictionary WriteGeometryCollection( + GeometryCollection geometryCollection + ) { return new Dictionary { { "type", "GeometryCollection" }, - { "geometries", geometryCollection.Geometries.Select(WriteGeometry).ToArray() } + { "geometries", geometryCollection.Geometries.Select(WriteGeometry).ToArray() }, }; } @@ -162,7 +176,7 @@ private Dictionary WriteFeature(Feature feature) var result = new Dictionary { { "type", "Feature" }, - { "geometry", feature.Geometry == null ? null : WriteGeometry(feature.Geometry) } + { "geometry", feature.Geometry == null ? null : WriteGeometry(feature.Geometry) }, }; if (feature.Properties != null && feature.Properties.Count > 0) @@ -181,17 +195,22 @@ private Dictionary WriteFeatureCollection(FeatureCollection feat return new Dictionary { { "type", "FeatureCollection" }, - { "features", featureCollection.Features.Select(WriteFeature).ToArray() } + { "features", featureCollection.Features.Select(WriteFeature).ToArray() }, }; } - private double[] WriteCoordinate(IPosition position) { var coordinate = position.GetCoordinate(); var pointZM = coordinate as CoordinateZM; if (pointZM != null) - return new[] { pointZM.Longitude, pointZM.Latitude, pointZM.Elevation, pointZM.Measure }; + return new[] + { + pointZM.Longitude, + pointZM.Latitude, + pointZM.Elevation, + pointZM.Measure, + }; var pointZ = coordinate as CoordinateZ; if (pointZ != null) return new[] { pointZ.Longitude, pointZ.Latitude, pointZ.Elevation }; @@ -210,4 +229,4 @@ private IEnumerable> WriteCoordinates(Polygon polygon) foreach (var hole in polygon.Holes) yield return WriteCoordinates(hole.Coordinates); } -} \ No newline at end of file +} diff --git a/Geo/IO/GeoJson/GeoJsonWriterSettings.cs b/Geo/IO/GeoJson/GeoJsonWriterSettings.cs index cd077c2..d4a4c52 100644 --- a/Geo/IO/GeoJson/GeoJsonWriterSettings.cs +++ b/Geo/IO/GeoJson/GeoJsonWriterSettings.cs @@ -12,4 +12,4 @@ public GeoJsonWriterSettings() public int CircleSides { get; set; } public static GeoJsonWriterSettings NtsCompatible => new(); -} \ No newline at end of file +} diff --git a/Geo/IO/Google/GooglePolylineEncoder.cs b/Geo/IO/Google/GooglePolylineEncoder.cs index 75e1be9..fa9fefe 100644 --- a/Geo/IO/Google/GooglePolylineEncoder.cs +++ b/Geo/IO/Google/GooglePolylineEncoder.cs @@ -43,7 +43,8 @@ public LineString Decode(string polyline) var coordinates = new List(); using (var reader = new StringReader(polyline)) { - int lat = 0, lng = 0; + int lat = 0, + lng = 0; while (reader.Peek() != -1) { lat += DecodeNumber(reader); @@ -75,7 +76,9 @@ private static void EncodeNumber(StringBuilder builder, int num) private static int DecodeNumber(StringReader reader) { - int b, shift = 0, result = 0; + int b, + shift = 0, + result = 0; do { b = reader.Read() - MinAscii; @@ -85,4 +88,4 @@ private static int DecodeNumber(StringReader reader) return (result & 1) != 0 ? ~(result >> 1) : result >> 1; } -} \ No newline at end of file +} diff --git a/Geo/IO/Wkb/WkbBinaryReader.cs b/Geo/IO/Wkb/WkbBinaryReader.cs index 68a1b20..66de9f4 100644 --- a/Geo/IO/Wkb/WkbBinaryReader.cs +++ b/Geo/IO/Wkb/WkbBinaryReader.cs @@ -69,4 +69,4 @@ public uint ReadUInt32() var bytes = ReadBytes(4); return BitConverter.ToUInt32(bytes, 0); } -} \ No newline at end of file +} diff --git a/Geo/IO/Wkb/WkbBinaryWriter.cs b/Geo/IO/Wkb/WkbBinaryWriter.cs index a0a9948..2f4aea1 100644 --- a/Geo/IO/Wkb/WkbBinaryWriter.cs +++ b/Geo/IO/Wkb/WkbBinaryWriter.cs @@ -66,4 +66,4 @@ public void Write(uint value) var bytes = BitConverter.GetBytes(value); Write(bytes); } -} \ No newline at end of file +} diff --git a/Geo/IO/Wkb/WkbDimensions.cs b/Geo/IO/Wkb/WkbDimensions.cs index f197e50..1b3524a 100644 --- a/Geo/IO/Wkb/WkbDimensions.cs +++ b/Geo/IO/Wkb/WkbDimensions.cs @@ -5,5 +5,5 @@ internal enum WkbDimensions XY = 0, XYZ = 1, XYM = 2, - XYZM = 3 -} \ No newline at end of file + XYZM = 3, +} diff --git a/Geo/IO/Wkb/WkbEncoding.cs b/Geo/IO/Wkb/WkbEncoding.cs index a1a239b..f47ad28 100644 --- a/Geo/IO/Wkb/WkbEncoding.cs +++ b/Geo/IO/Wkb/WkbEncoding.cs @@ -3,5 +3,5 @@ public enum WkbEncoding { BigEndian = 0, - LittleEndian = 1 -} \ No newline at end of file + LittleEndian = 1, +} diff --git a/Geo/IO/Wkb/WkbGeometryType.cs b/Geo/IO/Wkb/WkbGeometryType.cs index 220bc68..024bb84 100644 --- a/Geo/IO/Wkb/WkbGeometryType.cs +++ b/Geo/IO/Wkb/WkbGeometryType.cs @@ -9,5 +9,5 @@ internal enum WkbGeometryType : uint MultiLineString = 5, MultiPolygon = 6, GeometryCollection = 7, - Triangle = 17 -} \ No newline at end of file + Triangle = 17, +} diff --git a/Geo/IO/Wkb/WkbReader.cs b/Geo/IO/Wkb/WkbReader.cs index 3f1578d..16ad798 100644 --- a/Geo/IO/Wkb/WkbReader.cs +++ b/Geo/IO/Wkb/WkbReader.cs @@ -37,7 +37,9 @@ public IGeometry Read(Stream stream) } catch (EndOfStreamException) { - throw new SerializationException("End of stream reached before end of valid WKB geometry."); + throw new SerializationException( + "End of stream reached before end of valid WKB geometry." + ); } } } @@ -46,8 +48,14 @@ private Coordinate ReadCoordinate(WkbBinaryReader reader, WkbDimensions dimensio { var x = reader.ReadDouble(); var y = reader.ReadDouble(); - var z = dimensions == WkbDimensions.XYZ || dimensions == WkbDimensions.XYZM ? reader.ReadDouble() : double.NaN; - var m = dimensions == WkbDimensions.XYM || dimensions == WkbDimensions.XYZM ? reader.ReadDouble() : double.NaN; + var z = + dimensions == WkbDimensions.XYZ || dimensions == WkbDimensions.XYZM + ? reader.ReadDouble() + : double.NaN; + var m = + dimensions == WkbDimensions.XYM || dimensions == WkbDimensions.XYZM + ? reader.ReadDouble() + : double.NaN; if (!double.IsNaN(z) && !double.IsNaN(m)) return new CoordinateZM(y, x, z, m); @@ -63,7 +71,8 @@ private CoordinateSequence ReadCoordinates(WkbBinaryReader reader, WkbDimensions var pointCount = (int)reader.ReadUInt32(); var result = new List(pointCount); - for (var i = 0; i < pointCount; i++) result.Add(ReadCoordinate(reader, dimensions)); + for (var i = 0; i < pointCount; i++) + result.Add(ReadCoordinate(reader, dimensions)); return new CoordinateSequence(result); } @@ -197,4 +206,4 @@ private GeometryCollection ReadGeometryCollection(WkbBinaryReader reader) geometries.Add(ReadGeometry(reader)); return new GeometryCollection(geometries); } -} \ No newline at end of file +} diff --git a/Geo/IO/Wkb/WkbWriter.cs b/Geo/IO/Wkb/WkbWriter.cs index 4884ff9..86d6142 100644 --- a/Geo/IO/Wkb/WkbWriter.cs +++ b/Geo/IO/Wkb/WkbWriter.cs @@ -122,7 +122,9 @@ private void Write(IGeometry geometry, WkbBinaryWriter writer) } } - throw new SerializationException("Geometry of type '" + geometry.GetType().Name + "' is not supported"); + throw new SerializationException( + "Geometry of type '" + geometry.GetType().Name + "' is not supported" + ); } private void WriteCoordinate(Coordinate coordinate, WkbBinaryWriter writer) @@ -230,7 +232,11 @@ private void WriteGeometryCollection(GeometryCollection collection, WkbBinaryWri Write(geometry, writer); } - private void WriteGeometryType(IGeometry geometry, WkbGeometryType baseType, WkbBinaryWriter writer) + private void WriteGeometryType( + IGeometry geometry, + WkbGeometryType baseType, + WkbBinaryWriter writer + ) { if (geometry.IsEmpty) { @@ -249,4 +255,4 @@ private void WriteGeometryType(IGeometry geometry, WkbGeometryType baseType, Wkb writer.Write(typeCode); } } -} \ No newline at end of file +} diff --git a/Geo/IO/Wkb/WkbWriterSettings.cs b/Geo/IO/Wkb/WkbWriterSettings.cs index 9711b7b..80da8a4 100644 --- a/Geo/IO/Wkb/WkbWriterSettings.cs +++ b/Geo/IO/Wkb/WkbWriterSettings.cs @@ -18,4 +18,4 @@ public WkbWriterSettings() public int CircleSides { get; set; } public static WkbWriterSettings NtsCompatible => new(); -} \ No newline at end of file +} diff --git a/Geo/IO/Wkt/WktDimensions.cs b/Geo/IO/Wkt/WktDimensions.cs index 9a7f89e..8952176 100644 --- a/Geo/IO/Wkt/WktDimensions.cs +++ b/Geo/IO/Wkt/WktDimensions.cs @@ -5,5 +5,5 @@ internal enum WktDimensions XY = 0, XYZ = 1, XYM = 2, - XYZM = 3 -} \ No newline at end of file + XYZM = 3, +} diff --git a/Geo/IO/Wkt/WktReader.cs b/Geo/IO/Wkt/WktReader.cs index fcb484b..64c8964 100644 --- a/Geo/IO/Wkt/WktReader.cs +++ b/Geo/IO/Wkt/WktReader.cs @@ -130,8 +130,10 @@ private Polygon ParsePolygonInner(WktTokenQueue tokens, WktDimensions dimensions tokens.Dequeue(WktTokenType.LeftParenthesis); var linestrings = ParseLineStrings(tokens, dimensions); tokens.Dequeue(WktTokenType.RightParenthesis); - return new Polygon(new LinearRing(linestrings.First().Coordinates), - linestrings.Skip(1).Select(x => new LinearRing(x.Coordinates))); + return new Polygon( + new LinearRing(linestrings.First().Coordinates), + linestrings.Skip(1).Select(x => new LinearRing(x.Coordinates)) + ); } private List ParseLineStrings(WktTokenQueue tokens, WktDimensions dimensions) @@ -160,7 +162,6 @@ private MultiPoint ParseMultiPoint(WktTokenQueue tokens) tokens.Dequeue(WktTokenType.LeftParenthesis); - var points = new List { ParseMultiPointCoordinate(tokens, dimensions) }; while (tokens.NextTokenIs(WktTokenType.Comma)) { @@ -326,7 +327,10 @@ private List ParseOptionalOrdinates(WktTokenQueue tokens) return doubles; } - private CoordinateSequence ParseCoordinateSequence(WktTokenQueue tokens, WktDimensions dimensions) + private CoordinateSequence ParseCoordinateSequence( + WktTokenQueue tokens, + WktDimensions dimensions + ) { if (tokens.NextTokenIs("EMPTY")) { @@ -375,4 +379,4 @@ private WktDimensions ParseDimensions(WktTokenQueue tokens) return WktDimensions.XY; } -} \ No newline at end of file +} diff --git a/Geo/IO/Wkt/WktToken.cs b/Geo/IO/Wkt/WktToken.cs index 1013252..bb6c6a8 100644 --- a/Geo/IO/Wkt/WktToken.cs +++ b/Geo/IO/Wkt/WktToken.cs @@ -18,4 +18,4 @@ public WktToken(WktTokenType type, string value) public WktTokenType Type { get; } public string Value { get; } -} \ No newline at end of file +} diff --git a/Geo/IO/Wkt/WktTokenQueue.cs b/Geo/IO/Wkt/WktTokenQueue.cs index 94e53e0..d2084a7 100644 --- a/Geo/IO/Wkt/WktTokenQueue.cs +++ b/Geo/IO/Wkt/WktTokenQueue.cs @@ -6,13 +6,10 @@ namespace Geo.IO.Wkt; internal class WktTokenQueue : Queue { - public WktTokenQueue() - { - } + public WktTokenQueue() { } - public WktTokenQueue(IEnumerable tokens) : base(tokens) - { - } + public WktTokenQueue(IEnumerable tokens) + : base(tokens) { } public bool NextTokenIs(WktTokenType type) { @@ -41,8 +38,11 @@ public WktToken Dequeue(WktTokenType type) public WktToken Dequeue(string value) { var token = Dequeue(); - if (token.Type != WktTokenType.String || !string.Equals(value, token.Value, StringComparison.OrdinalIgnoreCase)) + if ( + token.Type != WktTokenType.String + || !string.Equals(value, token.Value, StringComparison.OrdinalIgnoreCase) + ) throw new SerializationException("Invalid WKT string."); return token; } -} \ No newline at end of file +} diff --git a/Geo/IO/Wkt/WktTokenType.cs b/Geo/IO/Wkt/WktTokenType.cs index 3a9a9d6..8e58f18 100644 --- a/Geo/IO/Wkt/WktTokenType.cs +++ b/Geo/IO/Wkt/WktTokenType.cs @@ -8,5 +8,5 @@ internal enum WktTokenType Whitespace, LeftParenthesis, RightParenthesis, - Comma -} \ No newline at end of file + Comma, +} diff --git a/Geo/IO/Wkt/WktTokenizer.cs b/Geo/IO/Wkt/WktTokenizer.cs index 3789369..08e4e1e 100644 --- a/Geo/IO/Wkt/WktTokenizer.cs +++ b/Geo/IO/Wkt/WktTokenizer.cs @@ -35,10 +35,12 @@ public WktTokenQueue Tokenize(TextReader reader) if (type != WktTokenType.Whitespace) { builder.Append(ch); - if (type != nextType || - type == WktTokenType.Comma || - type == WktTokenType.LeftParenthesis || - type == WktTokenType.RightParenthesis) + if ( + type != nextType + || type == WktTokenType.Comma + || type == WktTokenType.LeftParenthesis + || type == WktTokenType.RightParenthesis + ) { if (type != WktTokenType.Whitespace) queue.Enqueue(new WktToken(type, builder.ToString())); @@ -58,7 +60,11 @@ private static WktTokenType GetTokenType(char ch, WktTokenType? lastType = null) return WktTokenType.Whitespace; if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { - if ((ch == 'e' || ch == 'E') && lastType.HasValue && lastType.Value == WktTokenType.Number) + if ( + (ch == 'e' || ch == 'E') + && lastType.HasValue + && lastType.Value == WktTokenType.Number + ) return WktTokenType.Number; return WktTokenType.String; @@ -74,4 +80,4 @@ private static WktTokenType GetTokenType(char ch, WktTokenType? lastType = null) return WktTokenType.RightParenthesis; throw new SerializationException("Invalid WKT string."); } -} \ No newline at end of file +} diff --git a/Geo/IO/Wkt/WktWriter.cs b/Geo/IO/Wkt/WktWriter.cs index d4d9304..79cafb3 100644 --- a/Geo/IO/Wkt/WktWriter.cs +++ b/Geo/IO/Wkt/WktWriter.cs @@ -108,7 +108,9 @@ private void AppendGeometry(StringBuilder builder, IGeometry geometry) } } - throw new SerializationException("Geometry of type '" + geometry.GetType().Name + "' is not supported"); + throw new SerializationException( + "Geometry of type '" + geometry.GetType().Name + "' is not supported" + ); } private void AppendPoint(StringBuilder builder, Point point) @@ -259,7 +261,10 @@ private void AppendMultiPolygon(StringBuilder builder, MultiPolygon multiPolygon builder.Append(")"); } - private void AppendGeometryCollection(StringBuilder builder, GeometryCollection geometryCollection) + private void AppendGeometryCollection( + StringBuilder builder, + GeometryCollection geometryCollection + ) { builder.Append("GEOMETRYCOLLECTION"); if (geometryCollection.IsEmpty) @@ -322,7 +327,9 @@ private void AppendCoordinate(StringBuilder builder, Coordinate coordinate) if (coordinate.IsMeasured && _settings.MaxDimesions > 3) { builder.Append(" "); - builder.Append(((IsMeasured)coordinate).Measure.ToString(CultureInfo.InvariantCulture)); + builder.Append( + ((IsMeasured)coordinate).Measure.ToString(CultureInfo.InvariantCulture) + ); } } else @@ -341,8 +348,10 @@ private void AppendCoordinate(StringBuilder builder, Coordinate coordinate) if (coordinate.IsMeasured && _settings.MaxDimesions > 3) { builder.Append(" "); - builder.Append(((IsMeasured)coordinate).Measure.ToString(CultureInfo.InvariantCulture)); + builder.Append( + ((IsMeasured)coordinate).Measure.ToString(CultureInfo.InvariantCulture) + ); } } } -} \ No newline at end of file +} diff --git a/Geo/IO/Wkt/WktWriterSettings.cs b/Geo/IO/Wkt/WktWriterSettings.cs index 19fb36a..38c024f 100644 --- a/Geo/IO/Wkt/WktWriterSettings.cs +++ b/Geo/IO/Wkt/WktWriterSettings.cs @@ -24,5 +24,6 @@ public WktWriterSettings() public bool ConvertCirclesToRegularPolygons { get; set; } public int CircleSides { get; set; } - public static WktWriterSettings NtsCompatible => new() { DimensionFlag = false, LinearRing = true }; -} \ No newline at end of file + public static WktWriterSettings NtsCompatible => + new() { DimensionFlag = false, LinearRing = true }; +} diff --git a/Geo/InternalHelpers.cs b/Geo/InternalHelpers.cs index c1e82d3..8ab40ba 100644 --- a/Geo/InternalHelpers.cs +++ b/Geo/InternalHelpers.cs @@ -22,4 +22,4 @@ public static double NormalizeDegrees(this double degrees) degrees += 360; return degrees; } -} \ No newline at end of file +} diff --git a/Geo/LineSegment.cs b/Geo/LineSegment.cs index fa8206b..5646417 100644 --- a/Geo/LineSegment.cs +++ b/Geo/LineSegment.cs @@ -29,16 +29,17 @@ public Envelope GetBounds() public override bool Equals(object obj, SpatialEqualityOptions options) { var other = obj as LineSegment; - return !ReferenceEquals(null, other) && Equals(Coordinate1, other.Coordinate1, options) && - Equals(Coordinate2, other.Coordinate2, options); + return !ReferenceEquals(null, other) + && Equals(Coordinate1, other.Coordinate1, options) + && Equals(Coordinate2, other.Coordinate2, options); } public override int GetHashCode(SpatialEqualityOptions options) { unchecked { - return ((Coordinate1 != null ? Coordinate1.GetHashCode(options) : 0) * 397) ^ - (Coordinate2 != null ? Coordinate2.GetHashCode(options) : 0); + return ((Coordinate1 != null ? Coordinate1.GetHashCode(options) : 0) * 397) + ^ (Coordinate2 != null ? Coordinate2.GetHashCode(options) : 0); } } @@ -65,4 +66,4 @@ public override int GetHashCode() } #endregion -} \ No newline at end of file +} diff --git a/Geo/Linq/EnumerableExtensions.cs b/Geo/Linq/EnumerableExtensions.cs index 4c7eb0a..cc7f2db 100644 --- a/Geo/Linq/EnumerableExtensions.cs +++ b/Geo/Linq/EnumerableExtensions.cs @@ -25,7 +25,10 @@ public static Area Sum(this IEnumerable source, Func x.SiValue)); } - public static Distance Sum(this IEnumerable source, Func selector) + public static Distance Sum( + this IEnumerable source, + Func selector + ) { return new Distance(source.Select(selector).Sum(x => x.SiValue)); } @@ -35,7 +38,10 @@ public static Area Max(this IEnumerable source, Func x.SiValue)); } - public static Distance Max(this IEnumerable source, Func selector) + public static Distance Max( + this IEnumerable source, + Func selector + ) { return new Distance(source.Select(selector).Max(x => x.SiValue)); } @@ -45,8 +51,11 @@ public static Area Min(this IEnumerable source, Func x.SiValue)); } - public static Distance Min(this IEnumerable source, Func selector) + public static Distance Min( + this IEnumerable source, + Func selector + ) { return new Distance(source.Select(selector).Min(x => x.SiValue)); } -} \ No newline at end of file +} diff --git a/Geo/Linq/Spatial2DComparer.cs b/Geo/Linq/Spatial2DComparer.cs index c8bbb5b..e6bd073 100644 --- a/Geo/Linq/Spatial2DComparer.cs +++ b/Geo/Linq/Spatial2DComparer.cs @@ -4,7 +4,8 @@ namespace Geo.Linq; -public class Spatial2DComparer : IEqualityComparer where T : ISpatialEquatable +public class Spatial2DComparer : IEqualityComparer + where T : ISpatialEquatable { public bool Equals(T x, T y) { @@ -15,4 +16,4 @@ public int GetHashCode(T obj) { return obj.GetHashCode(GeoContext.Current.EqualityOptions.To2D()); } -} \ No newline at end of file +} diff --git a/Geo/Linq/Spatial3DComparer.cs b/Geo/Linq/Spatial3DComparer.cs index f4b450a..5d1657c 100644 --- a/Geo/Linq/Spatial3DComparer.cs +++ b/Geo/Linq/Spatial3DComparer.cs @@ -4,7 +4,8 @@ namespace Geo.Linq; -public class Spatial3DComparer : IEqualityComparer where T : ISpatialEquatable +public class Spatial3DComparer : IEqualityComparer + where T : ISpatialEquatable { public bool Equals(T x, T y) { @@ -15,4 +16,4 @@ public int GetHashCode(T obj) { return obj.GetHashCode(GeoContext.Current.EqualityOptions.To3D()); } -} \ No newline at end of file +} diff --git a/Geo/Measure/Area.cs b/Geo/Measure/Area.cs index cf0609a..65390b8 100644 --- a/Geo/Measure/Area.cs +++ b/Geo/Measure/Area.cs @@ -54,7 +54,8 @@ public bool Equals(Area other) public override bool Equals(object obj) { - if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(null, obj)) + return false; return obj is Distance && Equals((Distance)obj); } @@ -127,4 +128,4 @@ public static explicit operator Area(decimal metersPerSecond) { return new Area(left.SiValue - right.SiValue); } -} \ No newline at end of file +} diff --git a/Geo/Measure/AreaUnit.cs b/Geo/Measure/AreaUnit.cs index a629bff..d2a57ae 100644 --- a/Geo/Measure/AreaUnit.cs +++ b/Geo/Measure/AreaUnit.cs @@ -2,9 +2,18 @@ namespace Geo.Measure; public enum AreaUnit { - [Unit("m�", 1 * 1)] M = 0, - [Unit("nm�", 1852 * 1852)] Nm = 1, - [Unit("km�", 1000 * 1000)] Km = 2, - [Unit("mi�", 1609.34 * 1609.34)] Mile = 3, - [Unit("ft�", 0.3048 * 0.3048)] Ft = 4 -} \ No newline at end of file + [Unit("m�", 1 * 1)] + M = 0, + + [Unit("nm�", 1852 * 1852)] + Nm = 1, + + [Unit("km�", 1000 * 1000)] + Km = 2, + + [Unit("mi�", 1609.34 * 1609.34)] + Mile = 3, + + [Unit("ft�", 0.3048 * 0.3048)] + Ft = 4, +} diff --git a/Geo/Measure/AreaUnitExtensions.cs b/Geo/Measure/AreaUnitExtensions.cs index ce1b894..fdc415e 100644 --- a/Geo/Measure/AreaUnitExtensions.cs +++ b/Geo/Measure/AreaUnitExtensions.cs @@ -31,4 +31,4 @@ public double To(AreaUnit unit) return _value.ConvertTo(unit); } } -} \ No newline at end of file +} diff --git a/Geo/Measure/Distance.cs b/Geo/Measure/Distance.cs index 32398a5..ff866a7 100644 --- a/Geo/Measure/Distance.cs +++ b/Geo/Measure/Distance.cs @@ -54,7 +54,8 @@ public bool Equals(Distance other) public override bool Equals(object obj) { - if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(null, obj)) + return false; return obj is Distance && Equals((Distance)obj); } @@ -132,4 +133,4 @@ public static explicit operator Distance(decimal metersPerSecond) { return new Area(left.SiValue * right.SiValue); } -} \ No newline at end of file +} diff --git a/Geo/Measure/DistanceUnit.cs b/Geo/Measure/DistanceUnit.cs index e1dd32d..45a0211 100644 --- a/Geo/Measure/DistanceUnit.cs +++ b/Geo/Measure/DistanceUnit.cs @@ -2,9 +2,18 @@ namespace Geo.Measure; public enum DistanceUnit { - [Unit("m", 1)] M = 0, - [Unit("nm", 1852)] Nm = 1, - [Unit("km", 1000)] Km = 2, - [Unit("mi", 1609.34)] Mile = 3, - [Unit("ft", 0.3048)] Ft = 4 -} \ No newline at end of file + [Unit("m", 1)] + M = 0, + + [Unit("nm", 1852)] + Nm = 1, + + [Unit("km", 1000)] + Km = 2, + + [Unit("mi", 1609.34)] + Mile = 3, + + [Unit("ft", 0.3048)] + Ft = 4, +} diff --git a/Geo/Measure/DistanceUnitExtensions.cs b/Geo/Measure/DistanceUnitExtensions.cs index 0a882ee..abe3ae4 100644 --- a/Geo/Measure/DistanceUnitExtensions.cs +++ b/Geo/Measure/DistanceUnitExtensions.cs @@ -31,4 +31,4 @@ public double To(DistanceUnit unit) return _value.ConvertTo(unit); } } -} \ No newline at end of file +} diff --git a/Geo/Measure/Speed.cs b/Geo/Measure/Speed.cs index c47a3aa..0b9c609 100644 --- a/Geo/Measure/Speed.cs +++ b/Geo/Measure/Speed.cs @@ -20,8 +20,11 @@ public Speed(double value, SpeedUnit unit) public Speed(double metres, TimeSpan timeSpan) { Unit = SpeedUnit.Ms; - if (Math.Abs(metres - 0d) < double.Epsilon || timeSpan == default || - Math.Abs(timeSpan.TotalSeconds - 0) < double.Epsilon) + if ( + Math.Abs(metres - 0d) < double.Epsilon + || timeSpan == default + || Math.Abs(timeSpan.TotalSeconds - 0) < double.Epsilon + ) SiValue = 0d; else SiValue = metres / timeSpan.TotalSeconds; @@ -68,7 +71,8 @@ public bool Equals(Speed other) public override bool Equals(object obj) { - if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(null, obj)) + return false; return obj is Speed && Equals((Speed)obj); } @@ -141,4 +145,4 @@ public static explicit operator Speed(decimal metersPerSecond) { return new Speed(left.SiValue - right.SiValue); } -} \ No newline at end of file +} diff --git a/Geo/Measure/SpeedUnit.cs b/Geo/Measure/SpeedUnit.cs index 08caf18..974e3be 100644 --- a/Geo/Measure/SpeedUnit.cs +++ b/Geo/Measure/SpeedUnit.cs @@ -2,8 +2,15 @@ namespace Geo.Measure; public enum SpeedUnit { - [Unit("m/s", 1)] Ms = 0, - [Unit("knots", 0.514444444)] Knots = 1, - [Unit("kph", 0.277778)] Kph = 2, - [Unit("mph", 0.44704)] Mph = 3 -} \ No newline at end of file + [Unit("m/s", 1)] + Ms = 0, + + [Unit("knots", 0.514444444)] + Knots = 1, + + [Unit("kph", 0.277778)] + Kph = 2, + + [Unit("mph", 0.44704)] + Mph = 3, +} diff --git a/Geo/Measure/SpeedUnitExtensions.cs b/Geo/Measure/SpeedUnitExtensions.cs index c2b4842..b24051f 100644 --- a/Geo/Measure/SpeedUnitExtensions.cs +++ b/Geo/Measure/SpeedUnitExtensions.cs @@ -31,4 +31,4 @@ public double To(SpeedUnit unit) return _value.ConvertTo(unit); } } -} \ No newline at end of file +} diff --git a/Geo/Measure/UnitAttribute.cs b/Geo/Measure/UnitAttribute.cs index b3d22d8..526da95 100644 --- a/Geo/Measure/UnitAttribute.cs +++ b/Geo/Measure/UnitAttribute.cs @@ -29,4 +29,4 @@ public string Format(double value) { return string.Format("{0} {1}", value, _symbol); } -} \ No newline at end of file +} diff --git a/Geo/Measure/UnitMetadata.cs b/Geo/Measure/UnitMetadata.cs index f010e48..685f413 100644 --- a/Geo/Measure/UnitMetadata.cs +++ b/Geo/Measure/UnitMetadata.cs @@ -51,4 +51,4 @@ private static Dictionary Init() return new Dictionary(a); } -} \ No newline at end of file +} diff --git a/Geo/SimpleJson.cs b/Geo/SimpleJson.cs index 9123399..0bf7e9d 100644 --- a/Geo/SimpleJson.cs +++ b/Geo/SimpleJson.cs @@ -54,19 +54,20 @@ using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; -#if !SIMPLE_JSON_NO_LINQ_EXPRESSION -using System.Linq.Expressions; -#endif using System.ComponentModel; using System.Diagnostics.CodeAnalysis; -#if SIMPLE_JSON_DYNAMIC -using System.Dynamic; -#endif using System.Globalization; using System.Reflection; using System.Runtime.Serialization; using System.Text; using Geo.Reflection; +#if SIMPLE_JSON_DYNAMIC +using System.Dynamic; +#endif + +#if !SIMPLE_JSON_NO_LINQ_EXPRESSION +using System.Linq.Expressions; +#endif // ReSharper disable LoopCanBeConvertedToQuery // ReSharper disable RedundantExplicitArrayCreation @@ -84,18 +85,19 @@ namespace Geo #else public #endif - class JsonArray : List + class JsonArray : List { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public JsonArray() { } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The capacity of the json array. - public JsonArray(int capacity) : base(capacity) { } + public JsonArray(int capacity) + : base(capacity) { } /// /// The json representation of the array. @@ -118,11 +120,11 @@ public override string ToString() #else public #endif - class JsonObject : + class JsonObject : #if SIMPLE_JSON_DYNAMIC - DynamicObject, + DynamicObject, #endif - IDictionary + IDictionary { /// /// The internal member dictionary. @@ -163,7 +165,8 @@ internal static object GetAtIndex(IDictionary obj, int index) throw new ArgumentOutOfRangeException("index"); int i = 0; foreach (KeyValuePair o in obj) - if (i++ == index) return o.Value; + if (i++ == index) + return o.Value; return null; } @@ -274,7 +277,8 @@ public bool Contains(KeyValuePair item) /// Index of the array. public void CopyTo(KeyValuePair[] array, int arrayIndex) { - if (array == null) throw new ArgumentNullException("array"); + if (array == null) + throw new ArgumentNullException("array"); int num = Count; foreach (KeyValuePair kvp in this) { @@ -362,10 +366,12 @@ public override bool TryConvert(ConvertBinder binder, out object result) // Type targetType = binder.Type; - if ((targetType == typeof(IEnumerable)) || - (targetType == typeof(IEnumerable>)) || - (targetType == typeof(IDictionary)) || - (targetType == typeof(IDictionary))) + if ( + (targetType == typeof(IEnumerable)) + || (targetType == typeof(IEnumerable>)) + || (targetType == typeof(IDictionary)) + || (targetType == typeof(IDictionary)) + ) { result = this; return true; @@ -401,7 +407,8 @@ public override bool TryDeleteMember(DeleteMemberBinder binder) /// public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result) { - if (indexes == null) throw new ArgumentNullException("indexes"); + if (indexes == null) + throw new ArgumentNullException("indexes"); if (indexes.Length == 1) { result = ((IDictionary)this)[(string)indexes[0]]; @@ -442,7 +449,8 @@ public override bool TryGetMember(GetMemberBinder binder, out object result) /// public override bool TrySetIndex(SetIndexBinder binder, object[] indexes, object value) { - if (indexes == null) throw new ArgumentNullException("indexes"); + if (indexes == null) + throw new ArgumentNullException("indexes"); if (indexes.Length == 1) { ((IDictionary)this)[(string)indexes[0]] = value; @@ -489,7 +497,7 @@ namespace Geo /// /// This class encodes and decodes JSON strings. /// Spec. details, see http://www.json.org/ - /// + /// /// JSON uses Arrays and Objects. These correspond here to the datatypes JsonArray(IList<object>) and JsonObject(IDictionary<string,object>). /// All numbers are parsed to doubles. /// @@ -499,7 +507,7 @@ namespace Geo #else public #endif - static class SimpleJson + static class SimpleJson { private const int TOKEN_NONE = 0; private const int TOKEN_CURLY_OPEN = 1; @@ -516,13 +524,22 @@ static class SimpleJson private const int BUILDER_CAPACITY = 2000; private static readonly char[] EscapeTable; - private static readonly char[] EscapeCharacters = new char[] { '"', '\\', '\b', '\f', '\n', '\r', '\t' }; + private static readonly char[] EscapeCharacters = new char[] + { + '"', + '\\', + '\b', + '\f', + '\n', + '\r', + '\t', + }; private static readonly string EscapeCharactersString = new string(EscapeCharacters); static SimpleJson() { EscapeTable = new char[93]; - EscapeTable['"'] = '"'; + EscapeTable['"'] = '"'; EscapeTable['\\'] = '\\'; EscapeTable['\b'] = 'b'; EscapeTable['\f'] = 'f'; @@ -556,7 +573,11 @@ public static object DeserializeObject(string json) /// /// Returns true if successfull otherwise false. /// - [SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification="Need to support .NET 2")] + [SuppressMessage( + "Microsoft.Design", + "CA1007:UseGenericsWhereAppropriate", + Justification = "Need to support .NET 2" + )] public static bool TryDeserializeObject(string json, out object obj) { bool success = true; @@ -572,12 +593,22 @@ public static bool TryDeserializeObject(string json, out object obj) return success; } - public static object DeserializeObject(string json, Type type, IJsonSerializerStrategy jsonSerializerStrategy) + public static object DeserializeObject( + string json, + Type type, + IJsonSerializerStrategy jsonSerializerStrategy + ) { object jsonObject = DeserializeObject(json); - return type == null || jsonObject != null && ReflectionUtils.IsAssignableFrom(jsonObject.GetType(), type) - ? jsonObject - : (jsonSerializerStrategy ?? CurrentJsonSerializerStrategy).DeserializeObject(jsonObject, type); + return + type == null + || jsonObject != null + && ReflectionUtils.IsAssignableFrom(jsonObject.GetType(), type) + ? jsonObject + : (jsonSerializerStrategy ?? CurrentJsonSerializerStrategy).DeserializeObject( + jsonObject, + type + ); } public static object DeserializeObject(string json, Type type) @@ -585,7 +616,10 @@ public static object DeserializeObject(string json, Type type) return DeserializeObject(json, type, null); } - public static T DeserializeObject(string json, IJsonSerializerStrategy jsonSerializerStrategy) + public static T DeserializeObject( + string json, + IJsonSerializerStrategy jsonSerializerStrategy + ) { return (T)DeserializeObject(json, typeof(T), jsonSerializerStrategy); } @@ -601,7 +635,10 @@ public static T DeserializeObject(string json) /// A IDictionary<string,object> / IList<object> /// Serializer strategy to use /// A JSON encoded string, or null if object 'json' is not serializable - public static string SerializeObject(object json, IJsonSerializerStrategy jsonSerializerStrategy) + public static string SerializeObject( + object json, + IJsonSerializerStrategy jsonSerializerStrategy + ) { StringBuilder builder = new StringBuilder(BUILDER_CAPACITY); bool success = SerializeValue(jsonSerializerStrategy, json, builder); @@ -835,20 +872,37 @@ static string ParseString(char[] json, ref int index, ref bool success) { // parse the 32 bit hex into an integer codepoint uint codePoint; - if (!(success = UInt32.TryParse(new string(json, index, 4), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out codePoint))) + if ( + !( + success = UInt32.TryParse( + new string(json, index, 4), + NumberStyles.HexNumber, + CultureInfo.InvariantCulture, + out codePoint + ) + ) + ) return ""; // convert the integer codepoint to a unicode char and add to string - if (0xD800 <= codePoint && codePoint <= 0xDBFF) // if high surrogate + if (0xD800 <= codePoint && codePoint <= 0xDBFF) // if high surrogate { index += 4; // skip 4 chars remainingLength = json.Length - index; if (remainingLength >= 6) { uint lowCodePoint; - if (new string(json, index, 2) == "\\u" && UInt32.TryParse(new string(json, index + 2, 4), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out lowCodePoint)) + if ( + new string(json, index, 2) == "\\u" + && UInt32.TryParse( + new string(json, index + 2, 4), + NumberStyles.HexNumber, + CultureInfo.InvariantCulture, + out lowCodePoint + ) + ) { - if (0xDC00 <= lowCodePoint && lowCodePoint <= 0xDFFF) // if low surrogate + if (0xDC00 <= lowCodePoint && lowCodePoint <= 0xDFFF) // if low surrogate { s.Append((char)codePoint); s.Append((char)lowCodePoint); @@ -857,7 +911,7 @@ static string ParseString(char[] json, ref int index, ref bool success) } } } - success = false; // invalid surrogate pair + success = false; // invalid surrogate pair return ""; } s.Append(ConvertFromUtf32((int)codePoint)); @@ -883,13 +937,21 @@ private static string ConvertFromUtf32(int utf32) { // http://www.java2s.com/Open-Source/CSharp/2.6.4-mono-.net-core/System/System/Char.cs.htm if (utf32 < 0 || utf32 > 0x10FFFF) - throw new ArgumentOutOfRangeException("utf32", "The argument must be from 0 to 0x10FFFF."); + throw new ArgumentOutOfRangeException( + "utf32", + "The argument must be from 0 to 0x10FFFF." + ); if (0xD800 <= utf32 && utf32 <= 0xDFFF) - throw new ArgumentOutOfRangeException("utf32", "The argument must not be in surrogate pair range."); + throw new ArgumentOutOfRangeException( + "utf32", + "The argument must not be in surrogate pair range." + ); if (utf32 < 0x10000) return new string((char)utf32, 1); utf32 -= 0x10000; - return new string(new char[] { (char)((utf32 >> 10) + 0xD800), (char)(utf32 % 0x0400 + 0xDC00) }); + return new string( + new char[] { (char)((utf32 >> 10) + 0xD800), (char)(utf32 % 0x0400 + 0xDC00) } + ); } static object ParseNumber(char[] json, ref int index, ref bool success) @@ -899,16 +961,29 @@ static object ParseNumber(char[] json, ref int index, ref bool success) int charLength = (lastIndex - index) + 1; object returnNumber; string str = new string(json, index, charLength); - if (str.IndexOf(".", StringComparison.OrdinalIgnoreCase) != -1 || str.IndexOf("e", StringComparison.OrdinalIgnoreCase) != -1) + if ( + str.IndexOf(".", StringComparison.OrdinalIgnoreCase) != -1 + || str.IndexOf("e", StringComparison.OrdinalIgnoreCase) != -1 + ) { double number; - success = double.TryParse(new string(json, index, charLength), NumberStyles.Any, CultureInfo.InvariantCulture, out number); + success = double.TryParse( + new string(json, index, charLength), + NumberStyles.Any, + CultureInfo.InvariantCulture, + out number + ); returnNumber = number; } else { long number; - success = long.TryParse(new string(json, index, charLength), NumberStyles.Any, CultureInfo.InvariantCulture, out number); + success = long.TryParse( + new string(json, index, charLength), + NumberStyles.Any, + CultureInfo.InvariantCulture, + out number + ); returnNumber = number; } index = lastIndex + 1; @@ -919,14 +994,16 @@ static int GetLastIndexOfNumber(char[] json, int index) { int lastIndex; for (lastIndex = index; lastIndex < json.Length; lastIndex++) - if ("0123456789+-.eE".IndexOf(json[lastIndex]) == -1) break; + if ("0123456789+-.eE".IndexOf(json[lastIndex]) == -1) + break; return lastIndex - 1; } static void EatWhitespace(char[] json, ref int index) { for (; index < json.Length; index++) - if (" \t\n\r\b\f".IndexOf(json[index]) == -1) break; + if (" \t\n\r\b\f".IndexOf(json[index]) == -1) + break; } static int LookAhead(char[] json, int index) @@ -977,7 +1054,13 @@ static int NextToken(char[] json, ref int index) // false if (remainingLength >= 5) { - if (json[index] == 'f' && json[index + 1] == 'a' && json[index + 2] == 'l' && json[index + 3] == 's' && json[index + 4] == 'e') + if ( + json[index] == 'f' + && json[index + 1] == 'a' + && json[index + 2] == 'l' + && json[index + 3] == 's' + && json[index + 4] == 'e' + ) { index += 5; return TOKEN_FALSE; @@ -986,7 +1069,12 @@ static int NextToken(char[] json, ref int index) // true if (remainingLength >= 4) { - if (json[index] == 't' && json[index + 1] == 'r' && json[index + 2] == 'u' && json[index + 3] == 'e') + if ( + json[index] == 't' + && json[index + 1] == 'r' + && json[index + 2] == 'u' + && json[index + 3] == 'e' + ) { index += 4; return TOKEN_TRUE; @@ -995,7 +1083,12 @@ static int NextToken(char[] json, ref int index) // null if (remainingLength >= 4) { - if (json[index] == 'n' && json[index + 1] == 'u' && json[index + 2] == 'l' && json[index + 3] == 'l') + if ( + json[index] == 'n' + && json[index + 1] == 'u' + && json[index + 2] == 'l' + && json[index + 3] == 'l' + ) { index += 4; return TOKEN_NULL; @@ -1004,7 +1097,11 @@ static int NextToken(char[] json, ref int index) return TOKEN_NONE; } - static bool SerializeValue(IJsonSerializerStrategy jsonSerializerStrategy, object value, StringBuilder builder) + static bool SerializeValue( + IJsonSerializerStrategy jsonSerializerStrategy, + object value, + StringBuilder builder + ) { bool success = true; string stringValue = value as string; @@ -1015,20 +1112,35 @@ static bool SerializeValue(IJsonSerializerStrategy jsonSerializerStrategy, objec IDictionary dict = value as IDictionary; if (dict != null) { - success = SerializeObject(jsonSerializerStrategy, dict.Keys, dict.Values, builder); + success = SerializeObject( + jsonSerializerStrategy, + dict.Keys, + dict.Values, + builder + ); } else { - IDictionary stringDictionary = value as IDictionary; + IDictionary stringDictionary = + value as IDictionary; if (stringDictionary != null) { - success = SerializeObject(jsonSerializerStrategy, stringDictionary.Keys, stringDictionary.Values, builder); + success = SerializeObject( + jsonSerializerStrategy, + stringDictionary.Keys, + stringDictionary.Values, + builder + ); } else { IEnumerable enumerableValue = value as IEnumerable; if (enumerableValue != null) - success = SerializeArray(jsonSerializerStrategy, enumerableValue, builder); + success = SerializeArray( + jsonSerializerStrategy, + enumerableValue, + builder + ); else if (IsNumeric(value)) success = SerializeNumber(value, builder); else if (value is bool) @@ -1038,7 +1150,10 @@ static bool SerializeValue(IJsonSerializerStrategy jsonSerializerStrategy, objec else { object serializedObject; - success = jsonSerializerStrategy.TrySerializeNonPrimitiveObject(value, out serializedObject); + success = jsonSerializerStrategy.TrySerializeNonPrimitiveObject( + value, + out serializedObject + ); if (success) SerializeValue(jsonSerializerStrategy, serializedObject, builder); } @@ -1048,7 +1163,12 @@ static bool SerializeValue(IJsonSerializerStrategy jsonSerializerStrategy, objec return success; } - static bool SerializeObject(IJsonSerializerStrategy jsonSerializerStrategy, IEnumerable keys, IEnumerable values, StringBuilder builder) + static bool SerializeObject( + IJsonSerializerStrategy jsonSerializerStrategy, + IEnumerable keys, + IEnumerable values, + StringBuilder builder + ) { builder.Append("{"); IEnumerator ke = keys.GetEnumerator(); @@ -1063,8 +1183,8 @@ static bool SerializeObject(IJsonSerializerStrategy jsonSerializerStrategy, IEnu string stringKey = key as string; if (stringKey != null) SerializeString(stringKey, builder); - else - if (!SerializeValue(jsonSerializerStrategy, value, builder)) return false; + else if (!SerializeValue(jsonSerializerStrategy, value, builder)) + return false; builder.Append(":"); if (!SerializeValue(jsonSerializerStrategy, value, builder)) return false; @@ -1074,7 +1194,11 @@ static bool SerializeObject(IJsonSerializerStrategy jsonSerializerStrategy, IEnu return true; } - static bool SerializeArray(IJsonSerializerStrategy jsonSerializerStrategy, IEnumerable anArray, StringBuilder builder) + static bool SerializeArray( + IJsonSerializerStrategy jsonSerializerStrategy, + IEnumerable anArray, + StringBuilder builder + ) { builder.Append("["); bool first = true; @@ -1132,7 +1256,11 @@ static bool SerializeString(string aString, StringBuilder builder) if (safeCharacterCount > 0) { - builder.Append(charArray, charArray.Length - safeCharacterCount, safeCharacterCount); + builder.Append( + charArray, + charArray.Length - safeCharacterCount, + safeCharacterCount + ); } builder.Append('"'); @@ -1154,7 +1282,11 @@ static bool SerializeNumber(object number, StringBuilder builder) else if (number is float) builder.Append(((float)number).ToString(CultureInfo.InvariantCulture)); else - builder.Append(Convert.ToDouble(number, CultureInfo.InvariantCulture).ToString("r", CultureInfo.InvariantCulture)); + builder.Append( + Convert + .ToDouble(number, CultureInfo.InvariantCulture) + .ToString("r", CultureInfo.InvariantCulture) + ); return true; } @@ -1164,17 +1296,28 @@ static bool SerializeNumber(object number, StringBuilder builder) /// static bool IsNumeric(object value) { - if (value is sbyte) return true; - if (value is byte) return true; - if (value is short) return true; - if (value is ushort) return true; - if (value is int) return true; - if (value is uint) return true; - if (value is long) return true; - if (value is ulong) return true; - if (value is float) return true; - if (value is double) return true; - if (value is decimal) return true; + if (value is sbyte) + return true; + if (value is byte) + return true; + if (value is short) + return true; + if (value is ushort) + return true; + if (value is int) + return true; + if (value is uint) + return true; + if (value is long) + return true; + if (value is ulong) + return true; + if (value is float) + return true; + if (value is double) + return true; + if (value is decimal) + return true; return false; } @@ -1183,55 +1326,63 @@ public static IJsonSerializerStrategy CurrentJsonSerializerStrategy { get { - return _currentJsonSerializerStrategy ?? - (_currentJsonSerializerStrategy = + return _currentJsonSerializerStrategy + ?? (_currentJsonSerializerStrategy = #if SIMPLE_JSON_DATACONTRACT - DataContractJsonSerializerStrategy + DataContractJsonSerializerStrategy #else - PocoJsonSerializerStrategy + PocoJsonSerializerStrategy #endif -); - } - set - { - _currentJsonSerializerStrategy = value; + ); } + set { _currentJsonSerializerStrategy = value; } } private static PocoJsonSerializerStrategy _pocoJsonSerializerStrategy; + [EditorBrowsable(EditorBrowsableState.Advanced)] public static PocoJsonSerializerStrategy PocoJsonSerializerStrategy { get { - return _pocoJsonSerializerStrategy ?? (_pocoJsonSerializerStrategy = new PocoJsonSerializerStrategy()); + return _pocoJsonSerializerStrategy + ?? (_pocoJsonSerializerStrategy = new PocoJsonSerializerStrategy()); } } #if SIMPLE_JSON_DATACONTRACT private static DataContractJsonSerializerStrategy _dataContractJsonSerializerStrategy; + [System.ComponentModel.EditorBrowsable(EditorBrowsableState.Advanced)] public static DataContractJsonSerializerStrategy DataContractJsonSerializerStrategy { get { - return _dataContractJsonSerializerStrategy ?? (_dataContractJsonSerializerStrategy = new DataContractJsonSerializerStrategy()); + return _dataContractJsonSerializerStrategy + ?? ( + _dataContractJsonSerializerStrategy = + new DataContractJsonSerializerStrategy() + ); } } #endif } - + [GeneratedCode("simple-json", "1.0.0")] #if SIMPLE_JSON_INTERNAL internal #else public #endif - interface IJsonSerializerStrategy + interface IJsonSerializerStrategy { - [SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification="Need to support .NET 2")] + [SuppressMessage( + "Microsoft.Design", + "CA1007:UseGenericsWhereAppropriate", + Justification = "Need to support .NET 2" + )] bool TrySerializeNonPrimitiveObject(object input, out object output); object DeserializeObject(object value, Type type); } @@ -1242,27 +1393,39 @@ interface IJsonSerializerStrategy #else public #endif - class PocoJsonSerializerStrategy : IJsonSerializerStrategy + class PocoJsonSerializerStrategy : IJsonSerializerStrategy { internal IDictionary ConstructorCache; internal IDictionary> GetCache; - internal IDictionary>> SetCache; + internal IDictionary< + Type, + IDictionary> + > SetCache; internal static readonly Type[] EmptyTypes = new Type[0]; internal static readonly Type[] ArrayConstructorParameterTypes = new Type[] { typeof(int) }; private static readonly string[] Iso8601Format = new string[] - { - @"yyyy-MM-dd\THH:mm:ss.FFFFFFF\Z", - @"yyyy-MM-dd\THH:mm:ss\Z", - @"yyyy-MM-dd\THH:mm:ssK" - }; + { + @"yyyy-MM-dd\THH:mm:ss.FFFFFFF\Z", + @"yyyy-MM-dd\THH:mm:ss\Z", + @"yyyy-MM-dd\THH:mm:ssK", + }; public PocoJsonSerializerStrategy() { - ConstructorCache = new ReflectionUtils.ThreadSafeDictionary(ContructorDelegateFactory); - GetCache = new ReflectionUtils.ThreadSafeDictionary>(GetterValueFactory); - SetCache = new ReflectionUtils.ThreadSafeDictionary>>(SetterValueFactory); + ConstructorCache = new ReflectionUtils.ThreadSafeDictionary< + Type, + ReflectionUtils.ConstructorDelegate + >(ContructorDelegateFactory); + GetCache = new ReflectionUtils.ThreadSafeDictionary< + Type, + IDictionary + >(GetterValueFactory); + SetCache = new ReflectionUtils.ThreadSafeDictionary< + Type, + IDictionary> + >(SetterValueFactory); } protected virtual string MapClrMemberNameToJsonFieldName(string clrPropertyName) @@ -1272,12 +1435,18 @@ protected virtual string MapClrMemberNameToJsonFieldName(string clrPropertyName) internal virtual ReflectionUtils.ConstructorDelegate ContructorDelegateFactory(Type key) { - return ReflectionUtils.GetContructor(key, key.IsArray ? ArrayConstructorParameterTypes : EmptyTypes); + return ReflectionUtils.GetContructor( + key, + key.IsArray ? ArrayConstructorParameterTypes : EmptyTypes + ); } - internal virtual IDictionary GetterValueFactory(Type type) + internal virtual IDictionary GetterValueFactory( + Type type + ) { - IDictionary result = new Dictionary(); + IDictionary result = + new Dictionary(); foreach (PropertyInfo propertyInfo in ReflectionUtils.GetProperties(type)) { if (propertyInfo.CanRead) @@ -1285,21 +1454,27 @@ internal virtual ReflectionUtils.ConstructorDelegate ContructorDelegateFactory(T MethodInfo getMethod = ReflectionUtils.GetGetterMethodInfo(propertyInfo); if (getMethod.IsStatic || !getMethod.IsPublic) continue; - result[MapClrMemberNameToJsonFieldName(propertyInfo.Name)] = ReflectionUtils.GetGetMethod(propertyInfo); + result[MapClrMemberNameToJsonFieldName(propertyInfo.Name)] = + ReflectionUtils.GetGetMethod(propertyInfo); } } foreach (FieldInfo fieldInfo in ReflectionUtils.GetFields(type)) { if (fieldInfo.IsStatic || !fieldInfo.IsPublic) continue; - result[MapClrMemberNameToJsonFieldName(fieldInfo.Name)] = ReflectionUtils.GetGetMethod(fieldInfo); + result[MapClrMemberNameToJsonFieldName(fieldInfo.Name)] = + ReflectionUtils.GetGetMethod(fieldInfo); } return result; } - internal virtual IDictionary> SetterValueFactory(Type type) + internal virtual IDictionary< + string, + KeyValuePair + > SetterValueFactory(Type type) { - IDictionary> result = new Dictionary>(); + IDictionary> result = + new Dictionary>(); foreach (PropertyInfo propertyInfo in ReflectionUtils.GetProperties(type)) { if (propertyInfo.CanWrite) @@ -1307,88 +1482,138 @@ internal virtual ReflectionUtils.ConstructorDelegate ContructorDelegateFactory(T MethodInfo setMethod = ReflectionUtils.GetSetterMethodInfo(propertyInfo); if (setMethod.IsStatic || !setMethod.IsPublic) continue; - result[MapClrMemberNameToJsonFieldName(propertyInfo.Name)] = new KeyValuePair(propertyInfo.PropertyType, ReflectionUtils.GetSetMethod(propertyInfo)); + result[MapClrMemberNameToJsonFieldName(propertyInfo.Name)] = new KeyValuePair< + Type, + ReflectionUtils.SetDelegate + >(propertyInfo.PropertyType, ReflectionUtils.GetSetMethod(propertyInfo)); } } foreach (FieldInfo fieldInfo in ReflectionUtils.GetFields(type)) { if (fieldInfo.IsInitOnly || fieldInfo.IsStatic || !fieldInfo.IsPublic) continue; - result[MapClrMemberNameToJsonFieldName(fieldInfo.Name)] = new KeyValuePair(fieldInfo.FieldType, ReflectionUtils.GetSetMethod(fieldInfo)); + result[MapClrMemberNameToJsonFieldName(fieldInfo.Name)] = new KeyValuePair< + Type, + ReflectionUtils.SetDelegate + >(fieldInfo.FieldType, ReflectionUtils.GetSetMethod(fieldInfo)); } return result; } public virtual bool TrySerializeNonPrimitiveObject(object input, out object output) { - return TrySerializeKnownTypes(input, out output) || TrySerializeUnknownTypes(input, out output); + return TrySerializeKnownTypes(input, out output) + || TrySerializeUnknownTypes(input, out output); } [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] public virtual object DeserializeObject(object value, Type type) { - if (type == null) throw new ArgumentNullException("type"); + if (type == null) + throw new ArgumentNullException("type"); string str = value as string; - if (type == typeof (Guid) && string.IsNullOrEmpty(str)) + if (type == typeof(Guid) && string.IsNullOrEmpty(str)) return default(Guid); if (value == null) return null; - + object obj = null; if (str != null) { if (str.Length != 0) // We know it can't be null now. { - if (type == typeof(DateTime) || (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(DateTime))) - return DateTime.ParseExact(str, Iso8601Format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal); - if (type == typeof(DateTimeOffset) || (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(DateTimeOffset))) - return DateTimeOffset.ParseExact(str, Iso8601Format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal); - if (type == typeof(Guid) || (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(Guid))) + if ( + type == typeof(DateTime) + || ( + ReflectionUtils.IsNullableType(type) + && Nullable.GetUnderlyingType(type) == typeof(DateTime) + ) + ) + return DateTime.ParseExact( + str, + Iso8601Format, + CultureInfo.InvariantCulture, + DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal + ); + if ( + type == typeof(DateTimeOffset) + || ( + ReflectionUtils.IsNullableType(type) + && Nullable.GetUnderlyingType(type) == typeof(DateTimeOffset) + ) + ) + return DateTimeOffset.ParseExact( + str, + Iso8601Format, + CultureInfo.InvariantCulture, + DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal + ); + if ( + type == typeof(Guid) + || ( + ReflectionUtils.IsNullableType(type) + && Nullable.GetUnderlyingType(type) == typeof(Guid) + ) + ) return new Guid(str); if (type == typeof(Uri)) { - bool isValid = Uri.IsWellFormedUriString(str, UriKind.RelativeOrAbsolute); + bool isValid = Uri.IsWellFormedUriString(str, UriKind.RelativeOrAbsolute); Uri result; if (isValid && Uri.TryCreate(str, UriKind.RelativeOrAbsolute, out result)) return result; - return null; + return null; } - - if (type == typeof(string)) - return str; - return Convert.ChangeType(str, type, CultureInfo.InvariantCulture); + if (type == typeof(string)) + return str; + + return Convert.ChangeType(str, type, CultureInfo.InvariantCulture); } else { if (type == typeof(Guid)) obj = default(Guid); - else if (ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(Guid)) + else if ( + ReflectionUtils.IsNullableType(type) + && Nullable.GetUnderlyingType(type) == typeof(Guid) + ) obj = null; else obj = str; } // Empty string case - if (!ReflectionUtils.IsNullableType(type) && Nullable.GetUnderlyingType(type) == typeof(Guid)) + if ( + !ReflectionUtils.IsNullableType(type) + && Nullable.GetUnderlyingType(type) == typeof(Guid) + ) return str; } else if (value is bool) return value; - + bool valueIsLong = value is long; bool valueIsDouble = value is double; if ((valueIsLong && type == typeof(long)) || (valueIsDouble && type == typeof(double))) return value; if ((valueIsDouble && type != typeof(double)) || (valueIsLong && type != typeof(long))) { - obj = type == typeof(int) || type == typeof(long) || type == typeof(double) || type == typeof(float) || type == typeof(bool) || type == typeof(decimal) || type == typeof(byte) || type == typeof(short) - ? Convert.ChangeType(value, type, CultureInfo.InvariantCulture) - : value; + obj = + type == typeof(int) + || type == typeof(long) + || type == typeof(double) + || type == typeof(float) + || type == typeof(bool) + || type == typeof(decimal) + || type == typeof(byte) + || type == typeof(short) + ? Convert.ChangeType(value, type, CultureInfo.InvariantCulture) + : value; } else { @@ -1404,7 +1629,10 @@ public virtual object DeserializeObject(object value, Type type) Type keyType = types[0]; Type valueType = types[1]; - Type genericType = typeof(Dictionary<,>).MakeGenericType(keyType, valueType); + Type genericType = typeof(Dictionary<,>).MakeGenericType( + keyType, + valueType + ); IDictionary dict = (IDictionary)ConstructorCache[genericType](); @@ -1420,7 +1648,12 @@ public virtual object DeserializeObject(object value, Type type) else { obj = ConstructorCache[type](); - foreach (KeyValuePair> setter in SetCache[type]) + foreach ( + KeyValuePair< + string, + KeyValuePair + > setter in SetCache[type] + ) { object jsonValue; if (jsonObject.TryGetValue(setter.Key, out jsonValue)) @@ -1447,10 +1680,17 @@ public virtual object DeserializeObject(object value, Type type) foreach (object o in jsonObject) list[i++] = DeserializeObject(o, type.GetElementType()); } - else if (ReflectionUtils.IsTypeGenericeCollectionInterface(type) || ReflectionUtils.IsAssignableFrom(typeof(IList), type)) + else if ( + ReflectionUtils.IsTypeGenericeCollectionInterface(type) + || ReflectionUtils.IsAssignableFrom(typeof(IList), type) + ) { Type innerType = ReflectionUtils.GetGenericListElementType(type); - list = (IList)(ConstructorCache[type] ?? ConstructorCache[typeof(List<>).MakeGenericType(innerType)])(jsonObject.Count); + list = (IList) + ( + ConstructorCache[type] + ?? ConstructorCache[typeof(List<>).MakeGenericType(innerType)] + )(jsonObject.Count); foreach (object o in jsonObject) list.Add(DeserializeObject(o, innerType)); } @@ -1469,14 +1709,22 @@ protected virtual object SerializeEnum(Enum p) return Convert.ToDouble(p, CultureInfo.InvariantCulture); } - [SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification="Need to support .NET 2")] + [SuppressMessage( + "Microsoft.Design", + "CA1007:UseGenericsWhereAppropriate", + Justification = "Need to support .NET 2" + )] protected virtual bool TrySerializeKnownTypes(object input, out object output) { bool returnValue = true; if (input is DateTime) - output = ((DateTime)input).ToUniversalTime().ToString(Iso8601Format[0], CultureInfo.InvariantCulture); + output = ((DateTime)input) + .ToUniversalTime() + .ToString(Iso8601Format[0], CultureInfo.InvariantCulture); else if (input is DateTimeOffset) - output = ((DateTimeOffset)input).ToUniversalTime().ToString(Iso8601Format[0], CultureInfo.InvariantCulture); + output = ((DateTimeOffset)input) + .ToUniversalTime() + .ToString(Iso8601Format[0], CultureInfo.InvariantCulture); else if (input is Guid) output = ((Guid)input).ToString("D"); else if (input is Uri) @@ -1494,10 +1742,16 @@ protected virtual bool TrySerializeKnownTypes(object input, out object output) } return returnValue; } - [SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification="Need to support .NET 2")] + + [SuppressMessage( + "Microsoft.Design", + "CA1007:UseGenericsWhereAppropriate", + Justification = "Need to support .NET 2" + )] protected virtual bool TrySerializeUnknownTypes(object input, out object output) { - if (input == null) throw new ArgumentNullException("input"); + if (input == null) + throw new ArgumentNullException("input"); output = null; Type type = input.GetType(); if (type.FullName == null) @@ -1521,21 +1775,31 @@ protected virtual bool TrySerializeUnknownTypes(object input, out object output) #else public #endif - class DataContractJsonSerializerStrategy : PocoJsonSerializerStrategy + class DataContractJsonSerializerStrategy : PocoJsonSerializerStrategy { public DataContractJsonSerializerStrategy() { - GetCache = new ReflectionUtils.ThreadSafeDictionary>(GetterValueFactory); - SetCache = new ReflectionUtils.ThreadSafeDictionary>>(SetterValueFactory); + GetCache = new ReflectionUtils.ThreadSafeDictionary< + Type, + IDictionary + >(GetterValueFactory); + SetCache = new ReflectionUtils.ThreadSafeDictionary< + Type, + IDictionary> + >(SetterValueFactory); } - internal override IDictionary GetterValueFactory(Type type) + internal override IDictionary GetterValueFactory( + Type type + ) { - bool hasDataContract = ReflectionUtils.GetAttribute(type, typeof(DataContractAttribute)) != null; + bool hasDataContract = + ReflectionUtils.GetAttribute(type, typeof(DataContractAttribute)) != null; if (!hasDataContract) return base.GetterValueFactory(type); string jsonKey; - IDictionary result = new Dictionary(); + IDictionary result = + new Dictionary(); foreach (PropertyInfo propertyInfo in ReflectionUtils.GetProperties(type)) { if (propertyInfo.CanRead) @@ -1553,26 +1817,37 @@ public DataContractJsonSerializerStrategy() return result; } - internal override IDictionary> SetterValueFactory(Type type) + internal override IDictionary< + string, + KeyValuePair + > SetterValueFactory(Type type) { - bool hasDataContract = ReflectionUtils.GetAttribute(type, typeof(DataContractAttribute)) != null; + bool hasDataContract = + ReflectionUtils.GetAttribute(type, typeof(DataContractAttribute)) != null; if (!hasDataContract) return base.SetterValueFactory(type); string jsonKey; - IDictionary> result = new Dictionary>(); + IDictionary> result = + new Dictionary>(); foreach (PropertyInfo propertyInfo in ReflectionUtils.GetProperties(type)) { if (propertyInfo.CanWrite) { MethodInfo setMethod = ReflectionUtils.GetSetterMethodInfo(propertyInfo); if (!setMethod.IsStatic && CanAdd(propertyInfo, out jsonKey)) - result[jsonKey] = new KeyValuePair(propertyInfo.PropertyType, ReflectionUtils.GetSetMethod(propertyInfo)); + result[jsonKey] = new KeyValuePair( + propertyInfo.PropertyType, + ReflectionUtils.GetSetMethod(propertyInfo) + ); } } foreach (FieldInfo fieldInfo in ReflectionUtils.GetFields(type)) { if (!fieldInfo.IsInitOnly && !fieldInfo.IsStatic && CanAdd(fieldInfo, out jsonKey)) - result[jsonKey] = new KeyValuePair(fieldInfo.FieldType, ReflectionUtils.GetSetMethod(fieldInfo)); + result[jsonKey] = new KeyValuePair( + fieldInfo.FieldType, + ReflectionUtils.GetSetMethod(fieldInfo) + ); } // todo implement sorting for DATACONTRACT. return result; @@ -1583,27 +1858,29 @@ private static bool CanAdd(MemberInfo info, out string jsonKey) jsonKey = null; if (ReflectionUtils.GetAttribute(info, typeof(IgnoreDataMemberAttribute)) != null) return false; - DataMemberAttribute dataMemberAttribute = (DataMemberAttribute)ReflectionUtils.GetAttribute(info, typeof(DataMemberAttribute)); + DataMemberAttribute dataMemberAttribute = (DataMemberAttribute) + ReflectionUtils.GetAttribute(info, typeof(DataMemberAttribute)); if (dataMemberAttribute == null) return false; - jsonKey = string.IsNullOrEmpty(dataMemberAttribute.Name) ? info.Name : dataMemberAttribute.Name; + jsonKey = string.IsNullOrEmpty(dataMemberAttribute.Name) + ? info.Name + : dataMemberAttribute.Name; return true; } } - #endif namespace Reflection { // This class is meant to be copied into other libraries. So we want to exclude it from Code Analysis rules - // that might be in place in the target project. + // that might be in place in the target project. [GeneratedCode("reflection-utils", "1.0.0")] #if SIMPLE_JSON_REFLECTION_UTILS_PUBLIC public #else internal #endif - class ReflectionUtils + class ReflectionUtils { private static readonly object[] EmptyObjects = new object[] { }; @@ -1648,8 +1925,10 @@ public static Type GetGenericListElementType(Type type) #endif foreach (Type implementedInterface in interfaces) { - if (IsTypeGeneric(implementedInterface) && - implementedInterface.GetGenericTypeDefinition() == typeof (IList<>)) + if ( + IsTypeGeneric(implementedInterface) + && implementedInterface.GetGenericTypeDefinition() == typeof(IList<>) + ) { return GetGenericTypeArguments(implementedInterface)[0]; } @@ -1659,13 +1938,20 @@ public static Type GetGenericListElementType(Type type) public static Attribute GetAttribute(Type objectType, Type attributeType) { - #if SIMPLE_JSON_TYPEINFO - if (objectType == null || attributeType == null || !objectType.GetTypeInfo().IsDefined(attributeType)) + if ( + objectType == null + || attributeType == null + || !objectType.GetTypeInfo().IsDefined(attributeType) + ) return null; return objectType.GetTypeInfo().GetCustomAttribute(attributeType); #else - if (objectType == null || attributeType == null || !Attribute.IsDefined(objectType, attributeType)) + if ( + objectType == null + || attributeType == null + || !Attribute.IsDefined(objectType, attributeType) + ) return null; return Attribute.GetCustomAttribute(objectType, attributeType); #endif @@ -1692,14 +1978,15 @@ public static bool IsTypeGenericeCollectionInterface(Type type) Type genericDefinition = type.GetGenericTypeDefinition(); - return (genericDefinition == typeof(IList<>) + return ( + genericDefinition == typeof(IList<>) || genericDefinition == typeof(ICollection<>) || genericDefinition == typeof(IEnumerable<>) #if SIMPLE_JSON_READONLY_COLLECTIONS || genericDefinition == typeof(IReadOnlyCollection<>) || genericDefinition == typeof(IReadOnlyList<>) #endif - ); + ); } public static bool IsAssignableFrom(Type type1, Type type2) @@ -1725,12 +2012,19 @@ public static bool IsTypeDictionary(Type type) public static bool IsNullableType(Type type) { - return GetTypeInfo(type).IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); + return GetTypeInfo(type).IsGenericType + && type.GetGenericTypeDefinition() == typeof(Nullable<>); } public static object ToNullableType(object obj, Type nullableType) { - return obj == null ? null : Convert.ChangeType(obj, Nullable.GetUnderlyingType(nullableType), CultureInfo.InvariantCulture); + return obj == null + ? null + : Convert.ChangeType( + obj, + Nullable.GetUnderlyingType(nullableType), + CultureInfo.InvariantCulture + ); } public static bool IsValueType(Type type) @@ -1781,7 +2075,12 @@ public static IEnumerable GetProperties(Type type) #if SIMPLE_JSON_TYPEINFO return type.GetRuntimeProperties(); #else - return type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); + return type.GetProperties( + BindingFlags.Instance + | BindingFlags.Public + | BindingFlags.NonPublic + | BindingFlags.Static + ); #endif } @@ -1790,7 +2089,12 @@ public static IEnumerable GetFields(Type type) #if SIMPLE_JSON_TYPEINFO return type.GetRuntimeFields(); #else - return type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); + return type.GetFields( + BindingFlags.Instance + | BindingFlags.Public + | BindingFlags.NonPublic + | BindingFlags.Static + ); #endif } @@ -1830,12 +2134,20 @@ public static ConstructorDelegate GetContructor(Type type, params Type[] argsTyp #endif } - public static ConstructorDelegate GetConstructorByReflection(ConstructorInfo constructorInfo) + public static ConstructorDelegate GetConstructorByReflection( + ConstructorInfo constructorInfo + ) { - return delegate(object[] args) { return constructorInfo.Invoke(args); }; + return delegate(object[] args) + { + return constructorInfo.Invoke(args); + }; } - public static ConstructorDelegate GetConstructorByReflection(Type type, params Type[] argsType) + public static ConstructorDelegate GetConstructorByReflection( + Type type, + params Type[] argsType + ) { ConstructorInfo constructorInfo = GetConstructorInfo(type, argsType); return constructorInfo == null ? null : GetConstructorByReflection(constructorInfo); @@ -1843,7 +2155,9 @@ public static ConstructorDelegate GetConstructorByReflection(Type type, params T #if !SIMPLE_JSON_NO_LINQ_EXPRESSION - public static ConstructorDelegate GetConstructorByExpression(ConstructorInfo constructorInfo) + public static ConstructorDelegate GetConstructorByExpression( + ConstructorInfo constructorInfo + ) { ParameterInfo[] paramsInfo = constructorInfo.GetParameters(); ParameterExpression param = Expression.Parameter(typeof(object[]), "args"); @@ -1857,17 +2171,24 @@ public static ConstructorDelegate GetConstructorByExpression(ConstructorInfo con argsExp[i] = paramCastExp; } NewExpression newExp = Expression.New(constructorInfo, argsExp); - Expression> lambda = Expression.Lambda>(newExp, param); + Expression> lambda = Expression.Lambda< + Func + >(newExp, param); Func compiledLambda = lambda.Compile(); - return delegate(object[] args) { return compiledLambda(args); }; + return delegate(object[] args) + { + return compiledLambda(args); + }; } - public static ConstructorDelegate GetConstructorByExpression(Type type, params Type[] argsType) + public static ConstructorDelegate GetConstructorByExpression( + Type type, + params Type[] argsType + ) { ConstructorInfo constructorInfo = GetConstructorInfo(type, argsType); return constructorInfo == null ? null : GetConstructorByExpression(constructorInfo); } - #endif public static GetDelegate GetGetMethod(PropertyInfo propertyInfo) @@ -1891,12 +2212,18 @@ public static GetDelegate GetGetMethod(FieldInfo fieldInfo) public static GetDelegate GetGetMethodByReflection(PropertyInfo propertyInfo) { MethodInfo methodInfo = GetGetterMethodInfo(propertyInfo); - return delegate(object source) { return methodInfo.Invoke(source, EmptyObjects); }; + return delegate(object source) + { + return methodInfo.Invoke(source, EmptyObjects); + }; } public static GetDelegate GetGetMethodByReflection(FieldInfo fieldInfo) { - return delegate(object source) { return fieldInfo.GetValue(source); }; + return delegate(object source) + { + return fieldInfo.GetValue(source); + }; } #if !SIMPLE_JSON_NO_LINQ_EXPRESSION @@ -1905,19 +2232,40 @@ public static GetDelegate GetGetMethodByExpression(PropertyInfo propertyInfo) { MethodInfo getMethodInfo = GetGetterMethodInfo(propertyInfo); ParameterExpression instance = Expression.Parameter(typeof(object), "instance"); - UnaryExpression instanceCast = (!IsValueType(propertyInfo.DeclaringType)) ? Expression.TypeAs(instance, propertyInfo.DeclaringType) : Expression.Convert(instance, propertyInfo.DeclaringType); - Func compiled = Expression.Lambda>(Expression.TypeAs(Expression.Call(instanceCast, getMethodInfo), typeof(object)), instance).Compile(); - return delegate(object source) { return compiled(source); }; + UnaryExpression instanceCast = + (!IsValueType(propertyInfo.DeclaringType)) + ? Expression.TypeAs(instance, propertyInfo.DeclaringType) + : Expression.Convert(instance, propertyInfo.DeclaringType); + Func compiled = Expression + .Lambda>( + Expression.TypeAs( + Expression.Call(instanceCast, getMethodInfo), + typeof(object) + ), + instance + ) + .Compile(); + return delegate(object source) + { + return compiled(source); + }; } public static GetDelegate GetGetMethodByExpression(FieldInfo fieldInfo) { ParameterExpression instance = Expression.Parameter(typeof(object), "instance"); - MemberExpression member = Expression.Field(Expression.Convert(instance, fieldInfo.DeclaringType), fieldInfo); - GetDelegate compiled = Expression.Lambda(Expression.Convert(member, typeof(object)), instance).Compile(); - return delegate(object source) { return compiled(source); }; + MemberExpression member = Expression.Field( + Expression.Convert(instance, fieldInfo.DeclaringType), + fieldInfo + ); + GetDelegate compiled = Expression + .Lambda(Expression.Convert(member, typeof(object)), instance) + .Compile(); + return delegate(object source) + { + return compiled(source); + }; } - #endif public static SetDelegate GetSetMethod(PropertyInfo propertyInfo) @@ -1941,12 +2289,18 @@ public static SetDelegate GetSetMethod(FieldInfo fieldInfo) public static SetDelegate GetSetMethodByReflection(PropertyInfo propertyInfo) { MethodInfo methodInfo = GetSetterMethodInfo(propertyInfo); - return delegate(object source, object value) { methodInfo.Invoke(source, new object[] { value }); }; + return delegate(object source, object value) + { + methodInfo.Invoke(source, new object[] { value }); + }; } public static SetDelegate GetSetMethodByReflection(FieldInfo fieldInfo) { - return delegate(object source, object value) { fieldInfo.SetValue(source, value); }; + return delegate(object source, object value) + { + fieldInfo.SetValue(source, value); + }; } #if !SIMPLE_JSON_NO_LINQ_EXPRESSION @@ -1956,19 +2310,47 @@ public static SetDelegate GetSetMethodByExpression(PropertyInfo propertyInfo) MethodInfo setMethodInfo = GetSetterMethodInfo(propertyInfo); ParameterExpression instance = Expression.Parameter(typeof(object), "instance"); ParameterExpression value = Expression.Parameter(typeof(object), "value"); - UnaryExpression instanceCast = (!IsValueType(propertyInfo.DeclaringType)) ? Expression.TypeAs(instance, propertyInfo.DeclaringType) : Expression.Convert(instance, propertyInfo.DeclaringType); - UnaryExpression valueCast = (!IsValueType(propertyInfo.PropertyType)) ? Expression.TypeAs(value, propertyInfo.PropertyType) : Expression.Convert(value, propertyInfo.PropertyType); - Action compiled = Expression.Lambda>(Expression.Call(instanceCast, setMethodInfo, valueCast), new ParameterExpression[] { instance, value }).Compile(); - return delegate(object source, object val) { compiled(source, val); }; + UnaryExpression instanceCast = + (!IsValueType(propertyInfo.DeclaringType)) + ? Expression.TypeAs(instance, propertyInfo.DeclaringType) + : Expression.Convert(instance, propertyInfo.DeclaringType); + UnaryExpression valueCast = + (!IsValueType(propertyInfo.PropertyType)) + ? Expression.TypeAs(value, propertyInfo.PropertyType) + : Expression.Convert(value, propertyInfo.PropertyType); + Action compiled = Expression + .Lambda>( + Expression.Call(instanceCast, setMethodInfo, valueCast), + new ParameterExpression[] { instance, value } + ) + .Compile(); + return delegate(object source, object val) + { + compiled(source, val); + }; } public static SetDelegate GetSetMethodByExpression(FieldInfo fieldInfo) { ParameterExpression instance = Expression.Parameter(typeof(object), "instance"); ParameterExpression value = Expression.Parameter(typeof(object), "value"); - Action compiled = Expression.Lambda>( - Assign(Expression.Field(Expression.Convert(instance, fieldInfo.DeclaringType), fieldInfo), Expression.Convert(value, fieldInfo.FieldType)), instance, value).Compile(); - return delegate(object source, object val) { compiled(source, val); }; + Action compiled = Expression + .Lambda>( + Assign( + Expression.Field( + Expression.Convert(instance, fieldInfo.DeclaringType), + fieldInfo + ), + Expression.Convert(value, fieldInfo.FieldType) + ), + instance, + value + ) + .Compile(); + return delegate(object source, object val) + { + compiled(source, val); + }; } public static BinaryExpression Assign(Expression left, Expression right) @@ -1976,7 +2358,9 @@ public static BinaryExpression Assign(Expression left, Expression right) #if SIMPLE_JSON_TYPEINFO return Expression.Assign(left, right); #else - MethodInfo assign = typeof(Assigner<>).MakeGenericType(left.Type).GetMethod("Assign"); + MethodInfo assign = typeof(Assigner<>) + .MakeGenericType(left.Type) + .GetMethod("Assign"); BinaryExpression assignExpr = Expression.Add(left, right, assign); return assignExpr; #endif @@ -1989,7 +2373,6 @@ public static T Assign(ref T left, T right) return (left = right); } } - #endif public sealed class ThreadSafeDictionary : IDictionary @@ -1998,7 +2381,9 @@ public sealed class ThreadSafeDictionary : IDictionary _valueFactory; private Dictionary _dictionary; - public ThreadSafeDictionary(ThreadSafeDictionaryValueFactory valueFactory) + public ThreadSafeDictionary( + ThreadSafeDictionaryValueFactory valueFactory + ) { _valueFactory = valueFactory; } @@ -2028,7 +2413,9 @@ private TValue AddValue(TKey key) TValue val; if (_dictionary.TryGetValue(key, out val)) return val; - Dictionary dict = new Dictionary(_dictionary); + Dictionary dict = new Dictionary( + _dictionary + ); dict[key] = value; _dictionary = dict; } @@ -2118,7 +2505,6 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() return _dictionary.GetEnumerator(); } } - } } } diff --git a/Geo/SpatialEqualityOptions.cs b/Geo/SpatialEqualityOptions.cs index 2f014ed..31b331d 100644 --- a/Geo/SpatialEqualityOptions.cs +++ b/Geo/SpatialEqualityOptions.cs @@ -22,7 +22,7 @@ private SpatialEqualityOptions Transform(bool elevation) AntiMeridianCoordinatesAreEqual = AntiMeridianCoordinatesAreEqual, PoleCoordiantesAreEqual = PoleCoordiantesAreEqual, UseElevation = elevation, - UseM = false + UseM = false, }; } @@ -35,4 +35,4 @@ public SpatialEqualityOptions To3D() { return Transform(true); } -} \ No newline at end of file +}