如何使用st_write将sf对象作为shapefile写入文件地理数据库?
我不太了解st_write与文件地理数据库有关的'dsn','layer'和'driver'参数。
例如,我尝试了这两种方法,但没有运气
st_write(sf.object, dsn = "filepath/FileGeoDatabase.gbd",layer="name of output layer", driver="OpenFileGDB")
st_write(sf.object, dsn = "filepath/FileGeoDatabase.gbd",layer="name of output layer", driver="ESRI Shapefile")
sf
将数据另存为地理数据库外部的shapefile(或任何其他空间数据格式):library(sf)
## it will guess the driver automatically based on the .shp extension
st_write(sf.object, "data/my_shapefile.shp")
或者,如果您绝对需要在地理数据库中进行编写,则可以使用arcgisbinding
库,但是请注意,您将需要使用具有有效ArcGIS许可的计算机。因此,这在GNU / Linux和Mac上是行不通的。
由于我使用的是GNU / Linux,所以我无法验证这是否可行,但是应该遵循以下原则:
library(arcgisbinding) arc.write("data.gdb/fc", sf.object)
可以在
arcgisbinding
中找到R-ArcGIS Bridge(和here程序包的详细信息。