get_regular_polygon_grid: Get regular QuadKey polygon grid derived from the bounding...

View source: R/regular_grid.R

get_regular_polygon_gridR Documentation

Get regular QuadKey polygon grid derived from the bounding box of the quadkey column of a data.frame.

Description

This function estimates the bounding box of the QuadKeys given in the quadkey column and adds the rows needed to complete a regular grid.

For a detailed explanation on how to use this and other similar quadkeyr functions, read the the vignette: https://docs.ropensci.org/quadkeyr/articles/facebook_mobility_csvs_to_raster_files.html

Usage

get_regular_polygon_grid(data)

Arguments

data

A data.frame with a quadkey column.

Value

A list with three elements:

  • data An sf POLYGON data.frame with all the QuadKeys within the bounding box of the quadkey column of a data.frame. Only the columns quadkey, tileX, tileY and geometry are returned.

  • num_rows The number of columns of the regular grid.

  • num_cols The number of rows of the regular grid.

Examples


# Data File
path <- paste0(
  system.file("extdata", package = "quadkeyr"),
  "/cityA_2020_04_15_0000.csv"
)
data <- read.csv(path)
data <- format_fb_data(data)

get_regular_polygon_grid(data = data)


quadkeyr documentation built on April 3, 2025, 8:52 p.m.