Repository: GEOSwift/GEOSwift (swift)

Issue:
No access to LineStringSnapper
I'm trying to reach LineStringSnapper but it is not available. On Android it is available

Pull request:
Fixes #249

Patch:
diff --git a/.codecov.yml b/.codecov.yml
deleted file mode 100644
index 4d388907..00000000
--- a/.codecov.yml
+++ /dev/null
@@ -1,7 +0,0 @@
----
-coverage:
-  status:
-    patch: off
-ignore:
-  - "Tests"
-comment: false
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 01131538..38300285 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -117,8 +117,6 @@ jobs:
             xcode-version: "13.2.1"
           - os: macos-12
             xcode-version: "14.2"
-            flags: "--enable-code-coverage"
-            upload-coverage: true
     steps:
       - uses: actions/checkout@v3
       - name: Select Xcode Version
@@ -126,15 +124,3 @@ jobs:
         run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer
       - name: Build & Test
         run: swift test ${{ matrix.flags }}
-      - name: Convert coverage to lcov
-        if: matrix.upload-coverage
-        run: |
-          xcrun llvm-cov export \
-            -format="lcov" \
-            -instr-profile "$(swift build --show-bin-path)/codecov/default.profdata" \
-            "$(swift build --show-bin-path)/GEOSwiftPackageTests.xctest/Contents/MacOS/GEOSwiftPackageTests" \
-            Sources/**/*.swift > GEOSwift.lcov
-      - uses: codecov/codecov-action@v3
-        if: matrix.upload-coverage
-        with:
-          fail_ci_if_error: true
diff --git a/README.md b/README.md
index 7194b3cd..ba3cc1b9 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,6 @@
 [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/GEOSwift.svg)](https://cocoapods.org/pods/GEOSwift)
 [![Supported Platforms](https://img.shields.io/cocoapods/p/GEOSwift.svg?style=flat)](https://github.com/GEOSwift/GEOSwift)
 [![Build Status](https://github.com/GEOSwift/GEOSwift/actions/workflows/main.yml/badge.svg)](https://github.com/GEOSwift/GEOSwift/actions/workflows/main.yml)
-[![Code Coverage](https://img.shields.io/codecov/c/github/GEOSwift/GEOSwift/main)](https://codecov.io/gh/GEOSwift/GEOSwift)
 
 Easily handle a geometric object model (points, linestrings, polygons etc.) and
 related topological operations (intersections, overlapping etc.). A type-safe,
diff --git a/Sources/GEOSwift/GEOS/GeometryConvertible+GEOS.swift b/Sources/GEOSwift/GEOS/GeometryConvertible+GEOS.swift
index 988f08e6..c01da819 100644
--- a/Sources/GEOSwift/GEOS/GeometryConvertible+GEOS.swift
+++ b/Sources/GEOSwift/GEOS/GeometryConvertible+GEOS.swift
@@ -390,6 +390,18 @@ public extension GeometryConvertible {
         }
         return try Geometry(geosObject: GEOSObject(context: context, pointer: resultPointer))
     }
+
+    // MARK: - Snapping
+
+    func snap(to geometry: GeometryConvertible, tolerance: Double) throws -> Geometry {
+        let context = try GEOSContext()
+        let geosObject = try self.geometry.geosObject(with: context)
+        let otherGeosObject = try geometry.geometry.geosObject(with: context)
+        guard let pointer = GEOSSnap_r(context.handle, geosObject.pointer, otherGeosObject.pointer, tolerance) else {
+            throw GEOSError.libraryError(errorMessages: context.errors)
+        }
+        return try Geometry(geosObject: GEOSObject(context: context, pointer: pointer))
+    }
 }
 
 public extension Collection where Element: GeometryConvertible {


Test patch:
diff --git a/Tests/GEOSwiftTests/GEOS/GeometryConvertible+GEOSTests.swift b/Tests/GEOSwiftTests/GEOS/GeometryConvertible+GEOSTests.swift
index f76e5e1f..12d3380c 100644
--- a/Tests/GEOSwiftTests/GEOS/GeometryConvertible+GEOSTests.swift
+++ b/Tests/GEOSwiftTests/GEOS/GeometryConvertible+GEOSTests.swift
@@ -958,4 +958,16 @@ final class GeometryConvertible_GEOSTests: XCTestCase {
             }
         }
     }
+
+    // MARK: - Snapping
+
+    func testSnapAllPairs() {
+        for (g1, g2) in geometryConvertibles.allPairs {
+            do {
+                _ = try g1.snap(to: g2, tolerance: 1)
+            } catch {
+                XCTFail("Unexpected error for \(g1) snap(to: \(g2), tolerance: 1) \(error)")
+            }
+        }
+    }
 }