Learn R Programming

slippymath (version 0.3.1)

bbox_tile_extent: bbox_tile_extent

Description

Convert a bounding box from latitude and longitude to tile numbers

Usage

bbox_tile_extent(bbox, zoom)

Arguments

bbox

a bbox object created by `sf::st_bbox`, or a vector with names 'xmin', 'xmax', 'ymin', 'ymax'

zoom

zoom level to calculate the tile grid on.

Value

a list of `x_min`, `y_min`, `x_max`, `y_max`

Details

This function creates an analog of a bounding box but in tile numbers. It returns the min and max x and y tile numbers for a tile grid that would fit the bounding box for a given zoom level.

Examples

Run this code
# NOT RUN {
tibrogargan<- c(xmin = 152.938485, ymin = -26.93345, xmax = 152.956467, 
               ymax = -26.921463)
bbox_tile_extent(tibrogargan, zoom = 15)
# }

Run the code above in your browser using DataLab