gpkg_write | R Documentation |
Write data to a GeoPackage
gpkg_write(
x,
destfile,
table_name = NULL,
datatype = "FLT4S",
append = FALSE,
overwrite = FALSE,
NoData = NULL,
gdal_options = NULL,
...
)
x |
Vector of source file path(s), or a list containing one or more SpatRaster, SpatRasterCollection, or SpatVectorProxy objects. |
destfile |
Character. Path to output GeoPackage |
table_name |
Character. Default |
datatype |
Data type. Defaults to |
append |
Append to existing data source? Default: |
overwrite |
Overwrite existing data source? Default |
NoData |
Value to use as GDAL |
gdal_options |
Additional |
... |
Additional arguments are passed as GeoPackage "creation options." See Details. |
Additional, non-default GeoPackage creation options can be specified
as arguments to this function. The full list of creation options can be
viewed
here
or in the gpkg_creation_options
dataset. The name of the argument is
creation_option
and the value is selected from one of the elements of
values
for that option.
If x
contains source file paths, any comma-separated value (CSV) files
are treated as attribute data–even if they contain a geometry column.
GeoPackage source file paths are always treated as vector data sources, and
only one layer will be read from the source and written to the target. If
you need to read raster data from a GeoPackage first create a SpatRaster
from the layer of interest (see gpkg_rast()
) before passing to
gpkg_write()
. If you need to read multiple layers from any multi-layer
source read them individually into suitable objects. For a source
GeoPackage containing multiple layers you can use gpkg_read()
(returns a
geopackage object) or gpkg_tables()
(returns a list object).
Logical. TRUE
on successful write of at least one grid.
gpkg_creation_options
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.