| arc.write {arcgisbinding} | R Documentation |
Export a data.frame object to an ArcGIS dataset. If the data frame
includes a spatial attribute, this function writes a feature dataset. If no
spatial attribute is found, a table is instead written.
arc.write(path, data, coords = NULL, shape_info = NULL)
path |
full output path |
data |
input data frame. Accepts |
coords |
list containing geometry type and spatial reference (optional) |
shape_info |
(optional) |
Supports a variety of output formats. Below are pairs of example paths and the resulting data types:
C:/place.gdb/fc: File Geodatabase Feature Class
C:/place.gdb/fdataset/fc: File Geodatabase Feature Dataset
in_memory\logreg: In-memory workspace (must be run in ArcGIS Session)
C:/place.shp: Esri Shapefile
C:/place.dbf: Table
## write as a shapefile
fc <- arc.open(system.file("extdata", "ca_ozone_pts.shp",
package="arcgisbinding"))
d <- arc.select(fc, 'ozone')
d[1,] <- 0.6
arc.write(tempfile("ca_new", fileext=".shp"), d)
## write as table
arc.write(tempfile("tlb", fileext=".dbf"),
list('f1'=c(23,45), 'f2'=c('hello', 'bob')))
## from scratch as feature class
arc.write(tempfile("fc_pts", fileext=".shp"), list('data'=rnorm(100)),
list(x=runif(100,min=0,max=10),y=runif(100,min=0,max=10)),
list(type='Point'))