Saturday, 25 November 2017

QGIS's Select Features tools only work occasionally



I'm hoping someone can help me work out whether there's something I'm missing here or whether QGIS's Select Features tools are just really buggy.


I have a variety of polygon layers from shapefiles based on Australian geostatistical units. I've clipped these layers according to larger city-based polygons in order to create metropolitan cohorts. Now, I'm trying to copy and paste these cohort polygons into their own layers. So, I select the cohorts with a rectangular selection, then copy and paste into new layers.


Except it usually doesn't work. This isn't a case of the colours being similar; the copy option isn't available after I try to make a selection. And when it occasionally works, I can't work out what I've done to make it happen: sometimes I switch to another tool and back (eg. identify a feature, then switch back to the selection tools) and it works, sometimes it doesn't. Sometimes I switch to another application like my browser, and when I try again when I return it works fine. There doesn't seem to be any consistency to the behavior. I literally just made a successful selection, deselected, turned another layer on and back off, tried again and nothing happened.


Is there some sort of layer lock I'm not seeing that prevents interaction? Is it just a buggy tool? What am I missing? I'm using QGIS 2.12.1-Lyon of OS X.


EDIT: my workaround is to select features via the attribute table, which appears to work consistently. It's not ideal, though.


EDIT #2: nope, never mind—the attribute table doesn't work either. It highlights the features associated with the rows I select consistently, but Edit > Copy isn't enabled most of the time. Because they were highlighted and I was using the keyboard shortcut, I didn't realise this until I had a dozen incorrect layers pasted.



Answer



Unlike some other GIS programs, QGIS is heavily reliant on the layers panel to control inputs.


So to select from a layer you first need to highlight it in the layers panel. This makes the layer active and thus selectable.


This is also the same for copying features. Especially if you are selecting from the attribute table, you may still have a different layer active that it is trying to copy from.



So a methodological approach is best:



  1. Select the layer from the layers panel.

  2. Using the select tool select the features you want to copy.

  3. Choose Paste features as a new layer from the Edit menu.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...