Skip to content
Prev 23628 / 29559 Next

Adding spatial tables to existing SpatiaLite DBs

On Tue, 3 Nov 2015, Barry Rowlingson wrote:

            
No reported error in 1.1-1, but the original layer is overwritten. The 
layer in the existing dsn is overwritten. Appending is not something 
writeOGR knows about:
dataset_option="SPATIALITE=YES", layer_option="FORMAT=SPATIALITE")
dataset_option="SPATIALITE=YES", layer_option="FORMAT=SPATIALITE")
Error in writeOGR(pts, "tmpfile.db", "pts2", driver = "SQLite", 
dataset_option = "SPATIALITE=YES",  :
   layer exists, use a new layer name
[1] "pts2"
attr(,"driver")
[1] "SQLite"
attr(,"nlayers")
[1] 1

For now, system("ogr2ogr ..."), or something from gdalUtils? Contribution 
to writeOGR() to implement appending as in 
http://www.gdal.org/drv_sqlite.html?

Roger