Bug report #2324

Vector - Sum lines length crashes QGIS

Added by Maxim Dubinin almost 11 years ago. Updated over 10 years ago.

Status:Closed
Priority:Low
Assignee:cfarmer -
Category:Python plugins
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:12384

Description

Vector\\Analysis\\Sum lines length
crashes QGIS with these two layers. This might be due to geographic CRS, but still, shouldn't crash.

Associated revisions

Revision 4eb76e6c
Added by Martin Dobias almost 11 years ago

Fix #2324.

git-svn-id: http://svn.osgeo.org/qgis/trunk/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 8241b607
Added by Martin Dobias almost 11 years ago

Fix #2324.

git-svn-id: http://svn.osgeo.org/qgis/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 40a8a49f
Added by Jürgen Fischer over 10 years ago

fix #2324

git-svn-id: http://svn.osgeo.org/qgis/trunk/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 27e451ce
Added by Jürgen Fischer over 10 years ago

fix #2324

git-svn-id: http://svn.osgeo.org/qgis/[email protected] c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#2 Updated by Giovanni Manghi almost 11 years ago

confirmed under linux. Terminal returns just "seg fault".

#3 Updated by Jürgen Fischer almost 11 years ago

Following change cures that, but as that is probably not the only place with that construct, we'd probably be better of reverting the commit:7d175fb9 (SVN r12598).  Ccing Martin.

<pre>
Index: python/plugins/fTools/tools/doSumLines.py
===================================================================
--- python/plugins/fTools/tools/doSumLines.py   (revision 12612)
+++ python/plugins/fTools/tools/doSumLines.py   (working copy)
@@ -139,7 +139,7 @@
                                        if inGeom.intersects(i.geometry()):
                                                outGeom = inGeom.intersection(i.geometry())
                                                length = length + distArea.measure(outGeom)
-                       outFeat.setGeometry(inGeom)
+                       outFeat.setGeometry( [[QgsGeometry]](inGeom) )
                        outFeat.setAttributeMap(atMap)
                        outFeat.addAttribute(index, QVariant(length))
                        writer.addFeature(outFeat)
</pre>

#4 Updated by Martin Dobias almost 11 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Fixed in 8241b607 (SVN r12628): only the copying setGeometry() is used. Thanks Juergen for pointing out.

#5 Updated by dr - over 10 years ago

  • Status changed from Closed to Feedback
  • Resolution deleted (fixed)

bug is not fixed

#6 Updated by Giovanni Manghi over 10 years ago

This is right on the money, I just found two layers you can download here

http://mapserver.uevora.pt/~mapserver/

that do always crash qgis when the "sum line lenghts" operation is done.

In the terminal I get only a "seg fault" message.

#7 Updated by Giovanni Manghi over 10 years ago

Well,
in the case of the layers I posted it turns that if I save them in another projection (ie epsg 3763) the operation goes well. Weird.

#8 Updated by Giovanni Manghi over 10 years ago

Moreover there are other projection (ie epsg 20790) that I can use to save the original layers that cause qgis crash when the "sum line lenghts" operation is done.

#9 Updated by Jürgen Fischer over 10 years ago

  • Resolution set to fixed
  • Status changed from Feedback to Closed

fixed in 27e451ce (SVN r13725).

Also available in: Atom PDF