My script is -
# Find all multipart features in the active layer
l = iface.activeLayer()
iter = l.getFeatures()
geoms = []
for feature in iter:
geom = feature.geometry()
if geom.isMultipart():
l.select(feature.id())
geoms.append(geom)
print 'There are %i multipart features in this layer' % len(geoms)
I don't know the exact problem with this script. Using this script in the Python console should select all multi part features in the active layer but in my case no multi section polygons fetched, while I can easily see multi section polygons exists in my polygon file.
l.wkbType()
. If the value returned is6
then it is a multipolygon. You can check here for the wkb types.Vector > Geometry Tools > Singleparts to multipart
then try your code again. Also, if you want to notify someone, use the@
before their name so that they can receive a notification. I just stumbled back to this post by coincidence :)