[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qgis-user
Subject:    [Qgis-user] Use extend of label background in python
From:       <Fuenfer-Koenigstein.Benjamin2 () swm ! de>
Date:       2017-08-28 12:42:42
Message-ID: E93ED525835D87449CADD8CE48D5C2671EE5A0 () SVEXMB04 ! intra ! swm ! de
[Download RAW message or body]

Hi all,



in QGIS, there is the possibility to draw a rectangle around a label text w=
ith "Labels -> Background -> Shape: Rectangle; Size type: buffer". This way=
, the rectangle fits to text extend.



Does onyone know a way to use the size or the corner coordinates of this bu=
ffer rectangle in a python function? Would be very helpful to create leader=
 lines from the object to the nearest corner of the rectangle.



Best regards



Benjamin


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;}
h1
	{mso-style-priority:9;
	mso-style-link:"\00DCberschrift 1 Zchn";
	margin-top:24.0pt;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	page-break-after:avoid;
	font-size:14.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;}
h2
	{mso-style-priority:9;
	mso-style-link:"\00DCberschrift 2 Zchn";
	margin-top:10.0pt;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	page-break-after:avoid;
	font-size:13.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;}
h3
	{mso-style-priority:9;
	mso-style-link:"\00DCberschrift 3 Zchn";
	margin-top:10.0pt;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	page-break-after:avoid;
	font-size:10.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;}
h4
	{mso-style-priority:9;
	mso-style-link:"\00DCberschrift 4 Zchn";
	margin-top:10.0pt;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	page-break-after:avoid;
	font-size:10.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;
	font-style:italic;}
h5
	{mso-style-priority:9;
	mso-style-link:"\00DCberschrift 5 Zchn";
	margin-top:10.0pt;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	page-break-after:avoid;
	font-size:10.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;
	font-weight:normal;}
h6
	{mso-style-priority:9;
	mso-style-link:"\00DCberschrift 6 Zchn";
	margin-top:10.0pt;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	page-break-after:avoid;
	font-size:10.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;
	font-weight:normal;
	font-style:italic;}
p.MsoHeading7, li.MsoHeading7, div.MsoHeading7
	{mso-style-priority:9;
	mso-style-link:"\00DCberschrift 7 Zchn";
	margin-top:10.0pt;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	page-break-after:avoid;
	font-size:10.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;
	font-style:italic;}
p.MsoHeading8, li.MsoHeading8, div.MsoHeading8
	{mso-style-priority:9;
	mso-style-link:"\00DCberschrift 8 Zchn";
	margin-top:10.0pt;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	page-break-after:avoid;
	font-size:10.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;}
p.MsoHeading9, li.MsoHeading9, div.MsoHeading9
	{mso-style-priority:9;
	mso-style-link:"\00DCberschrift 9 Zchn";
	margin-top:10.0pt;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	page-break-after:avoid;
	font-size:10.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;
	font-style:italic;}
p.MsoTitle, li.MsoTitle, div.MsoTitle
	{mso-style-priority:10;
	mso-style-link:"Titel Zchn";
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:15.0pt;
	margin-left:0cm;
	mso-add-space:auto;
	border:none;
	padding:0cm;
	font-size:26.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	letter-spacing:.25pt;
	mso-fareast-language:EN-US;}
p.MsoTitleCxSpFirst, li.MsoTitleCxSpFirst, div.MsoTitleCxSpFirst
	{mso-style-priority:10;
	mso-style-link:"Titel Zchn";
	mso-style-type:export-only;
	margin:0cm;
	margin-bottom:.0001pt;
	mso-add-space:auto;
	border:none;
	padding:0cm;
	font-size:26.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	letter-spacing:.25pt;
	mso-fareast-language:EN-US;}
p.MsoTitleCxSpMiddle, li.MsoTitleCxSpMiddle, div.MsoTitleCxSpMiddle
	{mso-style-priority:10;
	mso-style-link:"Titel Zchn";
	mso-style-type:export-only;
	margin:0cm;
	margin-bottom:.0001pt;
	mso-add-space:auto;
	border:none;
	padding:0cm;
	font-size:26.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	letter-spacing:.25pt;
	mso-fareast-language:EN-US;}
p.MsoTitleCxSpLast, li.MsoTitleCxSpLast, div.MsoTitleCxSpLast
	{mso-style-priority:10;
	mso-style-link:"Titel Zchn";
	mso-style-type:export-only;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:15.0pt;
	margin-left:0cm;
	mso-add-space:auto;
	border:none;
	padding:0cm;
	font-size:26.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	letter-spacing:.25pt;
	mso-fareast-language:EN-US;}
p.MsoSubtitle, li.MsoSubtitle, div.MsoSubtitle
	{mso-style-priority:11;
	mso-style-link:"Untertitel Zchn";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	letter-spacing:.75pt;
	mso-fareast-language:EN-US;
	font-style:italic;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{mso-style-priority:99;
	mso-style-link:"Nur Text Zchn";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	color:black;
	mso-fareast-language:EN-US;}
p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing
	{mso-style-priority:1;
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;}
p.MsoIntenseQuote, li.MsoIntenseQuote, div.MsoIntenseQuote
	{mso-style-priority:30;
	mso-style-link:"Intensives Zitat Zchn";
	margin-top:10.0pt;
	margin-right:46.8pt;
	margin-bottom:14.0pt;
	margin-left:46.8pt;
	border:none;
	padding:0cm;
	font-size:10.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;
	font-weight:bold;
	font-style:italic;}
span.MsoIntenseEmphasis
	{mso-style-priority:21;
	color:black;
	font-weight:bold;
	font-style:italic;}
span.berschrift1Zchn
	{mso-style-name:"\00DCberschrift 1 Zchn";
	mso-style-priority:9;
	mso-style-link:"\00DCberschrift 1";
	font-family:"Arial","sans-serif";
	color:black;
	font-weight:bold;}
span.berschrift2Zchn
	{mso-style-name:"\00DCberschrift 2 Zchn";
	mso-style-priority:9;
	mso-style-link:"\00DCberschrift 2";
	font-family:"Arial","sans-serif";
	color:black;
	font-weight:bold;}
span.TitelZchn
	{mso-style-name:"Titel Zchn";
	mso-style-priority:10;
	mso-style-link:Titel;
	font-family:"Arial","sans-serif";
	color:black;
	letter-spacing:.25pt;}
span.UntertitelZchn
	{mso-style-name:"Untertitel Zchn";
	mso-style-priority:11;
	mso-style-link:Untertitel;
	font-family:"Arial","sans-serif";
	color:black;
	letter-spacing:.75pt;
	font-style:italic;}
span.IntensivesZitatZchn
	{mso-style-name:"Intensives Zitat Zchn";
	mso-style-priority:30;
	mso-style-link:"Intensives Zitat";
	color:black;
	font-weight:bold;
	font-style:italic;}
span.berschrift3Zchn
	{mso-style-name:"\00DCberschrift 3 Zchn";
	mso-style-priority:9;
	mso-style-link:"\00DCberschrift 3";
	font-family:"Arial","sans-serif";
	color:black;
	font-weight:bold;}
span.berschrift4Zchn
	{mso-style-name:"\00DCberschrift 4 Zchn";
	mso-style-priority:9;
	mso-style-link:"\00DCberschrift 4";
	font-family:"Arial","sans-serif";
	color:black;
	font-weight:bold;
	font-style:italic;}
span.berschrift5Zchn
	{mso-style-name:"\00DCberschrift 5 Zchn";
	mso-style-priority:9;
	mso-style-link:"\00DCberschrift 5";
	font-family:"Arial","sans-serif";
	color:black;}
span.berschrift6Zchn
	{mso-style-name:"\00DCberschrift 6 Zchn";
	mso-style-priority:9;
	mso-style-link:"\00DCberschrift 6";
	font-family:"Arial","sans-serif";
	color:black;
	font-style:italic;}
span.berschrift7Zchn
	{mso-style-name:"\00DCberschrift 7 Zchn";
	mso-style-priority:9;
	mso-style-link:"\00DCberschrift 7";
	font-family:"Arial","sans-serif";
	color:black;
	font-style:italic;}
span.berschrift8Zchn
	{mso-style-name:"\00DCberschrift 8 Zchn";
	mso-style-priority:9;
	mso-style-link:"\00DCberschrift 8";
	font-family:"Arial","sans-serif";
	color:black;}
span.berschrift9Zchn
	{mso-style-name:"\00DCberschrift 9 Zchn";
	mso-style-priority:9;
	mso-style-link:"\00DCberschrift 9";
	font-family:"Arial","sans-serif";
	color:black;
	font-style:italic;}
span.E-MailFormatvorlage34
	{mso-style-type:personal-compose;
	font-family:"Arial","sans-serif";
	color:windowtext;}
span.NurTextZchn
	{mso-style-name:"Nur Text Zchn";
	mso-style-priority:99;
	mso-style-link:"Nur Text";
	font-family:"Calibri","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;
	font-family:"Arial","sans-serif";
	color:black;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText"><span lang="EN-US">Hi all,<o:p></o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoPlainText"><span lang="EN-US">in QGIS, there is the possibility to draw \
a rectangle around a label text with &quot;Labels -&gt; Background -&gt; Shape: \
Rectangle; Size type: buffer&quot;. This way, the rectangle fits to text \
extend.<o:p></o:p></span></p> <p class="MsoPlainText"><span \
lang="EN-US"><o:p>&nbsp;</o:p></span></p> <p class="MsoPlainText"><span \
lang="EN-US">Does onyone know a way to use the size or the corner coordinates of this \
buffer rectangle in a python function? Would be very helpful to create leader lines \
from the object to the nearest corner of the rectangle.<o:p></o:p></span></p> <p \
class="MsoPlainText"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p> <p \
class="MsoPlainText">Best regards<o:p></o:p></p> <p \
class="MsoPlainText"><o:p>&nbsp;</o:p></p> <p class="MsoPlainText">Benjamin \
<o:p></o:p></p> <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>


[Attachment #4 (unknown)]

_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic