I'm working with QGIS 3.10 A Coruña on MacOS 10.13 environment. I have a vector polygon layer and I need to select features with a given attribute value and export them as a new shapefile. I'm a newbie in these matters and haven't get any further than
layer = qgis.utils.iface.mapCanvas().currentLayer()
request = QgsFeatureRequest(QgsExpression("CODNUT2 = 'ES24'"))
features = layer.getFeatures(request)
- What should be the next steps to generate the shapefile with those selected features?
- How to make it an iterative process to generate new shapefiles for every value in the
CODNUT2
attribute?