diff --git a/Package.resolved b/Package.resolved index 9269bce..761a219 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,12 +1,13 @@ { + "originHash" : "5d734874e4d66aa5e42e2e73f545fbb1c3e33e7f08847495a19cf43690d8a3e5", "pins" : [ { "identity" : "gis-tools", "kind" : "remoteSourceControl", "location" : "https://github.com/Outdooractive/gis-tools", "state" : { - "revision" : "9566dc8642851ed319b226eedfc2bb351abedfec", - "version" : "1.6.0" + "revision" : "831a87ebd1ae3bb013c46b1d1752400dbc7bc352", + "version" : "1.7.0" } }, { @@ -32,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-log.git", "state" : { - "revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5", - "version" : "1.5.4" + "revision" : "9cb486020ebf03bfa5b5df985387a14a98744537", + "version" : "1.6.1" } }, { @@ -46,5 +47,5 @@ } } ], - "version" : 2 + "version" : 3 } diff --git a/Package.swift b/Package.swift index 57305c6..6a2ebdb 100644 --- a/Package.swift +++ b/Package.swift @@ -24,10 +24,10 @@ let package = Package( targets: ["MVTTools"]), ], dependencies: [ - .package(url: "https://github.com/Outdooractive/gis-tools", from: "1.6.0"), + .package(url: "https://github.com/Outdooractive/gis-tools", from: "1.7.0"), .package(url: "https://github.com/1024jp/GzipSwift.git", from: "5.2.0"), .package(url: "https://github.com/apple/swift-argument-parser", from: "1.4.0"), - .package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"), + .package(url: "https://github.com/apple/swift-log.git", from: "1.6.1"), .package(url: "https://github.com/apple/swift-protobuf", from: "1.26.0"), ], targets: [ diff --git a/Tests/MVTToolsTests/GeoJsonTests.swift b/Tests/MVTToolsTests/GeoJsonTests.swift index 3d15d89..483e29e 100644 --- a/Tests/MVTToolsTests/GeoJsonTests.swift +++ b/Tests/MVTToolsTests/GeoJsonTests.swift @@ -26,4 +26,20 @@ final class GeoJsonTests: XCTestCase { XCTAssertTrue(someLayersFc.features.allSatisfy({ ($0.properties["test"] as? String) == "test" })) } + func testGeoJSONWithNull() throws { + let fc = FeatureCollection(Feature(Point(Coordinate3D(latitude: 47.56, longitude: 10.22, m: 1234)))) + var tile = try XCTUnwrap(VectorTile(x: 8657, y: 5725, z: 14)) + tile.addGeoJson(geoJson: fc, layerName: "test") + + let data = try XCTUnwrap(tile.data()) + + let decodedTile = try XCTUnwrap(VectorTile(data: data, x: 8657, y: 5725, z: 14)) + let decodedFc = try XCTUnwrap(decodedTile.features(for: "test")?.first) + let decodedCoordinate = try XCTUnwrap(decodedFc.geometry.allCoordinates.first) + + // Note: The MVT format doesn't encode altitude/m values, they will get lost + XCTAssertEqual(decodedCoordinate.latitude, 47.56, accuracy: 0.00001) + XCTAssertEqual(decodedCoordinate.longitude, 10.22, accuracy: 0.00001) + } + }