rsbivand / rgrass

Interpreted interface between the GRASS geographical information system and R
https://rsbivand.github.io/rgrass/
26 stars 9 forks source link

readVECT() and sqlite #3

Closed TillF closed 6 years ago

TillF commented 6 years ago

I am trying to import a vector from GRASS: res <- readVECT("basin_t") and get the following error messages:

DBMI-SQLite driver error:
Error in sqlite3_prepare(): select * from basin_t where oid < 0
no such table: basin_t

FEHLER: Kann Tabelle <basin_t> nicht beschreiben.
DBMI-SQLite driver error:
Error in sqlite3_prepare(): select * from basin_t where oid < 0
no such table: basin_t

Error in rgdal::readOGR(dsn = RDSN, layer = LAYER, verbose = !ignore.stderr,  : 
  no features found
In addition: Warning message:
In ogrFIDs(dsn = dsn, layer = layer) : no features found

The vector map "basin_t" does not have the field "oid", but "cat", "value" and "label". When reading vectors that are connected to dbf-tables, everything runs smoothly. However, basin_t is connected to a sqlite-table. I tried to explicitly connect to the sqlite-db by executing execGRASS("db.connect", driver="sqlite", database="wasweissich") The error above stays the same. What am I doing wrong?

sessionInfo() R version 3.5.0 (2018-04-23) Platform: i386-w64-mingw32/i386 (32-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale: [1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] lumpR_2.4.11 rgeos_0.3-28 rgdal_1.3-2 RODBC_1.3-15 foreach_1.4.4
[6] xts_0.10-2 zoo_1.8-1 maptools_0.9-2 cluster_2.0.7-1 raster_2.6-7
[11] rgrass7_0.1-10 XML_3.98-1.11 sp_1.2-7

loaded via a namespace (and not attached): [1] Rcpp_0.12.16 lattice_0.20-35 codetools_0.2-15 grid_3.5.0 iterators_1.0.9 [6] tools_3.5.0 foreign_0.8-70 compiler_3.5.0

rsbivand commented 6 years ago

Always use the grass-stats list for user questions. This is not the right place. You are using 32-bit Windows GRASS, it may well be that drivers are not supported on that very legacy platform. If you post, you need to provide a replicable example on a platform that others have access to.