View source: R/grid_to_polygon.R
grid_to_polygon | R Documentation |
The main argument of this function, the grid of
geographic coordinates (lat/long WG84) represents the upper-left
corner of the QuadKey.
To transform these coordinates into square polygons, the function
supplements the grid by adding a row and column of tiles. These points
introduce QuadKeys located at the border of the area using the internal
function complete_grid_for_polygons()
.
The function builds the polygons using all the points of the grid.
Note that it's possible to associate each QuadKey with its square polygon.
grid_to_polygon(data)
data |
A |
A sf POLYGON data.frame with a quadkey column.
grid <- create_qk_grid(
xmin = -59,
xmax = -57,
ymin = -35,
ymax = -34,
zoom = 11
)
grid_coords <- get_qk_coord(data = grid$data)
polygrid <- grid_to_polygon(grid_coords)
polygrid
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.