<div dir="ltr">Hi Paolo, <br><br><div class="gmail_extra"><div class="gmail_quote">On Thu, Nov 28, 2013 at 10:03 PM, Paolo Corti <span dir="ltr"><<a href="mailto:pcorti@gmail.com" target="_blank">pcorti@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I have a strange behavior with the QgsGeometry.convertToMultiType()<br>
method here: it looks like the method is always failing the first<br>
time, but getting success the second time is run:<br></blockquote><div><br></div><div>I already got a similar behaviour and I tried to fix it anywhere in <br>QgsGeometry class one year ago (see d8ca9193b1)... but maybe I miss <br>

some cases or something was changed from that date.<br><br></div><div>GeosGeometry and WKBGeometry are not synced, that's it.<br></div><div><br>Try to call  polygon.convertToMultiType() multiple times without exportToWkt().<br>

</div><div>I'm quite sure you will get false all  the times.<br><br></div><div>File a ticket, please.<br></div><div>Cheers.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



In [1]: from qgis.core import *<br>
<br>
In [2]: wkt = 'POLYGON((2283519.55884151300415397<br>
4679066.13715541176497936,2283544.75336170010268688<br>
4679033.60118563380092382,2283525.45749358925968409<br>
4679011.69776777736842632,2283506.92586500011384487<br>
4679037.65943400003015995,2283487.47002476220950484<br>
4679065.54728745669126511,2283519.55884151300415397<br>
4679066.13715541176497936))'<br>
<br>
In [3]: polygon = QgsGeometry.fromWkt(wkt)<br>
<br>
In [4]: polygon.convertToMultiType()<br>
Out[4]: False<br>
<br>
In [5]: print polygon.exportToWkt()<br>
POLYGON((2283519.55884151300415397<br>
4679066.13715541176497936,2283544.75336170010268688<br>
4679033.60118563380092382,2283525.45749358925968409<br>
4679011.69776777736842632,2283506.92586500011384487<br>
4679037.65943400003015995,2283487.47002476220950484<br>
4679065.54728745669126511,2283519.55884151300415397<br>
4679066.13715541176497936))<br>
<br>
In [6]: polygon.convertToMultiType()<br>
Out[6]: True<br>
<br>
In [7]: print polygon.exportToWkt()<br>
MULTIPOLYGON(((2283519.55884151300415397<br>
4679066.13715541176497936,2283544.75336170010268688<br>
4679033.60118563380092382,2283525.45749358925968409<br>
4679011.69776777736842632,2283506.92586500011384487<br>
4679037.65943400003015995,2283487.47002476220950484<br>
4679065.54728745669126511,2283519.55884151300415397<br>
4679066.13715541176497936)))<br>
<br>
a possible bug? Should I file a ticket?<br>
thanks<br>
<span class=""><font color="#888888">p<br>
<br>
--<br>
Paolo Corti<br>
Geospatial software developer<br>
web: <a href="http://www.paolocorti.net" target="_blank">http://www.paolocorti.net</a><br>
twitter: @capooti<br>
skype: capooti<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Giuseppe Sucameli
</div></div>