diff --git a/Project.toml b/Project.toml index 1ddf9f1..2a75258 100644 --- a/Project.toml +++ b/Project.toml @@ -8,6 +8,7 @@ DBFTables = "75c7ada1-017a-5fb6-b8c7-2125ff2d6c93" Extents = "411431e0-e8b7-467b-b5e0-f676ba4f2910" GeoFormatTypes = "68eda718-8dee-11e9-39e7-89f7f65f511f" GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" +GeoInterfaceMakie = "0edc0954-3250-4c18-859d-ec71c1660c08" GeoInterfaceRecipes = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" @@ -18,15 +19,25 @@ DBFTables = "1.2" Extents = "0.1" GeoFormatTypes = "0.4" GeoInterface = "1.0" +GeoInterfaceMakie = "0.1" GeoInterfaceRecipes = "1.0" +Makie = "0.20" OrderedCollections = "1" RecipesBase = "1" Tables = "0.2, 1" julia = "1.6" + +[weakdeps] +Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" + +[extensions] +ShapefileMakie = "Makie" + [extras] ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" RemoteFiles = "cbe49d4c-5af1-5b60-bb70-0a60aa018e1b" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/test/table.jl b/test/table.jl index 095a702..3fef2e7 100644 --- a/test/table.jl +++ b/test/table.jl @@ -2,6 +2,7 @@ using Shapefile using Test using RemoteFiles using Plots +using Makie import DBFTables import Tables import DataFrames @@ -198,10 +199,37 @@ for shx_path in ne_shx end end -@testset "plot tables" begin - plot(ne_land) - plot(ne_coastline) - plot(ne_cities) + +@testset "plot tables with Plots.jl" begin + # Tables + Plots.plot(ne_land) + Plots.plot(ne_coastline) + Plots.plot(ne_cities) + # Handles + Plots.plot(getfield(ne_land, :shp)) + Plots.plot(getfield(ne_coastline, :shp)) + Plots.plot(getfield(ne_cities, :shp)) +end + +@testset "plot tables with Makie.jl" begin + # Tables + p = Makie.plot(ne_land) + # Makie doesn't actually plot vectors of multiline string: + # Makie.plot(ne_coastline) + # So we do it manually + for geom in Shapefile.shapes(ne_coastline) + Makie.plot!(p.axis, geom) + end + Makie.plot!(p.axis, ne_cities) + # Handles + p = Makie.plot(getfield(ne_land, :shp)) + # Makie doesn't actually plot vectors of multiline string: + # Makie.plot(ne_coastline) + # So we do it manually + for geom in Shapefile.shapes(getfield(ne_coastline, :shp)) + Makie.plot!(p.axis, geom) + end + Makie.plot!(p.axis, getfield(ne_cities, :shp)) end end # testset "Tables interface"