Skip to contents

Construct a layer-level gdal_creation_opts() object for the ESRI Shapefile driver.

Usage

shp_creation_opts(
  spatial_index = NULL,
  encoding = NULL,
  resize = NULL,
  shpt = NULL,
  two_gb_limit = NULL,
  auto_repack = NULL,
  dbf_date_last_update = NULL,
  dbf_eof_char = NULL,
  ...,
  .set_defaults = FALSE
)

Arguments

spatial_index

Value for SPATIAL_INDEX (logical -> "YES"/"NO"); create a .qix spatial index. GDAL default "NO".

encoding

Value for ENCODING (DBF encoding written to the .cpg/header). GDAL default "LDID/87".

resize

Value for RESIZE (logical -> "YES"/"NO"); resize fields to their optimal size. GDAL default "NO".

shpt

Value for SHPT (shape type override): one of NULL/POINT/ARC/POLYGON/ MULTIPOINT (2D), the *Z/*M/*ZM measured/3D variants, or MULTIPATCH.

two_gb_limit

Value for 2GB_LIMIT (logical -> "YES"/"NO"); enforce the 2 GB .shp/.dbf size limit. GDAL default "NO".

auto_repack

Value for AUTO_REPACK (logical -> "YES"/"NO"); auto-repack when needed. GDAL default "YES".

dbf_date_last_update

Value for DBF_DATE_LAST_UPDATE (YYYY-MM-DD); modification date written in the DBF header. Defaults to the current date.

dbf_eof_char

Value for DBF_EOF_CHAR (logical -> "YES"/"NO"); write the 0x1A end-of-file character in the .dbf. GDAL default "YES".

...

Additional NAME = value options passed through verbatim alongside the typed arguments. They are coerced and validated against the driver metadata in the same way, and take precedence over a typed argument that sets the same option.

.set_defaults

Logical. If TRUE, options left unset (NULL) are filled with the driver's documented GDAL metadata defaults (via the relevant gdal_vector_driver_*_opts_defaults()); user-supplied values always take precedence. Defaults to FALSE.

Value

A layer-level gdal_creation_opts() object for the ESRI Shapefile driver.

Examples

shp_creation_opts(spatial_index = TRUE, encoding = "UTF-8")
#> <gdal_creation_opts/gdal_opts>
#>  Driver: ESRI Shapefile
#>  Creation Options: SPATIAL_INDEX=YES, ENCODING=UTF-8
#>  Command Line: --output-format 'ESRI Shapefile' --layer-creation-option 'SPATIAL_INDEX=YES' --layer-creation-option 'ENCODING=UTF-8'