Opened 14 years ago
Closed 14 years ago
#2430 closed bug (fixed)
Random points ftools issue
Reported by: | dr | Owned by: | cfarmer |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | Version 1.5.0 |
Component: | Python plugins and bindings | Version: | Trunk |
Keywords: | Random points, ftools | Cc: | dr, gislab, alexbruy |
Must Fix for Release: | No | Platform: | All |
Platform Version: | Awaiting user input: | no |
Description
- Open shapefile: http://gis-lab.info/data/vmap0/bounds-correct.7z;
- Try to put two random points with Random points tool;
At result I get an error:
An error has occured while executing Python code: Traceback (most recent call last): File "C:\OSGeo4W\apps\qgis-dev\python\plugins\fTools\tools\doRandPoints.py", line 123, in accept self.randomize(inLayer, outPath, minimum, design, value, self.progressBar) File "C:\OSGeo4W\apps\qgis-dev\python\plugins\fTools\tools\doRandPoints.py", line 209, in randomize else: bound = self.createSinglePolygon(inLayer, progressBar) File "C:\OSGeo4W\apps\qgis-dev\python\plugins\fTools\tools\doRandPoints.py", line 155, in createSinglePolygon geom = geom.combine(QgsGeometry( feat.geometry() )) AttributeError: 'NoneType' object has no attribute 'combine' Python version: 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]
Attachments (1)
Change History (7)
comment:1 by , 14 years ago
Owner: | changed from | to
---|
follow-up: 5 comment:3 by , 14 years ago
Got a different error:
Traceback (most recent call last): File "/usr/share/qgis/python/plugins/fTools/tools/doRandPoints.py", line 124, in accept self.randomize(inLayer, outPath, minimum, design, value) File "/usr/share/qgis/python/plugins/fTools/tools/doRandPoints.py", line 186, in randomize else: points = self.loopThruPolygons(inLayer, value, design) File "/usr/share/qgis/python/plugins/fTools/tools/doRandPoints.py", line 227, in loopThruPolygons value = sAtMap[index].toInt()[0] UnboundLocalError: local variable 'index' referenced before assignment
Versione Python: 2.6.5 (r265:79063, Mar 18 2010, 23:59:47) [GCC 4.4.3]
Strangely enough, this does not happen with some PC, for unknown reasons.
comment:5 by , 14 years ago
Replying to pcav:
Got a different error:
Traceback (most recent call last): File "/usr/share/qgis/python/plugins/fTools/tools/doRandPoints.py", line 124, in accept self.randomize(inLayer, outPath, minimum, design, value) File "/usr/share/qgis/python/plugins/fTools/tools/doRandPoints.py", line 186, in randomize else: points = self.loopThruPolygons(inLayer, value, design) File "/usr/share/qgis/python/plugins/fTools/tools/doRandPoints.py", line 227, in loopThruPolygons value = sAtMap[index].toInt()[0] UnboundLocalError: local variable 'index' referenced before assignment
Versione Python: 2.6.5 (r265:79063, Mar 18 2010, 23:59:47) [GCC 4.4.3]
Strangely enough, this does not happen with some PC, for unknown reasons.
I've found the issue: the reason is the used language. I'm writing a patch.
by , 14 years ago
Attachment: | randomPoint #2430 comment 3.diff added |
---|
patch to fix the error reported in the 3rd comment
comment:6 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I tested both under windows (xp) and linux and got no python errors, but the tool is way too slow: I waited something like 10 minutes just to see the progress bar arrive at 41% and then become apparently stuck.