Bug report #9138
QgsGeometry.convertToMultiType() fails
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Marco Hugentobler | ||
Category: | Vectors | ||
Affected QGIS version: | 2.0.1 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 17773 |
Description
I have a strange behavior with the QgsGeometry.convertToMultiType()
method here: it looks like the method is always failing the first
time, but getting success the second time is run:
In [1]: from qgis.core import *
In [2]: wkt = 'POLYGON((2283519.55884151300415397
4679066.13715541176497936,2283544.75336170010268688
4679033.60118563380092382,2283525.45749358925968409
4679011.69776777736842632,2283506.92586500011384487
4679037.65943400003015995,2283487.47002476220950484
4679065.54728745669126511,2283519.55884151300415397
4679066.13715541176497936))'
In [3]: polygon = QgsGeometry.fromWkt(wkt)
In [4]: polygon.convertToMultiType()
Out4: False
In [5]: print polygon.exportToWkt()
POLYGON((2283519.55884151300415397
4679066.13715541176497936,2283544.75336170010268688
4679033.60118563380092382,2283525.45749358925968409
4679011.69776777736842632,2283506.92586500011384487
4679037.65943400003015995,2283487.47002476220950484
4679065.54728745669126511,2283519.55884151300415397
4679066.13715541176497936))
In [6]: polygon.convertToMultiType()
Out6: True
In [7]: print polygon.exportToWkt()
MULTIPOLYGON(((2283519.55884151300415397
4679066.13715541176497936,2283544.75336170010268688
4679033.60118563380092382,2283525.45749358925968409
4679011.69776777736842632,2283506.92586500011384487
4679037.65943400003015995,2283487.47002476220950484
4679065.54728745669126511,2283519.55884151300415397
4679066.13715541176497936)))
Associated revisions
History
#1 Updated by Denis Rouzaud almost 11 years ago
#2 Updated by Denis Rouzaud almost 11 years ago
- Target version set to Future Release - High Priority
- Assignee set to Marco Hugentobler
- Status changed from Open to In Progress
- Category set to Vectors
#3 Updated by Marco Hugentobler almost 11 years ago
- Status changed from In Progress to Closed
Fixed in changeset 63c62adf213a9f1b1ba9cc07d4d7ae904e392503.