qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.54k stars 2.99k forks source link

Processing Toolbox - Split vector layer by ruled categories #44102

Open Intuos5 opened 3 years ago

Intuos5 commented 3 years ago

Feature description. It would be very helpful to be able to Split a Vector Layer by Ruled categories. This workflow would allow one to inspect and categorise data first before splitting it. It is also a tedious process of manually selecting certain features to export them to a new file. The rule based splitting could ease this process.

uclaros commented 3 years ago

You can create a virtual field to categorize your data, then use the Split vector layer algorithm to achieve what you describe.

Intuos5 commented 3 years ago

Yes, but that is a workaround, which could be drastically simplified (or automated) in my book. @uclaros

uclaros commented 3 years ago

Could you describe your simplified or automated proposed solution?

Intuos5 commented 3 years ago

Perhaps, QGIS could, as you suggested for the manual process, create some sort of temporary virtual field for the categories specified under the symbology tab. It would then split the vector layer based on the temporary virtual field values (the symbology categories) to separate vector layers. After which it would (optionally) remove the virtual field again. The virtual fields could optionally be included in the split layers, to allow for merging the features back to one layer if needed.

I am sure there is a better way of implementing Split Vector Layers by Category, since these are just some tentative outlines that do not take performance into account.