1

I noticed that with at least QGIS 3.14 (maybe earlier too) all objects are exported to shapefile as multi-geometry ie. points are exported as multipoints, lines as multiLines, etc, even if objects are internally stored as single-part geometry (after running multipart to single part). I simply noticed that when some of my GDAL-based scripts stopped working with new data processed with this version of QGIS. I consider it a bug. But I'm afraid it is a feature with some narrow-targeted explanations.

3
  • 3
    Shapefile doesn't support the concept of multi-geometry in lines or polygons (all lines and polygons are always potentially multi-part). It does support point/multipoint, because the file format is different (XY vs bnd,count,array of XY). Please Edit your Question to contain a question.
    – Vince
    Sep 27, 2020 at 14:28
  • Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works.
    – Ian Turton
    Sep 27, 2020 at 16:45
  • The question is correct and is answered below
    – jarekj71
    Sep 28, 2020 at 20:39

1 Answer 1

1

@Jarekj1 yes, I also noticed it trying to change a plugin from QGIS2 to 3, in QGIS3.4. I could notice that in QGIS2 it accepted simple geometries, but in 3 all of them are "apparently" generated as multipart.

Just in case, I put a conditional in my code if feature.geometry().isMultipart(): to handle the case that a simple geometry arrives, but it has not happened yet.

If you are writing code I advise you to consider that conditional. At least, until we find such a specification in the API or a CORE developer manifests it

If you want to handle multiparts with python in QGIS, just make the queries and we will guide you.

1
  • Thanks, that explains. Unfortunaltey .isMulipart is not gdal/ogr api but qgis. For gdal there is a different workaround (check geometry type)
    – jarekj71
    Sep 28, 2020 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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