Skip to content

Commit

Permalink
Use @variable in replacement of $function in expression build
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ committed May 12, 2023
1 parent f0b6755 commit 1273154
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 44 deletions.
10 changes: 5 additions & 5 deletions docs/user_manual/expressions/expression_help/Aggregates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ Returns an aggregate value calculated using features from another layer.
* ``aggregate('rail_stations','sum', "passengers"/7)`` → calculates a daily average of "passengers" by dividing the "passengers" field by 7 before summing the values
* ``aggregate(layer:='rail_stations',aggregate:='sum',expression:="passengers",filter:="class">3)`` → sums up all values from the "passengers" field from features where the "class" attribute is greater than 3 only
* ``aggregate(layer:='rail_stations',aggregate:='concatenate', expression:="name", concatenator:=',')`` → comma separated list of the name field for all features in the rail_stations layer
* ``aggregate(layer:='countries', aggregate:='max', expression:="code", filter:=intersects( $geometry, geometry(@parent) ) )`` → The country code of an intersecting country on the layer 'countries'
* ``aggregate(layer:='rail_stations',aggregate:='sum',expression:="passengers",filter:=contains( @atlas_geometry, $geometry ) )`` → sum of all values from the passengers field in the rail_stations within the current atlas feature
* ``aggregate(layer:='rail_stations', aggregate:='collect', expression:=centroid($geometry), filter:="region_name" = attribute(@parent,'name') )`` → aggregates centroid geometries of the rail_stations of the same region as current feature
* ``aggregate(layer:='countries', aggregate:='max', expression:="code", filter:=intersects( @geometry, geometry(@parent) ) )`` → The country code of an intersecting country on the layer 'countries'
* ``aggregate(layer:='rail_stations',aggregate:='sum',expression:="passengers",filter:=contains( @atlas_geometry, @geometry ) )`` → sum of all values from the passengers field in the rail_stations within the current atlas feature
* ``aggregate(layer:='rail_stations', aggregate:='collect', expression:=centroid(@geometry), filter:="region_name" = attribute(@parent,'name') )`` → aggregates centroid geometries of the rail_stations of the same region as current feature


.. end_aggregate_section
Expand Down Expand Up @@ -110,8 +110,8 @@ Returns the multipart geometry of aggregated geometries from an expression
* **group_by** - optional expression to use to group aggregate calculations
* **filter** - optional expression to use to filter features used to calculate aggregate
* - Examples
- * ``collect( $geometry )`` → multipart geometry of aggregated geometries
* ``collect( centroid($geometry), group_by:="region", filter:= "use" = 'civilian' )`` → aggregated centroids of the civilian features based on their region value
- * ``collect( @geometry )`` → multipart geometry of aggregated geometries
* ``collect( centroid(@geometry), group_by:="region", filter:= "use" = 'civilian' )`` → aggregated centroids of the civilian features based on their region value


.. end_collect_section
Expand Down

0 comments on commit 1273154

Please sign in to comment.