[R-sig-Geo] rgdal sqlite does not work in QGIS

Suarez-Soto, Rene J. (ATSDR/DCHI/SSB) eta6 at cdc.gov
Mon Jan 30 02:20:25 CET 2017


I am trying to save some spatial dataframes to a spatialite database that I want to use in QGIS. Every time I try to connect to the database in QGIS I get a "failed to check metadata error". I am using QGIS 2.18.2 and some of the R sessioninfo is below.

I tried using the following example and sample data from rgdal and I get the same erroring QGIS

library(rgdal)
data(nor2k)
rgdal::writeOGR(obj = nor2k, dsn = "geodatabase.sqlite", layer = "norwegian_peaks", overwrite_layer = TRUE, driver = "SQLite")

R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
rgdal version 1.2.5

I tried creating a SpatiaLite database in QGIS and reading it in R using readOGR and it works fine. I see some examples online where writeOGR have the following parameters:

dataset_option="SPATIALITE=YES", layer_option="FORMAT=SPATIALITE"

but it does not seem to work. Any ideas would be appreciated.


	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list