Sort all layers open in QGIS according to geometry in the QGIS layer list: points, lines and then polygons. Rasters will be sorted to the bottom of the list. Group and subgroup sorting can also be performed, using either feature count or alphabetically. An option is also avaiable to remove groups.
- Download the zip file stored here: https://github.com/vermeulendivan/layer-sorting/tree/main/plugin:
- Use the QGIS plugin installer to install the plugin: Plugins > Manage and install plugins;
- Select the Install from ZIP tab; and
- Select the zip file and click Install Plugin.
- Make a clone using the git:
- git clone https://github.com/vermeulendivan/layer-sorting;
- Go to the QGIS plugin folder: C:\Users\USER\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins;
- Create a folder "layer_sorting"; and
- Paste the cloned/downloaded files into the folder.
Sorting will be done as follows:
- Points;
- Lines;
- Polygons; and
- Rasters.
Opening the plugin:
The plugin window:
The user has two parameters to set:
- Sort type:
- Alphabetic: Layers in the root, groups, and subgroups will be sorted alphabetically (A to Z);
- Feature count: Sorts the layers according to feature count, with the layer with the least number of features at the top.
- Group by:
- Keep groups: All groups and subgroups will be used, with sorting applied within each of the groups;
- Remove groups: All layers within groups and subgroups will be moved to the root, and the groups will be removed.
Sort type will be applied to each type of geometry, and rasters individually. Geometry sorting is therefore preserved.