Bug report #16380

qgis.core.QgsGeometry has odd behaviour on pyqgis

Added by Patrice V about 7 years ago. Updated about 5 years ago.

Affected QGIS version:master Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:no timely feedback
Crashes QGIS or corrupts data:No Copied to github as #:24290



I use qgis-dev version on windows 7:
2.99.0-Master - 8b9e492

Using pyqgis, I get the following error when a try to create a multipolyline geometry from a list of list of QgsPoint :

test = qgis.core.QgsGeometry.fromMultiPolyline(multipoly)
TypeError: fromMultiPolyline(object): argument 1 has unexpected type 'list'

Also, when I do :
polygon = parentfet.geometry().asMultiPolygon()
qgis is dumping (the same code works on qgis 2.18)

Something is wrong with the pyqgis geometry class....



#1 Updated by Giovanni Manghi almost 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#2 Updated by Loïc BARTOLETTI over 5 years ago

Can you retry with newest version of QGIS 3?

Just trying:
test = QgsGeometry.fromMultiPolylineXY([[QgsPointXY(0, 0), QgsPointXY(1, 1), QgsPointXY(2, 2), QgsPointXY(0,0)], [QgsPointXY(10,0), QgsPointXY(11,1), QgsPointXY(12,2), QgsPointXY(10,0)]])
<QgsGeometry: MultiLineString ((0 0, 1 1, 2 2, 0 0),(10 0, 11 1, 12 2, 10 0))>

#3 Updated by Giovanni Manghi over 5 years ago

  • Description updated (diff)
  • Status changed from Open to Feedback

#4 Updated by Jürgen Fischer about 5 years ago

  • Resolution set to no timely feedback
  • Status changed from Feedback to Closed

Bulk closing 82 tickets in feedback state for more than 90 days affecting an old version. Feel free to reopen if it still applies to a current version and you have more information that clarify the issue.

Also available in: Atom PDF