Skip to main content
6 events
when toggle format what by license comment
Oct 14, 2013 at 6:51 vote accept blueman010112
Oct 11, 2013 at 7:03 comment added blueman010112 I have add my pointlist and code in my post thanks for help!
Oct 11, 2013 at 5:59 comment added Jake @blueman010112: You're using the list comprehension wrong: [polygons for polygon in polygons] just repeats the polygons list as many times as there are coordinates in that list. If polygons is already a list of QgsPoints, all you have to do is QgsGeometry.fromMultiPolygon([[polygons]]). I don't understand why you want to use a MultiPolygon for this, though, since you only seem to have one polygon. Maybe it's best if you edit your question with an example of your data.
Oct 11, 2013 at 2:12 comment added blueman010112 I still have problem here, I use feature.setGeometry(QgsGeometry.fromMultiPolygon([polygons for polygon in polygons])) where polygons is a list of QgsPoints, but it's still give me same error before, so it's not a list of polygon?
Oct 10, 2013 at 7:38 vote accept blueman010112
Oct 11, 2013 at 5:14
Oct 9, 2013 at 8:00 history answered Jake CC BY-SA 3.0