5

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!

6
  • Which Version and what have you tried to find multi-part features?
    – Mapperz
    Oct 24, 2014 at 17:02
  • The version is 1.8.0 and what I tried is : 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. Oct 24, 2014 at 17:07
  • please put this info in your question to be re-opened.
    – Mapperz
    Oct 24, 2014 at 17:10
  • Ok, done.. sorry! Oct 24, 2014 at 17:52
  • If I recall this can be done with a simple field calculation in ArcGIS, but I don't know about QGIS. If you only want to identify them, you could make use of the Topology Checker plugin and use the 'must not have multi-part geometries' rule but I believe that will require a newer version of QGIS. If you're ok with breaking them up rather than just identifying, there's the multi-part to single-part tool, though again that may require a newer version.
    – Chris W
    Oct 24, 2014 at 21:02

1 Answer 1

4

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.

6
  • It seems that geomToWKT( $geometry ) gives NULL, I was looking up for a sort of reference to discover when this happens but I found nothing. can you please explain me this ? Oct 26, 2014 at 10:41
  • I suspect that's happening because of the older version (1.8). Why not upgrade to 2.4? Basic functionality the same but far, far more features and much better performance.
    – Simbamangu
    Oct 26, 2014 at 11:24
  • This is pretty much what I was thinking of for ArcGIS, except the expression uses !shape.isMultipart! - I didn't know how to do that in QGIS, and it appears the version might play a role as well.
    – Chris W
    Oct 26, 2014 at 20:07
  • I was trying avoid the version switching to keep the one which my Professor used during the lectures, but I ended up doing it anyway. Thank you very much. Oct 27, 2014 at 16:38
  • It's a pretty significant upgrade in terms of capability and performance - and I doubt that much will be different to the one used in your lectures. Thanks!
    – Simbamangu
    Oct 27, 2014 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.