| arc.open {arcgisbinding} | R Documentation |
Open ArcGIS datasets, tables and layers. Returns a new
arc.dataset-class object which contains details on both the spatial
information and attribute information (data frame) contained within the dataset.
arc.open(path)
path |
file path or layer name |
An arc.dataset object
Feature Class: A collection of geographic features with the
same geometry type (i.e. point, line, polygon) and the same spatial reference,
combined with an attribute table. Feature classes can be stored in a variety
of formats, including: files (e.g. Shapefiles), Geodatabases, components
of feature datasets, and as coverages. All of these types can be accessed
using the full path of the relevant feature class (see note below on how to
specify path names).
Layer: A layer references a feature layer, but also includes
additional information necessary to symbolize and label a dataset appropriately.
arc.open supports active layers in the current ArcGIS session, which
can be addressed simply by referencing the layer name as it is displayed within
the application. Instead of referencing file layers on disk (i.e.
.lyr and .lyrx files), the direct reference to the actual dataset
should be used.
Table: Tables are effectively the same as data frames, containing
a collection of records (or observations) organized in rows, with columns
storing different variables (or fields). Feature classes similarly contain a
table, but include the additional information about geometries lacking in a
standalone table. When a standalone table is queries for its spatial information,
e.g. arc.shape(table), it will return NULL. Table data types include
formats such as text files, Excel spreadsheets, dBASE tables, and INFO tables.
Paths must be properly quoted for the Windows platform. There are two styles of paths that work within R on Windows:
Doubled backslashes, such as:
C:\\Workspace\\archive.gdb\\feature_class.
Forward-slashes such as:
C:/Workspace/archive.gdb/feature_class.
Network paths can be accessed with a leading
\\\\host\share or //host/share path.
To access tables and data within a Feature Dataset, reference the full path to
the dataset, which follows the structure:
<directory>/<Geodatabase Name>/<feature dataset name>/<dataset name>.
So for a table called table1 located in a feature dataset fdataset within
a Geodatabase called data.gdb, the full path might be:
C:/Workspace/data.gdb/fdataset/table1
ozone.file <- system.file("extdata", "ca_ozone_pts.shp",
package="arcgisbinding")
d <- arc.open(ozone.file)
cat('all fields:', names(d@fields), fill = TRUE) # print all fields