Skip to content

Commit

Permalink
Dependency update
Browse files Browse the repository at this point in the history
  • Loading branch information
trasch committed Jul 2, 2024
1 parent dd74507 commit 185c831
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
11 changes: 6 additions & 5 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -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"
}
},
{
Expand All @@ -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"
}
},
{
Expand All @@ -46,5 +47,5 @@
}
}
],
"version" : 2
"version" : 3
}
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
16 changes: 16 additions & 0 deletions Tests/MVTToolsTests/GeoJsonTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}

0 comments on commit 185c831

Please sign in to comment.