[QGIS-trac] [Quantum GIS] #1605: QgsGeometry().fromPolygon([[]]) crashes Qgis

Quantum GIS qgis at qgis.org
Tue Mar 31 10:11:53 EDT 2009


#1605: QgsGeometry().fromPolygon([[]]) crashes Qgis
---------------------------------------------------------+------------------
   Reporter:  Barryrowlingson                            |              Owner:  nobody
       Type:  bug                                        |             Status:  new   
   Priority:  critical: causes crash or data corruption  |          Milestone:        
  Component:  Vectors                                    |            Version:  1.0.0 
   Keywords:                                             |   Platform_version:        
   Platform:  Linux                                      |           Must_fix:  No    
Status_info:  0                                          |  
---------------------------------------------------------+------------------
 I can make a geometry like this:

 >>> pol = [ QgsPoint(0,0),QgsPoint(0,1),QgsPoint(1,1)]
 >>> QgsGeometry.fromPolygon([pol])
 <qgis.core.QgsGeometry object at 0x998aeac>

 but if I do:

 >>> pol = []
 >>> QgsGeometry.fromPolygon([pol])

  - crash:

  Fatal: ASSERT failure in QVector<T>::operator[]: "index out of range",
 file /usr/include/qt4/QtCore/qvector.h, line 320

  - this happened when a selection tool I wrote was trying to create a
 geometry from a list of coordinates that it hadn't filled yet. Carson
 Farmer had the same problem.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1605>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list