I often need to view on the canvas the (selected or not) features from the current active vector layer.
In this situation, I only need to view something on the canvas, without doing anything on the canvas itself (so, the active window is always the Attribute Table).
This is what I usually do:
- Open the Attribute Table for the current active layer;
- Select the first feature;
- Press Ctrl+P button (i.e. the "Pan map to the selected row" button);
- Minimize the Attribute Table;
- View something on the canvas for the current feature;
- Go to the first step until needed.
Is there a way (a method, a shortcut) for directly browsing every feature on the canvas without the needing of going backwards and forwards with the Attribute Table? I mean, something like a "next" button?
(I may use the workaround of splitting the windows of the Attribute Table and of the canvas within the monitor, or also docking the Atrribute Table, but I would like to work on the full QGIS window).
EDIT I saw that my question was casted as a duplicate of this question. The two questions are very similiar, but I think it should be left as open for two reasons:
- the related duplicated question doesn't have an accepted answer;
- my question is slightly different because I'm looking for the possibility of displaying only the selected features (and the @Joseph's answer, that I marked as accepted, answers well to my request).
Answer
One method is to download the selenext plugin from the menubar:
Plugins > Manage and Install Plugins...
Once download, modify the selenext.py file by replacing the following in both the run()
and runPrevious()
functions:
box = vlayer.boundingBoxOfSelected()
self.iface.mapCanvas().setExtent(box)
self.iface.mapCanvas().refresh()
with:
self.iface.actionPanToSelected().trigger()
Reload the plugin. Now whenever you click on the the next or previous icons, the canvas will pan to the selected feature:
No comments:
Post a Comment