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" diff --git a/ext/AvizExt/viz/spatial.jl b/ext/AvizExt/viz/spatial.jl index 6722e3e9a..2c783a017 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 @@ -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,