Hi,
At the moment an array or map data structure in an expression can only
be created by using the array() and map() constructor function where one
has to explicitly include all the values at the creation of the data
structure. Arrays can also be created from strings with the
string_to_array function.
Wouldn't it be useful if the arrays could be created by an aggregate
function and in particular the relation_aggregate function (esp. useful
for analyzing 1:n relations)?
Something like: aggregate(layer:='countries', aggregate:='array',
expression:="area") --> array with all areas of the countries
or
relation_aggregate(relation:='cities_in_countries',aggregate:='array',
calculation:="towns") --> array with all towns that are related to a
country.
---------------
Similar for maps:
aggregate(layer:='countries', aggregate:='map', expression:="area",
mapAttributes:="area, population") --> nested maps with all areas and
population per country.
or
relation_aggregate(relation:='cities_in_countries',aggregate:='map',
mapAttributes:="town_name,town_population") --> array with all town
attributes that are related to a country.
Any thoughts?
Andreas
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer