Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature][expression] refFunction port to core #38405

Merged
merged 49 commits into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
502291c
geometry_overlay implementation test
enricofer May 15, 2019
2e1c846
Fix code style of reffunctions
m-kuhn May 16, 2019
025c96a
Further intersect fixes
m-kuhn Jun 22, 2019
57d90fe
Add overlay expression function tests
m-kuhn Jun 24, 2019
c7fc079
Expression function improvements
m-kuhn Jun 24, 2019
42f40a1
Fix tests and caching
m-kuhn Jun 24, 2019
853c7cb
Add expression support
m-kuhn Jun 25, 2019
0594d95
Add todos
m-kuhn Jun 25, 2019
9d229b5
Generalize boilerplate code
m-kuhn Jun 26, 2019
c5616bd
new overlay functions
enricofer Jul 3, 2019
75759ea
overlay functions first implementation
enricofer Jul 7, 2019
a67d991
optional parameter handling, disjoint, nearest multiresult
enricofer Jul 8, 2019
a03e600
limit overlay nearest neighbors to 1
enricofer Jul 10, 2019
ba1b34d
geometry overlay functions test suite
enricofer Jul 10, 2019
cc5102e
limit features parameter; grow spatial index query geometry bbox for …
enricofer Jul 12, 2019
50e07df
limit parameter default changed to -1
enricofer Jul 12, 2019
e741750
further optional parameters decode hack
enricofer Jul 12, 2019
33e0710
right limit parameter extraction method
enricofer Jul 12, 2019
d724b88
exclude current feature for self overlay layer
enricofer Jul 14, 2019
d5f8adb
target layer with different crs reproject support
enricofer Jul 15, 2019
6bbcb3d
different crs reprojection code revision
enricofer Jul 15, 2019
a9d943d
Code style
m-kuhn Mar 13, 2020
86deebd
fix crash when QgsFeature has no layer
olivierdalang Jul 7, 2020
d4f8e2c
[refFunctions] (initial help text)
olivierdalang Jul 15, 2020
c738731
[refFunctions] remove *_test functions and factor repeated code
olivierdalang Aug 20, 2020
a393ad9
[refFunctions] remove *_test functions and factor repeated code
olivierdalang Aug 20, 2020
afd3c59
[refFunctions] add help texts
olivierdalang Aug 20, 2020
1654223
[refFunctions] reenable neighbours and max_distance for geometry_over…
olivierdalang Aug 20, 2020
6daafef
[refFunctions] fix not working in attribute table
olivierdalang Aug 20, 2020
6c5ee80
[refFunctions] honor testOnly parameter for geometry_overlay_nearest too
olivierdalang Aug 20, 2020
10367d0
[refFunctions] fix broken test, which now fails
olivierdalang Aug 20, 2020
39b5968
[refFunctions] remove neighbours param for geometry_overlay_nearest a…
olivierdalang Aug 20, 2020
7244f84
[refFunctions] fix tests
olivierdalang Aug 20, 2020
68c27a3
[refFunctions] add more tests
olivierdalang Aug 20, 2020
b1470aa
[refFunctions] help json
olivierdalang Aug 20, 2020
49f0d20
[refFunctions] astyle
olivierdalang Aug 20, 2020
26a3d6d
[refFunctions] add cache param
olivierdalang Sep 8, 2020
6c0eab7
[refFunctions] fix ordering with nearest
olivierdalang Sep 8, 2020
4626aa2
[refFunctions] refactor
olivierdalang Sep 8, 2020
e3150d0
[refFunctions] honor limit parameter on disjoint results
olivierdalang Sep 8, 2020
900cef3
[refFunctions] json helps and cleanup
olivierdalang Sep 8, 2020
6192cf9
[refFunctions] add self overlay test
olivierdalang Sep 9, 2020
751ad05
[refFunctions] fix overlay test
olivierdalang Sep 9, 2020
bcd6d53
[refFunctions] missing help description
olivierdalang Sep 9, 2020
ece763d
[refFunctions] cache expression and context
olivierdalang Sep 9, 2020
5213b15
[refFunctions] fix inversion of geomA and geomB !
olivierdalang Sep 9, 2020
723a6ef
Merge branch 'master' into refFunctionsRebase
olivierdalang Sep 9, 2020
9d27a53
[refFunctions] fix deadlocks
olivierdalang Sep 10, 2020
6f759f3
[refFunctions] fix (mistaken ?) spell check failure
olivierdalang Sep 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions resources/function_help/json/geometry_overlay_contains
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "geometry_overlay_contains",
"type": "function",
"description": "Performs a spatial join of type CONTAINS. This returns an array of results of an expression evaluated on features from a different layer that CONTAINS the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer CONTAINS the current feature.", "arguments": [
{
"arg": "layer",
"description": "the other layer"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
}
],
"examples": [
{
"expression": "geometry_overlay_contains('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_contains('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_contains('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_contains('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
}
50 changes: 50 additions & 0 deletions resources/function_help/json/geometry_overlay_crosses
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "geometry_overlay_crosses",
"type": "function",
"description": "Performs a spatial join of type CROSSES. This returns an array of results of an expression evaluated on features from a different layer that CROSSES the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer CROSSES the current feature.",
"arguments": [
{
"arg": "layer",
"description": "the other layer"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
}
],
"examples": [
{
"expression": "geometry_overlay_crosses('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_crosses('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_crosses('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_crosses('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
}
50 changes: 50 additions & 0 deletions resources/function_help/json/geometry_overlay_disjoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "geometry_overlay_disjoint",
"type": "function",
"description": "Performs a spatial join of type DISJOINT. This returns an array of results of an expression evaluated on features from a different layer that DISJOINT the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer DISJOINT the current feature.",
"arguments": [
{
"arg": "layer",
"description": "the other layer"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
}
],
"examples": [
{
"expression": "geometry_overlay_disjoint('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_disjoint('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_disjoint('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_disjoint('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
}
49 changes: 49 additions & 0 deletions resources/function_help/json/geometry_overlay_equals
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "geometry_overlay_equals",
"type": "function",
"description": "Performs a spatial join of type EQUALS. This returns an array of results of an expression evaluated on features from a different layer that EQUALS the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer EQUALS the current feature.","arguments": [
{
"arg": "layer",
"description": "the other layer"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
}
],
"examples": [
{
"expression": "geometry_overlay_equals('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_equals('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_equals('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_equals('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
}
50 changes: 50 additions & 0 deletions resources/function_help/json/geometry_overlay_intersects
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "geometry_overlay_intersects",
"type": "function",
"description": "Performs a spatial join of type INTERSECTS. This returns an array of results of an expression evaluated on features from a different layer that INTERSECTS the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer INTERSECTS the current feature.",
"arguments": [
{
"arg": "layer",
"description": "the other layer"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
}
],
"examples": [
{
"expression": "geometry_overlay_intersects('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_intersects('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_intersects('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_intersects('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
}
55 changes: 55 additions & 0 deletions resources/function_help/json/geometry_overlay_nearest
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "geometry_overlay_nearest",
"type": "function",
"description": "This returns an array of results of an expression evaluated on features from a different layer ordered BY DISTANCE to the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer was found. Note : this function can be slow and consume a lot of memory for large layers.",
"arguments": [
{
"arg": "layer",
"description": "the other layer"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, only the nearest feature will be returned)",
"optional": true
},
{
"arg": "max_distance",
"description": "an optional maximum distance to limit the number of matching features (if not set, only the nearest feature will be returned)",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
}
],
"examples": [
{
"expression": "geometry_overlay_nearest('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_nearest('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_nearest('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_nearest('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
}
50 changes: 50 additions & 0 deletions resources/function_help/json/geometry_overlay_touches
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "geometry_overlay_touches",
"type": "function",
"description": "Performs a spatial join of type TOUCHES. This returns an array of results of an expression evaluated on features from a different layer that TOUCHES the current feature, or, if no expression if provided, simply returns whether at least one feature from the other layer TOUCHES the current feature.",
"arguments": [
{
"arg": "layer",
"description": "the other layer"
},
{
"arg": "expression",
"description": "an optional expression to evaluate on the features from the other layer (if not set, the function will just return a boolean indicating whether there is at least one match)",
"optional": true
},
{
"arg": "filter",
"description": "an optional expression to filter the matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "limit",
"description": "an optional integer to limit the number of matching features (if not set, all features will be returned)",
"optional": true
},
{
"arg": "cache",
"description": "set this to true to build a local spatial index (most of the time, this is unwanted, unless you are working with a particularly slow data provider)",
"optional": true,
"default": false
}
],
"examples": [
{
"expression": "geometry_overlay_touches('regions')",
"returns": "True"
},
{
"expression": "geometry_overlay_touches('regions', name)",
"returns": "['South Africa', 'Africa', 'World']"
},
{
"expression": "geometry_overlay_touches('regions', name, name != 'World')",
"returns": "['South Africa', 'Africa']"
},
{
"expression": "geometry_overlay_touches('regions', name, limit:=1)",
"returns": "['South Africa']"
}
]
}
Loading