From b3b6d430f6e1779219fcb171cd9b0a8737c0c8e1 Mon Sep 17 00:00:00 2001 From: Maarten Plonk <114733774+repro-code@users.noreply.github.com> Date: Sun, 11 Jan 2026 11:24:36 +0000 Subject: [PATCH 1/6] Add GeoInterfaceRecipes/Project.toml --- GeoInterfaceRecipes/Project.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 GeoInterfaceRecipes/Project.toml diff --git a/GeoInterfaceRecipes/Project.toml b/GeoInterfaceRecipes/Project.toml new file mode 100644 index 0000000..f06f197 --- /dev/null +++ b/GeoInterfaceRecipes/Project.toml @@ -0,0 +1,11 @@ +name = "GeoInterfaceRecipes" +uuid = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" +authors = ["JuliaGeo and contributors"] +version = "1.0.3" + +[deps] +GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" + +[compat] +GeoInterface = "1.5" +julia = "1.6" From 3f0c6cff080e45d7d167efa6f419f0e0f45f233b Mon Sep 17 00:00:00 2001 From: Maarten Plonk <114733774+repro-code@users.noreply.github.com> Date: Sun, 11 Jan 2026 11:24:45 +0000 Subject: [PATCH 2/6] Add GeoInterfaceRecipes/src/GeoInterfaceRecipes.jl --- GeoInterfaceRecipes/src/GeoInterfaceRecipes.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 GeoInterfaceRecipes/src/GeoInterfaceRecipes.jl diff --git a/GeoInterfaceRecipes/src/GeoInterfaceRecipes.jl b/GeoInterfaceRecipes/src/GeoInterfaceRecipes.jl new file mode 100644 index 0000000..72c7415 --- /dev/null +++ b/GeoInterfaceRecipes/src/GeoInterfaceRecipes.jl @@ -0,0 +1,12 @@ +module GeoInterfaceRecipes + +# This package is deprecated. Plotting recipes are now built into GeoInterface.jl +# as package extensions. See: +# - GeoInterfaceRecipesBaseExt for Plots.jl support +# - GeoInterfaceMakieExt for Makie.jl support +# +# This empty package exists only to allow smooth upgrades for users who had +# GeoInterfaceRecipes.jl installed. No action is needed - simply load +# GeoInterface with Plots or Makie and the recipes will work automatically. + +end From 35e9d28c9e9bb22415a67f1277e06dddcc34361e Mon Sep 17 00:00:00 2001 From: Maarten Plonk <114733774+repro-code@users.noreply.github.com> Date: Sun, 11 Jan 2026 11:24:45 +0000 Subject: [PATCH 3/6] Add GeoInterfaceRecipes/test/runtests.jl --- GeoInterfaceRecipes/test/runtests.jl | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 GeoInterfaceRecipes/test/runtests.jl diff --git a/GeoInterfaceRecipes/test/runtests.jl b/GeoInterfaceRecipes/test/runtests.jl new file mode 100644 index 0000000..8f4756c --- /dev/null +++ b/GeoInterfaceRecipes/test/runtests.jl @@ -0,0 +1,8 @@ +using GeoInterfaceRecipes +using Test + +@testset "GeoInterfaceRecipes.jl" begin + # This is now an empty stub package. + # The actual recipes are in GeoInterface.jl extensions. + @test true +end From acf8d462dcfdcceb17a07a990d1d184cad5abadf Mon Sep 17 00:00:00 2001 From: Maarten Plonk <114733774+repro-code@users.noreply.github.com> Date: Sun, 11 Jan 2026 11:24:47 +0000 Subject: [PATCH 4/6] Add GeoInterfaceRecipes/LICENSE --- GeoInterfaceRecipes/LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 GeoInterfaceRecipes/LICENSE diff --git a/GeoInterfaceRecipes/LICENSE b/GeoInterfaceRecipes/LICENSE new file mode 100644 index 0000000..9e77a23 --- /dev/null +++ b/GeoInterfaceRecipes/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Julia Computing + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 299f4eb1de46bff3a9d774ca1e516bf9eca4cf67 Mon Sep 17 00:00:00 2001 From: Maarten Plonk <114733774+repro-code@users.noreply.github.com> Date: Sun, 11 Jan 2026 11:24:48 +0000 Subject: [PATCH 5/6] Add GeoInterfaceRecipes/README.md --- GeoInterfaceRecipes/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 GeoInterfaceRecipes/README.md diff --git a/GeoInterfaceRecipes/README.md b/GeoInterfaceRecipes/README.md new file mode 100644 index 0000000..62516d8 --- /dev/null +++ b/GeoInterfaceRecipes/README.md @@ -0,0 +1,22 @@ +# GeoInterfaceRecipes.jl + +**This package is deprecated.** + +Plotting recipes for GeoInterface geometries are now built directly into [GeoInterface.jl](https://github.com/JuliaGeo/GeoInterface.jl) as package extensions: + +- **Plots.jl support**: Load `GeoInterface` with `Plots` and recipes work automatically +- **Makie.jl support**: Load `GeoInterface` with `Makie` and `GeometryBasics` for Makie plotting + +## Migration + +No action is needed. Simply remove `GeoInterfaceRecipes` from your dependencies and use `GeoInterface` directly with your preferred plotting package. + +```julia +using GeoInterface +using Plots # or using Makie + +# Plotting just works +plot(my_geometry) +``` + +This empty package exists only to provide a smooth upgrade path for users who had GeoInterfaceRecipes.jl in their dependencies. From f0049435afc70965fbfdbb34ef9c0536bc518f88 Mon Sep 17 00:00:00 2001 From: Maarten Pronk Date: Sun, 18 Jan 2026 22:03:19 +0100 Subject: [PATCH 6/6] Redirect macros to extensions. --- GeoInterfaceRecipes/Project.toml | 13 ++- .../src/GeoInterfaceRecipes.jl | 17 +++- GeoInterfaceRecipes/test/runtests.jl | 97 ++++++++++++++++++- 3 files changed, 119 insertions(+), 8 deletions(-) diff --git a/GeoInterfaceRecipes/Project.toml b/GeoInterfaceRecipes/Project.toml index f06f197..291d339 100644 --- a/GeoInterfaceRecipes/Project.toml +++ b/GeoInterfaceRecipes/Project.toml @@ -1,11 +1,20 @@ name = "GeoInterfaceRecipes" uuid = "0329782f-3d07-4b52-b9f6-d3137cf03c7a" -authors = ["JuliaGeo and contributors"] version = "1.0.3" +authors = ["JuliaGeo and contributors"] [deps] GeoInterface = "cf35fbd7-0cd7-5166-be24-54bfbe79505f" +RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" [compat] GeoInterface = "1.5" -julia = "1.6" +RecipesBase = "1" +julia = "1.9" + +[extras] +Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["Plots", "Test"] diff --git a/GeoInterfaceRecipes/src/GeoInterfaceRecipes.jl b/GeoInterfaceRecipes/src/GeoInterfaceRecipes.jl index 72c7415..fda0024 100644 --- a/GeoInterfaceRecipes/src/GeoInterfaceRecipes.jl +++ b/GeoInterfaceRecipes/src/GeoInterfaceRecipes.jl @@ -1,12 +1,25 @@ module GeoInterfaceRecipes +using RecipesBase +using GeoInterface + +export @enable_geo_plots # This package is deprecated. Plotting recipes are now built into GeoInterface.jl # as package extensions. See: # - GeoInterfaceRecipesBaseExt for Plots.jl support # - GeoInterfaceMakieExt for Makie.jl support -# -# This empty package exists only to allow smooth upgrades for users who had + +# This stub package exists only to allow smooth upgrades for users who had # GeoInterfaceRecipes.jl installed. No action is needed - simply load # GeoInterface with Plots or Makie and the recipes will work automatically. +macro enable(typ) + :(GeoInterface.@enable_plots RecipesBase $(esc(typ))) +end + +# Compat +macro enable_geo_plots(typ) + :(GeoInterface.@enable_plots RecipesBase $(esc(typ))) +end + end diff --git a/GeoInterfaceRecipes/test/runtests.jl b/GeoInterfaceRecipes/test/runtests.jl index 8f4756c..3165d48 100644 --- a/GeoInterfaceRecipes/test/runtests.jl +++ b/GeoInterfaceRecipes/test/runtests.jl @@ -1,8 +1,97 @@ using GeoInterfaceRecipes +using GeoInterface +using Plots using Test -@testset "GeoInterfaceRecipes.jl" begin - # This is now an empty stub package. - # The actual recipes are in GeoInterface.jl extensions. - @test true + +abstract type MyAbstractGeom{N} end +# Implement interface +struct MyPoint{N} <: MyAbstractGeom{N} end +struct MyCurve{N} <: MyAbstractGeom{N} end +struct MyLinearRing{N} <: MyAbstractGeom{N} end +struct MyLineString{N} <: MyAbstractGeom{N} end +struct MyPolygon{N} <: MyAbstractGeom{N} end +struct MyMultiPoint{N} <: MyAbstractGeom{N} end +struct MyMultiCurve{N} <: MyAbstractGeom{N} end +struct MyMultiPolygon{N} <: MyAbstractGeom{N} end +struct MyCollection{N} <: MyAbstractGeom{N} end +struct MyFeature end +struct MyFeatureCollection end + +GeoInterfaceRecipes.@enable MyAbstractGeom +GeoInterfaceRecipes.@enable MyFeature +# Test legacy interface +GeoInterfaceRecipes.@enable_geo_plots MyFeatureCollection + +GeoInterface.isgeometry(::MyAbstractGeom) = true +GeoInterface.is3d(::GeoInterface.AbstractGeometryTrait, ::MyAbstractGeom{N}) where {N} = N == 3 +GeoInterface.ncoord(::GeoInterface.AbstractGeometryTrait, geom::MyAbstractGeom{N}) where {N} = N +GeoInterface.coordnames(::GeoInterface.AbstractGeometryTrait, ::MyAbstractGeom{2}) = (:X, :Y) +GeoInterface.coordnames(::GeoInterface.AbstractGeometryTrait, ::MyAbstractGeom{3}) = (:X, :Y, :Z) + +GeoInterface.geomtrait(::MyPoint) = GeoInterface.PointTrait() +GeoInterface.getcoord(::GeoInterface.PointTrait, geom::MyPoint{2}, i::Integer) = (rand(1:10), rand(11:20))[i] +GeoInterface.getcoord(::GeoInterface.PointTrait, geom::MyPoint{3}, i::Integer) = (rand(1:10), rand(11:20), rand(21:30))[i] + +GeoInterface.geomtrait(::MyCurve) = GeoInterface.LineStringTrait() +GeoInterface.ngeom(::GeoInterface.LineStringTrait, geom::MyCurve) = 3 +GeoInterface.getgeom(::GeoInterface.LineStringTrait, geom::MyCurve{N}, i) where {N} = MyPoint{N}() +GeoInterface.convert(::Type{MyCurve}, ::GeoInterface.LineStringTrait, geom) = geom + +GeoInterface.geomtrait(::MyLinearRing) = GeoInterface.LinearRingTrait() +GeoInterface.ngeom(::GeoInterface.LinearRingTrait, geom::MyLinearRing) = 3 +GeoInterface.getgeom(::GeoInterface.LinearRingTrait, geom::MyLinearRing{N}, i) where {N} = MyPoint{N}() +GeoInterface.convert(::Type{MyLinearRing}, ::GeoInterface.LinearRingTrait, geom) = geom + +GeoInterface.geomtrait(::MyLineString) = GeoInterface.LineStringTrait() +GeoInterface.ngeom(::GeoInterface.LineStringTrait, geom::MyLineString) = 3 +GeoInterface.getgeom(::GeoInterface.LineStringTrait, geom::MyLineString{N}, i) where {N} = MyPoint{N}() +GeoInterface.convert(::Type{MyLineString}, ::GeoInterface.LineStringTrait, geom) = geom + +GeoInterface.geomtrait(::MyPolygon) = GeoInterface.PolygonTrait() +GeoInterface.ngeom(::GeoInterface.PolygonTrait, geom::MyPolygon) = 2 +GeoInterface.getgeom(::GeoInterface.PolygonTrait, geom::MyPolygon{N}, i) where {N} = MyCurve{N}() + +GeoInterface.geomtrait(::MyMultiPolygon) = GeoInterface.MultiPolygonTrait() +GeoInterface.ngeom(::GeoInterface.MultiPolygonTrait, geom::MyMultiPolygon) = 2 +GeoInterface.getgeom(::GeoInterface.MultiPolygonTrait, geom::MyMultiPolygon{N}, i) where {N} = MyPolygon{N}() + +GeoInterface.geomtrait(::MyMultiPoint) = GeoInterface.MultiPointTrait() +GeoInterface.ngeom(::GeoInterface.MultiPointTrait, geom::MyMultiPoint) = 10 +GeoInterface.getgeom(::GeoInterface.MultiPointTrait, geom::MyMultiPoint{N}, i) where {N} = MyPoint{N}() + +GeoInterface.geomtrait(geom::MyCollection) = GeoInterface.GeometryCollectionTrait() +GeoInterface.ncoord(::GeoInterface.GeometryCollectionTrait, geom::MyCollection{N}) where {N} = N +GeoInterface.ngeom(::GeoInterface.GeometryCollectionTrait, geom::MyCollection) = 4 +GeoInterface.getgeom(::GeoInterface.GeometryCollectionTrait, geom::MyCollection{N}, i) where {N} = MyMultiPolygon{N}() + +GeoInterface.trait(::MyFeature) = FeatureTrait() +GeoInterface.trait(::MyFeatureCollection) = FeatureCollectionTrait() +GeoInterface.getfeature(::GeoInterface.FeatureCollectionTrait, geom::MyFeatureCollection, i) = MyFeature() +GeoInterface.getfeature(::GeoInterface.FeatureCollectionTrait, geom::MyFeatureCollection) = [MyFeature(), MyFeature()] +GeoInterface.geometry(geom::MyFeature) = rand((MyPolygon{2}(), MyMultiPolygon{2}())) +GeoInterface.nfeature(::GeoInterface.FeatureTrait, geom::MyFeature) = 1 + +@testset "plot" begin + # We just check if they actually run + # 2d + plot(MyPoint{2}()) + plot(MyCurve{2}()) + plot(MyLinearRing{2}()) + plot(MyLineString{2}()) + plot(MyMultiPoint{2}()) + plot(MyPolygon{2}()) + plot(MyMultiPolygon{2}()) + plot(MyCollection{2}()) + # 3d + plot(MyPoint{3}()) + plot(MyCurve{3}()) + plot(MyLinearRing{3}()) + plot(MyLineString{3}()) + plot(MyMultiPoint{3}()) + plot(MyPolygon{3}()) + plot(MyMultiPolygon{3}()) + plot(MyCollection{3}()) + plot(MyFeature()) + plot(MyFeatureCollection()) end