4

How can I convert a Multi Polygon GPKG to single Polygons using ogr2ogr? (I'm working in a Jupyter Hub environment without access to QGIS.)

1 Answer 1

6

ogr2ogr has an -explodecollections flag. Different name – same result.

ogr2ogr -explodecollections singlepart.gpkg multipart.gpkg

2
  • 2
    That is even documented gdal.org/programs/ogr2ogr.html "Produce one feature for each geometry in any kind of geometry collection in the source file, applied after any -sql option."
    – user30184
    Commented Jun 9, 2022 at 14:38
  • Thanks for the pointer, adding it to the answer. Commented Jun 9, 2022 at 14:39

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.