From b878709ff664c1153ec8a7d82fa138d4d66eb962 Mon Sep 17 00:00:00 2001 From: Felix Cremer Date: Wed, 27 Dec 2023 18:35:33 +0100 Subject: [PATCH] Add GeoInterfaceMakie as a weak dependency (#404) * Try to setup GeoInterfaceMakie as weak dependency * Add GeoInterfaceMakie as normal dep This adds GeoInterfaceMakie to enable the easy plotting of ArchGDAL geometries. * Remove Makie from the deps list * Use full name for GeoInterfaceMakie * Compat Makie to 0.20 * Remove print statement * Tidy up unnecessary loading of GeoInterfaceMakie * Add Makie to extras in Project.toml This should enable to be able to ignore the weak dependency in Julia 1.8 or older. * Update src/geointerface.jl Co-authored-by: Felix Cremer * Rename ArchGDALGeoInterfaceMakie.jl to ArchGDALMakieExt.jl * Update Project.toml * Update ext/ArchGDALMakieExt.jl --------- Co-authored-by: Rafael Schouten --- Project.toml | 12 ++++++++++++ ext/ArchGDALMakieExt.jl | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 ext/ArchGDALMakieExt.jl diff --git a/Project.toml b/Project.toml index 9aa894b7..18ee3568 100644 --- a/Project.toml +++ b/Project.toml @@ -15,9 +15,16 @@ GDAL = "add2ef01-049f-52c4-9ee2-e494f65e021a" GeoFormatTypes = "68eda718-8dee-11e9-39e7-89f7f65f511f" GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" GeoInterfaceRecipes = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" +GeoInterfaceMakie = "0edc0954-3250-4c18-859d-ec71c1660c08" ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +[weakdeps] +Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" + +[extensions] +ArchGDALMakieExt = "Makie" + [compat] CEnum = "0.4, 0.5" ColorTypes = "0.10, 0.11" @@ -27,6 +34,11 @@ GDAL = "1.5.1" GeoFormatTypes = "0.4.2" GeoInterface = "1" GeoInterfaceRecipes = "1.0" +GeoInterfaceMakie = "0.1" ImageCore = "0.8, 0.9, 0.10" +Makie = "0.20" Tables = "1" julia = "1.6" + +["extras"] +Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" \ No newline at end of file diff --git a/ext/ArchGDALMakieExt.jl b/ext/ArchGDALMakieExt.jl new file mode 100644 index 00000000..b21b2ca0 --- /dev/null +++ b/ext/ArchGDALMakieExt.jl @@ -0,0 +1,7 @@ +module ArchGDALMakieExt +using GeoInterfaceMakie: GeoInterfaceMakie +using ArchGDAL: ArchGDAL + +GeoInterfaceMakie.@enable ArchGDAL.IGeometry +GeoInterfaceMakie.@enable ArchGDAL.Geometry +end