QGIS 3 – Creating Nested Hex Grids for Advanced Cartography

cartographyhexagonal gridpolygon-creationqgis-3symbology

I'm looking to replicate the kind of map seen here, where there are essentially multiple hex grids nested inside one another.

map
Author : Kate Berg

That example was made in ArcGIS Pro, whereas I'm working in QGIS 3.20. I have gotten as far as creating a couple of separate hex grid layers and tried tinkering with the offsets of the top layer. However that only moves the top layer and doesn't have the shrinking effect I'm after.

Best Answer

Step 1. Create a grid with the "Create grid" geoalgorithm

step_1

Step 2. Use the "Geometry by expression" from the Processing Toolbox (Ctrl+Alt+T).

With the following expression:

make_regular_polygon(
    centroid($geometry),
    end_point(
        line_substring(
            make_line(
                point_on_surface(
                    boundary($geometry)
                    ),
                centroid($geometry)
                ),
            0,
            0.25 -- specify a step here 
            )
        ),
    6,
    0
    )

and get the output:

result1

In case if more hexagons are required apply the following expression:

collect_geometries(
    array_foreach(
        generate_series(
            0,
            distance(centroid($geometry), point_on_surface(boundary($geometry))),
            0.25 -- specify a step here
            ),
        make_regular_polygon(
            centroid($geometry),
            end_point(
                line_substring(
                    make_line(
                        point_on_surface(
                            boundary($geometry)
                            ),
                        centroid($geometry)
                        ),
                    0,
                    @element 
                    )
                ),
            6,
            0
            )
        )
    )

and get a corresponding answer:

result2

Keep in mind that each output feature is a MultiPolygon, so the application of the "Multipart to singleparts" tool can be useful.

single_part


References: