<div dir="ltr">Hi Benoît
,<br><br><div><div class="gmail_extra"><div class="gmail_quote">On Tue, May 14, 2013 at 3:18 AM, Benoît Laurent <span dir="ltr"><<a href="mailto:blaurent@heurisis.eu" target="_blank">blaurent@heurisis.eu</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">
<div text="#000000" bgcolor="#FFFFFF">
<div>Hello,<br>
<br>
Did I ask my question in the right place ? Can someone help me ?
Thank you in advance.<br></div></div></blockquote><div><br></div><div>If you are using a master branch build, you can script the new labeling engine via Python. The following test script has some sample code [1].<br>
<br>[1] <a href="https://github.com/qgis/Quantum-GIS/blob/master/tests/src/python/test_qgspallabeling.py">https://github.com/qgis/Quantum-GIS/blob/master/tests/src/python/test_qgspallabeling.py</a><br><br></div><div>Regards,<br>
<br></div><div>Larry<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"><div text="#000000" bgcolor="#FFFFFF"><div>
Regards,<br>
<br>
Benoît<br>
<br>
<br>
</div>
<blockquote type="cite">Hello,
<br>
<br>
I am not sure to be on the right place to ask my question. If not,
I beg your pardon.
<br>
<br>
I am trying the write a Python script that :
<br>
- load a set of shapefile ;
<br>
- automatically add labels based on a field ;
<br>
- set the color, the size, etc. of my points.
<br>
<br>
For the moment, I can load the shapefiles. I also succeded in
labeling but I am not able to move the labels manually once
created. Here is my piece of code for labeling :
<br>
def add_label(self, layer):
<br>
layer.enableLabels(1)
<br>
myLabel = layer.label()
<br>
myLabel.setLabelField( QgsLabel.Text, 17)
<br>
myLabel.layerAttributes().setAlignment(4)
<br>
<br>
Is there an other way of doing this ? Is there samples of code ?
<br>
<br>
Thank you in advance.
<br>
<br>
Benoît
<br>
<br>
_______________________________________________
<br>
Qgis-developer mailing list
<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">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>
</blockquote>
<br>
<br>
<div>-- <br>
<table style border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="padding-right:10px" valign="top"><a href="http://www.heurisis.eu" target="_blank"><img alt="Heurisis" title="Heurisis" border="0" height="91" width="100"></a><br>
</td>
<td style="border-left:1px solid rgb(245,245,245);font-family:Trebuchet MS;font-size:10pt;padding-right:10px;padding-left:10px" valign="top"> <font color="#32312d" face="Trebuchet ms" size="1">
<p style="margin:0px;font-size:10pt;font-weight:bold">Benoît
LAURENT <span style="color:rgb(68,85,140)">Consultant Optimisation</span></p>
9, rue Alexandre Fleming, 49066 Angers CEDEX<br>
<br>
<img style="width: 17px; min-height: 15px;" alt="Portable"> +33
(0)6 28 03 81 32
</font><font color="#32312d" face="Trebuchet ms" size="1"><a href="mailto:blaurent@heurisis.eu" target="_blank"><img alt="e-mail :" align="top" border="0"> blaurent@heurisis.eu</a></font><br>
<font color="#32312d" face="Trebuchet ms" size="1"> <img alt="tel
:" align="top"> <a href="tel:%2B33%20%280%299%2054%2030%2041%2014" value="+33954304114" target="_blank">+33 (0)9 54 30 41 14</a> </font><font color="#32312d" face="Trebuchet ms" size="1"><a href="http://www.heurisis.eu/" target="_blank"><img alt="site :" align="top" border="0"> www.heurisis.eu</a><br>
</font><font color="#32312d" face="Trebuchet ms" size="1"><br>
<table style="font-family:Trebuchet MS" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<td><br>
</td>
<td> <font color="#32312d" face="Trebuchet ms" size="1"> Visitez le site <span style="font-family:Trebuchet ms;font-size:10pt;font-weight:bold"><a href="http://www.optiscolaire.fr" target="_blank">www.optiscolaire.fr</a></span>
</font> </td>
</tr>
</tbody>
</table>
</font> </td>
</tr>
<tr>
<td colspan="2"> <font color="#c99716" face="Trebuchet ms" size="1">
<p style="color:rgb(201,151,22);text-align:center"><img alt="éco :"> Avant d’imprimer ce mail, pensez à
l’environnement</p>
</font> </td>
</tr>
</tbody>
</table>
<br style="clear:both" clear="all">
</div>
</div>
<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>
<br></blockquote></div><br></div></div></div>