Open ConnectedSystems opened 2 months ago
Would appreciate any input @evetion @asinghvi17 as I'm not so familiar with GeoMakie/GeoInterface internals.
Hey, thanks for the PR! In this case it's probably better to stick with the existing Makie machinery in e.g GeoInterfaceMakie, and maybe make an extension on that as well as regular Makie. I think Shapefile.jl does something similar, and GeoMakie loads GeoInterfaceMakie which brings all of these extensions as well.
The issue here, though, is that GeoDataFrames are not their own type, but rather a simple DataFrame. This means that there is no way to disambiguate between a GeoDataFrame and a regular dataframe. If we do create a GeoDataFrame type, even if just by wrapping a DataFrame and forwarding all possible method combinations, then this issue goes away and it's a lot easier to plot these.
Is there a fundamental difference between e.g. plot(gdf.geometry)
and plot(gdf, :geometry)
for your usecase? The number of characters is similar and IMO plot(gdf.geometry)
should already work with the GeoInterface/Makie/ArchGDAL integration. I also have a PR https://github.com/JuliaGeo/GeoInterface.jl/pull/139 which fixes plotting Vector{<: Missing, Geometry}
which is the last step to smooth integration. This plus my earlier PR should also remove the need to use eg GeoMakie.to_multipoly
since the Makie recipe for vectors of geometries calls that internally.
Draft PR for #66 - currently just a proof of concept.
There's currently some issue with GDAL.jl which prevents successful precompilation. I've resolved it temporarily with:
~Plotting certain types of polygons currently does not work!~ Now correctly supports points and multipolys but need to test with a wider variety of data.