This function applies an OGR SQL query to obtain bounding coordinates of a table containing a geometry column. https://gdal.org/user/sql_sqlite_dialect.html and https://gdal.org/user/ogr_sql_dialect.html
gpkg_bbox(x, table_name, geom_column = "geom")
A geopackage object
character. One or more table names.
character. Geometry column name, default "geom"
a data.frame containing columns "xmin"
, "ymin"
, "xmax"
, "ymax"
# \donttest{
tf <- tempfile(fileext = ".gpkg")
r <- terra::rast(system.file("extdata", "dem.tif", package = "gpkg"))
v <- terra::as.polygons(r, ext = TRUE)
g <- geopackage(list(bbox = v))
gpkg_bbox(g, 'bbox')
#> xmin ymin xmax ymax
#> 1 6.008333 49.69167 6.266667 49.94167
# }