Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE][expressions] Simplified variant of "attribute" function
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!
- Loading branch information
1 parent
3433c9c
commit db1a192
Showing
3 changed files
with
66 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
{ | ||
"name": "attribute", | ||
"type": "function", | ||
"description": "Returns the value of a specified attribute from a feature.", | ||
"arguments": [ {"arg":"feature","description":"a feature"}, | ||
{"arg":"attribute_name","description":"name of attribute to be returned"}], | ||
"examples": [ { "expression":"attribute( $currentfeature, 'name' )", "returns":"value stored in 'name' attribute for the current feature"}] | ||
"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"}] } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters