Read an ArcGIS layer (or table or ImageServer) and optionally encode domains
Source:R/arc_read_encode.R
arc_read_encode.Rd
Read an ArcGIS layer (or table or ImageServer) and optionally encode domains
Arguments
- url
The URL of the FeatureLayer, Table, or ImageServer.
- col_names
Default
TRUE
. Column names or name handling rule.col_names
can beTRUE
,FALSE
,NULL
, or a character vector:If
TRUE
, use existing default column names for the layer or table. IfFALSE
orNULL
, column names will be generated automatically: X1, X2, X3 etc.If
col_names
is a character vector, values replace the existing column names.col_names
can't be length 0 or longer than the number of fields in the returned layer.
- col_select
Default
NULL
. A character vector of the field names to be returned. By default, all fields are returned.- n_max
Defaults to
Inf
or an option set withoptions("arcgislayers.n_max" = <max records>)
. Maximum number of records to return.- name_repair
Default
"unique"
. Seevctrs::vec_as_names()
for details. Ifname_repair = NULL
andalias = "replace"
may include invalid names.- crs
the spatial reference to be returned. If the CRS is different than the CRS for the input FeatureLayer, a transformation will occur server-side. Ignored if x is a
Table
.- ...
Additional arguments passed to
arcgislayers::arc_select()
if URL is aFeatureLayer
orTable
orarcgislayers::arc_raster()
if URL is anImageLayer.
- fields
Default
NULL
a character vector of the field names to returned. By default all fields are returned. Ignored ifcol_names
is supplied.- alias
Use of field alias values. Default
c("drop", "label", "replace")
,. There are three options:"drop"
, field alias values are ignored."label"
: field alias values are assigned as a label attribute for each field."replace"
: field alias values replace existing column names.col_names
- token
your authorization token.
- encode_field_values
Logical, character vector, or list of character vectors.
FALSE
(the default): do not encode any fields.TRUE
: encode all fields that have coded-value domains.Specific field or list of fields to replace. Fields that do not have coded value domains are ignored.
- codes
Character scalar, one of
"replace"
or"label"
. Passed through toarcgislayers::encode_field_values()
to control whether domain labels replace the raw codes or just attach as an attribute.