Bug report #9138

QgsGeometry.convertToMultiType() fails

Added by Paolo Corti almost 6 years ago. Updated almost 6 years ago.

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

Revision 63c62adf
Added by Marco Hugentobler almost 6 years ago

Merge pull request #1014 from 3nids/issue9138

fix #9138

History

#2 Updated by Denis Rouzaud almost 6 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 6 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF