arc.write {arcgisbinding}R Documentation

Write dataset, table or layer

Description

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.

Usage

arc.write(path, data, coords = NULL, shape_info = NULL)

Arguments

path

full output path

data

input data frame. Accepts data.frame, spatial data.frame, SpatialPointsDataFrame, SpatialLinesDataFrame, and SpatialPolygonsDataFrame objects.

coords

list containing geometry type and spatial reference (optional)

shape_info

(optional)

Details

Supports a variety of output formats. Below are pairs of example paths and the resulting data types:

References

See Also

arc.dataset-class, arc.open

Examples

## 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'))

[Package arcgisbinding version 1.0.0.124 Index]