qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.52k stars 2.99k forks source link

ftools: error in select by location #11729

Closed qgib closed 5 years ago

qgib commented 15 years ago

Author Name: bjpfei - (bjpfei -) Original Redmine Issue: 1669

Redmine category:python_plugins Assignee: cfarmer -


1.) open select by location

2.) choose two db-layers (seems that it doesn't matter if line or polygon

3.) ok

ftools version 0.5.9 You get a python error

"/home/bjsvwpfe/.qgis/python/plugins/fTools/tools/doSelectByLocation.py", line 61, in compute geomLayer = [[QgsGeometry]](feat.geometry()) [[TypeError]]: argument 1 of [[QgsGeometry]]() has an invalid type

thx

qgib commented 15 years ago

Author Name: Giovanni Manghi (@gioman)


I cannot replicate the python error (using ftools 0.5.10) under ubuntu 9.04/win xp and qgis 1.2 but I can produce and replicate qgis freeze using the same "select by location" tool.

Take the qgis sample dataset and pick a polygon layer (ex. grassland) and a line layer (ex. trails and majrivers): if I select features in grassland intersecting features in trails is all ok, if repeat the same but with majrivers instead of trails, than wgis freezes.

qgib commented 15 years ago

Author Name: Horst Düster (@hdus)


The error occurs when you use [[PostGIS]] Layer for the analysis. The following error is reported:

Traceback (most recent call last):
  File "/usr/local/qgis-trunk/share/qgis/python/plugins/fTools/tools/doSelectByLocation.py", line 52, in accept
    self.compute(inPoly, inPts, self.cmbModify.currentText())
  File "/usr/local/qgis-trunk/share/qgis/python/plugins/fTools/tools/doSelectByLocation.py", line 64, in compute
    geomLayer = [[QgsGeometry]](feat.geometry())
[[TypeError]]: argument 1 of [[QgsGeometry]]() has an invalid type
qgib commented 15 years ago

Author Name: Giovanni Manghi (@gioman)


Ok, confirmed also this error when using postgis layers:

An error has occured while executing Python code:

Traceback (most recent call last):
  File "/usr/local/share/qgis/python/plugins/fTools/tools/doSelectByLocation.py", line 52, in accept
    self.compute(inPoly, inPts, self.cmbModify.currentText())
  File "/usr/local/share/qgis/python/plugins/fTools/tools/doSelectByLocation.py", line 64, in compute
    geomLayer = [[QgsGeometry]](feat.geometry())
[[TypeError]]: argument 1 of [[QgsGeometry]]() has an invalid type

Python version:
2.6.2 (release26-maint, Apr 19 2009, 02:11:59) 
[GCC 4.3.3]

Python path:['/usr/local/share/qgis/python', '/home/gio/.qgis//python/plugins', '/usr/local/share/qgis/python/plugins', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/var/lib/python-support/python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/var/lib/python-support/python2.6/gtk-2.0', '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode', '/usr/local/lib/python2.6/dist-packages', '/usr/local/share/qgis/python/plugins/fTools/tools']
qgib commented 14 years ago

Author Name: Giovanni Manghi (@gioman)


All this issues are confirmed in the latest trunk qgis code.

qgib commented 14 years ago

Author Name: cfarmer - (cfarmer -)


Should be fixed in 67376a6e (SVN r13206)

-Carson


qgib commented 13 years ago

Author Name: bderstine - (bderstine -)


I seem to be getting a similar error when running on two very large polygon vector shapefiles (select features in a layer with 820,154 small footprint records, that intersect features in a layer with 7,766 large footprint records).
using fTools 0.5.10, qGIS 1.6.0:

An error has occured while executing Python code:

Traceback (most recent call last): File "C:\QUANTU~1\apps\qgis\python\plugins\fTools\tools\doSelectByLocation.py", line 53, in accept self.compute(inPoly, inPts, self.cmbModify.currentText()) File "C:\QUANTU~1\apps\qgis\python\plugins\fTools\tools\doSelectByLocation.py", line 78, in compute print len(intersects) IOError: [Errno 9] Bad file descriptor

Python version: 2.5.2 (c5cd2930 (SVN r253):60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]


qgib commented 13 years ago

Author Name: cfarmer - (cfarmer -)


Replying to [comment:7 bderstine]:

I seem to be getting a similar error when running on two very large polygon vector shapefiles: IOError: [Errno 9] Bad file descriptor

The above error is not related to the previously posted error, this 'new error' is a Windows IO problem that we have encountered before. This being the case, this issue has also already been resolved in trunk. Please ensure that you are in fact using the latest version of QGIS, and also the latest version of fTools (which is in fact the one installed by default). Looking at the source for the "select by location" tool, the offending print statement is no longer there in recent versions.

-Carson


qgib commented 13 years ago

Author Name: bderstine - (bderstine -)


Carson, thanks for the response. I was using the Standalone Installer of release 1.6.0, but have now switched to the OSGeo4W Installer using the qgis-dev package in order to get the nightly builds of trunk. It works great.