kaerosen / tilemaps

An R package for generating tile maps
https://kaerosen.github.io/tilemaps/
45 stars 1 forks source link

maintain contiguity of lower-level units #6

Closed schmert closed 1 month ago

schmert commented 6 months ago

{tilemaps} is a wonderful package. Thanks. I'm trying to use it to create a map of hexagons representing Sweden's 290 municipalities. Each municipality belongs to one of 21 counties, and I would like tiles belonging to the same county to be contiguous.

Just as an example, the attached map shows a typical municipality tilemap, with the municipalities belonging to Stockholm county in red. Is there any way to force generate_map to keep them together?

SWE-tiles

kaerosen commented 6 months ago

Currently the generate_map function doesn’t support any hierarchical structure of the data. My best suggestion for ensuring that all municipalities within a county are contiguous would be to generate a tile map for each county, and then compile all the maps together.

schmert commented 6 months ago

Thanks. That's what I suspected. I'll see what I can do with the one-county-at-a-time approach. Different sizes of tiles will be a problem.

Here's the first attempt: image