Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#1245 closed bug (fixed)

QgsFeature.setGeometry() does not work properly for MultiPolygons

Reported by: cfarmer Owned by: jef
Priority: major: does not work as expected Milestone:
Component: Vectors Version: Trunk
Keywords: setGeometry(), QgsFeature, MultiPolygon Cc:
Must Fix for Release: Yes Platform: Linux
Platform Version: Awaiting user input: no

Description

Using the following test, I get an unknown wkbType:

geom = feat.geometry() multi_geom = QgsGeometry() if geom.isMultipart():

multi_geom = geom.asMultiPolygon() temp_geom = QgsGeometry.fromMultiPolygon(multi_geom) #temp_geom has a wkbType of 6 (MultiPolygon) outfeat.setGeometry(temp_geom) check_geom = outfeat.geometry() #check_geom has a wkbType of 7 (Unknown)

Attachments (1)

MultiPoly.zip (1.8 KB ) - added by cfarmer 16 years ago.
Shapefile containing a single polygon and a multipolygon

Download all attachments as: .zip

Change History (4)

by cfarmer, 16 years ago

Attachment: MultiPoly.zip added

Shapefile containing a single polygon and a multipolygon

comment:1 by jef, 16 years ago

You're running GEOS 2.2.3. GEOSGeom_clone() doesn't seem to work on multipolygons there (QgsGeometry contained a work-around for that earlier).

Please test and close the bug if the problem is solved (I current don't have a machine with GEOS 2 and Qt >=4.3).

comment:2 by cfarmer, 16 years ago

Resolution: fixed
Status: newclosed

comment:3 by (none), 15 years ago

Milestone: Version 1.0.0

Milestone Version 1.0.0 deleted

Note: See TracTickets for help on using tickets.