diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 76e653d..93bab72 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: version: - - '1.6' + - '1.9' - '1' - 'nightly' os: diff --git a/Project.toml b/Project.toml index 7b56082..4266f53 100644 --- a/Project.toml +++ b/Project.toml @@ -8,25 +8,35 @@ CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910" GEOS_jll = "d604d12d-fa86-5845-992e-78dc15976526" GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" +GeoInterfaceMakie = "0edc0954-3250-4c18-859d-ec71c1660c08" GeoInterfaceRecipes = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" +[weakdeps] +Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" + +[extensions] +LibGEOSMakieExt = "Makie" + [compat] Aqua = "0.8" CEnum = "0.2, 0.3, 0.4, 0.5" Extents = "0.1.1" GEOS_jll = "3.12" GeoInterface = "1" +GeoInterfaceMakie = "0.1" GeoInterfaceRecipes = "1" +Makie = "0.20" Plots = "1" RecipesBase = "1" -Test = "1" -julia = "1.6" +Test = "<0.0.1,1" +julia = "1.9" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "Plots", "RecipesBase", "Test"] +test = ["Aqua", "Makie", "Plots", "RecipesBase", "Test"] diff --git a/ext/LibGEOSMakieExt.jl b/ext/LibGEOSMakieExt.jl new file mode 100644 index 0000000..8d5c847 --- /dev/null +++ b/ext/LibGEOSMakieExt.jl @@ -0,0 +1,7 @@ +module LibGEOSMakieExt +using GeoInterfaceMakie: GeoInterfaceMakie +using LibGEOS: LibGEOS + +GeoInterfaceMakie.@enable LibGEOS.AbstractGeometry + +end diff --git a/test/runtests.jl b/test/runtests.jl index 753faee..9f88891 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,7 @@ - using GeoInterface, GeoInterfaceRecipes, Extents using GeoInterface, Extents using Test, LibGEOS, RecipesBase + import Aqua version = LibGEOS.GEOSversion() @@ -16,9 +16,14 @@ if version != LibGEOS.GEOS_CAPI_VERSION end @testset "LibGEOS" begin - Aqua.test_all(LibGEOS; - ambiguities=(exclude=[RecipesBase.apply_recipe],), - ) + @testset "Aqua.jl" begin + Aqua.test_all( + LibGEOS; + ambiguities=(exclude=[GeoInterfaceRecipes.RecipesBase.apply_recipe],), + stale_deps=(ignore=[:GeoInterfaceMakie],), + ) + end + include("test_geos_types.jl") include("test_geos_functions.jl") include("test_geos_operations.jl") diff --git a/test/test_geo_interface.jl b/test/test_geo_interface.jl index 6d667d9..41c3be5 100644 --- a/test/test_geo_interface.jl +++ b/test/test_geo_interface.jl @@ -1,4 +1,4 @@ -using Test, Plots, GeoInterface, LibGEOS, Extents +using Test, Makie, Plots, GeoInterface, LibGEOS, Extents const GI = GeoInterface const LG = LibGEOS @@ -13,7 +13,8 @@ const LG = LibGEOS @test GeoInterface.testgeometry(pt) @test GeoInterface.is3d(pt) == false @test GeoInterface.extent(pt) == Extent(X=(1.0, 1.0), Y=(2.0, 2.0)) - plot(pt) + Plots.plot(pt) + Makie.plot(pt) pt = LibGEOS.Point(1.0, 2.0, 3.0) @test GeoInterface.x(pt) == 1.0 @@ -27,7 +28,9 @@ const LG = LibGEOS # This doesn't return the Z extent @test_broken GeoInterface.extent(pt) == Extent(X = (1.0, 1.0), Y = (2.0, 2.0), Z = (3.0, 3.0)) - plot(pt) + Plots.plot(pt) + Makie.plot(pt) + Makie.plot(pt) pt = LibGEOS.Point(1, 2) @test GeoInterface.coordinates(pt) ≈ [1, 2] atol = 1e-5 @@ -63,7 +66,10 @@ const LG = LibGEOS @test GeoInterface.coordinates(p) == [10, 0] @test GeoInterface.testgeometry(mpt) @test GeoInterface.is3d(mpt) == false - plot(mpt) + Plots.plot(mpt) + Makie.plot(mpt) + + @inferred GeoInterface.ncoord(mpt) @inferred GeoInterface.ngeom(mpt) @@ -78,10 +84,12 @@ const LG = LibGEOS p = GeoInterface.getgeom(ls, 3) @test p isa LibGEOS.Point @test GeoInterface.coordinates(p) == [9, 2] - @test GeoInterface.testgeometry(ls) + @test GeoInterface.testgeometry(ls) @test GeoInterface.is3d(ls) == false - plot(ls) + Plots.plot(ls) + Makie.plot(ls) + @inferred GeoInterface.ncoord(ls) @inferred GeoInterface.ngeom(ls) @inferred GeoInterface.getgeom(ls) @@ -98,7 +106,9 @@ const LG = LibGEOS @test GeoInterface.ngeom(mls) == 2 @test GeoInterface.testgeometry(mls) @test GeoInterface.is3d(mls) == false - plot(mls) + Plots.plot(mls) + Makie.plot(mls) + @inferred GeoInterface.ncoord(mls) @inferred GeoInterface.ngeom(mls) @@ -116,7 +126,8 @@ const LG = LibGEOS @test GeoInterface.is3d(lr) == false @test GeoInterface.testgeometry(lr) # Cannot convert LinearRingTrait to series data for plotting - # plot(lr) + # Plots.plot(lr) + # Makie.plot(lr) @inferred GeoInterface.ncoord(lr) @inferred GeoInterface.ngeom(lr) @@ -137,7 +148,9 @@ const LG = LibGEOS @test GeoInterface.coordinates(ls) == coords[2] @test GeoInterface.testgeometry(polygon) @test GeoInterface.is3d(polygon) == false - plot(polygon) + Plots.plot(polygon) + Makie.plot(polygon) + @inferred GeoInterface.ncoord(polygon) @inferred GeoInterface.ngeom(polygon) @@ -162,7 +175,8 @@ const LG = LibGEOS @test GeoInterface.testgeometry(multipolygon) @test GeoInterface.is3d(multipolygon) == false @test GeoInterface.extent(multipolygon) == Extent(X=(0.0, 10.0), Y=(0.0, 10.0)) - plot(multipolygon) + Plots.plot(multipolygon) + Makie.plot(multipolygon) @inferred GeoInterface.ncoord(multipolygon) @inferred GeoInterface.ngeom(multipolygon) @@ -247,7 +261,10 @@ const LG = LibGEOS @test GeoInterface.geomtrait(geomcollection) == GeometryCollectionTrait() @test GeoInterface.testgeometry(geomcollection) @test GeoInterface.is3d(geomcollection) == false - plot(geomcollection) + Plots.plot(geomcollection) + # Can't plot geometry collection yet with Makie + @test_broken Makie.plot(geomcollection) + @inferred GeoInterface.ncoord(geomcollection) @inferred GeoInterface.ngeom(geomcollection)