Getting value set in binding input widget in QGIS expression? Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?SVG from QGIS to Illustrator CC gets wrong stroke widthsPlacement for LabelQGIS 2.8.2 - Using spatial expressions in labellingData dependent override on colour and linewidth of line pattern fill not working after upgrade to QGIS 2.12Transparency control in svg symbolsScale color ramp filtered on common layer columns, in QGISHow to show line symbol (arrow) independently of line length in ArcGIS?How to mount an expression for “contain” in QGIS 2.18.14 Atlas/Print Composer?How to create sequential numbers in a field by defining automatically the start, end and interval numbers?How to scale features declining using map units in QGIS
Does the Black Tentacles spell do damage twice at the start of turn to an already restrained creature?
retrieve food groups from food item list
Should a wizard buy fine inks every time he want to copy spells into his spellbook?
Sally's older brother
What adaptations would allow standard fantasy dwarves to survive in the desert?
How can a team of shapeshifters communicate?
Why do early math courses focus on the cross sections of a cone and not on other 3D objects?
What is the chair depicted in Cesare Maccari's 1889 painting "Cicerone denuncia Catilina"?
Did any compiler fully use 80-bit floating point?
New Order #6: Easter Egg
Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?
License to disallow distribution in closed source software, but allow exceptions made by owner?
How would you say "es muy psicólogo"?
Connecting Mac Book Pro 2017 to 2 Projectors via USB C
Why datecode is SO IMPORTANT to chip manufacturers?
Random body shuffle every night—can we still function?
I can't produce songs
BITCOIN: on a chart what does it mean for the USD price to be higher then marketcap?
Getting out of while loop on console
Is openssl rand command cryptographically secure?
How can I prevent/balance waiting and turtling as a response to cooldown mechanics
Drawing a ribbon graph
Understanding p-Values using an example
How much damage would a cupful of neutron star matter do to the Earth?
Getting value set in binding input widget in QGIS expression?
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?SVG from QGIS to Illustrator CC gets wrong stroke widthsPlacement for LabelQGIS 2.8.2 - Using spatial expressions in labellingData dependent override on colour and linewidth of line pattern fill not working after upgrade to QGIS 2.12Transparency control in svg symbolsScale color ramp filtered on common layer columns, in QGISHow to show line symbol (arrow) independently of line length in ArcGIS?How to mount an expression for “contain” in QGIS 2.18.14 Atlas/Print Composer?How to create sequential numbers in a field by defining automatically the start, end and interval numbers?How to scale features declining using map units in QGIS
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I would like to set dynamic line width and it should be scaled by the value "Stroke width".
When I set the value to 0.15, it will be less than 0.15 if $length is too small. I need a function to get the value set in "Stroke width" so that I can modify it directly in "Stroke width" instead of in Expression String builder.
CASE
WHEN ($length < 1) THEN ($length * 0.15 / 1)
WHEN ($length >= 1) THEN (0.15)
END


qgis line expression
add a comment |
I would like to set dynamic line width and it should be scaled by the value "Stroke width".
When I set the value to 0.15, it will be less than 0.15 if $length is too small. I need a function to get the value set in "Stroke width" so that I can modify it directly in "Stroke width" instead of in Expression String builder.
CASE
WHEN ($length < 1) THEN ($length * 0.15 / 1)
WHEN ($length >= 1) THEN (0.15)
END


qgis line expression
1
you may be interested inscale_linear(val, domain_min, domain_max, range_min, range_max)orscale_exp(val, domain_min, domain_max, range_min, range_max, exponent). Something likescale_linear("Stroke width", min("Stroke width"), max("Stroke width"), 1, 5)in Map Units
– Taras
Apr 12 at 7:51
add a comment |
I would like to set dynamic line width and it should be scaled by the value "Stroke width".
When I set the value to 0.15, it will be less than 0.15 if $length is too small. I need a function to get the value set in "Stroke width" so that I can modify it directly in "Stroke width" instead of in Expression String builder.
CASE
WHEN ($length < 1) THEN ($length * 0.15 / 1)
WHEN ($length >= 1) THEN (0.15)
END


qgis line expression
I would like to set dynamic line width and it should be scaled by the value "Stroke width".
When I set the value to 0.15, it will be less than 0.15 if $length is too small. I need a function to get the value set in "Stroke width" so that I can modify it directly in "Stroke width" instead of in Expression String builder.
CASE
WHEN ($length < 1) THEN ($length * 0.15 / 1)
WHEN ($length >= 1) THEN (0.15)
END


qgis line expression
qgis line expression
edited Apr 12 at 7:55
Taras
2,3703730
2,3703730
asked Apr 12 at 7:39
Fang ZheFang Zhe
162
162
1
you may be interested inscale_linear(val, domain_min, domain_max, range_min, range_max)orscale_exp(val, domain_min, domain_max, range_min, range_max, exponent). Something likescale_linear("Stroke width", min("Stroke width"), max("Stroke width"), 1, 5)in Map Units
– Taras
Apr 12 at 7:51
add a comment |
1
you may be interested inscale_linear(val, domain_min, domain_max, range_min, range_max)orscale_exp(val, domain_min, domain_max, range_min, range_max, exponent). Something likescale_linear("Stroke width", min("Stroke width"), max("Stroke width"), 1, 5)in Map Units
– Taras
Apr 12 at 7:51
1
1
you may be interested in
scale_linear(val, domain_min, domain_max, range_min, range_max) or scale_exp(val, domain_min, domain_max, range_min, range_max, exponent). Something like scale_linear("Stroke width", min("Stroke width"), max("Stroke width"), 1, 5) in Map Units– Taras
Apr 12 at 7:51
you may be interested in
scale_linear(val, domain_min, domain_max, range_min, range_max) or scale_exp(val, domain_min, domain_max, range_min, range_max, exponent). Something like scale_linear("Stroke width", min("Stroke width"), max("Stroke width"), 1, 5) in Map Units– Taras
Apr 12 at 7:51
add a comment |
1 Answer
1
active
oldest
votes
You refer to "stroke width" in double quotation marks, which makes it seem like your attribute table has a field called "stroke width." If that's the case, you can use this field in an expression, and scale the line width based on the value in the stroke width field.


If, as I suspect, you're actually talking about the stroke width box in the layer styling panel
, then you can't do what you're asking for. QGIS just isn't designed that way. The value set in the stroke width box is not available in the expression builder. The Data-Defined Override setting will always override the value you enter into the stroke width box. See the second and third definitions of "override" from dictionary.com:
- to disregard, set aside, or nullify; countermand
- to take precedence over; preempt or supersede
What you can do instead is define a custom variable in the layer properties. Eg, you could call your variable default_stroke_width. Once the variable is defined, you can use it in the expression builder with @default_stroke_width.


Even though this variable has the words "stroke width" in its name, it's not connected to the stroke width box in the style panel. When you want to change the default_stroke_width value, you'll have to go back into layer properties and edit the variable. This is probably less convenient than editing the expression itself.
add a comment |
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%2f318563%2fgetting-value-set-in-binding-input-widget-in-qgis-expression%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You refer to "stroke width" in double quotation marks, which makes it seem like your attribute table has a field called "stroke width." If that's the case, you can use this field in an expression, and scale the line width based on the value in the stroke width field.


If, as I suspect, you're actually talking about the stroke width box in the layer styling panel
, then you can't do what you're asking for. QGIS just isn't designed that way. The value set in the stroke width box is not available in the expression builder. The Data-Defined Override setting will always override the value you enter into the stroke width box. See the second and third definitions of "override" from dictionary.com:
- to disregard, set aside, or nullify; countermand
- to take precedence over; preempt or supersede
What you can do instead is define a custom variable in the layer properties. Eg, you could call your variable default_stroke_width. Once the variable is defined, you can use it in the expression builder with @default_stroke_width.


Even though this variable has the words "stroke width" in its name, it's not connected to the stroke width box in the style panel. When you want to change the default_stroke_width value, you'll have to go back into layer properties and edit the variable. This is probably less convenient than editing the expression itself.
add a comment |
You refer to "stroke width" in double quotation marks, which makes it seem like your attribute table has a field called "stroke width." If that's the case, you can use this field in an expression, and scale the line width based on the value in the stroke width field.


If, as I suspect, you're actually talking about the stroke width box in the layer styling panel
, then you can't do what you're asking for. QGIS just isn't designed that way. The value set in the stroke width box is not available in the expression builder. The Data-Defined Override setting will always override the value you enter into the stroke width box. See the second and third definitions of "override" from dictionary.com:
- to disregard, set aside, or nullify; countermand
- to take precedence over; preempt or supersede
What you can do instead is define a custom variable in the layer properties. Eg, you could call your variable default_stroke_width. Once the variable is defined, you can use it in the expression builder with @default_stroke_width.


Even though this variable has the words "stroke width" in its name, it's not connected to the stroke width box in the style panel. When you want to change the default_stroke_width value, you'll have to go back into layer properties and edit the variable. This is probably less convenient than editing the expression itself.
add a comment |
You refer to "stroke width" in double quotation marks, which makes it seem like your attribute table has a field called "stroke width." If that's the case, you can use this field in an expression, and scale the line width based on the value in the stroke width field.


If, as I suspect, you're actually talking about the stroke width box in the layer styling panel
, then you can't do what you're asking for. QGIS just isn't designed that way. The value set in the stroke width box is not available in the expression builder. The Data-Defined Override setting will always override the value you enter into the stroke width box. See the second and third definitions of "override" from dictionary.com:
- to disregard, set aside, or nullify; countermand
- to take precedence over; preempt or supersede
What you can do instead is define a custom variable in the layer properties. Eg, you could call your variable default_stroke_width. Once the variable is defined, you can use it in the expression builder with @default_stroke_width.


Even though this variable has the words "stroke width" in its name, it's not connected to the stroke width box in the style panel. When you want to change the default_stroke_width value, you'll have to go back into layer properties and edit the variable. This is probably less convenient than editing the expression itself.
You refer to "stroke width" in double quotation marks, which makes it seem like your attribute table has a field called "stroke width." If that's the case, you can use this field in an expression, and scale the line width based on the value in the stroke width field.


If, as I suspect, you're actually talking about the stroke width box in the layer styling panel
, then you can't do what you're asking for. QGIS just isn't designed that way. The value set in the stroke width box is not available in the expression builder. The Data-Defined Override setting will always override the value you enter into the stroke width box. See the second and third definitions of "override" from dictionary.com:
- to disregard, set aside, or nullify; countermand
- to take precedence over; preempt or supersede
What you can do instead is define a custom variable in the layer properties. Eg, you could call your variable default_stroke_width. Once the variable is defined, you can use it in the expression builder with @default_stroke_width.


Even though this variable has the words "stroke width" in its name, it's not connected to the stroke width box in the style panel. When you want to change the default_stroke_width value, you'll have to go back into layer properties and edit the variable. This is probably less convenient than editing the expression itself.
edited Apr 12 at 18:42
answered Apr 12 at 18:27
cskcsk
10.1k1135
10.1k1135
add a comment |
add a comment |
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%2f318563%2fgetting-value-set-in-binding-input-widget-in-qgis-expression%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
1
you may be interested in
scale_linear(val, domain_min, domain_max, range_min, range_max)orscale_exp(val, domain_min, domain_max, range_min, range_max, exponent). Something likescale_linear("Stroke width", min("Stroke width"), max("Stroke width"), 1, 5)in Map Units– Taras
Apr 12 at 7:51