kaerosen / tilemaps

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

Extra features #3

Closed gjmcn closed 3 years ago

gjmcn commented 4 years ago

Great to see this algorithm implemented in R.

I worked on the tile map paper. After developing the original algorithm, we considered a couple of extra features:

1) Repel non-neighbors 2) Allow using the concave hull of the centroids rather than the original boundary

These were not added in time for the paper, but are included in the demos:

https://observablehq.com/@gjmcn/make-a-tile-map https://gjmcn.github.io/tile-maps-eurovis-demo/

I don't think these features are included in this package? If not, it might be nice to add them at some point?

kaerosen commented 4 years ago

Thanks for letting me know about these extra features! They are currently not included in this package, but I will definitely look into adding them in the future.

silpai commented 3 years ago

using this as R code: install.packages(c("tilemaps", "sf")) library(tilemaps) library(sf) library(dplyr) library(ggplot2) governors <- governors %>% mutate(tile_map = generate_map(geometry, square = FALSE, flat_topped = TRUE)) head(governors)

ggplot(governors) + geom_sf(aes(geometry = tile_map)) + geom_sf_text(aes(geometry = tile_map, label = abbreviation), fun.geometry = function(x) st_centroid(x)) + theme_void()

I am trying to build a Canadian Tile map. I got the geometry (lpr_000b16a_e.shp found https://open.canada.ca/data/en/dataset/47bd4f2e-1c77-49f8-8406-dc4dca64ee6b) from statistics Canada.

when I am using the R code above, I am getting this error: Error: Problem with mutate() input tile_map. x regions are not contiguous i Input tile_map is `generate_map(geometry, square = FALSE, flat_topped = TRUE)

How can I create a tile map of the Canada provinces?

kaerosen commented 3 years ago

Hi, I have opened a new issue (#4) to address this question.