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

mapLayer.selectedFeatures(layer = NULL, geometry = FALSE, ...)

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

...

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.