[QGIS-trac] Re: [Quantum GIS] #2561: splitGeometry returns one part of the splitted line, instead of two

Quantum GIS qgis at qgis.org
Wed Mar 17 11:14:01 EDT 2010


#2561: splitGeometry returns one part of the splitted line, instead of two
--------------------------------------------------------------+-------------
        Reporter:  gislab                                     |         Owner:  nobody       
            Type:  bug                                        |        Status:  new          
        Priority:  critical: causes crash or data corruption  |     Milestone:  Version 1.5.0
       Component:  Vectors                                    |       Version:  HEAD         
      Resolution:                                             |      Keywords:               
Platform_version:                                             |      Platform:  Windows      
        Must_fix:  No                                         |   Status_info:  0            
--------------------------------------------------------------+-------------
Comment (by gislab):

 Overedited the code, sorry
 {{{
 cl = qgis.utils.iface.mapCanvas().currentLayer()
 selfeats = cl.selectedFeatures()
 geom0 = QgsGeometry(selfeats[0].geometry())
 geom1 = QgsGeometry(selfeats[1].geometry())
 pnt0=geom0.vertexAt(0)
 pnt1=geom0.vertexAt(1)
 pnts=[]
 pnts.append(pnt0)
 pnts.append(pnt1)
 (res, newlist, topolist) = geom1.splitGeometry(pnts, False)
 }}}

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