Package: quadkeyr 0.1.0

Florencia DAndrea

quadkeyr: Generate Raster Images from QuadKey-Identified Datasets

A set of functions of increasing complexity allows users to (1) convert QuadKey-identified datasets, based on 'Microsoft's Bing Maps Tile System', into Simple Features data frames, (2) transform Simple Features data frames into rasters, and (3) process multiple 'Meta' ('Facebook') QuadKey-identified human mobility files directly into raster files. For more details, see D’Andrea et al. (2024) <doi:10.21105/joss.06500>.

Authors:Florencia D'Andrea [aut, cre], Pilar Fernandez [aut], Maria Paula Caldas [rev], Vincent van Hees [rev], Andrew Pulsipher [ctb], CDC's Center for Forecasting and Outbreak Analytics [fnd], MIDAS-NIH COVID-19 urgent grant program [fnd], Paul G. Allen School for Global Health, Washington State University [cph]

quadkeyr_0.1.0.tar.gz
quadkeyr_0.1.0.zip(r-4.5)quadkeyr_0.1.0.zip(r-4.4)quadkeyr_0.1.0.zip(r-4.3)
quadkeyr_0.1.0.tgz(r-4.5-any)quadkeyr_0.1.0.tgz(r-4.4-any)quadkeyr_0.1.0.tgz(r-4.3-any)
quadkeyr_0.1.0.tar.gz(r-4.5-noble)quadkeyr_0.1.0.tar.gz(r-4.4-noble)
quadkeyr_0.1.0.tgz(r-4.4-emscripten)quadkeyr_0.1.0.tgz(r-4.3-emscripten)
quadkeyr.pdf |quadkeyr.html
quadkeyr/json (API)
NEWS

# Install 'quadkeyr' in R:
install.packages('quadkeyr', repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))

Reviews:rOpenSci Software Review #619

Bug tracker:https://github.com/ropensci/quadkeyr/issues

Pkgdown site:https://docs.ropensci.org

On CRAN:quadkeyr-0.1.0(2025-03-24)

Conda:

geospatialquadkeyrastertilemap

6.03 score 12 stars 7 scripts 9 downloads 26 exports 65 dependencies

Last updated 11 hours agofrom:07cc343b2d (on main). Checks:9 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesOKMar 25 2025
R-4.5-winOKMar 25 2025
R-4.5-macOKMar 25 2025
R-4.5-linuxOKMar 25 2025
R-4.4-winOKMar 25 2025
R-4.4-macOKMar 25 2025
R-4.4-linuxOKMar 25 2025
R-4.3-winOKMar 25 2025
R-4.3-macOKMar 25 2025

Exports:add_regular_polygon_gridapply_weekly_lagcreate_qk_gridcreate_stars_rasterformat_fb_dataget_qk_coordget_regular_polygon_gridgrid_to_polygonground_reslatlong_to_pixelXYlatlong_to_quadkeymapscalemapsizemissing_combinationspixelXY_to_latlongpixelXY_to_tileXYpolygon_to_rasterqkmap_appquadkey_df_to_polygonquadkey_to_latlongquadkey_to_polygonquadkey_to_tileXYread_fb_mobility_filesregular_qk_gridtileXY_to_pixelXYtileXY_to_quadkey

Dependencies:abindbase64encbitbit64bslibcachemclassclassIntclicliprcommonmarkcpp11crayonDBIdigestdplyre1071fansifastmapfontawesomefsgenericsgluehmshtmltoolshttpuvjquerylibjsonliteKernSmoothlaterlifecyclelubridatemagrittrMASSmemoisemimepillarpkgconfigprettyunitsprogresspromisesproxypurrrR6rappdirsRcppreadrrlangs2sasssfshinysourcetoolsstarstibbletidyselecttimechangetzdbunitsutf8vctrsvroomwithrwkxtable

quadkeyr

Rendered fromquadkeyr.Rmdusingknitr::rmarkdownon Mar 25 2025.

Last update: 2025-03-17
Started: 2025-03-17

Citation

To cite package ‘quadkeyr’ in publications use:

D'Andrea F, Fernandez P (2025). quadkeyr: Generate Raster Images from QuadKey-Identified Datasets. R package version 0.1.0, , https://github.com/ropensci/quadkeyr.

Corresponding BibTeX entry:

  @Manual{,
    title = {quadkeyr: Generate Raster Images from QuadKey-Identified
      Datasets},
    author = {Florencia D'Andrea and Pilar Fernandez},
    year = {2025},
    note = {R package version 0.1.0, },
    url = {https://github.com/ropensci/quadkeyr},
  }

Readme and manuals

quadkeyr

What can this package do for you?

The quadkeyr R package presents a comprehensive toolkit tailored for generating raster images from Quadkey-Identified data within Microsoft’s Bing Maps Tile System. Designed to integrate Quadkey-Identified data into R workflows, this package facilitates the creation of QuadKey grids and raster images and introduces specialized functions for the processing of Meta Mobility data, previously referred to as Facebook mobility data.

What are QuadKeys in Tile Maps?

Tile maps divide the Earth’s surface into a grid of tiles, with each tile corresponding to a specific geographic area at various zoom levels.

QuadKeys represent a location on a map by encoding its hierarchical spatial position as a sequence of characters. They provide an efficient method to address and retrieve specific map tiles, facilitating rapid display within mapping applications.

The QuadKey of any tile starts with the QuadKey of its parent tile (the containing tile at the previous level). Image extracted from Microsoft’s Bing Maps Tile System webpage.


The goal of quadkeyr is to:

  1. Convert a QuadKey to a Simple Features data.frame (and more) quadkeyr provides functions to convert a QuadKey to a sf POINT data.frame or sf POLYGON data.frame. Additionally, it offers all the R functions described in the official documentation for converting QuadKeys to and from tiles, pixels, and geographic coordinates.
  1. Generate Raster Images from Quadkey-Identified Data Complete a grid of QuadKeys within a specified area and zoom level, and create a stars raster. You can also directly convert QuadKeys in a data.frame column into an sf POLYGON data.frame.
  1. Convert Meta (Facebook) Mobility QuadKey-identified Datasets into Raster Files Convert Meta (Facebook) mobility data .csv files into .tif files by day and hour reported.
  1. Offer an App for visualizing QuadKeys on a map Introduce a QuadKey visualization application enabling users to validate function outcomes.

Install quadkeyr quadkeyr

R-Universe

For the latest development version of quadkeyr:

install.packages("quadkeyr",
                 repos = "https://ropensci.r-universe.dev")
GitHub

You can install the development version of quadkeyr from GitHub with:

# install.packages("remotes")
# remotes::install_github("ropensci/quadkeyr")
install.packages("quadkeyr", repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))
CRAN

You can install the latest version of quadkeyr from CRAN with:

install.packages("quadkeyr")

Code of Conduct

Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Contribute

If you’d like to contribute to this project, please follow the contributing guidelines

Links of interest

Help Manual

Help pageTopics
Add the rows needed to complete a regular QuadKey polygon grid derived from the bounding box of the 'quadkey' column of a data.frame.add_regular_polygon_grid
Apply a 7 day lag to the variable 'n_crisis'apply_weekly_lag
Create grid of QuadKeys for a particular zoom or level of detail.create_qk_grid
Create a 'stars' rastercreate_stars_raster
Format the Facebook mobility dataformat_fb_data
Get lat/long coordinates from the QuadKeyget_qk_coord
Get regular QuadKey polygon grid derived from the bounding box of the 'quadkey' column of a data.frame.get_regular_polygon_grid
Convert a grid of QuadKeys to square polygonsgrid_to_polygon
Ground resolution at a specified latitude and zoom levelground_res
Convert lat/long coordinates to pixel XY coordinateslatlong_to_pixelXY
Convert latitude/longitude coordinates into QuadKeyslatlong_to_quadkey
Map scale (1 : N)mapscale
Map size in pixelsmapsize
Detect dates and hours missing in filenamesmissing_combinations
Convert pixel XY coordinatess into lat/long coordinates.pixelXY_to_latlong
Convert pixel XY coordinates into tile XY coordinatespixelXY_to_tileXY
Create and save raster images for different dates and timespolygon_to_raster
Launch the Shiny Appqkmap_app
Convert data.frame with 'quadkey' column to a 'sf' POLYGON data.framequadkey_df_to_polygon
Convert a string of Quadkey numbers to lat/long coordinatesquadkey_to_latlong
Convert a QuadKey into a square polygonquadkey_to_polygon
Convert a QuadKey into tile XY coordinates.quadkey_to_tileXY
Read all the .csv files in a folder and format the data.read_fb_mobility_files
Convert a incomplete QuadKey 'sf' POINT data.frame into a regular grid.regular_qk_grid
Convert tile XY coordinates into pixel XY coordinatestileXY_to_pixelXY
Convert tile XY coordinates into a QuadKey.tileXY_to_quadkey