Label callout lines to the closest point on the label The 2019 Stack Overflow Developer Survey...
Who or what is the being for whom Being is a question for Heidegger?
How to prevent selfdestruct from another contract
Hopping to infinity along a string of digits
system call string length limit
What information about me do stores get via my credit card?
How does ice melt when immersed in water
Is above average number of years spent on PhD considered a red flag in future academia or industry positions?
Match Roman Numerals
Mortgage adviser recommends a longer term than necessary combined with overpayments
Working through the single responsibility principle (SRP) in Python when calls are expensive
What do you call a plan that's an alternative plan in case your initial plan fails?
how can a perfect fourth interval be considered either consonant or dissonant?
"... to apply for a visa" or "... and applied for a visa"?
verb not working in beamer even though I use [fragile]
Was credit for the black hole image misattributed?
Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?
How to grep and cut numbes from a file and sum them
Button changing its text & action. Good or terrible?
Arduino Pro Micro - switch off LEDs
What can I do if neighbor is blocking my solar panels intentionally?
Are my PIs rude or am I just being too sensitive?
How can I define good in a religion that claims no moral authority?
Windows 10: How to Lock (not sleep) laptop on lid close?
How does this infinite series simplify to an integral?
Label callout lines to the closest point on the label
The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Placement for LabelCreating multiple lines label in QGIS?Creating leader lines for moved labelsGetting the height and width of labels in QGIS?Adding lines connecting labels to points in QGIS?QGIS 3 Line connecting point to label issue - can not get line to align with label in desired placeStraight Lines from Label to Feature in QGIS?QGIS API Label expression for vector layerFinding which side of closest polyline point lies on in QGIS?Create label from different fields in ArcGIS Desktop?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I am trying to improve callout lines on maps I'm making. I'm currently using the method in this link to make my callout lines. That works fine, bu I'd like the lines to always go to the closest point of the label like this:




I think it would work if I used code down the line of this in the expression editor for the geometry generator.
make_line(
make_point($x, $y),
make_point((CASE
WHEN "auxiliary_storage_labeling_positionx" > $x
THEN "auxiliary_storage_labeling_positionx"
WHEN ("auxiliary_storage_labeling_positionx" + "labelwidth") > $x
AND ("auxiliary_storage_labeling_positionx") < $x
THEN ("auxiliary_storage_labeling_positionx" + "labelwidth")
ELSE $x
END )
,(CASE
WHEN "auxiliary_storage_labeling_positiony" < $y
THEN "auxiliary_storage_labeling_positiony"
WHEN ("auxiliary_storage_labeling_positiony" + "labelHeight") < $y
AND ("auxiliary_storage_labeling_positiony") > $y
THEN ("auxiliary_storage_labeling_positiony" + "labelHeight")
ELSE $y
END )
)
)
I'm not sure if I have all the < and > correct but that's beside the point.
The issue with that is that I can't seem to figure out how to get the width and the height of the label.
I am not very good with the expression editor, and have never done anything with the function editor.
qgis labeling qgis-3
add a comment |
I am trying to improve callout lines on maps I'm making. I'm currently using the method in this link to make my callout lines. That works fine, bu I'd like the lines to always go to the closest point of the label like this:




I think it would work if I used code down the line of this in the expression editor for the geometry generator.
make_line(
make_point($x, $y),
make_point((CASE
WHEN "auxiliary_storage_labeling_positionx" > $x
THEN "auxiliary_storage_labeling_positionx"
WHEN ("auxiliary_storage_labeling_positionx" + "labelwidth") > $x
AND ("auxiliary_storage_labeling_positionx") < $x
THEN ("auxiliary_storage_labeling_positionx" + "labelwidth")
ELSE $x
END )
,(CASE
WHEN "auxiliary_storage_labeling_positiony" < $y
THEN "auxiliary_storage_labeling_positiony"
WHEN ("auxiliary_storage_labeling_positiony" + "labelHeight") < $y
AND ("auxiliary_storage_labeling_positiony") > $y
THEN ("auxiliary_storage_labeling_positiony" + "labelHeight")
ELSE $y
END )
)
)
I'm not sure if I have all the < and > correct but that's beside the point.
The issue with that is that I can't seem to figure out how to get the width and the height of the label.
I am not very good with the expression editor, and have never done anything with the function editor.
qgis labeling qgis-3
add a comment |
I am trying to improve callout lines on maps I'm making. I'm currently using the method in this link to make my callout lines. That works fine, bu I'd like the lines to always go to the closest point of the label like this:




I think it would work if I used code down the line of this in the expression editor for the geometry generator.
make_line(
make_point($x, $y),
make_point((CASE
WHEN "auxiliary_storage_labeling_positionx" > $x
THEN "auxiliary_storage_labeling_positionx"
WHEN ("auxiliary_storage_labeling_positionx" + "labelwidth") > $x
AND ("auxiliary_storage_labeling_positionx") < $x
THEN ("auxiliary_storage_labeling_positionx" + "labelwidth")
ELSE $x
END )
,(CASE
WHEN "auxiliary_storage_labeling_positiony" < $y
THEN "auxiliary_storage_labeling_positiony"
WHEN ("auxiliary_storage_labeling_positiony" + "labelHeight") < $y
AND ("auxiliary_storage_labeling_positiony") > $y
THEN ("auxiliary_storage_labeling_positiony" + "labelHeight")
ELSE $y
END )
)
)
I'm not sure if I have all the < and > correct but that's beside the point.
The issue with that is that I can't seem to figure out how to get the width and the height of the label.
I am not very good with the expression editor, and have never done anything with the function editor.
qgis labeling qgis-3
I am trying to improve callout lines on maps I'm making. I'm currently using the method in this link to make my callout lines. That works fine, bu I'd like the lines to always go to the closest point of the label like this:




I think it would work if I used code down the line of this in the expression editor for the geometry generator.
make_line(
make_point($x, $y),
make_point((CASE
WHEN "auxiliary_storage_labeling_positionx" > $x
THEN "auxiliary_storage_labeling_positionx"
WHEN ("auxiliary_storage_labeling_positionx" + "labelwidth") > $x
AND ("auxiliary_storage_labeling_positionx") < $x
THEN ("auxiliary_storage_labeling_positionx" + "labelwidth")
ELSE $x
END )
,(CASE
WHEN "auxiliary_storage_labeling_positiony" < $y
THEN "auxiliary_storage_labeling_positiony"
WHEN ("auxiliary_storage_labeling_positiony" + "labelHeight") < $y
AND ("auxiliary_storage_labeling_positiony") > $y
THEN ("auxiliary_storage_labeling_positiony" + "labelHeight")
ELSE $y
END )
)
)
I'm not sure if I have all the < and > correct but that's beside the point.
The issue with that is that I can't seem to figure out how to get the width and the height of the label.
I am not very good with the expression editor, and have never done anything with the function editor.
qgis labeling qgis-3
qgis labeling qgis-3
asked 7 mins ago
Troy BuergeTroy Buerge
999
999
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318711%2flabel-callout-lines-to-the-closest-point-on-the-label%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f318711%2flabel-callout-lines-to-the-closest-point-on-the-label%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown