Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replace $-based functions with their corresponding @ variable in expr…
…ession examples

Also cleans a little bit tags list
  • Loading branch information
DelazJ authored and nyalldawson committed May 11, 2023
1 parent dd00077 commit c9af189
Show file tree
Hide file tree
Showing 32 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion resources/function_help/json/IS
Expand Up @@ -26,7 +26,7 @@
"expression": "4 IS 2",
"returns": "FALSE"
}, {
"expression": "$geometry IS NULL",
"expression": "@geometry IS NULL",
"returns": "0, if your geometry is not NULL"
}],
"tags": ["compare", "same", "equal", "identical"]
Expand Down
6 changes: 3 additions & 3 deletions resources/function_help/json/aggregate
Expand Up @@ -39,13 +39,13 @@
"expression": "aggregate(layer:='rail_stations',aggregate:='concatenate', expression:=\"name\", concatenator:=',')",
"returns": "comma separated list of the name field for all features in the rail_stations layer"
}, {
"expression": "aggregate(layer:='countries', aggregate:='max', expression:=\"code\", filter:=intersects( $geometry, geometry(@parent) ) )",
"expression": "aggregate(layer:='countries', aggregate:='max', expression:=\"code\", filter:=intersects( @geometry, geometry(@parent) ) )",
"returns": "The country code of an intersecting country on the layer 'countries'"
}, {
"expression": "aggregate(layer:='rail_stations',aggregate:='sum',expression:=\"passengers\",filter:=contains( @atlas_geometry, $geometry ) )",
"expression": "aggregate(layer:='rail_stations',aggregate:='sum',expression:=\"passengers\",filter:=contains( @atlas_geometry, @geometry ) )",
"returns": "sum of all values from the passengers field in the rail_stations within the current atlas feature"
}, {
"expression": "aggregate(layer:='rail_stations', aggregate:='collect', expression:=centroid($geometry), filter:=\"region_name\" = attribute(@parent,'name') )",
"expression": "aggregate(layer:='rail_stations', aggregate:='collect', expression:=centroid(@geometry), filter:=\"region_name\" = attribute(@parent,'name') )",
"returns": "aggregates centroid geometries of the rail_stations of the same region as current feature"
}],
"tags": ["aggregate", "combine", "features", "calculated", "merge", "concatenate", "sum", "mean", "median", "count", "quartile", "minimum", "maximum", "minority", "majority", "standard", "deviation", "length", "unique"]
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/bounds
Expand Up @@ -8,7 +8,7 @@
"description": "a geometry"
}],
"examples": [{
"expression": "bounds($geometry)",
"expression": "bounds(@geometry)",
"returns": "bounding box of the current feature's geometry"
}, {
"expression": "geom_to_wkt(bounds(geom_from_wkt('Polygon((1 1, 0 0, -1 1, 1 1))')))",
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/bounds_height
Expand Up @@ -8,7 +8,7 @@
"description": "a geometry"
}],
"examples": [{
"expression": "bounds_height($geometry)",
"expression": "bounds_height(@geometry)",
"returns": "height of bounding box of the current feature's geometry"
}, {
"expression": "bounds_height(geom_from_wkt('Polygon((1 1, 0 0, -1 1, 1 1))'))",
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/bounds_width
Expand Up @@ -8,7 +8,7 @@
"description": "a geometry"
}],
"examples": [{
"expression": "bounds_width($geometry)",
"expression": "bounds_width(@geometry)",
"returns": "width of bounding box of the current feature's geometry"
}, {
"expression": "bounds_width(geom_from_wkt('Polygon((1 1, 0 0, -1 1, 1 1))'))",
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/buffer
Expand Up @@ -31,7 +31,7 @@
"description": "miter distance limit, for use when the join style is set to 'miter'"
}],
"examples": [{
"expression": "buffer($geometry, 10.5)",
"expression": "buffer(@geometry, 10.5)",
"returns": "polygon of the current feature's geometry buffered by 10.5 units"
}],
"tags": ["distance", "equal", "spatial", "reference", "calculations", "system", "points", "segments", "miter", "join", "cap", "round"]
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/centroid
Expand Up @@ -8,7 +8,7 @@
"description": "a geometry"
}],
"examples": [{
"expression": "centroid($geometry)",
"expression": "centroid(@geometry)",
"returns": "a point geometry"
}],
"tags": ["geometric", "center"]
Expand Down
4 changes: 2 additions & 2 deletions resources/function_help/json/collect
Expand Up @@ -16,10 +16,10 @@
"description": "optional expression to use to filter features used to calculate aggregate"
}],
"examples": [{
"expression": "collect( $geometry )",
"expression": "collect( @geometry )",
"returns": "multipart geometry of aggregated geometries"
}, {
"expression": "collect( centroid($geometry), group_by:=\"region\", filter:= \"use\" = 'civilian' )",
"expression": "collect( centroid(@geometry), group_by:=\"region\", filter:= \"use\" = 'civilian' )",
"returns": "aggregated centroids of the civilian features based on their region value"
}],
"tags": ["aggregated", "multipart"]
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/display_expression
Expand Up @@ -41,7 +41,7 @@
"expression": "display_expression( 'streets', get_feature_by_id('streets', 1))",
"returns": "The display expression of the feature with the ID 1 on the layer 'streets'."
}, {
"expression": "display_expression('a_layer_id', $currentfeature, 'False')",
"expression": "display_expression('a_layer_id', @feature, 'False')",
"returns": "The display expression of the given feature not evaluated."
}]
}],
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/geom_to_wkb
Expand Up @@ -8,7 +8,7 @@
"description": "a geometry"
}],
"examples": [{
"expression": "geom_to_wkb( $geometry )",
"expression": "geom_to_wkb( @geometry )",
"returns": "binary blob containing a geometry object"
}],
"tags": ["wkb", "binary", "representation", "known", "conversion"]
Expand Down
6 changes: 3 additions & 3 deletions resources/function_help/json/geometry
Expand Up @@ -8,13 +8,13 @@
"description": "a feature object"
}],
"examples": [{
"expression": " geometry( $currentfeature )",
"returns": "the geometry of the current feature. Prefer using $geometry."
"expression": "geometry( @feature )",
"returns": "the geometry of the current feature. Prefer using @geometry."
}, {
"expression": "geom_to_wkt( geometry( get_feature_by_id( 'streets', 1 ) ) )",
"returns": "the geometry in WKT of the feature with the id 1 on the layer \"streets\", e.g. 'POINT(6 50)'"
}, {
"expression": "intersects( $geometry, geometry( get_feature( 'streets', 'name', 'Main St.' ) ) )",
"expression": "intersects( @geometry, geometry( get_feature( 'streets', 'name', 'Main St.' ) ) )",
"returns": "TRUE if the current feature spatially intersects the 'Main St.' named feature in the \"streets\" layer"
}],
"tags": []
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/is_empty_or_null
Expand Up @@ -2,7 +2,7 @@
"name": "is_empty_or_null",
"type": "function",
"groups": ["GeometryGroup"],
"description": "Returns TRUE if a geometry is NULL or empty (without coordinates) or false otherwise. This function is like the expression '$geometry IS NULL or is_empty($geometry)'",
"description": "Returns TRUE if a geometry is NULL or empty (without coordinates) or false otherwise. This function is like the expression '@geometry IS NULL or is_empty(@geometry)'",
"arguments": [{
"arg": "geometry",
"description": "a geometry"
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/maptip
Expand Up @@ -41,7 +41,7 @@
"expression": "maptip('streets', get_feature_by_id('streets', 1))",
"returns": "The maptip of the feature with the ID 1 on the layer 'streets'."
}, {
"expression": "maptip('a_layer_id', $currentfeature, 'False')",
"expression": "maptip('a_layer_id', @feature, 'False')",
"returns": "The maptip of the given feature not evaluated."
}]
}],
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/num_points
Expand Up @@ -8,7 +8,7 @@
"description": "a geometry"
}],
"examples": [{
"expression": "num_points($geometry)",
"expression": "num_points(@geometry)",
"returns": "number of vertices in the current feature's geometry"
}],
"tags": ["vertices"]
Expand Down
8 changes: 4 additions & 4 deletions resources/function_help/json/offset_curve
Expand Up @@ -26,16 +26,16 @@
"description": "limit on the miter ratio used for very sharp corners (when using miter joins only)"
}],
"examples": [{
"expression": "offset_curve($geometry, 10.5)",
"expression": "offset_curve(@geometry, 10.5)",
"returns": "line offset to the left by 10.5 units"
}, {
"expression": "offset_curve($geometry, -10.5)",
"expression": "offset_curve(@geometry, -10.5)",
"returns": "line offset to the right by 10.5 units"
}, {
"expression": "offset_curve($geometry, 10.5, segments:=16, join:=1)",
"expression": "offset_curve(@geometry, 10.5, segments:=16, join:=1)",
"returns": "line offset to the left by 10.5 units, using more segments to result in a smoother curve"
}, {
"expression": "offset_curve($geometry, 10.5, join:=3)",
"expression": "offset_curve(@geometry, 10.5, join:=3)",
"returns": "line offset to the left by 10.5 units, using a beveled join"
}],
"tags": ["spatial", "offsetting", "reference", "system", "linestring", "formed", "distances", "side"]
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/order_parts
Expand Up @@ -16,7 +16,7 @@
"description": "boolean, True for ascending, False for descending"
}],
"examples": [{
"expression": "geom_to_wkt(order_parts(geom_from_wkt('MultiPolygon (((1 1, 5 1, 5 5, 1 5, 1 1)),((1 1, 9 1, 9 9, 1 9, 1 1)))'), 'area($geometry)', False))",
"expression": "geom_to_wkt(order_parts(geom_from_wkt('MultiPolygon (((1 1, 5 1, 5 5, 1 5, 1 1)),((1 1, 9 1, 9 9, 1 9, 1 1)))'), 'area(@geometry)', False))",
"returns": "'MultiPolygon (((1 1, 9 1, 9 9, 1 9, 1 1)),((1 1, 5 1, 5 5, 1 5, 1 1)))'"
}, {
"expression": "geom_to_wkt(order_parts(geom_from_wkt('LineString(1 2, 3 2, 4 3)'), '1', True))",
Expand Down
4 changes: 2 additions & 2 deletions resources/function_help/json/overlay_contains
Expand Up @@ -40,8 +40,8 @@
"expression": "array_sort(overlay_contains(layer:='regions', expression:=\"name\", filter:= population > 10000))",
"returns": "an ordered array of names, for the regions contained in the current feature and with a population greater than 10000"
}, {
"expression": "overlay_contains(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"expression": "overlay_contains(layer:='regions', expression:= geom_to_wkt(@geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions contained in the current feature"
}],
"tags": ["least", "predicate", "current", "contained", "target", "contains", "array", "geos", "st_contains", "postgis", "described", "underlying", "features"]
"tags": ["predicate", "contained", "target", "contains", "array", "geos", "st_contains", "postgis", "underlying", "features"]
}
4 changes: 2 additions & 2 deletions resources/function_help/json/overlay_crosses
Expand Up @@ -40,8 +40,8 @@
"expression": "array_sort(overlay_crosses(layer:='regions', expression:=\"name\", filter:= population > 10000))",
"returns": "an ordered array of names, for the regions crossed by the current feature and with a population greater than 10000"
}, {
"expression": "overlay_crosses(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"expression": "overlay_crosses(layer:='regions', expression:= geom_to_wkt(@geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions crossed by the current feature"
}],
"tags": ["predicate", "st_crosses", "crosses", "current", "target", "array", "geos", "described", "underlying", "features", "crossed"]
"tags": ["predicate", "st_crosses", "crosses", "current", "target", "array", "geos", "underlying", "features", "crossed"]
}
4 changes: 2 additions & 2 deletions resources/function_help/json/overlay_disjoint
Expand Up @@ -40,8 +40,8 @@
"expression": "array_sort(overlay_disjoint(layer:='regions', expression:=\"name\", filter:= population > 10000))",
"returns": "an ordered array of names, for the regions spatially disjoint from the current feature and with a population greater than 10000"
}, {
"expression": "overlay_disjoint(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"expression": "overlay_disjoint(layer:='regions', expression:= geom_to_wkt(@geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions spatially disjoint from the current feature"
}],
"tags": ["predicate", "st_disjoint", "disjoint", "current", "target", "array", "geos", "described", "underlying", "features"]
"tags": ["predicate", "st_disjoint", "disjoint", "current", "target", "array", "geos", "underlying", "features"]
}
2 changes: 1 addition & 1 deletion resources/function_help/json/overlay_equals
Expand Up @@ -40,7 +40,7 @@
"expression": "array_sort(overlay_equals(layer:='regions', expression:=\"name\", filter:= population > 10000))",
"returns": "an ordered array of names, for the regions spatially equal to the current feature and with a population greater than 10000"
}, {
"expression": "overlay_equals(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"expression": "overlay_equals(layer:='regions', expression:= geom_to_wkt(@geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions spatially equal to the current feature"
}],
"tags": ["predicate", "current", "equals", "equal", "target", "array", "geos", "st_equals", "described", "underlying", "features"]
Expand Down
8 changes: 4 additions & 4 deletions resources/function_help/json/overlay_intersects
Expand Up @@ -72,7 +72,7 @@
"returns": "an ordered array of names, for the regions intersected by the current feature and with a population greater than 10000"
},
{
"expression": "overlay_intersects(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"expression": "overlay_intersects(layer:='regions', expression:= geom_to_wkt(@geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions intersected by the current feature"
},
{
Expand All @@ -84,13 +84,13 @@
"returns": "TRUE if the current feature spatially intersects a region and the intersection area maximum inscribed circle's radius (of at least one of the parts in case of multipart) is greater or equal to 0.54"
},
{
"expression": "overlay_intersects(layer:='regions', expression:= geom_to_wkt($geometry), return_details:=true)",
"expression": "overlay_intersects(layer:='regions', expression:= geom_to_wkt(@geometry), return_details:=true)",
"returns": "an array of maps containing 'id', 'result', 'overlap' and 'radius'"
},
{
"expression": "overlay_intersects(layer:='regions', expression:= geom_to_wkt($geometry), sort_by_intersection_size:='des')",
"expression": "overlay_intersects(layer:='regions', expression:= geom_to_wkt(@geometry), sort_by_intersection_size:='des')",
"returns": "an array of geometries (in WKT) ordered by the overlap value in descending order"
}
],
"tags": ["intersected", "least", "predicate", "current", "target", "array", "geos", "postgis", "described", "st_intersects", "intersects", "underlying", "features"]
"tags": ["intersected", "predicate", "current", "target", "array", "geos", "postgis", "described", "st_intersects", "intersects", "underlying", "features"]
}
2 changes: 1 addition & 1 deletion resources/function_help/json/overlay_nearest
Expand Up @@ -51,5 +51,5 @@
"expression": "overlay_nearest(layer:='airports', expression:=\"name\", limit:= -1, max_distance:= 5000)",
"returns": "an array of names, for all the airports within a distance of 5000 map units from the current feature, ordered by distance"
}],
"tags": ["distance", "layers", "large", "slow", "current", "target", "array", "lot", "features"]
"tags": ["distance", "near", "close", "current", "target", "array", "features"]
}
4 changes: 2 additions & 2 deletions resources/function_help/json/overlay_touches
Expand Up @@ -40,8 +40,8 @@
"expression": "array_sort(overlay_touches(layer:='regions', expression:=\"name\", filter:= population > 10000))",
"returns": "an ordered array of names, for the regions touched by the current feature and with a population greater than 10000"
}, {
"expression": "overlay_touches(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"expression": "overlay_touches(layer:='regions', expression:= geom_to_wkt(@geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions touched by the current feature"
}],
"tags": ["least", "predicate", "touches", "current", "target", "array", "geos", "described", "underlying", "touched", "st_touches", "features"]
"tags": ["predicate", "touches", "current", "target", "array", "geos", "touched", "st_touches", "features"]
}
4 changes: 2 additions & 2 deletions resources/function_help/json/overlay_within
Expand Up @@ -40,8 +40,8 @@
"expression": "array_sort(overlay_within(layer:='regions', expression:=\"name\", filter:= population > 10000))",
"returns": "an ordered array of names, for the regions containing the current feature and with a population greater than 10000"
}, {
"expression": "overlay_within(layer:='regions', expression:= geom_to_wkt($geometry), limit:=2)",
"expression": "overlay_within(layer:='regions', expression:= geom_to_wkt(@geometry), limit:=2)",
"returns": "an array of geometries (in WKT), for up to two regions containing the current feature"
}],
"tags": ["predicate", "current", "contain", "target", "array", "geos", "described", "underlying", "features"]
"tags": ["predicate", "current", "contain", "target", "array", "geos", "underlying", "features"]
}
4 changes: 2 additions & 2 deletions resources/function_help/json/point_on_surface
Expand Up @@ -8,8 +8,8 @@
"description": "a geometry"
}],
"examples": [{
"expression": "point_on_surface($geometry)",
"expression": "point_on_surface(@geometry)",
"returns": "a point geometry"
}],
"tags": ["point", "surface", "lie", "centroid", "overlay"]
"tags": ["point", "surface", "lie", "centroid", "overlay", "within"]
}
2 changes: 1 addition & 1 deletion resources/function_help/json/pole_of_inaccessibility
Expand Up @@ -14,5 +14,5 @@
"expression": "geom_to_wkt(pole_of_inaccessibility( geom_from_wkt('POLYGON((0 1, 0 9, 3 10, 3 3, 10 3, 10 1, 0 1))'), 0.1))",
"returns": "'Point(1.546875 2.546875)'"
}],
"tags": ["inaccessibility", "precise", "tolerances", "calculates", "guaranteed", "boundary", "require", "point", "true", "iterations", "internal", "uses", "approximate", "approach", "polylabel", "find", "distant", "calculate", "pole", "take", "surface", "specified", "tolerance", "iterative"]
"tags": ["inaccessibility", "precise", "tolerances", "boundary", "iterations", "internal", "approximate", "approach", "polylabel", "distant", "pole"]
}
4 changes: 2 additions & 2 deletions resources/function_help/json/rotate
Expand Up @@ -21,10 +21,10 @@
"description": "apply rotation per part. If true, then rotation will apply around the center of each part's bounding box when the input geometry is multipart and an explicit rotation center point is not specified."
}],
"examples": [{
"expression": "rotate($geometry, 45, make_point(4, 5))",
"expression": "rotate(@geometry, 45, make_point(4, 5))",
"returns": "geometry rotated 45 degrees clockwise around the (4, 5) point"
}, {
"expression": "rotate($geometry, 45)",
"expression": "rotate(@geometry, 45)",
"returns": "geometry rotated 45 degrees clockwise around the center of its bounding box"
}],
"tags": ["version", "spatial", "reference", "calculations", "rotated", "system"]
Expand Down
6 changes: 3 additions & 3 deletions resources/function_help/json/scale
Expand Up @@ -18,11 +18,11 @@
"description": "scaling center point. If not specified, the center of the geometry's bounding box is used."
}],
"examples": [{
"expression": "scale($geometry, 2, 0.5, make_point(4, 5))",
"expression": "scale(@geometry, 2, 0.5, make_point(4, 5))",
"returns": "geometry scaled twice horizontally and halved vertically, around the (4, 5) point"
}, {
"expression": "scale($geometry, 2, 0.5)",
"expression": "scale(@geometry, 2, 0.5)",
"returns": "geometry twice horizontally and halved vertically, around the center of its bounding box"
}],
"tags": ["version", "scaled", "spatial", "reference", "calculations", "system"]
"tags": ["scaled", "spatial", "affine", "calculations", "resize"]
}
8 changes: 4 additions & 4 deletions resources/function_help/json/single_sided_buffer
Expand Up @@ -26,16 +26,16 @@
"description": "limit on the miter ratio used for very sharp corners (when using miter joins only)"
}],
"examples": [{
"expression": "single_sided_buffer($geometry, 10.5)",
"expression": "single_sided_buffer(@geometry, 10.5)",
"returns": "line buffered to the left by 10.5 units"
}, {
"expression": "single_sided_buffer($geometry, -10.5)",
"expression": "single_sided_buffer(@geometry, -10.5)",
"returns": "line buffered to the right by 10.5 units"
}, {
"expression": "single_sided_buffer($geometry, 10.5, segments:=16, join:=1)",
"expression": "single_sided_buffer(@geometry, 10.5, segments:=16, join:=1)",
"returns": "line buffered to the left by 10.5 units, using more segments to result in a smoother buffer"
}, {
"expression": "single_sided_buffer($geometry, 10.5, join:=3)",
"expression": "single_sided_buffer(@geometry, 10.5, join:=3)",
"returns": "line buffered to the left by 10.5 units, using a beveled join"
}],
"tags": ["buffering", "spatial", "reference", "system", "linestring", "formed", "distances", "side"]
Expand Down
2 changes: 1 addition & 1 deletion resources/function_help/json/translate
Expand Up @@ -14,7 +14,7 @@
"description": "delta y"
}],
"examples": [{
"expression": "translate($geometry, 5, 10)",
"expression": "translate(@geometry, 5, 10)",
"returns": "a geometry of the same type like the original one"
}],
"tags": ["spatial", "reference", "calculations", "system", "translated", "displace", "move"]
Expand Down

0 comments on commit c9af189

Please sign in to comment.