From 99c2359dd652e2fd7da0c51de93adb9f75a795d7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 May 2025 16:12:16 +0000 Subject: [PATCH 1/6] Initial plan for issue From 6e6faca7acad7f83fe4c64e00e19e98d3dbea37c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 May 2025 16:16:16 +0000 Subject: [PATCH 2/6] Add GitHub Actions CI workflow file Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com> --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8de14cb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + pull_request: + branches: [ develop ] + push: + branches: [ develop ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.0.x' + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore + + - name: Test + run: dotnet test --no-build --filter "Category!=Osm.Integration" --verbosity normal \ No newline at end of file From 51b9decbf6a499088904d089211e038995c68a4a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 May 2025 16:19:11 +0000 Subject: [PATCH 3/6] Update README with CI badge and branch protection instructions Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com> --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f177d8..39fcc64 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ SpatialLITE is a lightweight .NET library for spatial data processing. -![Build Status](https://kabrt.visualstudio.com/_apis/public/build/definitions/a0c2814c-9acd-4035-824a-a2548f8a8c1b/10/badge) +![CI](https://github.com/lukaskabrt/SpatialLITE/workflows/CI/badge.svg?branch=develop) ## Features @@ -65,7 +65,23 @@ Add-on for the SpatialLite library that adds support for OpenStreetMap data form * Do you have a question? ... [ask on StackOverflow](https://stackoverflow.com/questions/ask?tags=spatiallite) * Do you want to contribute piece of code? ... [submit a pull-request](https://github.com/lukaskabrt/spatiallite-net/pulls) * `master` branch contains the code being worked on + * `develop` branch requires passing CI checks before merging PRs +## Development + +### CI Pipeline + +The repository uses GitHub Actions for continuous integration. The CI pipeline automatically builds all projects and runs tests for pull requests to the `develop` branch. + +### Branch Protection Setup + +To enforce CI requirements before merging PRs: + +1. Go to repository Settings > Branches +2. Add a branch protection rule for the `develop` branch +3. Enable "Require status checks to pass before merging" +4. Select the "CI" status check +5. Optionally enable other protections as needed ## License [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details \ No newline at end of file From 21feb58c6249d752ee8767a7f521586833ed132e Mon Sep 17 00:00:00 2001 From: Lukas Kabrt Date: Thu, 22 May 2025 20:54:52 +0200 Subject: [PATCH 4/6] Disable platform dependant integration tests --- .../Integration/Pbf/OsmosisIntegrationTests.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Tests.SpatialLite.Osm/Integration/Pbf/OsmosisIntegrationTests.cs b/src/Tests.SpatialLite.Osm/Integration/Pbf/OsmosisIntegrationTests.cs index bf19a02..10507b1 100644 --- a/src/Tests.SpatialLite.Osm/Integration/Pbf/OsmosisIntegrationTests.cs +++ b/src/Tests.SpatialLite.Osm/Integration/Pbf/OsmosisIntegrationTests.cs @@ -14,7 +14,7 @@ public class OsmosisIntegrationTests { private const int TestFileWaysCount = 14461; private const int TestFileRelationsCount = 124; - [Fact, Trait("Category", "Osm.Integration")] + [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] public void PbfReaderReadsFilesCreatedByOsmosis_NoDenseNoCompression() { string pbfFile = PathHelper.GetTempFilePath("pbfreader-osmosis-compatibility-test-osmosis-real-file.pbf"); @@ -26,7 +26,7 @@ public void PbfReaderReadsFilesCreatedByOsmosis_NoDenseNoCompression() { } } - [Fact, Trait("Category", "Osm.Integration")] + [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] public void PbfReaderReadsFilesCreatedByOsmosis_DenseNoCompression() { var pbfFile = PathHelper.GetTempFilePath("pbfreader-osmosis-compatibility-test-osmosis-real-file-d.pbf"); @@ -38,7 +38,7 @@ public void PbfReaderReadsFilesCreatedByOsmosis_DenseNoCompression() { } } - [Fact, Trait("Category", "Osm.Integration")] + [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] public void PbfReaderReadsFilesCreatedByOsmosis_NoDenseDeflateCompression() { string pbfFile = PathHelper.GetTempFilePath("pbfreader-osmosis-compatibility-test-osmosis-real-file-c.pbf"); @@ -50,7 +50,7 @@ public void PbfReaderReadsFilesCreatedByOsmosis_NoDenseDeflateCompression() { } } - [Fact, Trait("Category", "Osm.Integration")] + [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] public void PbfReaderReadsFilesCreatedByOsmosis_DenseDeflate() { string pbfFile = PathHelper.GetTempFilePath("pbfreader-osmosis-compatibility-test-osmosis-real-file-dc.pbf"); @@ -62,7 +62,7 @@ public void PbfReaderReadsFilesCreatedByOsmosis_DenseDeflate() { } } - [Fact, Trait("Category", "Osm.Integration")] + [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] public void PbfWriterWritesFilesCompatibleWithOsmosis_NoDenseNoCompression() { string pbfFile = PathHelper.GetTempFilePath("pbfwriter-osmosis-compatibility-test-pbfwriter-real-file.pbf"); @@ -80,7 +80,7 @@ public void PbfWriterWritesFilesCompatibleWithOsmosis_NoDenseNoCompression() { Assert.True(new FileInfo(osmosisXmlFile).Length > 0); } - [Fact, Trait("Category", "Osm.Integration")] + [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] public void PbfWriterWritesFilesCompatibleWithOsmosis_NoDenseDeflate() { string pbfFile = PathHelper.GetTempFilePath("pbfwriter-osmosis-compatibility-test-pbfwriter-real-file-c.pbf"); @@ -98,7 +98,7 @@ public void PbfWriterWritesFilesCompatibleWithOsmosis_NoDenseDeflate() { Assert.True(new FileInfo(osmosisXmlFile).Length > 0); } - [Fact, Trait("Category", "Osm.Integration")] + [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] public void PbfWriterWritesFilesCompatibleWithOsmosis_DenseNoCompression() { string pbfFile = PathHelper.GetTempFilePath("pbfwriter-osmosis-compatibility-test-pbfwriter-real-file-d.pbf"); @@ -116,7 +116,7 @@ public void PbfWriterWritesFilesCompatibleWithOsmosis_DenseNoCompression() { Assert.True(new FileInfo(osmosisXmlFile).Length > 0); } - [Fact, Trait("Category", "Osm.Integration")] + [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] public void PbfWriterWritesFilesCompatibleWithOsmosis_DenseDeflate() { string pbfFile = PathHelper.GetTempFilePath("pbfwriter-osmosis-compatibility-test-pbfwriter-real-file-dc.pbf"); From 49388ac33040ed4544fe51104106d96fc37bd821 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 May 2025 19:25:01 +0000 Subject: [PATCH 5/6] Fixed code review issues and fixed failing tests Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- README.md | 14 ++------- .../Algorithms/Euclidean2DCalculator.cs | 22 +++++++------- .../MeasurementsTests.cs | 25 +++++++++++----- .../IO/PbfReaderTests.cs | 30 +++++++++---------- .../Pbf/OsmosisIntegrationTests.cs | 16 +++++----- .../Xml/OsmosisIntegrationTests.cs | 4 +-- 7 files changed, 56 insertions(+), 57 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8de14cb..6dd9634 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,4 +25,4 @@ jobs: run: dotnet build --no-restore - name: Test - run: dotnet test --no-build --filter "Category!=Osm.Integration" --verbosity normal \ No newline at end of file + run: dotnet test --no-build --verbosity normal \ No newline at end of file diff --git a/README.md b/README.md index 39fcc64..e492273 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ Add-on for the SpatialLite library that adds support for OpenStreetMap data form * Have you find a bug? Do you have an idea for a new feature? ... [open an issue on GitHub](https://github.com/lukaskabrt/spatiallite-net/issues) * Do you have a question? ... [ask on StackOverflow](https://stackoverflow.com/questions/ask?tags=spatiallite) * Do you want to contribute piece of code? ... [submit a pull-request](https://github.com/lukaskabrt/spatiallite-net/pulls) - * `master` branch contains the code being worked on - * `develop` branch requires passing CI checks before merging PRs + * `master` branch contains released code + * `develop` branch contains code being worked on ## Development @@ -73,15 +73,5 @@ Add-on for the SpatialLite library that adds support for OpenStreetMap data form The repository uses GitHub Actions for continuous integration. The CI pipeline automatically builds all projects and runs tests for pull requests to the `develop` branch. -### Branch Protection Setup - -To enforce CI requirements before merging PRs: - -1. Go to repository Settings > Branches -2. Add a branch protection rule for the `develop` branch -3. Enable "Require status checks to pass before merging" -4. Select the "CI" status check -5. Optionally enable other protections as needed - ## License [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details \ No newline at end of file diff --git a/src/SpatialLite.Core/Algorithms/Euclidean2DCalculator.cs b/src/SpatialLite.Core/Algorithms/Euclidean2DCalculator.cs index 0545ddc..00becc1 100644 --- a/src/SpatialLite.Core/Algorithms/Euclidean2DCalculator.cs +++ b/src/SpatialLite.Core/Algorithms/Euclidean2DCalculator.cs @@ -101,17 +101,17 @@ public double CalculateArea(ICoordinateList vertices) { throw new ArgumentException("List must contain at least 3 vertices.", "vertices"); } - double area = 0; - int maxIndex = vertices.Count - 1; - if (vertices[0] != vertices[maxIndex]) { - maxIndex++; - } - - for (int i = 0; i < maxIndex; i++) { - area += (vertices[(i + 1) % vertices.Count].X + vertices[i % vertices.Count].X) * (vertices[(i + 1) % vertices.Count].Y - vertices[i % vertices.Count].Y); - } - - return area / 2.0; + double area = 0; + int maxIndex = vertices.Count - 1; + if (vertices[0] != vertices[maxIndex]) { + maxIndex++; + } + + for (int i = 0; i < maxIndex; i++) { + area += (vertices[(i + 1) % vertices.Count].X + vertices[i % vertices.Count].X) * (vertices[(i + 1) % vertices.Count].Y - vertices[i % vertices.Count].Y); + } + + return Math.Abs(area / 2.0); } } diff --git a/src/Tests.SpatialLite.Core/MeasurementsTests.cs b/src/Tests.SpatialLite.Core/MeasurementsTests.cs index 014cd32..424dd01 100644 --- a/src/Tests.SpatialLite.Core/MeasurementsTests.cs +++ b/src/Tests.SpatialLite.Core/MeasurementsTests.cs @@ -225,23 +225,32 @@ public void ComputeArea_IPolygon_ReturnsAreaOfSimplePolygonCalculatedByIDimensio [Fact] public void ComputeArea_IPolygon_ReturnsAreaOfPolygonWithoutHolesCalculatedByIDimensionsCalculator() { - Random generator = new Random(); - + // Create polygon with interior ring Polygon polygon = new Polygon(new CoordinateList()); polygon.InteriorRings.Add(new CoordinateList()); - double exteriorArea = generator.Next(100) + 10; - double interiorArea = generator.Next(10); + // Fixed test values + double exteriorArea = 50; + double interiorArea = 10; + double expectedArea = exteriorArea - interiorArea; + // Setup mock Mock calculatorM = new Mock(); - calculatorM.Setup(calc => calc.CalculateArea(polygon.ExteriorRing)).Returns(exteriorArea); - calculatorM.Setup(calc => calc.CalculateArea(polygon.InteriorRings[0])).Returns(interiorArea); - + calculatorM.Setup(calc => calc.CalculateArea(It.IsAny())) + .Returns(coords => { + if (coords == polygon.ExteriorRing) return exteriorArea; + if (coords == polygon.InteriorRings[0]) return interiorArea; + return 0; + }); + + // Create the object being tested Measurements target = new Measurements(calculatorM.Object); + // Execute the method being tested double area = target.ComputeArea(polygon); - Assert.Equal(exteriorArea - interiorArea, area); + // Verify the result + Assert.Equal(expectedArea, area); } [Fact] diff --git a/src/Tests.SpatialLite.Osm/IO/PbfReaderTests.cs b/src/Tests.SpatialLite.Osm/IO/PbfReaderTests.cs index 3319813..5128540 100644 --- a/src/Tests.SpatialLite.Osm/IO/PbfReaderTests.cs +++ b/src/Tests.SpatialLite.Osm/IO/PbfReaderTests.cs @@ -77,19 +77,19 @@ public void Constructor_StringSettings_ThrowsExceptionIfFileDoesnotExist() { [Fact] public void Constructor_StringSettings_ThrowsExceptionIfFileDoesntContainOSMHeaderBeforeOSMData() { - string filename = "..\\..\\..\\Data\\Pbf\\pbf-without-osm-header.pbf"; + string filename = Path.Combine("..", "..", "..", "Data", "Pbf", "pbf-without-osm-header.pbf"); Assert.Throws(() => new PbfReader(filename, new OsmReaderSettings() { ReadMetadata = false })); } [Fact] public void Constructor_StringSettings_ThrowsExceptionIfOSMHeaderDefinedUnsupportedRequiredFeature() { - string filename = "..\\..\\..\\Data\\Pbf\\pbf-unsupported-required-feature.pbf"; + string filename = Path.Combine("..", "..", "..", "Data", "Pbf", "pbf-unsupported-required-feature.pbf"); Assert.Throws(() => new PbfReader(filename, new OsmReaderSettings() { ReadMetadata = false })); } [Fact] public void Constructor_StringSettings_SetsSettingsAndMakesThemIsReadOnly() { - string filename = "..\\..\\..\\Data\\Pbf\\pbf-n-node.pbf"; + string filename = Path.Combine("..", "..", "..", "Data", "Pbf", "pbf-n-node.pbf"); OsmReaderSettings settings = new OsmReaderSettings(); using (PbfReader target = new PbfReader(filename, settings)) { @@ -271,18 +271,18 @@ public void Read_SkipsRelationMetadataIfProcessMetadataIsFalse_NoCompresion() { Assert.Null(readRelation.Metadata); } - [Fact] - public void Dispose_ClosesOutputStreamIfWritingToFiles() { - string filename = "..\\..\\..\\Data\\Pbf\\pbf-n-node.pbf"; - OsmReaderSettings settings = new OsmReaderSettings() { ReadMetadata = true }; - - var aaa = Path.GetFullPath(filename); - PbfReader target = new PbfReader(filename, settings); - target.Dispose(); - - FileStream testStream = null; - testStream = new FileStream(filename, FileMode.Open, FileAccess.ReadWrite); - testStream.Dispose(); + [Fact] + public void Dispose_ClosesOutputStreamIfWritingToFiles() { + string filename = Path.Combine("..", "..", "..", "Data", "Pbf", "pbf-n-node.pbf"); + OsmReaderSettings settings = new OsmReaderSettings() { ReadMetadata = true }; + + var aaa = Path.GetFullPath(filename); + PbfReader target = new PbfReader(filename, settings); + target.Dispose(); + + FileStream testStream = null; + testStream = new FileStream(filename, FileMode.Open, FileAccess.ReadWrite); + testStream.Dispose(); } [Fact] diff --git a/src/Tests.SpatialLite.Osm/Integration/Pbf/OsmosisIntegrationTests.cs b/src/Tests.SpatialLite.Osm/Integration/Pbf/OsmosisIntegrationTests.cs index 10507b1..8e3fcd4 100644 --- a/src/Tests.SpatialLite.Osm/Integration/Pbf/OsmosisIntegrationTests.cs +++ b/src/Tests.SpatialLite.Osm/Integration/Pbf/OsmosisIntegrationTests.cs @@ -14,7 +14,7 @@ public class OsmosisIntegrationTests { private const int TestFileWaysCount = 14461; private const int TestFileRelationsCount = 124; - [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] + [Fact(Skip = "Test requires Windows-specific osmosis.bat file which is not available in Linux CI environment"), Trait("Category", "Osm.Integration")] public void PbfReaderReadsFilesCreatedByOsmosis_NoDenseNoCompression() { string pbfFile = PathHelper.GetTempFilePath("pbfreader-osmosis-compatibility-test-osmosis-real-file.pbf"); @@ -26,7 +26,7 @@ public void PbfReaderReadsFilesCreatedByOsmosis_NoDenseNoCompression() { } } - [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] + [Fact(Skip = "Test requires Windows-specific osmosis.bat file which is not available in Linux CI environment"), Trait("Category", "Osm.Integration")] public void PbfReaderReadsFilesCreatedByOsmosis_DenseNoCompression() { var pbfFile = PathHelper.GetTempFilePath("pbfreader-osmosis-compatibility-test-osmosis-real-file-d.pbf"); @@ -38,7 +38,7 @@ public void PbfReaderReadsFilesCreatedByOsmosis_DenseNoCompression() { } } - [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] + [Fact(Skip = "Test requires Windows-specific osmosis.bat file which is not available in Linux CI environment"), Trait("Category", "Osm.Integration")] public void PbfReaderReadsFilesCreatedByOsmosis_NoDenseDeflateCompression() { string pbfFile = PathHelper.GetTempFilePath("pbfreader-osmosis-compatibility-test-osmosis-real-file-c.pbf"); @@ -50,7 +50,7 @@ public void PbfReaderReadsFilesCreatedByOsmosis_NoDenseDeflateCompression() { } } - [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] + [Fact(Skip = "Test requires Windows-specific osmosis.bat file which is not available in Linux CI environment"), Trait("Category", "Osm.Integration")] public void PbfReaderReadsFilesCreatedByOsmosis_DenseDeflate() { string pbfFile = PathHelper.GetTempFilePath("pbfreader-osmosis-compatibility-test-osmosis-real-file-dc.pbf"); @@ -62,7 +62,7 @@ public void PbfReaderReadsFilesCreatedByOsmosis_DenseDeflate() { } } - [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] + [Fact(Skip = "Test requires Windows-specific osmosis.bat file which is not available in Linux CI environment"), Trait("Category", "Osm.Integration")] public void PbfWriterWritesFilesCompatibleWithOsmosis_NoDenseNoCompression() { string pbfFile = PathHelper.GetTempFilePath("pbfwriter-osmosis-compatibility-test-pbfwriter-real-file.pbf"); @@ -80,7 +80,7 @@ public void PbfWriterWritesFilesCompatibleWithOsmosis_NoDenseNoCompression() { Assert.True(new FileInfo(osmosisXmlFile).Length > 0); } - [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] + [Fact(Skip = "Test requires Windows-specific osmosis.bat file which is not available in Linux CI environment"), Trait("Category", "Osm.Integration")] public void PbfWriterWritesFilesCompatibleWithOsmosis_NoDenseDeflate() { string pbfFile = PathHelper.GetTempFilePath("pbfwriter-osmosis-compatibility-test-pbfwriter-real-file-c.pbf"); @@ -98,7 +98,7 @@ public void PbfWriterWritesFilesCompatibleWithOsmosis_NoDenseDeflate() { Assert.True(new FileInfo(osmosisXmlFile).Length > 0); } - [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] + [Fact(Skip = "Test requires Windows-specific osmosis.bat file which is not available in Linux CI environment"), Trait("Category", "Osm.Integration")] public void PbfWriterWritesFilesCompatibleWithOsmosis_DenseNoCompression() { string pbfFile = PathHelper.GetTempFilePath("pbfwriter-osmosis-compatibility-test-pbfwriter-real-file-d.pbf"); @@ -116,7 +116,7 @@ public void PbfWriterWritesFilesCompatibleWithOsmosis_DenseNoCompression() { Assert.True(new FileInfo(osmosisXmlFile).Length > 0); } - [Fact(Skip = "Not platform independent"), Trait("Category", "Osm.Integration")] + [Fact(Skip = "Test requires Windows-specific osmosis.bat file which is not available in Linux CI environment"), Trait("Category", "Osm.Integration")] public void PbfWriterWritesFilesCompatibleWithOsmosis_DenseDeflate() { string pbfFile = PathHelper.GetTempFilePath("pbfwriter-osmosis-compatibility-test-pbfwriter-real-file-dc.pbf"); diff --git a/src/Tests.SpatialLite.Osm/Integration/Xml/OsmosisIntegrationTests.cs b/src/Tests.SpatialLite.Osm/Integration/Xml/OsmosisIntegrationTests.cs index f0096a7..f7329ea 100644 --- a/src/Tests.SpatialLite.Osm/Integration/Xml/OsmosisIntegrationTests.cs +++ b/src/Tests.SpatialLite.Osm/Integration/Xml/OsmosisIntegrationTests.cs @@ -15,7 +15,7 @@ public class OsmosisIntegrationTests { private const int TestFileRelationsCount = 124; - [Fact, Trait("Category", "Osm.Integration")] + [Fact(Skip = "Test requires Windows-specific osmosis.bat file which is not available in Linux CI environment"), Trait("Category", "Osm.Integration")] public void XmlOsmReaderReadsFilesCreatedByOsmosis() { string xmlFile = PathHelper.GetTempFilePath("xmlreader-osmosis-compatibility-test-osmosis-real-file.osm"); string osmosisArguments = string.Format("--read-pbf file={0} --write-xml file={1}", PathHelper.RealPbfFilePath, xmlFile); @@ -26,7 +26,7 @@ public void XmlOsmReaderReadsFilesCreatedByOsmosis() { } } - [Fact, Trait("Category", "Osm.Integration")] + [Fact(Skip = "Test requires Windows-specific osmosis.bat file which is not available in Linux CI environment"), Trait("Category", "Osm.Integration")] public void XmlOsmWriterWritesFilesCompatibleWithOsmosis() { string xmlFile = PathHelper.GetTempFilePath("xmlwriter-osmosis-compatibility-test-xmlwriter-real-file.osm"); using (OsmXmlWriter writer = new OsmXmlWriter(xmlFile, new OsmWriterSettings() { WriteMetadata = true })) { From 5308101a55b088efc4f15d10e2b9bea344cd87d7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 May 2025 19:40:58 +0000 Subject: [PATCH 6/6] Remove Math.Abs from polygon area calculation Co-authored-by: lukaskabrt <2894161+lukaskabrt@users.noreply.github.com> --- src/SpatialLite.Core/Algorithms/Euclidean2DCalculator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SpatialLite.Core/Algorithms/Euclidean2DCalculator.cs b/src/SpatialLite.Core/Algorithms/Euclidean2DCalculator.cs index 00becc1..f725292 100644 --- a/src/SpatialLite.Core/Algorithms/Euclidean2DCalculator.cs +++ b/src/SpatialLite.Core/Algorithms/Euclidean2DCalculator.cs @@ -111,7 +111,7 @@ public double CalculateArea(ICoordinateList vertices) { area += (vertices[(i + 1) % vertices.Count].X + vertices[i % vertices.Count].X) * (vertices[(i + 1) % vertices.Count].Y - vertices[i % vertices.Count].Y); } - return Math.Abs(area / 2.0); + return area / 2.0; } }