imantha
1
I am wondering if there is a possibility to plot a shapefile loaded using GeoIO in map ?
using GeoIO
df_lo = GeoIO.load("data/processed/low/us_division_2018/us_division_2018.shp")
df_hi = GeoIO.load("data/processed/high/us_state_2018/us_state_2018.shp")
Here is the python code to do it …
df_lo = gpd.read_file("data/processed/low/us_division_2018/us_division_2018.shp")
df_hi = gpd.read_file("data/processed/high/us_state_2018/us_state_2018.shp")
fig, (ax1, ax2) = plt.subplots(ncols = 2, sharex = True, sharey = True)
df_lo.plot(ax = ax1, column = "area")
df_hi.plot(ax = ax2, column = "area")
fig.set_figheight(20)
fig.set_figwidth(20)
ax1.set_title("Low Resolution Boundaries")
ax2.set_title("High Resolution Boundaries")
plt.show()
TimG
2
1 Like
juliohm
3
TimG
4
Using a UK-based shapefile from ONS: Local Authority Districts (December 2023) Boundaries UK BFC
using GeoStats, GeoIO
import CairoMakie as Mke
plotdf = GeoIO.load("LAD_DEC_2023_UK_BGC.shp")
fig = Mke.Figure()
ax2 = Mke.Axis(fig[1, 1], aspect=Mke.DataAspect())
viz!(ax2, plotdf.geometry, color=1:nrow(plotdf), colormap=:lajolla)
Mke.display(fig)
You can control every aspect of the plot’s appearance in Makie.
2 Likes
juliohm
5
And if you need US boundaries from an open database, check GeoArtifacts.jl: