<div dir="ltr"><div>HI Tim, <br></div><div>the old plugin is crappy as it was made before the auxiliary data storage and the geometry generator awesome features.  <br></div><div>The expression used are exactly similar to Nyall's advice. The next plugin will just be a helper to set all those expressions and geometry generator style for users. I still miss a native implementation for callouts, but that might become a reality in the next months. Finger crossed. <br></div><div>Régis<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 11 avr. 2019 à 08:43, Tim Sutton <<a href="mailto:tim@kartoza.com">tim@kartoza.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Hi Alexis, Régis and Nyall<br><br>I went with Nyall’s approach for now since I was 90% there and he gave me the last nudge I needed :-) I used data defined alignments:<br><br><img id="gmail-m_39222737873353394960D949F67-E371-4568-9E8A-3E7D0F051081" src="cid:16a0b25025c8b3c7d561" width="284" height="99"><br><br>Here are the expressions I used for horizontal:<br><br><br>if (<br>  X(closest_point($geometry,<br>  make_point( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony" ))) ><br>  X(make_point( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony" )),<br>  'Right', 'Left’)<br><br>Which gives (animated gif, open in browser if needed):<div><br></div><div><img id="gmail-m_39222737873353394967BD87059-775F-4904-8645-B008F22606DC" src="cid:16a0b25025ddbb55dca2"><br><br>And Vertical<br><br>if (<br>  Y(closest_point($geometry,<br>  make_point( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony" ))) <<br>  Y(make_point( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony" )),<br>  ’Top’, ‘Bottom’)<br><br>Which gives (animated gif, open in browser if needed):</div><div><br></div><div><img id="gmail-m_3922273787335339496CFD3B774-F7F6-495B-B5C7-05177946E0FB" src="cid:16a0b25025e9b14c9943"><br><br>@Régis I will give your plugin a try to see what it does too, thanks!<br><br>QGIS Rocks!</div><div><br></div><div>Regards</div><div><br></div><div>Tim<br><br><blockquote type="cite">On 11 Apr 2019, at 07:19, Régis Haubourg <<a href="mailto:regis.haubourg@gmail.com" target="_blank">regis.haubourg@gmail.com</a>> wrote:<br><br>Hi Tim, <br>You can have a look at easycustomlabeling plugin code. It's sets those expressions for label alignement.<br> <br>FYI I should be working on a new version of it taking profit of the geometry generators power soon , and we might be able to revive the QEP47 to revive the idea of porting this natively to core.<br>Best regards <br>Regis<br><br>Le jeu. 11 avr. 2019 à 00:54, Tim Sutton <<a href="mailto:tim@kartoza.com" target="_blank">tim@kartoza.com</a>> a écrit :<br>To clarify a little, I am trying to avoid the label text crossing the call-out line.<br><br>Regards<br><br>Tim<br><br><blockquote type="cite">On 10 Apr 2019, at 23:02, Tim Sutton <<a href="mailto:tim@kartoza.com" target="_blank">tim@kartoza.com</a>> wrote:<br><br>Hi Friends<br><br>So I am using logic like this* to make call out labels using a geometry generator:<br><br>make_line(<br>  closest_point($geometry,<br>  make_point( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony" )),<br>  make_point( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony" )<br>)<br><br>The line runs from the closest point along the edge of the polygon to the bottom left corner of the label box. With this configuration it works well when my ‘lollipop’ callout label is north-east of the polygon being labelled:<br><br><Screenshot 2019-04-10 at 22.54.29.jpg><br><br>But doesn’t work when the label is e.g. south west of the polygon:<br><br><Screenshot 2019-04-10 at 22.54.54.jpg><br><br>Now I am wondering if we have any options for getting the geometry of the label box so I can do the reverse and get the closest point along the edge of the label box to the polygon being labelled. So my question:<br><br>Is there any sneaky trick for getting the geometry of the label box for a feature in an expression? And no, using an opaque background for my label to mask away the call out line doesn’t really hack it. I know the label box isn’t being calculated at the time the polygon is being rendered so the answer is probably ’no’ but maybe someone else has a clever idea to make may lollipops work when labels are south (or east or west for that matter) of the feature being labelled?<br><br>Thanks!<br><br>Regards<br><br>Tim<br><br><br><br>—<br><br><br><KartozaNewLogoThumbnail.jpg><br><br><br><br><br><br><br>Tim Sutton<br><br>Co-founder: Kartoza<br>Ex Project chair: QGIS.org<br><br>Visit <a href="http://kartoza.com" target="_blank">http://kartoza.com</a> to find out about open source:<br><br>Desktop GIS programming services<br>Geospatial web development<br>GIS Training<br>Consulting Services<br><br>Skype: timlinux <br>IRC: timlinux on #qgis at <a href="http://freenode.net" target="_blank">freenode.net</a><br><br>I'd love to connect. Here's my calendar link to make finding time easy.<br><br></blockquote><br>—<br><br><br><img id="gmail-m_3922273787335339496m_-17592939539569758138BFEC717-8301-41A2-B997-6ADF29C45E51" src="cid:16a0b25025e2451cdf24"><br><br><br><br><br><br><br>Tim Sutton<br><br>Co-founder: Kartoza<br>Ex Project chair: QGIS.org<br><br>Visit <a href="http://kartoza.com" target="_blank">http://kartoza.com</a> to find out about open source:<br><br>Desktop GIS programming services<br>Geospatial web development<br>GIS Training<br>Consulting Services<br><br>Skype: timlinux <br>IRC: timlinux on #qgis at <a href="http://freenode.net" target="_blank">freenode.net</a><br><br>I'd love to connect. Here's my calendar link to make finding time easy.<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" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br><span id="gmail-m_3922273787335339496cid:%3C%3E"><KartozaNewLogoThumbnail.jpg></span><br></blockquote><br><div><span>—</span><br><br><br><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span><span><span><span><span><span><span><span><span><span><span><img id="gmail-m_392227378733533949687A336C4-AA30-465F-B3E9-86D0D415F793" src="cid:16a0b25025e2451cdf24"></span><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal;min-height:14px"><br class="gmail-m_3922273787335339496Apple-interchange-newline"><br class="gmail-m_3922273787335339496Apple-interchange-newline"><br class="gmail-m_3922273787335339496Apple-interchange-newline"><br class="gmail-m_3922273787335339496Apple-interchange-newline"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal;min-height:14px"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal"><b>Tim Sutton</b></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal;min-height:14px"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal"><b>Co-founder:</b><span class="gmail-m_3922273787335339496Apple-converted-space"> </span>Kartoza</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal"><b>Ex Project chair:</b><span style="font-weight:normal"><span class="gmail-m_3922273787335339496Apple-converted-space"> </span><a href="http://QGIS.org" target="_blank">QGIS.org</a></span></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal;min-height:14px"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal">Visit <a href="http://kartoza.com/" target="_blank"><span>http://kartoza.com</span></a> to find out about open source:</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal;min-height:14px"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal">Desktop GIS programming services</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal">Geospatial web development</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal">GIS Training</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal">Consulting Services</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal;min-height:14px"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal"><b>Skype</b>: timlinux </div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal"><b>IRC:</b><span class="gmail-m_3922273787335339496Apple-converted-space"> </span>timlinux on #qgis at <a href="http://freenode.net" target="_blank">freenode.net</a></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:center;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;margin:0px;line-height:normal"><span style="color:rgb(102,106,115);font-family:"Proxima Nova",sans-serif;font-size:14px;text-align:left;background-color:rgb(255,255,255)">I'd love to connect. </span><a class="gmail-m_3922273787335339496t-quick-start-share-link" href="https://calendly.com/timlinux" style="color:rgb(0,162,255);text-decoration:none;font-family:"Proxima Nova",sans-serif;font-size:14px;text-align:left" target="_blank">Here's my calendar link</a><span style="color:rgb(102,106,115);font-family:"Proxima Nova",sans-serif;font-size:14px;text-align:left;background-color:rgb(255,255,255)"> to make finding time easy.</span></div>
</span></span></span></span></span></span></span></span></span></span></span></div><br></div></div></blockquote></div>