[QGIS-Developer] QGIS expressions: map vs dict

Andreas Neumann a.neumann at carto.net
Fri Aug 4 11:01:07 PDT 2017

Hi devs, Hi Patrick,

I noticed that in QGIS master there is a new group of expressions called 
"Maps". I think they have been developed by pvalsecc (Camptocamp). 
First, thanks for adding them!

I know that is has been added a while ago, but I would like to discuss, 
if this group of functions could be renamed to "Dicts", with a prefix of 
"dict_xx" instead of "map_xx". Alternatively, it could be named "kvp_" 
(key/value pairs).

The reasoning is that in the future we may want to have multiple maps 
per project and we may want to reserve "Maps" for actual maps 
(identified by name or id).

Besides, users that do not know programming, might not understand that 
this is not about maps, but actually about a dictionary data structure 
or key/value pairs.


Another thing: the declaration of a "map" or "dict" could be improved:

The current notation is:
map('1','one','2', 'two')

Wouldn't it be nicer to have something like:
map('1':'one', '2':'two') or map('1':='one', '2':='two')

It would be easier to read than just a lot of commas, where every second 
one is a key, resp. the value.

Any thoughts on these two issues about "map" expressions?



More information about the QGIS-Developer mailing list