Search code examples
pythongeospatialspatialgeo

Fill polygon with Hexagons using Python


Is there a spatial Python Modul or a function within a spatial Modul, that lets one fill a Polygon with hexagons?

Something like this:

Hexagongrid

Source


Solution

  • Do you need specific regular hexagons like this? I would warn that while they look regular, the real size of hexagons differ, especially if you use Mercator projection here.

    If you don't care about specific hexagons, H3 is a library for hex grid. It is not regular like this one, but it can be used to fill whole globe, and it is more or less uniform in size (the sizes of hexagons still vary though). https://pypi.org/project/h3/