I know you said no Python, but this is an easy code you can use in the Python console in QGIS, I will make the comments shown by # where you have to change some names according to your project.
- Change Your_shapefile for the name of your shapefile
- Change: ATTRIBUTE = the column name where you want to extract the polygon. Change: VALUE = the value you want to extract
- Change the path C:\Users\Extracted_values where you want to store the new shapefile, and keep the ending .shp
layers = QgsProject.instance().mapLayersByName("Your_shapefile") # Change Your_shapefile for the name of your shapefile
if len(layers) > 0:
layer = layers[0]
layer.selectByExpression('"ATTRIBUTE" = VALUE') # Change : ATTRIBUTE =
the column name where you want to extract the polygon. Change: VALUE = the value you want to extract
fn = r"C:\Users\Extracted_values.shp" # Change the path where you want to store the new shapefile
writer = QgsVectorFileWriter.writeAsVectorFormat(layer, fn, 'utf-8', driverName='ESRI Shapefile', onlySelected=True)
del writer
Selected_layer = iface.addVectorLayer(fn, '', 'ogr')
else:
print("Layer 'Your_shapefile' not found in the project.") #
ogr2ogr -f "ESRI Shapefile" type_1.shp input.shp -sql "select * from input where type=1"