2015-06-11 12:02:27 +10:00
|
|
|
{
|
2015-09-20 17:12:43 +02:00
|
|
|
"name": "get_feature",
|
|
|
|
"type": "function",
|
2020-07-02 01:46:48 +01:00
|
|
|
"groups": ["Record and Attributes"],
|
2015-06-11 12:02:27 +10:00
|
|
|
"description": "Returns the first feature of a layer matching a given attribute value.",
|
2022-01-07 08:33:29 -05:00
|
|
|
"variants": [{
|
|
|
|
"variant": "Single value variant",
|
|
|
|
"variant_description": "Along with the layer ID, a single column and value are specified.",
|
|
|
|
"arguments": [{
|
|
|
|
"arg": "layer",
|
|
|
|
"description": "layer name or ID"
|
|
|
|
}, {
|
|
|
|
"arg": "attribute",
|
|
|
|
"description": "attribute name to use for the match"
|
|
|
|
}, {
|
|
|
|
"arg": "value",
|
|
|
|
"description": "attribute value to match"
|
|
|
|
}],
|
|
|
|
"examples": [{
|
|
|
|
"expression": "get_feature('streets','name','main st')",
|
|
|
|
"returns": "first feature found in \"streets\" layer with \"main st\" value in the \"name\" field"
|
|
|
|
}]
|
|
|
|
}, {
|
|
|
|
"variant": "Map variant",
|
|
|
|
"variant_description": "Along with the layer ID, a map containing the columns (key) and their respective value to be used.",
|
|
|
|
"arguments": [{
|
|
|
|
"arg": "layer",
|
|
|
|
"description": "layer name or ID"
|
|
|
|
}, {
|
2022-02-23 08:40:12 +10:00
|
|
|
"arg": "attribute",
|
2022-01-07 08:33:29 -05:00
|
|
|
"description": "Map containing the column and value pairs to use"
|
|
|
|
}],
|
|
|
|
"examples": [{
|
|
|
|
"expression": "get_feature('streets',map('name','main st','lane_num','4'))",
|
|
|
|
"returns": "first feature found in \"streets\" layer with \"main st\" value in the \"name\" field and \"4\" value in the \"lane_num\" field"
|
|
|
|
}]
|
|
|
|
}],
|
2022-01-11 11:17:49 -05:00
|
|
|
"tags": ["attribute", "first", "matching", "search", "find"]
|
2015-06-11 12:02:27 +10:00
|
|
|
}
|