Thursday 27 April 2017

Discover multipart features in a layer in QGIS


I am trying to identify multipart features using QGIS version is 1.8.0.


I've tried:




  1. look at the attributes table

  2. select a random feature and check in the canvas if there are multiple geometries selected

  3. repeat until found one or all features have been examined


What I would like to check is something like a Boolean value in the Layer properties!



Answer



I'm on QGIS 2.4; not sure if this will work in 1.8!


Start an edit session on the layer and add a new field called multi - an integer, single-digit.


For the expression, enter:



CASE WHEN  geomToWKT( $geometry ) LIKE '%MULTI%' THEN 1 ELSE 0 END

This will give you a 1 for each row when it's a multi-part line or polygon.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...