[QGIS-trac] Re: [Quantum GIS] #3159: invalid geometry in python console crashes qgis

Quantum GIS qgis at qgis.org
Mon Dec 13 15:42:59 EST 2010


#3159: invalid geometry in python console crashes qgis
--------------------------------------------------------------+-------------
        Reporter:  elpaso                                     |         Owner:  borysiasty   
            Type:  bug                                        |        Status:  closed       
        Priority:  critical: causes crash or data corruption  |     Milestone:  Version 1.7.0
       Component:  Python plugins and bindings                |       Version:  1.5.0        
      Resolution:  fixed                                      |      Keywords:               
Platform_version:  lucid lynx 64bit                           |      Platform:  Debian       
        Must_fix:  No                                         |   Status_info:  0            
--------------------------------------------------------------+-------------
Changes (by wonder):

  * status:  new => closed
  * resolution:  => fixed
  * milestone:  Version 1.6.0 => Version 1.7.0


Comment:

 The problem should be fixed in r14904 - there was an unhandled exception
 from GEOS - the WKT should read {{{POINT(9 45)}}} - with no comma between
 the coordinates.

 The whole correct code would be:
 {{{
 g = qgis.core.QgsGeometry.fromWkt('POINT(9 45)')
 f = qgis.core.QgsFeature()
 f.setGeometry(g)
 l=qgis.core.QgsVectorLayer("Point", "QPoint", "memory")
 l.dataProvider().addFeatures([f])
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/3159#comment:3>
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