Closed mdsumner closed 4 years ago
library(dplyr) f <- tibble::tibble(fullname = fs::dir_ls(recurse = TRUE, ceramic::ceramic_cache(), type = "file", glob = "*.jpg")) %>% mutate(zoom = ceramic:::tile_zoom(fullname), tile_x = ceramic:::tile_x(fullname), tile_y = ceramic:::tile_y(fullname)) exts <- do.call(rbind, purrr::map(purrr::transpose(f), ~ceramic:::mercator_tile_extent(.x$tile_x, .x$tile_y, .x$zoom, 256))) f$xmin <- exts[, 1L, drop = TRUE] f$xmax <- exts[, 2L, drop = TRUE] f$ymin <- exts[, 3L, drop = TRUE] f$ymax <- exts[, 4L, drop = TRUE] files <- f %>% dplyr::filter(grepl("satellite", fullname), zoom == 6) library(ggimg) library(ggplot2) ggplot(files) + geom_img(aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, img = fullname))
yet again one for #32