data source name (path to file, connection string, URL)
layer
integer of layer to work with, defaults to the first (0) or the name of the layer
sql
if not empty this is executed against the data source (layer will be ignored)
limit_n
an arbitrary limit to the number of features scanned
skip_n
an arbitrary number of features to skip
extent
apply an arbitrary extent, only when 'sql' used (must be 'ex = c(xmin, xmax, ymin, ymax)' but sp bbox, sf bbox, and raster extent also accepted)
Details
This may be virtual (created by GDAL for the SQL interface) and may be 0- or
1- based. Some drivers have actual names, and they are persistent and
arbitrary. Please use with caution, this function can return the current
FIDs, but there's no guarantee of what it represents for subsequent access.
An earlier version use 'OGRSQL' to obtain these names, which was slow for some
drivers and also clashed with independent use of the sql argument.