1
在R中使用writeOGR()将多层写入GeoPackage?
我试图在R中的同一GeoPackage中写入多个图层,但出现错误Creation of output file failed。我试图搜索使用RGDAL读写.gpkg文件的文档,例如,弄清楚是否writeOGR()实际上支持多层,但收效甚微。如果可能的话,这怎么可能呢?最小的工作示例: library(sp) library(maptools) library(rgdal) data(wrld_simpl) norway <- wrld_simpl[wrld_simpl$NAME == "Norway", ] sweden <- wrld_simpl[wrld_simpl$NAME == "Sweden", ] file <- tempfile("scandinavia", fileext = c(".gpkg")) writeOGR(norway, dsn = file, layer = "norway", driver = "GPKG") writeOGR(sweden, dsn = file, layer = "sweden", driver = "GPKG") ogrListLayers(file) 显然,有一个可以完成技巧的ogr2ogr shell命令(hat …
11
gdal
r
rgdal
geopackage
sf