arc.open | R Documentation |
Open ArcGIS datasets, tables, rasters 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 (character) or layer name (character) |
An arc.dataset-class
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.
rasters
: Rasters represent continuous geographic data in cells, or pixels, of equal size (square or rectangular). Spatial data represented on this rasters are also known as grided data. In contrast to spatial data structures represented in feature classes, rasters contain information on spatially continuous data.
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
arc.select
,
arc.raster
,
arc.write
## open feature
filename <- system.file("extdata", "ca_ozone_pts.shp",
package="arcgisbinding")
d <- arc.open(filename)
cat('all fields:', names(d@fields), fill = TRUE) # print all fields
## open raster
filename <- system.file("pictures", "logo.jpg", package="rgdal")
d <- arc.open(filename)
dim(d) # show raster dimension
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.