<html>
<head>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello all,<br>
I've got a strange problem with a python function in my QGIS 2.2.0
plugin:<br>
<br>
This first function works perfectly:<br>
<br>
<i>def points_linestring (pointgeoms):</i><i><br>
</i><i> return QgsGeometry.fromPolyline([point.asPoint() for
point in pointgeoms])</i><br>
<br>
pointgeoms contains points.<br>
The function transforms these in a linestring.<br>
<br>
BUT, if I want a multipolyline, and if I try :<br>
<br>
<i>def points_linestring (pointgeoms):</i><i><br>
</i><i> return QgsGeometry.fromMultiPolyline([point.asPoint() for
point in pointgeoms])</i><br>
<br>
(I've juste added "Multi"),<br>
Qgis returns :<br>
<br>
"/home/vincent/.qgis2/python/plugins/bdtravaux/convert_geoms.py",
line 70, in points_linestring<br>
return QgsGeometry.fromMultiPolyline(polyligne.asPolyline())<br>
TypeError: QgsGeometry.fromMultiPolyline(unknown-type): argument 1
has unexpected type 'list'<br>
<br>
Does somebody know why this function works with fromPolyline() and
not fromMultiPolyline()?<br>
I found nothing about this in the doc and in google searchs.<br>
<br>
Thanks for advance.<br>
Vincent<br>
<div class="moz-signature">
<div class="moz-signature">
<div class="moz-signature"><br>
<div class="moz-signature">--------------------------- <br>
<div class="moz-signature">
<div class="moz-signature">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<title></title>
<br>
<div class="moz-signature">
<table border="0" cellpadding="2" cellspacing="2"
height="125" width="579">
<tbody>
<tr>
<td colspan="2" rowspan="1" valign="top"
width="200">Vincent Damoy - Responsable SIG<br>
Conservatoire d'espaces naturels du Nord et du
Pas-de-Calais<br>
152 bd de Paris - 62190 Lillers<br>
Tél : 03.21.54.75.00 - Fax : 03.21.54.56.07<br>
<small><font color="#009900"><i><b>Pour
adhérer au Conservatoire :</b> <a
class="moz-txt-link-abbreviated"
href="http://www.cen-npdc.org/nous-rejoindre/adherent.html">www.cen-npdc.org/nous-rejoindre/adherent.html</a></i></font></small></td>
</tr>
</tbody>
</table>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>