<div dir="ltr"><div>Hi Régis,</div><div><br></div><div>thanks a lot for your insights. 
Finally I caught the issue. It's easy, since the labelling layer is a 
view, everytime this view was updated, the id, changed, and then the 
messy thing happened. I fixed already. <br></div><div>Again, thanks ^^ </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El lun., 11 nov. 2019 a las 18:43, Régis Haubourg (<<a href="mailto:regis.haubourg@gmail.com" target="_blank">regis.haubourg@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Oh ok, expression taken from label connector plugin :)<br>
<br>
Be aware that it can be slow with big geometries and that it is a<br>
temporary approach before having a native one in core (which I'd be<br>
pleased to have implemented if anyone supports it).<br>
<br>
So it seems you have something messing the unique id's that auxiliary<br>
storage database uses to link your data and qgis projected data when<br>
you add a new feature. Are you sure your ID's and foreign keys beahve<br>
like expected on the database side? For the auxiliary storage, a new<br>
feature shouldn't have any x-y value and thus the label should fall<br>
back to the automatic labeling options. In your case, it seems the<br>
newly created feature inherits from the id of another feature. This is<br>
a common case in labeling, and I remember the famous Mapinfo label<br>
callout mix ups that occured when compressing datasets, just because<br>
it didn't use real id's, but line number to identify features.<br>
<br>
<br>
Régis<br>
<br>
Le lun. 11 nov. 2019 à 17:33, Luís Miguel Royo Pérez<br>
<<a href="mailto:luis.miguel.royo@gmail.com" target="_blank">luis.miguel.royo@gmail.com</a>> a écrit :<br>
><br>
> Of course, here is:<br>
><br>
> case when "auxiliary_storage_labeling_positionx" < $x and "auxiliary_storage_labeling_positiony" > $y and abs("auxiliary_storage_labeling_positiony"-$y) < abs("auxiliary_storage_labeling_positionx"-$x) THEN<br>
>  make_line($geometry, make_point($x-abs("auxiliary_storage_labeling_positiony"-$y),"auxiliary_storage_labeling_positiony"),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))<br>
> when  "auxiliary_storage_labeling_positionx" < $x and "auxiliary_storage_labeling_positiony" > $y and abs("auxiliary_storage_labeling_positiony"-$y) >= abs("auxiliary_storage_labeling_positionx"-$x) then<br>
>   make_line($geometry, make_point($x,abs("auxiliary_storage_labeling_positionx"-$x)+$y),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))<br>
> when "auxiliary_storage_labeling_positionx" < $x and "auxiliary_storage_labeling_positiony" < $y and abs("auxiliary_storage_labeling_positiony"-$y) < abs("auxiliary_storage_labeling_positionx"-$x) THEN<br>
>   make_line($geometry, make_point($x-abs("auxiliary_storage_labeling_positiony"-$y),"auxiliary_storage_labeling_positiony"),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))<br>
> when  "auxiliary_storage_labeling_positionx" < $x and "auxiliary_storage_labeling_positiony" < $y and abs("auxiliary_storage_labeling_positiony"-$y) >= abs("auxiliary_storage_labeling_positionx"-$x) then<br>
>   make_line($geometry, make_point($x,$y-abs("auxiliary_storage_labeling_positionx"-$x)),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))<br>
> when "auxiliary_storage_labeling_positionx" >= $x and "auxiliary_storage_labeling_positiony" > $y and abs("auxiliary_storage_labeling_positiony"-$y) > abs("auxiliary_storage_labeling_positionx"-$x) then --quadrant ur alternatif<br>
>   make_line($geometry, make_point($x,"auxiliary_storage_labeling_positiony"-abs("auxiliary_storage_labeling_positionx"-$x)),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))<br>
> when "auxiliary_storage_labeling_positionx" >= $x and "auxiliary_storage_labeling_positiony" > $y and abs("auxiliary_storage_labeling_positiony"-$y) < abs("auxiliary_storage_labeling_positionx"-$x) then<br>
>    make_line($geometry, make_point($x+abs("auxiliary_storage_labeling_positiony"-$y),"auxiliary_storage_labeling_positiony"),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))<br>
> when "auxiliary_storage_labeling_positionx" >= $x and "auxiliary_storage_labeling_positiony" <= $y and abs("auxiliary_storage_labeling_positiony"-$y) > abs("auxiliary_storage_labeling_positionx"-$x) THEN<br>
>   make_line($geometry, make_point($x,$y-abs("auxiliary_storage_labeling_positionx"-$x)),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))<br>
> when "auxiliary_storage_labeling_positionx" >= $x and "auxiliary_storage_labeling_positiony" <= $y and abs("auxiliary_storage_labeling_positiony"-$y) < abs("auxiliary_storage_labeling_positionx"-$x) THEN<br>
>  make_line($geometry, make_point($x+abs("auxiliary_storage_labeling_positiony"-$y),"auxiliary_storage_labeling_positiony"),make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony"))<br>
>    END<br>
><br>
><br>
><br>
><br>
> El lun., 11 nov. 2019 17:15, Régis Haubourg <<a href="mailto:regis.haubourg@gmail.com" target="_blank">regis.haubourg@gmail.com</a>> escribió:<br>
>><br>
>> Hi Luis, can you share your geometry generator expression please?<br>
>> regards<br>
>> Régis<br>
>><br>
>> Le lun. 11 nov. 2019 à 09:04, Luís Miguel Royo Pérez<br>
>> <<a href="mailto:luis.miguel.royo@gmail.com" target="_blank">luis.miguel.royo@gmail.com</a>> a écrit :<br>
>> ><br>
>> > Hello everyone,<br>
>> ><br>
>> > I'm developing a QGIS plugin along with PostGIS and I'm facing some problems with labeling. This plugin creates several layers and tables. Some of these layers are views  (labeling layers), so if I edit the one fo the source layer the view changes and then the label. I explain more detailed:<br>
>> ><br>
>> > I have the following:<br>
>> ><br>
>> > One layer. Let's call it layer1.<br>
>> > One none spatial table. Let's call it table1.<br>
>> > One spatial view from these other two layers layer1 and table1 meant for labeling. Let's call it labelView1.<br>
>> ><br>
>> > The point is this, when I edit table1 adding a new element linked by a foreign key with layer1. The label position in labelView1 changes into a messy thing. The Style of labelView1 is the following:<br>
>> ><br>
>> > Symbol is a geometry generator. Since I want to create callouts from label to the geometry, wich is a point.<br>
>> > The position of the label is saved on project. In the qgd file.<br>
>> ><br>
>> > I have seen this behaviour in Windows10 and in Ubuntu. The QGIS version is 3.4, but I tried to move to the new 3.10 version of QGIS, with the callouts new feature, but is the same result.<br>
>> ><br>
>> > As well I tried to reproduce it in a much simple way, but without succed, that's why I want to share a link with a GIF file showing this issue:<br>
>> ><br>
>> > <a href="https://gifyu.com/image/vMY7" rel="noreferrer" target="_blank">https://gifyu.com/image/vMY7</a><br>
>> ><br>
>> > I've done the same but without fixed position,and the labels don't move, but the geometry_generator does.<br>
>> ><br>
>> > Is this a bug? Is there any way to prevent it?<br>
>> ><br>
>> > Thanks.<br>
>> > --<br>
>> > Luís Miguel Royo Pérez.<br>
>> > Analista-Programador GIS<br>
>> > C/ Antic Regne de Valencia nº 4. Manises (Valencia)<br>
>> > Teléfono:+34  679846103<br>
>> > webs:<br>
>> > <a href="http://inisig.com" rel="noreferrer" target="_blank">inisig.com</a><br>
>> > <a href="http://geofibra.com" rel="noreferrer" target="_blank">geofibra.com</a><br>
>> ><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>
>> > List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>> > Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><span><font color="#888888"><span><font color="#888888">Luís Miguel Royo Pérez. <br>Analista-Programador GIS<br>C/ Antic Regne de Valencia nº 4. Manises (Valencia)<br>Teléfono:+34  679846103 <br>webs: </font></span></font></span></div><div style="margin-left:40px"><span><font color="#888888"><span><font color="#888888"><a href="http://inisig.com" target="_blank">inisig.com </a><br></font></span></font></span></div><div style="margin-left:40px"><span><font color="#888888"><span><font color="#888888"><a href="https://geofibra.com" target="_blank">geofibra.com</a><br></font></span></font></span></div><div><span><font color="#888888"><span></span></font></span><span><font color="#888888"><span><font color="#888888"><br></font></span></font></span><br></div></div></div></div></div></div></div>