I'm trying to draw a hex grid over a world map. The latter can be done easily enough with Geopandas:
import geopandas
import matplotlib.pyplot as plt
world = geopandas.read_file(geopandas.datasets.get_path("naturalearth_lowres"))
world.plot()
plt.savefig("world.png")
plt.show()
For the former, I get the impression H3 should be able to do it. I've got H3 installed, along with the Python bindings for it, and can now import h3
, but... well, I'm currently at what might be the 'step 2: draw the rest of the effing owl' stage, or might be just one or two lines of code that I'm missing. Searching for H3 documentation and tutorials, finds plenty of discussion on the merits of hexagons, on how to do all sorts of subtle calculations with H3, but I have not yet found anything that points out how to draw the actual hex grid.
So: how to use H3 to draw a hex grid over a Geopandas map? (For that matter, is H3 indeed the best tool for this job?)