8

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:

  1. Open the Attribute Table for the current active layer;
  2. Select the first feature;
  3. Press Ctrl+P button (i.e. the "Pan map to the selected row" button);
  4. Minimize the Attribute Table;
  5. View something on the canvas for the current feature;
  6. 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:

  1. the related duplicated question doesn't have an accepted answer;
  2. 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).
  • 1
    You can have a look at the plugin "Item Browser". Its description seems to match your requirements. plugins.qgis.org/plugins/itembrowser – Germán Carrillo Feb 14 '17 at 19:19
  • Many thanks, @GermánCarrillo! I tried the plugin and it's really simple to use! – mgri Feb 14 '17 at 20:09
4

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:

selenext icons

  • Thanks Joseph, but can you find the plugin from the repository? – mgri Feb 13 '17 at 13:59
  • @mgri - Yes, it's not marked as experimental or depreciated...weird! Otherwise you can download it as a .zip file from the GitHub page, then extract it to your plugins folder. Note that you may need to change the folder name from selenext-master to just selenext =) – Joseph Feb 13 '17 at 14:04
  • 1
    @mgri - Most welcome! Hope it was helpful :) – Joseph Feb 13 '17 at 14:15
2

This functionality is now integrated in QGIS 3.10 (not sure about previous versions):

  1. Open the attribute table of the vector layer in question.
  2. Click on the Switch to form view icon on the bottom right of the attribute table.
  3. On the bottom left, just below the list of features, choose to either
    • Automatically pan to the current feature or
    • Automatically zoom to the current feature.
  4. (Optionally activate the Highlight current feature on map option.)
  5. You can then either click on the feature of interest or click on the left/right arrow to browse through the features.

Alternatively you can now also setup a keyboard shortcut to Edit previous/next feature in attribute table (respectively Ctrl+Alt+[ and Ctrl+Alt+] by default on my system; the keyboard shortcuts can be found under the Settings menu).

You may also want to use the Dock Attribute Table option for convenience.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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