Skip to content

Commit

Permalink
Merge pull request #884 from open-AIMS/makie-update
Browse files Browse the repository at this point in the history
Update code and dependencies to GeoMakie v0.7.x
  • Loading branch information
arlowhite authored Oct 22, 2024
2 parents f8a35ac + f02290e commit 15aea4c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Manifest-v1.11.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 10 additions & 10 deletions ext/AvizExt/viz/spatial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit 15aea4c

Please sign in to comment.