mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-10 00:13:55 -04:00
This adds a second variant for the existing "attribute" function. The current function requires both a target feature and attribute name to be specified, while the NEW variant just uses the current feature. E.g. NEW: attribute( 'name' ) -> returns the value stored in 'name' attribute for the current feature EXISTING: attribute( @atlas_feature, 'name' ) -> returns value stored in 'name' attribute for the current atlas feature It's just a faster shorthand version!
17 lines
932 B
Plaintext
17 lines
932 B
Plaintext
{
|
|
"name": "attribute",
|
|
"type": "function",
|
|
"description": "Returns an attribute from a feature.",
|
|
"variants": [
|
|
{ "variant": "Variant 1",
|
|
"variant_description": "Returns the value of an attribute from the current feature.",
|
|
"arguments": [ {"arg":"attribute_name","description":"name of attribute to be returned"}],
|
|
"examples": [ { "expression":"attribute( 'name' )", "returns":"value stored in 'name' attribute for the current feature"}] },
|
|
{ "variant": "Variant 2",
|
|
"variant_description": "Allows the target feature and attribute name to be specified.",
|
|
"arguments": [ {"arg":"feature","description":"a feature"},
|
|
{"arg":"attribute_name","description":"name of attribute to be returned"}],
|
|
"examples": [ { "expression":"attribute( @atlas_feature, 'name' )", "returns":"value stored in 'name' attribute for the current atlas feature"}] }
|
|
]
|
|
}
|