You could use a custom script containing the following function which essentially:
- Let's you select the master lot (in case you have more than one in your shapefile).
- Uses a spatial index to add all features (which intersect the master lot) to a list.
- Deselects the master lot.
- Selects all features which lie inside the master lot.
You can create a script from:
Processing Toolbox > Scripts > Tools > Create new script
Then use something like the following:
from qgis.core import QgsSpatialIndex
layer = processing.getObject(Polygon_layer)
# Create spatial index
index = QgsSpatialIndex()
# Get master lot
m_lot = layer.selectedFeatures()
for f in m_lot:
master_lot = f
# Iterate through all features and add to index
for feat in layer.getFeatures():
# List to find features which intersect master lot
id_list = index.intersects(master_lot.geometry().boundingBox())
# Remove master lot from list
# Deselect master lot
# Select features from id_list
Make sure the script is saved in your
/.qgis2/processing/scripts/ directory. Before you run the script, select the master lot from your layer.
A simple polygon containing smaller polygons inside.
Now we select the bigger polygon:
Then run the script to see the selected polygons inside: