Running examples in ‘gdalraster-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: GDALVector-class
> ### Title: Class encapsulating a vector layer in a GDAL dataset
> ### Aliases: GDALVector-class Rcpp_GDALVector Rcpp_GDALVector-class
> ###   GDALVector
> 
> ### ** Examples
> 
> ## MTBS fire perimeters in Yellowstone National Park 1984-2022
> f <- system.file("extdata/ynp_fires_1984_2022.gpkg", package = "gdalraster")
> 
> ## copy to a temporary file that is writeable
> dsn <- file.path(tempdir(), basename(f))
> file.copy(f, dsn)
[1] TRUE
> 
> (lyr <- new(GDALVector, dsn, "mtbs_perims"))
C++ object of class GDALVector
 Driver : GeoPackage (GPKG)
 DSN    : /tmp/Rtmpm8zYp6/ynp_fires_1984_2022.gpkg
 Layer  : mtbs_perims
 CRS    : NAD83 / Montana (EPSG:32100)
 Geom   : MULTIPOLYGON
> 
> str(lyr)
Reference class 'Rcpp_GDALVector' [package "gdalraster"] with 11 fields
 $ arrowStreamOptions: chr ""
 $ convertToLinear   : logi FALSE
 $ defaultGeomColName: chr "geom"
 $ m_dialect         : chr ""
 $ m_is_sql          : logi FALSE
 $ m_layer_name      : chr "mtbs_perims"
 $ promoteToMulti    : logi FALSE
 $ quiet             : logi FALSE
 $ returnGeomAs      : chr "WKB"
 $ transactionsForce : logi FALSE
 $ wkbByteOrder      : chr "LSB"
 and 73 methods, of which 59 are  possibly relevant:
   OGRFeatureFromList_dumpReadble, batchCreateFeature, bbox,
   clearSpatialFilter, close, commitTransaction, createFeature, deleteFeature,
   fetch, finalize, getArrowStream, getAttributeFilter, getDriverLongName,
   getDriverShortName, getDsn, getFIDColumn, getFeature, getFeatureCount,
   getFieldDomain, getFieldNames, getFileList, getGeomType, getGeometryColumn,
   getIgnoredFields, getLastWriteFID, getLayerDefn, getMetadata,
   getMetadataItem, getName, getNextFeature, getSpatialFilter, getSpatialRef,
   info, initialize, isOpen, layerClip, layerErase, layerIdentity,
   layerIntersection, layerSymDifference, layerUnion, layerUpdate, open,
   releaseArrowStream, resetReading, rollbackTransaction, setAttributeFilter,
   setFeature, setIgnoredFields, setMetadata, setNextByIndex,
   setSelectedFields, setSpatialFilter, setSpatialFilterRect, show#envRefClass,
   startTransaction, syncToDisk, testCapability, upsertFeature
> 
> ## dataset info
> lyr$getDriverShortName()
[1] "GPKG"
> lyr$getDriverLongName()
[1] "GeoPackage"
> lyr$getFileList()
[1] "/tmp/Rtmpm8zYp6/ynp_fires_1984_2022.gpkg"
> 
> ## layer info
> lyr$getName()
[1] "mtbs_perims"
> lyr$getGeomType()
[1] "MULTIPOLYGON"
> lyr$getGeometryColumn()
[1] "geom"
> lyr$getFIDColumn()
[1] "fid"
> lyr$getSpatialRef()
[1] "PROJCS[\"NAD83 / Montana\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6269\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4269\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"latitude_of_origin\",44.25],PARAMETER[\"central_meridian\",-109.5],PARAMETER[\"standard_parallel_1\",49],PARAMETER[\"standard_parallel_2\",45],PARAMETER[\"false_easting\",600000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH],AUTHORITY[\"EPSG\",\"32100\"]]"
> lyr$bbox()
[1] 469685.73 -12917.76 573531.72  96577.34
> 
> ## layer capabilities
> lyr$testCapability()
$RandomRead
[1] TRUE

$SequentialWrite
[1] FALSE

$RandomWrite
[1] FALSE

$UpsertFeature
[1] FALSE

$FastSpatialFilter
[1] TRUE

$FastFeatureCount
[1] TRUE

$FastGetExtent
[1] TRUE

$FastSetNextByIndex
[1] TRUE

$FastGetArrowStream
[1] TRUE

$FastWriteArrowBatch
[1] FALSE

$CreateField
[1] FALSE

$CreateGeomField
[1] FALSE

$DeleteField
[1] FALSE

$ReorderFields
[1] FALSE

$AlterFieldDefn
[1] FALSE

$AlterGeomFieldDefn
[1] FALSE

$IgnoreFields
[1] TRUE

$DeleteFeature
[1] FALSE

$Rename
[1] FALSE

$StringsAsUTF8
[1] TRUE

$CurveGeometries
[1] TRUE

> 
> ## re-open with write access
> lyr$open(read_only = FALSE)
> lyr$testCapability()$SequentialWrite
[1] TRUE
> lyr$testCapability()$RandomWrite
[1] TRUE
> 
> ## feature class definition - a list of field names and their definitions
> defn <- lyr$getLayerDefn()
> names(defn)
 [1] "event_id"     "incid_name"   "incid_type"   "map_id"       "burn_bnd_ac" 
 [6] "burn_bnd_lat" "burn_bnd_lon" "ig_date"      "ig_year"      "geom"        
> str(defn)
List of 10
 $ event_id    :List of 9
  ..$ type       : chr "OFTString"
  ..$ subtype    : chr "OFSTNone"
  ..$ width      : int 254
  ..$ precision  : int 0
  ..$ is_nullable: logi TRUE
  ..$ is_unique  : logi FALSE
  ..$ default    : chr ""
  ..$ domain     : chr ""
  ..$ is_geom    : logi FALSE
 $ incid_name  :List of 9
  ..$ type       : chr "OFTString"
  ..$ subtype    : chr "OFSTNone"
  ..$ width      : int 254
  ..$ precision  : int 0
  ..$ is_nullable: logi TRUE
  ..$ is_unique  : logi FALSE
  ..$ default    : chr ""
  ..$ domain     : chr ""
  ..$ is_geom    : logi FALSE
 $ incid_type  :List of 9
  ..$ type       : chr "OFTString"
  ..$ subtype    : chr "OFSTNone"
  ..$ width      : int 254
  ..$ precision  : int 0
  ..$ is_nullable: logi TRUE
  ..$ is_unique  : logi FALSE
  ..$ default    : chr ""
  ..$ domain     : chr ""
  ..$ is_geom    : logi FALSE
 $ map_id      :List of 9
  ..$ type       : chr "OFTInteger64"
  ..$ subtype    : chr "OFSTNone"
  ..$ width      : int 0
  ..$ precision  : int 0
  ..$ is_nullable: logi TRUE
  ..$ is_unique  : logi FALSE
  ..$ default    : chr ""
  ..$ domain     : chr ""
  ..$ is_geom    : logi FALSE
 $ burn_bnd_ac :List of 9
  ..$ type       : chr "OFTInteger64"
  ..$ subtype    : chr "OFSTNone"
  ..$ width      : int 0
  ..$ precision  : int 0
  ..$ is_nullable: logi TRUE
  ..$ is_unique  : logi FALSE
  ..$ default    : chr ""
  ..$ domain     : chr ""
  ..$ is_geom    : logi FALSE
 $ burn_bnd_lat:List of 9
  ..$ type       : chr "OFTString"
  ..$ subtype    : chr "OFSTNone"
  ..$ width      : int 10
  ..$ precision  : int 0
  ..$ is_nullable: logi TRUE
  ..$ is_unique  : logi FALSE
  ..$ default    : chr ""
  ..$ domain     : chr ""
  ..$ is_geom    : logi FALSE
 $ burn_bnd_lon:List of 9
  ..$ type       : chr "OFTString"
  ..$ subtype    : chr "OFSTNone"
  ..$ width      : int 10
  ..$ precision  : int 0
  ..$ is_nullable: logi TRUE
  ..$ is_unique  : logi FALSE
  ..$ default    : chr ""
  ..$ domain     : chr ""
  ..$ is_geom    : logi FALSE
 $ ig_date     :List of 9
  ..$ type       : chr "OFTDate"
  ..$ subtype    : chr "OFSTNone"
  ..$ width      : int 0
  ..$ precision  : int 0
  ..$ is_nullable: logi TRUE
  ..$ is_unique  : logi FALSE
  ..$ default    : chr ""
  ..$ domain     : chr ""
  ..$ is_geom    : logi FALSE
 $ ig_year     :List of 9
  ..$ type       : chr "OFTInteger"
  ..$ subtype    : chr "OFSTNone"
  ..$ width      : int 0
  ..$ precision  : int 0
  ..$ is_nullable: logi TRUE
  ..$ is_unique  : logi FALSE
  ..$ default    : chr ""
  ..$ domain     : chr ""
  ..$ is_geom    : logi FALSE
 $ geom        :List of 4
  ..$ type       : chr "MULTIPOLYGON"
  ..$ srs        : chr "PROJCS[\"NAD83 / Montana\",GEOGCS[\"NAD83\",DATUM[\"North_American_Datum_1983\",SPHEROID[\"GRS 1980\",6378137,2"| __truncated__
  ..$ is_nullable: logi TRUE
  ..$ is_geom    : logi TRUE
> 
> ## default value of the read/write field 'returnGeomAs'
> lyr$returnGeomAs
[1] "WKB"
> 
> lyr$getFeatureCount()
[1] 61
> 
> ## sequential read cursor
> # a single feature returned as a named list of fields and their values:
> (feat <- lyr$getNextFeature())
OGR feature
$FID
integer64
[1] 1

$event_id
[1] WY4413411069519870807

$incid_name
[1] POLECAT

$incid_type
[1] Wildfire

$map_id
integer64
[1] 10015934

$burn_bnd_ac
integer64
[1] 1093

$burn_bnd_lat
[1] 44.132

$burn_bnd_lon
[1] -110.696

$ig_date
[1] 1987-08-07

$ig_year
[1] 1987

$geom
[1] WKB MULTIPOLYGON: raw 01 06 00 00 ...

> 
> ## set an attribute filter
> lyr$setAttributeFilter("ig_year = 2020")
> lyr$getFeatureCount()
[1] 1
> 
> feat <- lyr$getNextFeature()
> plot(feat)
Error: Package 'vctrs' is required for wk_plot()
Execution halted