Opened 14 years ago
Closed 14 years ago
#2324 closed bug (fixed)
Vector - Sum lines length crashes QGIS
Reported by: | gislab | Owned by: | cfarmer |
---|---|---|---|
Priority: | critical: causes crash or data corruption | Milestone: | Version 1.5.0 |
Component: | Python plugins and bindings | Version: | Trunk |
Keywords: | python, ftools | Cc: | dr, wonder |
Must Fix for Release: | No | Platform: | All |
Platform Version: | Awaiting user input: | no |
Description
Vector\Analysis\Sum lines length crashes QGIS with these two layers. This might be due to geographic CRS, but still, shouldn't crash.
Change History (10)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Component: | Vectors → Python plugins and bindings |
---|---|
Owner: | changed from | to
Platform: | Windows → All |
confirmed under linux. Terminal returns just "seg fault".
comment:3 by , 14 years ago
Cc: | added |
---|
Looks like this was caused by r12597. In http://trac.osgeo.org/qgis/browser/trunk/qgis/python/plugins/fTools/tools/doSumLines.py#L142 doSumLines:412 the output feature now takes ownership of the input polygon, although the input geometry still owns it. That way the geometry is freed twice, when compute
ends.
Following change cures that, but as that is probably not the only place with that construct, we'd probably be better of reverting the r12597. Ccing Martin.
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)
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r12627: only the copying setGeometry() is used. Thanks Juergen for pointing out.
comment:6 by , 14 years ago
Priority: | major: does not work as expected → critical: causes crash or data corruption |
---|
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.
comment:7 by , 14 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.
comment:8 by , 14 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.
comment:9 by , 14 years ago
Milestone: | Version 1.4.0 → Version 1.5.0 |
---|
test data
http://gis-lab.info/share/sumlines-crash.zip