From b77525087ce3ce6a13958d519ab7c71e3ba6cd44 Mon Sep 17 00:00:00 2001 From: Takuya Iwanaga Date: Fri, 18 Oct 2024 10:51:46 +1100 Subject: [PATCH 1/3] Use new multipoly helper from GeoMakie to handle polygon conversions --- ext/AvizExt/viz/spatial.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/AvizExt/viz/spatial.jl b/ext/AvizExt/viz/spatial.jl index 6722e3e9a..e038bc12d 100644 --- a/ext/AvizExt/viz/spatial.jl +++ b/ext/AvizExt/viz/spatial.jl @@ -4,21 +4,21 @@ using Graphs, GraphMakie, SimpleWeightedGraphs using ADRIA: _get_geom_col """ - _get_geoms(gdf::DataFrame) + _get_geoms(gdf::DataFrame, geom_col::Symbol) -Retrieve the vector of geometries from a GeoDataFrame. +Retrieve the vector of geometries from a specified column. """ -function _get_geoms(gdf::DataFrame) - return _get_geoms(gdf, _get_geom_col(gdf)) +function _get_geoms(gdf::DataFrame, geom_col::Symbol) + return GeoMakie.to_multipoly(gdf[:, geom_col]) end """ - _get_geoms(gdf::DataFrame, geom_col::Symbol) + _get_geoms(gdf::DataFrame) -Retrieve the vector of geometries from a specified column. +Retrieve the vector of geometries from a GeoDataFrame. """ -function _get_geoms(gdf::DataFrame, geom_col::Symbol) - return GeoMakie.geo2basic(AG.forceto.(gdf[!, geom_col], AG.wkbMultiPolygon)) +function _get_geoms(gdf::DataFrame) + return _get_geoms(gdf, _get_geom_col(gdf)) end function set_figure_defaults(fig_opts::OPT_TYPE)::OPT_TYPE From 746a80b2c0d8297a61640aa153f34180b85bdbb1 Mon Sep 17 00:00:00 2001 From: Takuya Iwanaga Date: Fri, 18 Oct 2024 10:52:05 +1100 Subject: [PATCH 2/3] Update expected type to re-enable spatial vizualisations --- ext/AvizExt/viz/spatial.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/AvizExt/viz/spatial.jl b/ext/AvizExt/viz/spatial.jl index e038bc12d..2c783a017 100644 --- a/ext/AvizExt/viz/spatial.jl +++ b/ext/AvizExt/viz/spatial.jl @@ -56,7 +56,7 @@ Create a spatial choropleth figure. # Arguments - `f` : Makie figure to create plot in -- `geodata` : FeatureCollection, Geospatial data to display +- `geodata` : MultiPolygon features to display - `data` : Values to use for choropleth - `highlight` : Stroke colors for each location - `show_colorbar` : Whether to show a colorbar (true) or not (false) @@ -69,7 +69,7 @@ Create a spatial choropleth figure. """ function create_map!( f::Union{GridLayout,GridPosition}, - geodata::Vector{<:GeoMakie.GeometryBasics.MultiPolygon}, + geodata::Vector{<:GeoMakie.MultiPolygon}, data::Observable, highlight::Union{Vector,Tuple,Nothing}, show_colorbar::Bool=true, From f02290e928e42ad06d1dd13eb949f601d4ebed3d Mon Sep 17 00:00:00 2001 From: Takuya Iwanaga Date: Fri, 18 Oct 2024 10:52:26 +1100 Subject: [PATCH 3/3] Update GeoMakie dependency to v0.7 --- Manifest-v1.11.toml | 2 +- Project.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Manifest-v1.11.toml b/Manifest-v1.11.toml index ed892f778..c586ab2ab 100644 --- a/Manifest-v1.11.toml +++ b/Manifest-v1.11.toml @@ -2,7 +2,7 @@ julia_version = "1.11.0" manifest_format = "2.0" -project_hash = "5f666870ec3ff1e90dbbe5c36b20f21f98fc4bb9" +project_hash = "0229aa1f09a15f438598d567849bd6194318dea1" [[deps.ARFFFiles]] deps = ["CategoricalArrays", "Dates", "Parsers", "Tables"] diff --git a/Project.toml b/Project.toml index fcd0b5f0c..73a49ba82 100644 --- a/Project.toml +++ b/Project.toml @@ -98,7 +98,7 @@ GDAL_jll = "301.900.0" GeoDataFrames = "0.3, 0.4" GeoFormatTypes = "0.4" GeoInterface = "1" -GeoMakie = "0.6" +GeoMakie = "0.7" GraphMakie = "0.5" Graphs = "1.4, 1.5" HypothesisTests = "0.10, 0.11"