5

I'm performing a simple select by location. I want to select polygons from TQ_Building that fall within rapidair_AOI, a larger polygon. My workspace looks like this:

enter image description here

I'm using QGIS 2.18.13. I've performed this through the Vector > Research Tools > Select by location menu, and through the python console (see code below) but no selection is made and a dialog box with 'unknown See log for more details' appears.

import processing
mapcanvas = iface.mapCanvas()
layers = mapcanvas.layers()
processing.runalg('qgis:selectbylocation',layers[1],layers[0],u'within',0,0)

The layers share the same CRS, they are enetered correctly as input and intersect layers in the code. Any help / suggestions?

UPDATE: following @GeoDatup pointing me to log, here's the log message:

Uncaught error while executing algorithm Traceback (most recent call last): File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\core\GeoAlgorithm.py", line 203, in execute self.processAlgorithm(progress) File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\algs\qgis\SelectByLocation.py", line 93, in processAlgorithm index = vector.spatialindex(inputLayer) File "C:/PROGRA~1/QGIS2~1.18/apps/qgis/./python/plugins\processing\tools\vector.py", line 219, in spatialindex idx = QgsSpatialIndex(layer.getFeatures(request)) Exception: unknown

UPDATE 2017-11-03

The above was running QGIS 2.18.13 on Windows 2012 r2 server. I have also tried to replicate on my local Dell machine with the following results:

enter image description here

But there's no selection made in the mapviewer (which is what we'd expect given the second 0 parameter in the selectbylocation algorithm) and no extra polygons in the rapidair_AOI layer (used for the intersection enyway).

closed as off-topic by underdark Apr 20 at 12:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – underdark
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    logs can be viewed from menu View > panel > log message – Hugo Roussaffa - GeoDatup Nov 1 '17 at 19:34
  • Assuming you're using 2.18, that line only gets called when the processing setting "Use only selected features" is unchecked (Processing > Options > General > Use only selected Features). What happens if you turn on that setting and retry? – Steven Kay Nov 1 '17 at 20:34
  • "Use only selected features" was checked. I unchecked then get error box: 'Wrong value for parameter "Mysys folder": Specified path does not exist: C:/PROGRA~1/QGIS2~1.18/apps\mysys. This causes QGIS to hang. Force quite and re-open "Use only selected features" unchecked but selectbylocation statement has same non-result, same error msg. Will check Mysys folder. – mark Nov 1 '17 at 20:56
  • @StevenKay OK. Trying to follow C:/PROGRA~1/QGIS2~1.18/apps\mysys. Find "C:\Program Files\QGIS 2.18\apps" but no mysys ?file. – mark Nov 1 '17 at 20:59
  • So, the mysys error was related to GRASS mysys folder in Processing>Options>Providers. Have set to blank. Still faced with same selectbylocation error. – mark Nov 1 '17 at 21:43

Browse other questions tagged or ask your own question.