Returns information about the ids and attributes of features of the given vector layer. If geometry is `TRUE, retrieves their geodata as well.

mapLayer.getFeatures(layer = NULL, geometry = FALSE, fid = NULL,
  rect = NULL, expr = NULL, ...)

Arguments

layer

layer (or ID of the layer) from which features should be retrieved. If not specified, defaults to the layer currently selected in QGIS.

geometry

if TRUE, return the features' geometry data on top of the attribute information

fid

the feature ID of the feature to retrieve

rect

boundary rectangle from which features should be retrieved (numeric vector of length four: xmin, ymin, xmax, ymax)

expr

a QGIS filter expression

...

low-level parameters (such as host and auth) to be passed on to qgisremote()

Value

If geometry is FALSE: a data frame of all features and their attributes, with the data frame's row names giving the respective QGIS-internal feature ids. If geometry is TRUE: a data frame of class sf.