Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[expressions] New is_feature_valid()/is_attribute_valid() functions (#…
- Loading branch information
Showing
4 changed files
with
264 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "is_attribute_valid", | ||
"type": "function", | ||
"groups": ["Record and Attributes"], | ||
"description": "Returns TRUE if a specific feature attribute meets all constraints.", | ||
"arguments": [{ | ||
"arg": "attribute", | ||
"description": "an attribute name" | ||
},{ | ||
"arg": "feature", | ||
"description": "A feature. If not set, the feature attached to the expression context will be used.", | ||
"optional": true | ||
},{ | ||
"arg": "layer", | ||
"description": "A vector layer. If not set, the layer attached to the expression context will be used.", | ||
"optional": true | ||
},{ | ||
"arg": "strength", | ||
"description": "Set to 'hard' or 'soft' to narrow down to a specific constraint type. If not set, the function will return FALSE if either a hard or a soft constraint fails.", | ||
"optional": true | ||
}], | ||
"examples": [{ | ||
"expression": "is_attribute_valid('HECTARES')", | ||
"returns": "TRUE" | ||
}, { | ||
"expression": "is_attribute_valid('HOUSES',get_feature('my_layer', 'FID', 10), 'my_layer')", | ||
"returns": "FALSE" | ||
}], | ||
"tags": ["constraints", "hard", "soft"] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "is_feature_valid", | ||
"type": "function", | ||
"groups": ["Record and Attributes"], | ||
"description": "Returns TRUE if a feature meets all field constraints.", | ||
"arguments": [{ | ||
"arg": "feature", | ||
"description": "A feature. If not set, the feature attached to the expression context will be used.", | ||
"optional": true | ||
},{ | ||
"arg": "layer", | ||
"description": "A vector layer. If not set, the layer attached to the expression context will be used.", | ||
"optional": true | ||
},{ | ||
"arg": "strength", | ||
"description": "Set to 'hard' or 'soft' to narrow down to a specific constraint type. If not set, the function will return FALSE if either a hard or a soft constraint fails.", | ||
"optional": true | ||
}], | ||
"examples": [{ | ||
"expression": "is_feature_valid(strength:='hard')", | ||
"returns": "TRUE" | ||
}, { | ||
"expression": "is_feature_valid(get_feature('my_layer', 'FID', 10), 'my_layer')", | ||
"returns": "FALSE" | ||
}], | ||
"tags": ["constraints", "hard", "soft"] | ||
} |
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