diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/swift-geo-Package.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/swift-geo-Package.xcscheme index 2629d5f..e796e9a 100644 --- a/.swiftpm/xcode/xcshareddata/xcschemes/swift-geo-Package.xcscheme +++ b/.swiftpm/xcode/xcshareddata/xcschemes/swift-geo-Package.xcscheme @@ -202,6 +202,20 @@ ReferencedContainer = "container:"> </BuildableReference> </BuildActionEntry> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "GeoJSON" + BuildableName = "GeoJSON" + BlueprintName = "GeoJSON" + ReferencedContainer = "container:"> + </BuildableReference> + </BuildActionEntry> </BuildActionEntries> </BuildAction> <TestAction @@ -310,6 +324,16 @@ ReferencedContainer = "container:"> </BuildableReference> </TestableReference> + <TestableReference + skipped = "NO"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "GeoJSONTests" + BuildableName = "GeoJSONTests" + BlueprintName = "GeoJSONTests" + ReferencedContainer = "container:"> + </BuildableReference> + </TestableReference> </Testables> </TestAction> <LaunchAction diff --git a/Package.swift b/Package.swift index 1c0b258..195615d 100644 --- a/Package.swift +++ b/Package.swift @@ -17,6 +17,7 @@ let package = Package( .library(name: "WGS84", targets: ["WGS84"]), .library(name: "GeodeticGeometry", targets: ["GeodeticGeometry"]), .library(name: "Turf", targets: ["Turf"]), + .library(name: "GeoJSON", targets: ["GeoJSON"]), ], dependencies: [ .package(url: "https://github.com/apple/swift-algorithms", .upToNextMajor(from: "1.0.0")), @@ -142,8 +143,8 @@ let package = Package( .target( name: "GeoJSON", dependencies: [ - .target(name: "GeoModels"), - .target(name: "Turf"), + .target(name: "GeodeticGeometry"), + .target(name: "WGS84Turf"), .product(name: "NonEmpty", package: "swift-nonempty"), ] ), diff --git a/Sources/Turf/Boundable.swift b/Sources/Turf/Boundable.swift deleted file mode 100644 index 1e8343d..0000000 --- a/Sources/Turf/Boundable.swift +++ /dev/null @@ -1,98 +0,0 @@ -// -// Boundable.swift -// SwiftGeo -// -// Created by Rémi Bardon on 04/02/2022. -// Copyright © 2022 Rémi Bardon. All rights reserved. -// - -import GeoModels - -public protocol Boundable { - - associatedtype BoundingBox: GeoModels.BoundingBox - - var _bbox: BoundingBox { get } - -} - -extension Boundable { - - public var bbox: BoundingBox { _bbox } - -} - -extension Boundable where Self: Hashable { - - public var bbox: BoundingBox { BoundingBoxCache.shared.bbox(for: self) } - -} - -extension Coordinate2D { - - public var _bbox: BoundingBox2D { - BoundingBox2D(southWest: self, width: .zero, height: .zero) - } - -} - -extension Coordinate3D: Boundable { - - public var _bbox: BoundingBox3D { - BoundingBox3D(southWestLow: self, width: .zero, height: .zero, zHeight: .zero) - } - -} - -extension Line2D: Boundable { - - public var _bbox: BoundingBox2D { - Turf.bbox(for: [start, end])! - } - -} - -extension Line3D: Boundable { - - public var _bbox: BoundingBox3D { - Turf.bbox(for: [start, end])! - } - -} - -extension BoundingBox2D: Boundable { - - public var _bbox: BoundingBox2D { self } - -} - -extension BoundingBox3D: Boundable { - - public var _bbox: BoundingBox3D { self } - -} - -// Extension of protocol 'Collection' cannot have an inheritance clause -//extension Collection: Boundable where Element: Boundable { -// -// public var _bbox: Element.BoundingBox { -// self.reduce(nil, { $0.union($1.bbox) }) ?? .zero -// } -// -//} - -extension Array: Boundable where Element: Boundable { - - public var _bbox: Element.BoundingBox { - self.reduce(nil, { $0.union($1.bbox) }) ?? .zero - } - -} - -extension Set: Boundable where Element: Boundable { - - public var _bbox: Element.BoundingBox { - self.reduce(nil, { $0.union($1.bbox) }) ?? .zero - } - -}