diff --git a/Project.toml b/Project.toml index 4d72daedb8..daaa3ec89d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GeometryOps" uuid = "3251bfac-6a57-4b6d-aa61-ac1fef2975ab" -authors = ["Anshul Singhvi ", "Rafael Schouten ", "Skylar Gering ", "and contributors"] version = "0.1.29" +authors = ["Anshul Singhvi ", "Rafael Schouten ", "Skylar Gering ", "and contributors"] [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" @@ -74,6 +74,7 @@ JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" LibGEOS = "a90b1aa1-3769-5649-ba7e-abc5a9d163eb" NaturalEarth = "436b0209-26ab-4e65-94a9-6526d86fea76" OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc" Polylabel = "49a44318-e865-4b63-9842-695152d634c1" Proj = "c94c279d-25a6-4763-9509-64d165bea63e" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" @@ -84,4 +85,4 @@ TGGeometry = "d7e755d2-3c95-4bcf-9b3c-79ab1a78647b" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["ArchGDAL", "CoordinateTransformations", "DataFrames", "Distributions", "DimensionalData", "Downloads", "FlexiJoins", "GeoJSON", "GeometryBasics", "Proj", "JLD2", "LibGEOS", "Random", "Rasters", "NaturalEarth", "OffsetArrays", "Polylabel", "SafeTestsets", "Shapefile", "TGGeometry", "Test"] +test = ["ArchGDAL", "CoordinateTransformations", "DataFrames", "Distributions", "DimensionalData", "Downloads", "FlexiJoins", "GeoJSON", "GeometryBasics", "Proj", "JLD2", "LibGEOS", "Random", "Rasters", "NaturalEarth", "OffsetArrays", "Polylabel", "SafeTestsets", "Shapefile", "TGGeometry", "Test", "ParallelTestRunner"] diff --git a/test/extensions/flexijoins.jl b/test/extensions/flexijoins.jl index 0d6f4b2875..f730690991 100644 --- a/test/extensions/flexijoins.jl +++ b/test/extensions/flexijoins.jl @@ -3,7 +3,7 @@ using FlexiJoins using DataFrames import GeometryOps as GO import GeoInterface as GI -using ..TestHelpers +using .TestHelpers points = GI.MultiPoint(tuple.(rand(100), rand(100))) diff --git a/test/methods/angles.jl b/test/methods/angles.jl index 4004642a5d..754ccaee2c 100644 --- a/test/methods/angles.jl +++ b/test/methods/angles.jl @@ -3,7 +3,7 @@ import GeoInterface as GI import GeometryOps as GO import GeometryBasics as GB import LibGEOS as LG -using ..TestHelpers +using .TestHelpers pt1 = GI.Point((0.0, 0.0)) mpt1 = GI.MultiPoint([pt1, pt1]) diff --git a/test/methods/area.jl b/test/methods/area.jl index 58eda64839..5bb78e516d 100644 --- a/test/methods/area.jl +++ b/test/methods/area.jl @@ -2,7 +2,7 @@ using Test import GeoInterface as GI import GeometryOps as GO import LibGEOS as LG -using ..TestHelpers +using .TestHelpers pt = LG.Point([0.0, 0.0]) empty_pt = LG.readgeom("POINT EMPTY") diff --git a/test/methods/centroid.jl b/test/methods/centroid.jl index 224a96da5e..c03d0aafaa 100644 --- a/test/methods/centroid.jl +++ b/test/methods/centroid.jl @@ -3,7 +3,7 @@ import GeoInterface as GI import GeometryOps as GO import LibGEOS as LG import ArchGDAL as AG -using ..TestHelpers +using .TestHelpers @testset "Lines/Rings" begin diff --git a/test/methods/clipping/coverage.jl b/test/methods/clipping/coverage.jl index 7127bb4c6b..7bce7347a2 100644 --- a/test/methods/clipping/coverage.jl +++ b/test/methods/clipping/coverage.jl @@ -3,7 +3,7 @@ import GeoInterface as GI import GeometryBasics as GB import GeometryOps as GO import LibGEOS as LG -using ..TestHelpers +using .TestHelpers cell_extremes = (0.0, 20.0, 0.0, 20.0) cell_extent = GI.Extents.Extent(X = (0.0, 20.0), Y = (0.0, 20.0)) diff --git a/test/methods/clipping/cut.jl b/test/methods/clipping/cut.jl index 7530bde2af..700253358d 100644 --- a/test/methods/clipping/cut.jl +++ b/test/methods/clipping/cut.jl @@ -1,7 +1,7 @@ using Test import GeoInterface as GI import GeometryOps as GO -using ..TestHelpers +using .TestHelpers # TODO this should also work with a LineString # Some geom packages don't have `Line` diff --git a/test/methods/clipping/intersection_points.jl b/test/methods/clipping/intersection_points.jl index 4cfc7074a7..c6d98e8a40 100644 --- a/test/methods/clipping/intersection_points.jl +++ b/test/methods/clipping/intersection_points.jl @@ -2,7 +2,7 @@ using Test import GeoInterface as GI import GeometryOps as GO import LibGEOS as LG -using ..TestHelpers +using .TestHelpers l1 = GI.LineString([(90000.0, 1000.0), (90000.0, 22500.0), (95000.0, 22500.0), (95000.0, 1000.0), (90000.0, 1000.0)]) l2 = GI.LineString([(90000.0, 7500.0), (107500.0, 27500.0), (112500.0, 27500.0), (95000.0, 7500.0), (90000.0, 7500.0)]) diff --git a/test/methods/clipping/polygon_clipping.jl b/test/methods/clipping/polygon_clipping.jl index b8f6e5e344..599a9fd14d 100644 --- a/test/methods/clipping/polygon_clipping.jl +++ b/test/methods/clipping/polygon_clipping.jl @@ -2,7 +2,7 @@ using Test import GeometryOps as GO import GeoInterface as GI import LibGEOS as LG -using ..TestHelpers +using .TestHelpers # Test of polygon clipping p1 = GI.Polygon([[(0.0, 0.0), (5.0, 5.0), (10.0, 0.0), (5.0, -5.0), (0.0, 0.0)]]) diff --git a/test/methods/convex_hull.jl b/test/methods/convex_hull.jl index 7caeb0c3dd..00e2c2d463 100644 --- a/test/methods/convex_hull.jl +++ b/test/methods/convex_hull.jl @@ -2,7 +2,7 @@ using Test import GeoInterface as GI import GeometryOps as GO import LibGEOS as LG -using ..TestHelpers +using .TestHelpers @testset "Basic example" begin points = tuple.(rand(100), rand(100)) diff --git a/test/methods/distance.jl b/test/methods/distance.jl index a2a48c8659..6577b06ee9 100644 --- a/test/methods/distance.jl +++ b/test/methods/distance.jl @@ -3,7 +3,7 @@ import ArchGDAL as AG import GeoInterface as GI import GeometryOps as GO import LibGEOS as LG -using ..TestHelpers +using .TestHelpers pt1 = LG.Point([0.0, 0.0]) pt2 = LG.Point([0.0, 1.0]) diff --git a/test/methods/equals.jl b/test/methods/equals.jl index 38fa45c047..ffd8108c48 100644 --- a/test/methods/equals.jl +++ b/test/methods/equals.jl @@ -3,7 +3,7 @@ import GeoInterface as GI import GeometryBasics as GB import GeometryOps as GO import LibGEOS as LG -using ..TestHelpers +using .TestHelpers p1 = LG.Point([0.0, 0.0]) p2 = LG.Point([0.0, 1.0]) diff --git a/test/methods/geom_relations.jl b/test/methods/geom_relations.jl index af60750f75..d8f91527cb 100644 --- a/test/methods/geom_relations.jl +++ b/test/methods/geom_relations.jl @@ -2,7 +2,7 @@ import GeometryOps as GO import GeoInterface as GI import LibGEOS as LG using Extents -using ..TestHelpers +using .TestHelpers # Tests of DE-9IM Methods pt1 = LG.Point([0.0, 0.0]) diff --git a/test/methods/orientation.jl b/test/methods/orientation.jl index fef53ebd4c..7918df2a2b 100644 --- a/test/methods/orientation.jl +++ b/test/methods/orientation.jl @@ -1,7 +1,7 @@ using Test, GeometryOps import GeoInterface as GI import GeometryOps as GO -using ..TestHelpers +using .TestHelpers line1 = GI.LineString([[9.170356, 45.477985], [9.164434, 45.482551], [9.166644, 45.484003]]) line2 = GI.LineString([[9.169356, 45.477985], [9.163434, 45.482551], [9.165644, 45.484003]]) diff --git a/test/methods/perimeter.jl b/test/methods/perimeter.jl index 546cadc736..12189fd944 100644 --- a/test/methods/perimeter.jl +++ b/test/methods/perimeter.jl @@ -1,6 +1,7 @@ using Test import GeometryOps as GO import LibGEOS as LG +import Proj # Basic geometries for testing point = LG.Point([0.0, 0.0]) diff --git a/test/methods/polygonize.jl b/test/methods/polygonize.jl index 8926c9459a..5233ef9058 100644 --- a/test/methods/polygonize.jl +++ b/test/methods/polygonize.jl @@ -1,5 +1,5 @@ using GeometryOps, GeoInterface, Test -using ..TestHelpers +using .TestHelpers import GeometryOps as GO import GeoInterface as GI diff --git a/test/primitives.jl b/test/primitives.jl index 70bbdf74da..0e6152e5ce 100644 --- a/test/primitives.jl +++ b/test/primitives.jl @@ -10,7 +10,7 @@ import Proj import Shapefile import DataFrames, Tables, DataAPI using Downloads: download -using ..TestHelpers +using .TestHelpers pv1 = [(1, 2), (3, 4), (5, 6), (1, 2)] pv2 = [(3, 4), (5, 6), (6, 7), (3, 4)] diff --git a/test/runtests.jl b/test/runtests.jl index 8a41f40055..f111d89d5f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,53 +1,58 @@ using GeometryOps using Test -using SafeTestsets +using ParallelTestRunner: runtests -include("helpers.jl") - -@testset "Core" begin - @safetestset "Algorithm" begin include("core/algorithm.jl") end - @safetestset "Manifold" begin include("core/manifold.jl") end - @safetestset "Applicators" begin include("core/applicators.jl") end +const init_code = quote + include(joinpath($(dirname(@__DIR__)), "test", "helpers.jl")) + using .TestHelpers end -@safetestset "Types" begin include("types.jl") end -@safetestset "Primitives" begin include("primitives.jl") end +runtests(GeometryOps, ARGS; init_code) + +# @testset "Core" begin +# @safetestset "Algorithm" begin include("core/algorithm.jl") end +# @safetestset "Manifold" begin include("core/manifold.jl") end +# @safetestset "Applicators" begin include("core/applicators.jl") end +# end + +# @safetestset "Types" begin include("types.jl") end +# @safetestset "Primitives" begin include("primitives.jl") end -# Utils -@safetestset "Utils" begin include("utils/utils.jl") end -@safetestset "LoopStateMachine" begin include("utils/LoopStateMachine.jl") end -@safetestset "SpatialTreeInterface" begin include("utils/SpatialTreeInterface.jl") end -@safetestset "UnitSpherical" begin include("utils/unitspherical.jl") end -@safetestset "RobustCrossProduct" begin include("utils/robustcrossproduct.jl") end -# Methods -@safetestset "Angles" begin include("methods/angles.jl") end -@safetestset "Area" begin include("methods/area.jl") end -@safetestset "Perimeter" begin include("methods/perimeter.jl") end -@safetestset "Barycentric coordinate operations" begin include("methods/barycentric.jl") end -@safetestset "Orientation" begin include("methods/orientation.jl") end -@safetestset "Centroid" begin include("methods/centroid.jl") end -@safetestset "Convex Hull" begin include("methods/convex_hull.jl") end -@safetestset "DE-9IM Geom Relations" begin include("methods/geom_relations.jl") end -@safetestset "Distance" begin include("methods/distance.jl") end -@safetestset "Equals" begin include("methods/equals.jl") end -# Clipping -@safetestset "Coverage" begin include("methods/clipping/coverage.jl") end -@safetestset "Cut" begin include("methods/clipping/cut.jl") end -@safetestset "Intersection Point" begin include("methods/clipping/intersection_points.jl") end -@safetestset "Polygon Clipping" begin include("methods/clipping/polygon_clipping.jl") end -# Transformations -@safetestset "Embed Extent" begin include("transformations/extent.jl") end -@safetestset "Reproject" begin include("transformations/reproject.jl") end -@safetestset "Flip" begin include("transformations/flip.jl") end -@safetestset "Simplify" begin include("transformations/simplify.jl") end -@safetestset "Segmentize" begin include("transformations/segmentize.jl") end -@safetestset "Transform" begin include("transformations/transform.jl") end -@safetestset "Force Dimensions" begin include("transformations/forcedims.jl") end -@safetestset "Geometry Correction" begin include("transformations/correction/geometry_correction.jl") end -@safetestset "Closed Rings" begin include("transformations/correction/closed_ring.jl") end -@safetestset "Intersecting Polygons" begin include("transformations/correction/intersecting_polygons.jl") end -# Extensions -@safetestset "FlexiJoins" begin include("extensions/flexijoins.jl") end -@safetestset "LibGEOS" begin include("extensions/libgeos.jl") end -@safetestset "TGGeometry" begin include("extensions/tggeometry.jl") end -@safetestset "DataFrames" begin include("extensions/dataframes.jl") end \ No newline at end of file +# # Utils +# @safetestset "Utils" begin include("utils/utils.jl") end +# @safetestset "LoopStateMachine" begin include("utils/LoopStateMachine.jl") end +# @safetestset "SpatialTreeInterface" begin include("utils/SpatialTreeInterface.jl") end +# @safetestset "UnitSpherical" begin include("utils/unitspherical.jl") end +# @safetestset "RobustCrossProduct" begin include("utils/robustcrossproduct.jl") end +# # Methods +# @safetestset "Angles" begin include("methods/angles.jl") end +# @safetestset "Area" begin include("methods/area.jl") end +# @safetestset "Perimeter" begin include("methods/perimeter.jl") end +# @safetestset "Barycentric coordinate operations" begin include("methods/barycentric.jl") end +# @safetestset "Orientation" begin include("methods/orientation.jl") end +# @safetestset "Centroid" begin include("methods/centroid.jl") end +# @safetestset "Convex Hull" begin include("methods/convex_hull.jl") end +# @safetestset "DE-9IM Geom Relations" begin include("methods/geom_relations.jl") end +# @safetestset "Distance" begin include("methods/distance.jl") end +# @safetestset "Equals" begin include("methods/equals.jl") end +# # Clipping +# @safetestset "Coverage" begin include("methods/clipping/coverage.jl") end +# @safetestset "Cut" begin include("methods/clipping/cut.jl") end +# @safetestset "Intersection Point" begin include("methods/clipping/intersection_points.jl") end +# @safetestset "Polygon Clipping" begin include("methods/clipping/polygon_clipping.jl") end +# # Transformations +# @safetestset "Embed Extent" begin include("transformations/extent.jl") end +# @safetestset "Reproject" begin include("transformations/reproject.jl") end +# @safetestset "Flip" begin include("transformations/flip.jl") end +# @safetestset "Simplify" begin include("transformations/simplify.jl") end +# @safetestset "Segmentize" begin include("transformations/segmentize.jl") end +# @safetestset "Transform" begin include("transformations/transform.jl") end +# @safetestset "Force Dimensions" begin include("transformations/forcedims.jl") end +# @safetestset "Geometry Correction" begin include("transformations/correction/geometry_correction.jl") end +# @safetestset "Closed Rings" begin include("transformations/correction/closed_ring.jl") end +# @safetestset "Intersecting Polygons" begin include("transformations/correction/intersecting_polygons.jl") end +# # Extensions +# @safetestset "FlexiJoins" begin include("extensions/flexijoins.jl") end +# @safetestset "LibGEOS" begin include("extensions/libgeos.jl") end +# @safetestset "TGGeometry" begin include("extensions/tggeometry.jl") end +# @safetestset "DataFrames" begin include("extensions/dataframes.jl") end \ No newline at end of file diff --git a/test/transformations/correction/closed_ring.jl b/test/transformations/correction/closed_ring.jl index 90819f40f5..1babda8eca 100644 --- a/test/transformations/correction/closed_ring.jl +++ b/test/transformations/correction/closed_ring.jl @@ -3,7 +3,7 @@ import ArchGDAL as AG import GeoInterface as GI import GeometryBasics as GB import GeometryOps as GO -using ..TestHelpers +using .TestHelpers open_rectangle = GI.Polygon([collect.([(0, 0), (10, 0), (10, 10), (0, 10)])]) diff --git a/test/transformations/correction/geometry_correction.jl b/test/transformations/correction/geometry_correction.jl index de8d51a090..2915e570bc 100644 --- a/test/transformations/correction/geometry_correction.jl +++ b/test/transformations/correction/geometry_correction.jl @@ -3,7 +3,7 @@ import ArchGDAL as AG import GeoInterface as GI import GeometryBasics as GB import GeometryOps as GO -using ..TestHelpers +using .TestHelpers open_rectangle = GI.Polygon([collect.([(0, 0), (10, 0), (10, 10), (0, 10)])]) diff --git a/test/transformations/correction/intersecting_polygons.jl b/test/transformations/correction/intersecting_polygons.jl index dfac723bf2..cd3fed0978 100644 --- a/test/transformations/correction/intersecting_polygons.jl +++ b/test/transformations/correction/intersecting_polygons.jl @@ -1,7 +1,7 @@ using Test import GeoInterface as GI import GeometryOps as GO -using ..TestHelpers +using .TestHelpers p1 = GI.Polygon([[(0.0, 0.0), (3.0, 0.0), (3.0, 3.0), (0.0, 3.0), (0.0, 0.0)]]) # (p1, p2) -> one polygon inside of the other, sharing an edge diff --git a/test/transformations/extent.jl b/test/transformations/extent.jl index 87026e9eb5..74dd4653d4 100644 --- a/test/transformations/extent.jl +++ b/test/transformations/extent.jl @@ -2,7 +2,7 @@ using Test import GeoInterface as GI import GeometryOps as GO using GeoInterface: Extents -using ..TestHelpers +using .TestHelpers poly = GI.Polygon([GI.LinearRing([(1, 2), (3, 4), (5, 6), (1, 2)]), GI.LinearRing([(3, 4), (5, 6), (6, 7), (3, 4)])]) diff --git a/test/transformations/flip.jl b/test/transformations/flip.jl index f02083ff53..f29703dd39 100644 --- a/test/transformations/flip.jl +++ b/test/transformations/flip.jl @@ -1,7 +1,7 @@ using Test import GeoInterface as GI import GeometryOps as GO -using ..TestHelpers +using .TestHelpers geom = GI.Polygon([GI.LinearRing([(1, 2), (3, 4), (5, 6), (1, 2)]), GI.LinearRing([(3, 4), (5, 6), (6, 7), (3, 4)])]) diff --git a/test/transformations/forcedims.jl b/test/transformations/forcedims.jl index 61e4f9e3ea..ff891d5853 100644 --- a/test/transformations/forcedims.jl +++ b/test/transformations/forcedims.jl @@ -1,6 +1,6 @@ import GeometryOps as GO import GeoInterface as GI -using ..TestHelpers +using .TestHelpers using Test diff --git a/test/transformations/reproject.jl b/test/transformations/reproject.jl index c78f0d16f3..a405bfcb28 100644 --- a/test/transformations/reproject.jl +++ b/test/transformations/reproject.jl @@ -3,7 +3,7 @@ using GeoFormatTypes import GeoInterface as GI import GeometryOps as GO import Proj -using ..TestHelpers +using .TestHelpers ring1 = GI.LinearRing([(1, 2), (7, 4), (5, 6), (1, 2)]) ring2 = GI.LinearRing([(11, 2), (20, 4), (15, 6), (11, 2)]) diff --git a/test/transformations/segmentize.jl b/test/transformations/segmentize.jl index 10d07c7f3b..73e6919f65 100644 --- a/test/transformations/segmentize.jl +++ b/test/transformations/segmentize.jl @@ -2,7 +2,7 @@ using Test using Proj import GeometryOps as GO import GeoInterface as GI -using ..TestHelpers +using .TestHelpers @testset "Segmentation on multiple geometry levels" begin ls = GI.LineString([(0, 0), (1, 1), (2, 2), (3, 3)]) diff --git a/test/transformations/simplify.jl b/test/transformations/simplify.jl index 1661c566a1..d183a25faf 100644 --- a/test/transformations/simplify.jl +++ b/test/transformations/simplify.jl @@ -3,7 +3,7 @@ import GeoJSON, JLD2 import GeometryOps as GO import GeoInterface as GI import LibGEOS as LG -using ..TestHelpers +using .TestHelpers datadir = realpath(joinpath(dirname(pathof(GO)), "../test/data")) @testset "RadialDistance and VisvalingamWhyatt" begin diff --git a/test/transformations/transform.jl b/test/transformations/transform.jl index 770e397866..44f139e145 100644 --- a/test/transformations/transform.jl +++ b/test/transformations/transform.jl @@ -2,7 +2,7 @@ using Test using CoordinateTransformations import GeoInterface as GI import GeometryOps as GO -using ..TestHelpers +using .TestHelpers geom = GI.Polygon([GI.LinearRing([(1, 2), (3, 4), (5, 6), (1, 2)]), GI.LinearRing([(3, 4), (5, 6), (6, 7), (3, 4)])])