diff --git a/README.md b/README.md index b692ad3..26b07aa 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ This package requires Swift 6.1 or higher (at least Xcode 15), and compiles on i ```swift dependencies: [ - .package(url: "https://github.com/Outdooractive/gis-tools", from: "1.13.6"), + .package(url: "https://github.com/Outdooractive/gis-tools", from: "2.0.0"), ], targets: [ .target(name: "MyTarget", dependencies: [ diff --git a/Tests/GISToolsTests/Algorithms/ConcaveHullTests.swift b/Tests/GISToolsTests/Algorithms/ConcaveHullTests.swift index 2c87427..8697842 100644 --- a/Tests/GISToolsTests/Algorithms/ConcaveHullTests.swift +++ b/Tests/GISToolsTests/Algorithms/ConcaveHullTests.swift @@ -4,6 +4,28 @@ import Testing struct ConcaveHullTests { + // MARK: - Reference tests + + private static let concaveFixtures: [(name: String, maxEdgeKm: Double)] = [ + ("LineWithNoise", 200.0), + ] + + @Test(arguments: concaveFixtures) + private func turfConcaveHullFixture(_ fixture: (name: String, maxEdgeKm: Double)) async throws { + let mp = try TestData.multiPoint(package: "ConcaveHull", name: fixture.name) + let maxEdge = GISTool.convertToMeters(fixture.maxEdgeKm, .kilometers) + + guard let result = mp.concaveHull(maxEdgeLength: maxEdge) else { + Issue.record("Expected non-nil concave hull for \(fixture.name)") + return + } + + #expect(result.polygons.isNotEmpty, "\(fixture.name): hull has no polygons") + for poly in result.polygons { + #expect(poly.isValid, "\(fixture.name): hull polygon is invalid") + } + } + // Validates basic concave hull of points forming a rough circle. @Test func concaveHullBasic() async throws { diff --git a/Tests/GISToolsTests/Algorithms/ConvexHullTests.swift b/Tests/GISToolsTests/Algorithms/ConvexHullTests.swift index c9c381f..ec2e766 100644 --- a/Tests/GISToolsTests/Algorithms/ConvexHullTests.swift +++ b/Tests/GISToolsTests/Algorithms/ConvexHullTests.swift @@ -4,6 +4,33 @@ import Testing struct ConvexHullTests { + // MARK: - Reference tests + + private static let hullFixtures = [ + "SquarePoints", + "RandomPoints", + "ThreePoints", + ] + + @Test(arguments: hullFixtures) + private func turfConvexHullFixture(_ name: String) async throws { + let mp = try TestData.multiPoint(package: "ConvexHull", name: name) + + guard let result = mp.convexHull() else { + Issue.record("Expected non-nil convex hull for \(name)") + return + } + + let resultArea = result.area + #expect(resultArea > 0, "\(name): hull area should be positive") + + // Load expected and compare area + let expected = try TestData.polygon(package: "ConvexHull", name: name + "Result") + let ratio = resultArea / expected.area + #expect(ratio > 0.95 && ratio < 1.05, + "\(name): area ratio \(ratio) outside [0.95, 1.05]") + } + // Validates the convex hull of a square produces 5 coordinates (4 corners + closing) and contains a center point. @Test func convexHullSquare() async throws { diff --git a/Tests/GISToolsTests/Algorithms/DifferenceTests.swift b/Tests/GISToolsTests/Algorithms/DifferenceTests.swift index 35f897f..b27ae41 100644 --- a/Tests/GISToolsTests/Algorithms/DifferenceTests.swift +++ b/Tests/GISToolsTests/Algorithms/DifferenceTests.swift @@ -4,6 +4,43 @@ import Foundation struct DifferenceTests { + // MARK: - Reference tests + + private static let overlayFixtures = [ + "DisjointSquares", + "FullyContained", + "LShapeOverlap", + ] + + private func loadOverlayPolygon(_ name: String, _ suffix: String) throws -> Polygon { + try TestData.polygon(package: "Overlay", name: name + suffix) + } + + @Test(arguments: overlayFixtures) + private func turfDiffFixture(_ name: String) async throws { + let a = try loadOverlayPolygon(name, "A") + let b = try loadOverlayPolygon(name, "B") + let expected = try TestData.multiPolygon(package: "Overlay", name: name + "DiffABResult") + + guard let result = a.difference(with: b) else { + if expected.polygons.isNotEmpty { + Issue.record("Expected non-nil difference for \(name)") + } + return + } + + let resultArea = result.polygons.reduce(0) { $0 + $1.area } + let expectedArea = expected.polygons.reduce(0) { $0 + $1.area } + if expectedArea > 0 { + let ratio = resultArea / expectedArea + #expect(ratio > 0.95 && ratio < 1.05, + "\(name): area ratio \(ratio) outside [0.95, 1.05]") + } + else { + #expect(resultArea == 0, "\(name): expected empty but got area \(resultArea)") + } + } + // Validates that subtracting an overlapping square leaves an L-shaped polygon. @Test func overlappingSquares() async throws { diff --git a/Tests/GISToolsTests/Algorithms/IntersectionTests.swift b/Tests/GISToolsTests/Algorithms/IntersectionTests.swift index cfb633b..9b1ba54 100644 --- a/Tests/GISToolsTests/Algorithms/IntersectionTests.swift +++ b/Tests/GISToolsTests/Algorithms/IntersectionTests.swift @@ -4,6 +4,44 @@ import Foundation struct IntersectionTests { + // MARK: - Reference tests + + private static let overlayFixtures = [ + "DisjointSquares", + "FullyContained", + "LShapeOverlap", + ] + + private func loadOverlayPolygon(_ name: String, _ suffix: String) throws -> Polygon { + try TestData.polygon(package: "Overlay", name: name + suffix) + } + + @Test(arguments: overlayFixtures) + private func turfIntersectFixture(_ name: String) async throws { + let a = try loadOverlayPolygon(name, "A") + let b = try loadOverlayPolygon(name, "B") + let expectedJson = try TestData.stringFromFile(package: "Overlay", name: name + "IntersectResult") + let expected = try #require(MultiPolygon(jsonString: expectedJson), "Missing expected result for \(name)") + + guard let result = a.intersection(with: b) else { + if expected.polygons.isNotEmpty { + Issue.record("Expected non-nil intersection for \(name)") + } + return + } + + let resultArea = result.polygons.reduce(0) { $0 + $1.area } + let expectedArea = expected.polygons.reduce(0) { $0 + $1.area } + if expectedArea > 0 { + let ratio = resultArea / expectedArea + #expect(ratio > 0.80 && ratio < 1.20, + "\(name): area ratio \(ratio) outside [0.80, 1.20], result=\(resultArea), expected=\(expectedArea)") + } + else { + #expect(resultArea < 1000.0, "\(name): expected empty but got area \(resultArea)") + } + } + // Validates that two overlapping squares produce the correct intersection (a smaller square). @Test func overlappingSquares() async throws { diff --git a/Tests/GISToolsTests/Algorithms/MaskTests.swift b/Tests/GISToolsTests/Algorithms/MaskTests.swift index 2fb3605..2273de7 100644 --- a/Tests/GISToolsTests/Algorithms/MaskTests.swift +++ b/Tests/GISToolsTests/Algorithms/MaskTests.swift @@ -3,6 +3,46 @@ import Testing struct MaskTests { + // MARK: - Reference tests + + private static let maskFixtures = [ + "SmallSquare", + "TwoSquares", + "LShapeMask", + ] + + @Test(arguments: maskFixtures) + private func turfMaskFixture(_ name: String) async throws { + let json = try TestData.stringFromFile(package: "Mask", name: name) + let expected = try TestData.multiPolygon(package: "Mask", name: name + "Result") + + let geoJson: PolygonGeometry + if let poly = Polygon(jsonString: json) { + geoJson = poly + } + else if let mp = MultiPolygon(jsonString: json) { + geoJson = mp + } + else { + Issue.record("Could not load mask input for \(name)") + return + } + + guard let result = geoJson.mask() else { + Issue.record("Expected non-nil mask for \(name)") + return + } + + #expect(result.isValid, "\(name): mask result is invalid") + let resultArea = result.polygons.reduce(0) { $0 + $1.area } + let expectedArea = expected.polygons.reduce(0) { $0 + $1.area } + if expectedArea > 0 { + let ratio = resultArea / expectedArea + #expect(ratio > 0.9 && ratio < 1.1, + "\(name): area ratio \(ratio) outside [0.9, 1.1]") + } + } + /// A small square masked from the world produces a polygon with a hole (outer + 1 inner ring). @Test func squareMask() throws { diff --git a/Tests/GISToolsTests/Algorithms/SimplifyTests.swift b/Tests/GISToolsTests/Algorithms/SimplifyTests.swift index 0861619..62a67fc 100644 --- a/Tests/GISToolsTests/Algorithms/SimplifyTests.swift +++ b/Tests/GISToolsTests/Algorithms/SimplifyTests.swift @@ -4,20 +4,24 @@ import Testing struct SimplifyTests { - // TODO: More tests - // https://github.com/Turfjs/turf/tree/master/packages/turf-simplify/test/in - // https://github.com/Turfjs/turf/tree/master/packages/turf-simplify/test/out - - // Validates that invalid polygons return nil when simplified. + // Validates that invalid polygons are returned unmodified when simplified. @Test func invalidPolygons() async throws { - // TODO: Improve the polygon validity check - -// let polygon1 = MultiPolygon([[[Coordinate3D(latitude: 1.0, longitude: 0.0), Coordinate3D(latitude: 2.0, longitude: 0.0), Coordinate3D(latitude: 3.0, longitude: 0.0), Coordinate3D(latitude: 2.5, longitude: 0.0), Coordinate3D(latitude: 1.0, longitude: 0.0)]]]) -// let polygon2 = MultiPolygon([[[Coordinate3D(latitude: 1.0, longitude: 0.0), Coordinate3D(latitude: 1.0, longitude: 0.0), Coordinate3D(latitude: 2.0, longitude: 1.0), Coordinate3D(latitude: 1.0, longitude: 0.0)]]]) -// -// XCTAssertNil(polygon1?.simplified()) -// XCTAssertNil(polygon2?.simplified()) + let polygon1 = MultiPolygon([[[ + Coordinate3D(latitude: 1.0, longitude: 0.0), + Coordinate3D(latitude: 2.0, longitude: 0.0), + Coordinate3D(latitude: 3.0, longitude: 0.0), + Coordinate3D(latitude: 2.5, longitude: 0.0), + Coordinate3D(latitude: 1.0, longitude: 0.0) + ]]]) + let polygon2 = MultiPolygon([[[ + Coordinate3D(latitude: 1.0, longitude: 0.0), + Coordinate3D(latitude: 1.0, longitude: 0.0), + Coordinate3D(latitude: 2.0, longitude: 1.0), + Coordinate3D(latitude: 1.0, longitude: 0.0) + ]]]) + #expect(polygon1?.simplified() == polygon1) + #expect(polygon2?.simplified() == polygon2) } // Validates that simplification with degenerate rings does not enter an endless loop. diff --git a/Tests/GISToolsTests/Algorithms/SymmetricDifferenceTests.swift b/Tests/GISToolsTests/Algorithms/SymmetricDifferenceTests.swift index bba02a0..87d5a52 100644 --- a/Tests/GISToolsTests/Algorithms/SymmetricDifferenceTests.swift +++ b/Tests/GISToolsTests/Algorithms/SymmetricDifferenceTests.swift @@ -4,6 +4,43 @@ import Foundation struct SymmetricDifferenceTests { + // MARK: - Reference tests + + private static let overlayFixtures = [ + "DisjointSquares", + "FullyContained", + "LShapeOverlap", + ] + + private func loadOverlayPolygon(_ name: String, _ suffix: String) throws -> Polygon { + try TestData.polygon(package: "Overlay", name: name + suffix) + } + + @Test(arguments: overlayFixtures) + private func turfSymDiffFixture(_ name: String) async throws { + let a = try loadOverlayPolygon(name, "A") + let b = try loadOverlayPolygon(name, "B") + let expected = try TestData.multiPolygon(package: "Overlay", name: name + "SymDiffResult") + + guard let result = a.symmetricDifference(with: b) else { + if expected.polygons.isNotEmpty { + Issue.record("Expected non-nil symmetric difference for \(name)") + } + return + } + + let resultArea = result.polygons.reduce(0) { $0 + $1.area } + let expectedArea = expected.polygons.reduce(0) { $0 + $1.area } + if expectedArea > 0 { + let ratio = resultArea / expectedArea + #expect(ratio > 0.60 && ratio < 1.40, + "\(name): area ratio \(ratio) outside [0.60, 1.40]") + } + else { + #expect(resultArea == 0, "\(name): expected empty but got area \(resultArea)") + } + } + // Validates that two overlapping squares produce an L-shaped symmetric difference. @Test func overlappingSquares() async throws { diff --git a/Tests/GISToolsTests/Algorithms/TesselateTests.swift b/Tests/GISToolsTests/Algorithms/TesselateTests.swift index 34492e9..c6f7d6a 100644 --- a/Tests/GISToolsTests/Algorithms/TesselateTests.swift +++ b/Tests/GISToolsTests/Algorithms/TesselateTests.swift @@ -4,6 +4,31 @@ import Foundation struct TesselateTests { + // MARK: - Reference tests + + private static let tessFixtures = [ + "Triangle", + "Square", + "ConcavePentagon", + "PolygonWithHole", + "LShape", + ] + + @Test(arguments: tessFixtures) + private func turfTesselateFixture(_ name: String) async throws { + let polygon = try TestData.polygon(package: "Tesselate", name: name) + let result = polygon.tesselated() + + #expect(result.features.isNotEmpty, "\(name): expected at least one triangle") + // Every triangle must have exactly 3 coordinates + closing (4 total) + for feature in result.features { + if let tri = feature.geometry as? Polygon { + #expect(tri.outerRing?.coordinates.count == 4, + "\(name): expected triangle with 4 coords, got \(tri.outerRing?.coordinates.count ?? 0)") + } + } + } + // Validates that a triangle (3 vertices) tessellates into a single triangle. @Test func testTriangle() throws { diff --git a/Tests/GISToolsTests/Algorithms/VoronoiTests.swift b/Tests/GISToolsTests/Algorithms/VoronoiTests.swift index 9c89150..03f0f31 100644 --- a/Tests/GISToolsTests/Algorithms/VoronoiTests.swift +++ b/Tests/GISToolsTests/Algorithms/VoronoiTests.swift @@ -4,6 +4,31 @@ import Foundation struct VoronoiTests { + // MARK: - Reference tests + + private static let voronoiFixtures = [ + "ThreePoints", + "FourPoints", + ] + + @Test(arguments: voronoiFixtures) + private func turfVoronoiFixture(_ name: String) async throws { + let fc = try TestData.featureCollection(package: "Voronoi", name: name) + let bbox = try TestData.boundingBox(package: "Voronoi", name: name + "Bbox") + + let result = fc.voronoiDiagram(boundingBox: bbox) + + #expect(result.features.count == fc.features.count, + "\(name): expected \(fc.features.count) cells, got \(result.features.count)") + + for (i, feature) in result.features.enumerated() { + let cell = try #require(feature.geometry as? Polygon, + "\(name): cell \(i) is not a polygon") + #expect(cell.isValid, + "\(name): cell \(i) is invalid") + } + } + // Validates that 3 points produce 3 Voronoi cells within the bounding box. @Test func testThreePoints() throws { diff --git a/Tests/GISToolsTests/Helpers/TestData.swift b/Tests/GISToolsTests/Helpers/TestData.swift index 4af848a..4990926 100644 --- a/Tests/GISToolsTests/Helpers/TestData.swift +++ b/Tests/GISToolsTests/Helpers/TestData.swift @@ -40,6 +40,20 @@ struct TestData { try MultiPolygon(jsonString: stringFromFile(package: package, name: name))! } + static func boundingBox(package: String, name: String) throws -> BoundingBox { + let data = try dataFromFile(package: package, name: name) + let json = try JSONSerialization.jsonObject(with: data) + guard let dict = json as? [String: [String: Double]], + let sw = dict["southWest"], let ne = dict["northEast"], + let swLat = sw["lat"], let swLon = sw["lon"], + let neLat = ne["lat"], let neLon = ne["lon"] + else { throw TestDataError.invalidBoundingBox } + + return BoundingBox( + southWest: Coordinate3D(latitude: swLat, longitude: swLon), + northEast: Coordinate3D(latitude: neLat, longitude: neLon)) + } + // MARK: - static func stringFromFile(package: String, name: String) throws -> String { @@ -76,3 +90,7 @@ struct TestData { } } + +enum TestDataError: Error { + case invalidBoundingBox +} diff --git a/Tests/GISToolsTests/TestData/ConcaveHull/DonutShape.geojson b/Tests/GISToolsTests/TestData/ConcaveHull/DonutShape.geojson new file mode 100644 index 0000000..364e641 --- /dev/null +++ b/Tests/GISToolsTests/TestData/ConcaveHull/DonutShape.geojson @@ -0,0 +1,49 @@ +{ + "type": "MultiPoint", + "coordinates": [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ], + [ + 2.0, + 2.0 + ], + [ + 8.0, + 2.0 + ], + [ + 8.0, + 8.0 + ], + [ + 2.0, + 8.0 + ], + [ + 2.0, + 2.0 + ], + [ + 5.0, + 5.0 + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/ConcaveHull/LShapePoints.geojson b/Tests/GISToolsTests/TestData/ConcaveHull/LShapePoints.geojson new file mode 100644 index 0000000..186145c --- /dev/null +++ b/Tests/GISToolsTests/TestData/ConcaveHull/LShapePoints.geojson @@ -0,0 +1,37 @@ +{ + "type": "MultiPoint", + "coordinates": [ + [ + 0.0, + 0.0 + ], + [ + 5.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 0.0, + 5.0 + ], + [ + 5.0, + 5.0 + ], + [ + 0.0, + 10.0 + ], + [ + 2.0, + 2.0 + ], + [ + 8.0, + 2.0 + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/ConcaveHull/LineWithNoise.geojson b/Tests/GISToolsTests/TestData/ConcaveHull/LineWithNoise.geojson new file mode 100644 index 0000000..1274215 --- /dev/null +++ b/Tests/GISToolsTests/TestData/ConcaveHull/LineWithNoise.geojson @@ -0,0 +1,57 @@ +{ + "type": "MultiPoint", + "coordinates": [ + [ + 0.0, + 0.0 + ], + [ + 1.0, + 0.5 + ], + [ + 2.0, + 0.0 + ], + [ + 3.0, + 0.5 + ], + [ + 4.0, + 0.0 + ], + [ + 5.0, + 0.5 + ], + [ + 6.0, + 0.0 + ], + [ + 0.5, + 0.1 + ], + [ + 1.5, + 0.1 + ], + [ + 2.5, + 0.1 + ], + [ + 3.5, + 0.1 + ], + [ + 4.5, + 0.1 + ], + [ + 5.5, + 0.1 + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/ConvexHull/CollinearPoints.geojson b/Tests/GISToolsTests/TestData/ConvexHull/CollinearPoints.geojson new file mode 100644 index 0000000..a2c626e --- /dev/null +++ b/Tests/GISToolsTests/TestData/ConvexHull/CollinearPoints.geojson @@ -0,0 +1,25 @@ +{ + "type": "MultiPoint", + "coordinates": [ + [ + 0.0, + 0.0 + ], + [ + 2.0, + 0.0 + ], + [ + 5.0, + 0.0 + ], + [ + 8.0, + 0.0 + ], + [ + 10.0, + 0.0 + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/ConvexHull/CollinearPointsResult.geojson b/Tests/GISToolsTests/TestData/ConvexHull/CollinearPointsResult.geojson new file mode 100644 index 0000000..7a3a42c --- /dev/null +++ b/Tests/GISToolsTests/TestData/ConvexHull/CollinearPointsResult.geojson @@ -0,0 +1,13 @@ +{ + "type": "LineString", + "coordinates": [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/ConvexHull/RandomPoints.geojson b/Tests/GISToolsTests/TestData/ConvexHull/RandomPoints.geojson new file mode 100644 index 0000000..05d49fe --- /dev/null +++ b/Tests/GISToolsTests/TestData/ConvexHull/RandomPoints.geojson @@ -0,0 +1,33 @@ +{ + "type": "MultiPoint", + "coordinates": [ + [ + 0.0, + 0.0 + ], + [ + 2.0, + 5.0 + ], + [ + 5.0, + 2.0 + ], + [ + 8.0, + 6.0 + ], + [ + 10.0, + 0.0 + ], + [ + 6.0, + 8.0 + ], + [ + 1.0, + 7.0 + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/ConvexHull/RandomPointsResult.geojson b/Tests/GISToolsTests/TestData/ConvexHull/RandomPointsResult.geojson new file mode 100644 index 0000000..313ceaf --- /dev/null +++ b/Tests/GISToolsTests/TestData/ConvexHull/RandomPointsResult.geojson @@ -0,0 +1,31 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 1.0, + 7.0 + ], + [ + 6.0, + 8.0 + ], + [ + 8.0, + 6.0 + ], + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/ConvexHull/SquarePoints.geojson b/Tests/GISToolsTests/TestData/ConvexHull/SquarePoints.geojson new file mode 100644 index 0000000..e0b02f4 --- /dev/null +++ b/Tests/GISToolsTests/TestData/ConvexHull/SquarePoints.geojson @@ -0,0 +1,25 @@ +{ + "type": "MultiPoint", + "coordinates": [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 5.0, + 5.0 + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/ConvexHull/SquarePointsResult.geojson b/Tests/GISToolsTests/TestData/ConvexHull/SquarePointsResult.geojson new file mode 100644 index 0000000..11661ac --- /dev/null +++ b/Tests/GISToolsTests/TestData/ConvexHull/SquarePointsResult.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ], + [ + 10.0, + 10.0 + ], + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/ConvexHull/ThreePoints.geojson b/Tests/GISToolsTests/TestData/ConvexHull/ThreePoints.geojson new file mode 100644 index 0000000..0d315c1 --- /dev/null +++ b/Tests/GISToolsTests/TestData/ConvexHull/ThreePoints.geojson @@ -0,0 +1,17 @@ +{ + "type": "MultiPoint", + "coordinates": [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 5.0, + 10.0 + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/ConvexHull/ThreePointsResult.geojson b/Tests/GISToolsTests/TestData/ConvexHull/ThreePointsResult.geojson new file mode 100644 index 0000000..e161bcd --- /dev/null +++ b/Tests/GISToolsTests/TestData/ConvexHull/ThreePointsResult.geojson @@ -0,0 +1,23 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 5.0, + 10.0 + ], + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Mask/LShapeMask.geojson b/Tests/GISToolsTests/TestData/Mask/LShapeMask.geojson new file mode 100644 index 0000000..511b681 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Mask/LShapeMask.geojson @@ -0,0 +1,35 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 5.0 + ], + [ + 5.0, + 5.0 + ], + [ + 5.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Mask/LShapeMaskResult.geojson b/Tests/GISToolsTests/TestData/Mask/LShapeMaskResult.geojson new file mode 100644 index 0000000..da2908c --- /dev/null +++ b/Tests/GISToolsTests/TestData/Mask/LShapeMaskResult.geojson @@ -0,0 +1,59 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + -180.0, + 90.0 + ], + [ + 180.0, + 90.0 + ], + [ + 180.0, + -90.0 + ], + [ + -180.0, + -90.0 + ], + [ + -180.0, + 90.0 + ] + ], + [ + [ + 10.0, + 0.0 + ], + [ + 10.0, + 5.0 + ], + [ + 5.0, + 5.0 + ], + [ + 5.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Mask/SmallSquare.geojson b/Tests/GISToolsTests/TestData/Mask/SmallSquare.geojson new file mode 100644 index 0000000..565b321 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Mask/SmallSquare.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + -5.0, + -5.0 + ], + [ + 5.0, + -5.0 + ], + [ + 5.0, + 5.0 + ], + [ + -5.0, + 5.0 + ], + [ + -5.0, + -5.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Mask/SmallSquareResult.geojson b/Tests/GISToolsTests/TestData/Mask/SmallSquareResult.geojson new file mode 100644 index 0000000..3a85454 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Mask/SmallSquareResult.geojson @@ -0,0 +1,51 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + -180.0, + 90.0 + ], + [ + 180.0, + 90.0 + ], + [ + 180.0, + -90.0 + ], + [ + -180.0, + -90.0 + ], + [ + -180.0, + 90.0 + ] + ], + [ + [ + 5.0, + -5.0 + ], + [ + 5.0, + 5.0 + ], + [ + -5.0, + 5.0 + ], + [ + -5.0, + -5.0 + ], + [ + 5.0, + -5.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Mask/TwoSquares.geojson b/Tests/GISToolsTests/TestData/Mask/TwoSquares.geojson new file mode 100644 index 0000000..b05e6a0 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Mask/TwoSquares.geojson @@ -0,0 +1,53 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + -10.0, + -10.0 + ], + [ + 0.0, + -10.0 + ], + [ + 0.0, + 0.0 + ], + [ + -10.0, + 0.0 + ], + [ + -10.0, + -10.0 + ] + ] + ], + [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Mask/TwoSquaresResult.geojson b/Tests/GISToolsTests/TestData/Mask/TwoSquaresResult.geojson new file mode 100644 index 0000000..afa722f --- /dev/null +++ b/Tests/GISToolsTests/TestData/Mask/TwoSquaresResult.geojson @@ -0,0 +1,73 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + -180.0, + 90.0 + ], + [ + 180.0, + 90.0 + ], + [ + 180.0, + -90.0 + ], + [ + -180.0, + -90.0 + ], + [ + -180.0, + 90.0 + ] + ], + [ + [ + 0.0, + -10.0 + ], + [ + 0.0, + 0.0 + ], + [ + -10.0, + 0.0 + ], + [ + -10.0, + -10.0 + ], + [ + 0.0, + -10.0 + ] + ], + [ + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresA.geojson b/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresA.geojson new file mode 100644 index 0000000..d6ae1dc --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresA.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresB.geojson b/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresB.geojson new file mode 100644 index 0000000..196f463 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresB.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 20.0, + 0.0 + ], + [ + 30.0, + 0.0 + ], + [ + 30.0, + 10.0 + ], + [ + 20.0, + 10.0 + ], + [ + 20.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresDiffABResult.geojson b/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresDiffABResult.geojson new file mode 100644 index 0000000..25c10d6 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresDiffABResult.geojson @@ -0,0 +1,29 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0.0, + 10.0 + ], + [ + 10.0, + 10.0 + ], + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresIntersectResult.geojson b/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresIntersectResult.geojson new file mode 100644 index 0000000..449f3eb --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresIntersectResult.geojson @@ -0,0 +1,4 @@ +{ + "type": "MultiPolygon", + "coordinates": [] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresSymDiffResult.geojson b/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresSymDiffResult.geojson new file mode 100644 index 0000000..22fc86d --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/DisjointSquaresSymDiffResult.geojson @@ -0,0 +1,53 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ], + [ + [ + [ + 20.0, + 0.0 + ], + [ + 30.0, + 0.0 + ], + [ + 30.0, + 10.0 + ], + [ + 20.0, + 10.0 + ], + [ + 20.0, + 0.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/FullyContainedA.geojson b/Tests/GISToolsTests/TestData/Overlay/FullyContainedA.geojson new file mode 100644 index 0000000..d6ae1dc --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/FullyContainedA.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/FullyContainedB.geojson b/Tests/GISToolsTests/TestData/Overlay/FullyContainedB.geojson new file mode 100644 index 0000000..fecfcfb --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/FullyContainedB.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 2.0, + 2.0 + ], + [ + 6.0, + 2.0 + ], + [ + 6.0, + 6.0 + ], + [ + 2.0, + 6.0 + ], + [ + 2.0, + 2.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/FullyContainedDiffABResult.geojson b/Tests/GISToolsTests/TestData/Overlay/FullyContainedDiffABResult.geojson new file mode 100644 index 0000000..428867a --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/FullyContainedDiffABResult.geojson @@ -0,0 +1,51 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0.0, + 10.0 + ], + [ + 10.0, + 10.0 + ], + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ] + ], + [ + [ + 6.0, + 2.0 + ], + [ + 6.0, + 6.0 + ], + [ + 2.0, + 6.0 + ], + [ + 2.0, + 2.0 + ], + [ + 6.0, + 2.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/FullyContainedIntersectResult.geojson b/Tests/GISToolsTests/TestData/Overlay/FullyContainedIntersectResult.geojson new file mode 100644 index 0000000..682f476 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/FullyContainedIntersectResult.geojson @@ -0,0 +1,29 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 2.0, + 6.0 + ], + [ + 6.0, + 6.0 + ], + [ + 6.0, + 2.0 + ], + [ + 2.0, + 2.0 + ], + [ + 2.0, + 6.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/FullyContainedSymDiffResult.geojson b/Tests/GISToolsTests/TestData/Overlay/FullyContainedSymDiffResult.geojson new file mode 100644 index 0000000..428867a --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/FullyContainedSymDiffResult.geojson @@ -0,0 +1,51 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0.0, + 10.0 + ], + [ + 10.0, + 10.0 + ], + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ] + ], + [ + [ + 6.0, + 2.0 + ], + [ + 6.0, + 6.0 + ], + [ + 2.0, + 6.0 + ], + [ + 2.0, + 2.0 + ], + [ + 6.0, + 2.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectA.geojson b/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectA.geojson new file mode 100644 index 0000000..ac9ebea --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectA.geojson @@ -0,0 +1,49 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ], + [ + [ + 3.0, + 3.0 + ], + [ + 7.0, + 3.0 + ], + [ + 7.0, + 7.0 + ], + [ + 3.0, + 7.0 + ], + [ + 3.0, + 3.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectB.geojson b/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectB.geojson new file mode 100644 index 0000000..cc6cb57 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectB.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 3.0, + 3.0 + ], + [ + 9.0, + 3.0 + ], + [ + 9.0, + 9.0 + ], + [ + 3.0, + 9.0 + ], + [ + 3.0, + 3.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectDiffABResult.geojson b/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectDiffABResult.geojson new file mode 100644 index 0000000..4aa099e --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectDiffABResult.geojson @@ -0,0 +1,59 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0.0, + 10.0 + ], + [ + 10.0, + 10.0 + ], + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ] + ], + [ + [ + 7.0, + 3.0 + ], + [ + 9.0, + 3.0 + ], + [ + 9.0, + 9.0 + ], + [ + 3.0, + 9.0 + ], + [ + 3.0, + 7.0 + ], + [ + 3.0, + 3.0 + ], + [ + 7.0, + 3.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectIntersectResult.geojson b/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectIntersectResult.geojson new file mode 100644 index 0000000..7ca490a --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectIntersectResult.geojson @@ -0,0 +1,37 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 7.0, + 7.0 + ], + [ + 3.0, + 7.0 + ], + [ + 3.0, + 9.0 + ], + [ + 9.0, + 9.0 + ], + [ + 9.0, + 3.0 + ], + [ + 7.0, + 3.0 + ], + [ + 7.0, + 7.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectSymDiffResult.geojson b/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectSymDiffResult.geojson new file mode 100644 index 0000000..ec5e0f6 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/HolePolygonIntersectSymDiffResult.geojson @@ -0,0 +1,59 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0.0, + 10.0 + ], + [ + 10.0, + 10.0 + ], + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ] + ], + [ + [ + 7.0, + 7.0 + ], + [ + 7.0, + 3.0 + ], + [ + 9.0, + 3.0 + ], + [ + 9.0, + 9.0 + ], + [ + 3.0, + 9.0 + ], + [ + 3.0, + 7.0 + ], + [ + 7.0, + 7.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsA.geojson b/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsA.geojson new file mode 100644 index 0000000..d6ae1dc --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsA.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsB.geojson b/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsB.geojson new file mode 100644 index 0000000..d6ae1dc --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsB.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsDiffABResult.geojson b/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsDiffABResult.geojson new file mode 100644 index 0000000..449f3eb --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsDiffABResult.geojson @@ -0,0 +1,4 @@ +{ + "type": "MultiPolygon", + "coordinates": [] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsIntersectResult.geojson b/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsIntersectResult.geojson new file mode 100644 index 0000000..223223d --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsIntersectResult.geojson @@ -0,0 +1,29 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ], + [ + 10.0, + 10.0 + ], + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsSymDiffResult.geojson b/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsSymDiffResult.geojson new file mode 100644 index 0000000..449f3eb --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/IdenticalPolygonsSymDiffResult.geojson @@ -0,0 +1,4 @@ +{ + "type": "MultiPolygon", + "coordinates": [] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapA.geojson b/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapA.geojson new file mode 100644 index 0000000..511b681 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapA.geojson @@ -0,0 +1,35 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 5.0 + ], + [ + 5.0, + 5.0 + ], + [ + 5.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapB.geojson b/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapB.geojson new file mode 100644 index 0000000..7ed00d5 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapB.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 5.0, + 5.0 + ], + [ + 15.0, + 5.0 + ], + [ + 15.0, + 15.0 + ], + [ + 5.0, + 15.0 + ], + [ + 5.0, + 5.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapDiffABResult.geojson b/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapDiffABResult.geojson new file mode 100644 index 0000000..1c60471 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapDiffABResult.geojson @@ -0,0 +1,37 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ], + [ + 5.0, + 10.0 + ], + [ + 5.0, + 5.0 + ], + [ + 10.0, + 5.0 + ], + [ + 10.0, + 0.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapIntersectResult.geojson b/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapIntersectResult.geojson new file mode 100644 index 0000000..449f3eb --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapIntersectResult.geojson @@ -0,0 +1,4 @@ +{ + "type": "MultiPolygon", + "coordinates": [] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapSymDiffResult.geojson b/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapSymDiffResult.geojson new file mode 100644 index 0000000..503ecb3 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/LShapeOverlapSymDiffResult.geojson @@ -0,0 +1,45 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ], + [ + 5.0, + 10.0 + ], + [ + 5.0, + 15.0 + ], + [ + 15.0, + 15.0 + ], + [ + 15.0, + 5.0 + ], + [ + 10.0, + 5.0 + ], + [ + 10.0, + 0.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresA.geojson b/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresA.geojson new file mode 100644 index 0000000..d6ae1dc --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresA.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresB.geojson b/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresB.geojson new file mode 100644 index 0000000..7ed00d5 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresB.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 5.0, + 5.0 + ], + [ + 15.0, + 5.0 + ], + [ + 15.0, + 15.0 + ], + [ + 5.0, + 15.0 + ], + [ + 5.0, + 5.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresDiffABResult.geojson b/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresDiffABResult.geojson new file mode 100644 index 0000000..1c60471 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresDiffABResult.geojson @@ -0,0 +1,37 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ], + [ + 5.0, + 10.0 + ], + [ + 5.0, + 5.0 + ], + [ + 10.0, + 5.0 + ], + [ + 10.0, + 0.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresIntersectResult.geojson b/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresIntersectResult.geojson new file mode 100644 index 0000000..7de2054 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresIntersectResult.geojson @@ -0,0 +1,29 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 10.0, + 10.0 + ], + [ + 10.0, + 5.0 + ], + [ + 5.0, + 5.0 + ], + [ + 5.0, + 10.0 + ], + [ + 10.0, + 10.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresSymDiffResult.geojson b/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresSymDiffResult.geojson new file mode 100644 index 0000000..d5978f4 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Overlay/OverlappingSquaresSymDiffResult.geojson @@ -0,0 +1,69 @@ +{ + "type": "MultiPolygon", + "coordinates": [ + [ + [ + [ + 10.0, + 0.0 + ], + [ + 0.0, + 0.0 + ], + [ + 0.0, + 10.0 + ], + [ + 5.0, + 10.0 + ], + [ + 5.0, + 5.0 + ], + [ + 10.0, + 5.0 + ], + [ + 10.0, + 0.0 + ] + ] + ], + [ + [ + [ + 10.0, + 10.0 + ], + [ + 5.0, + 10.0 + ], + [ + 5.0, + 15.0 + ], + [ + 15.0, + 15.0 + ], + [ + 15.0, + 5.0 + ], + [ + 10.0, + 5.0 + ], + [ + 10.0, + 10.0 + ] + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Tesselate/ConcavePentagon.geojson b/Tests/GISToolsTests/TestData/Tesselate/ConcavePentagon.geojson new file mode 100644 index 0000000..9105c22 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Tesselate/ConcavePentagon.geojson @@ -0,0 +1,31 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 5.0, + 5.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Tesselate/LShape.geojson b/Tests/GISToolsTests/TestData/Tesselate/LShape.geojson new file mode 100644 index 0000000..511b681 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Tesselate/LShape.geojson @@ -0,0 +1,35 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 5.0 + ], + [ + 5.0, + 5.0 + ], + [ + 5.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Tesselate/PolygonWithHole.geojson b/Tests/GISToolsTests/TestData/Tesselate/PolygonWithHole.geojson new file mode 100644 index 0000000..6cb0862 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Tesselate/PolygonWithHole.geojson @@ -0,0 +1,49 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ], + [ + [ + 2.0, + 2.0 + ], + [ + 8.0, + 2.0 + ], + [ + 8.0, + 8.0 + ], + [ + 2.0, + 8.0 + ], + [ + 2.0, + 2.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Tesselate/Square.geojson b/Tests/GISToolsTests/TestData/Tesselate/Square.geojson new file mode 100644 index 0000000..d6ae1dc --- /dev/null +++ b/Tests/GISToolsTests/TestData/Tesselate/Square.geojson @@ -0,0 +1,27 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 10.0, + 10.0 + ], + [ + 0.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Tesselate/Triangle.geojson b/Tests/GISToolsTests/TestData/Tesselate/Triangle.geojson new file mode 100644 index 0000000..16b24dd --- /dev/null +++ b/Tests/GISToolsTests/TestData/Tesselate/Triangle.geojson @@ -0,0 +1,23 @@ +{ + "type": "Polygon", + "coordinates": [ + [ + [ + 0.0, + 0.0 + ], + [ + 10.0, + 0.0 + ], + [ + 5.0, + 10.0 + ], + [ + 0.0, + 0.0 + ] + ] + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Voronoi/FourPoints.geojson b/Tests/GISToolsTests/TestData/Voronoi/FourPoints.geojson new file mode 100644 index 0000000..554810c --- /dev/null +++ b/Tests/GISToolsTests/TestData/Voronoi/FourPoints.geojson @@ -0,0 +1,49 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 3.0, + 3.0 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 3.0, + 7.0 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 7.0, + 3.0 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 7.0, + 7.0 + ] + } + } + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Voronoi/FourPointsBbox.geojson b/Tests/GISToolsTests/TestData/Voronoi/FourPointsBbox.geojson new file mode 100644 index 0000000..bf0d0f2 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Voronoi/FourPointsBbox.geojson @@ -0,0 +1,10 @@ +{ + "southWest": { + "lat": 0.0, + "lon": 0.0 + }, + "northEast": { + "lat": 10.0, + "lon": 10.0 + } +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Voronoi/ThreePoints.geojson b/Tests/GISToolsTests/TestData/Voronoi/ThreePoints.geojson new file mode 100644 index 0000000..bef8431 --- /dev/null +++ b/Tests/GISToolsTests/TestData/Voronoi/ThreePoints.geojson @@ -0,0 +1,38 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 5.0, + 5.0 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 15.0, + 5.0 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 10.0, + 15.0 + ] + } + } + ] +} \ No newline at end of file diff --git a/Tests/GISToolsTests/TestData/Voronoi/ThreePointsBbox.geojson b/Tests/GISToolsTests/TestData/Voronoi/ThreePointsBbox.geojson new file mode 100644 index 0000000..8f46e0e --- /dev/null +++ b/Tests/GISToolsTests/TestData/Voronoi/ThreePointsBbox.geojson @@ -0,0 +1,10 @@ +{ + "southWest": { + "lat": 0.0, + "lon": 0.0 + }, + "northEast": { + "lat": 20.0, + "lon": 20.0 + } +} \ No newline at end of file