da_read: Read Table with arcpy.da

Description Usage Arguments Details Value Examples

View source: R/tables.r

Description

Read a table (e.g. attribute table of a layer) with the arcpy.da module.

Usage

1
da_read(table.path, fields, simplify = TRUE)

Arguments

table.path

The file path to the table.

fields

A vector of field names or column indices to retrieve.

simplify

If TRUE, coerce the results to a data.frame. If FALSE, the results will be returned as a list of lists, with each top-level element corresponding to one row of the table.

Details

This implementation may be faster than accessing the @data slot of an object created from rgdal::readOGR in cases where there are a very large number of features. An additional advantage of da_read is that it can read raster attribute tables and stand-alone tables stored in file geodatabases, which is not supported by rgdal::readOGR.

Value

a dataframe with columns corresponding to fields.

Examples

1
2
3
4
5
6
7
8
## Not run: 
arcpy$env$workspace = tempdir()
arcpy$env$scratchWorkspace = tempdir()
fc = arcpy$management$CopyFeatures(system.file("CA_Counties",
  "CA_Counties_TIGER2016.shp", package = "arcpy"), "CA_Counties")
da_read(fc, c("COUNTYFP", "ALAND"))

## End(Not run)

mkoohafkan/arcpy documentation built on Aug. 9, 2020, 2:51 p.m.