[QGIS-Developer] Per Project Python custom expressions in QGIS 3.0?

Richard Duivenvoorde rdmailings at duif.net
Mon May 8 06:51:34 PDT 2017


On 08-05-17 15:13, Neumann, Andreas wrote:
> Hi,
> 
> My recent custom Python expressions I developed. clearly belong to a
> specific project and can't be used in the context of a different project
> - because they rely on the presence of specific data layers.
> 
> Question: could we introduce "per project" custom Python expresssions in
> QGIS 3.0 as opposed to per user ones? The idea would be to store them in
> the project file. This would make the deployment of the project much
> easier, as I wouldn't have to also distribute the expression functions
> to the users who want to use this specific project.
> 
> Thanks for your feedback/discussion,

I have a use-case in the same category: having a style with 2 custom
icons, I want to distribute the style (be it qml or sld) to people
INCLUDING those 2 svg icon files...

Was also thinking about 'merging' the svg into the project xml, but on
second thought we should maybe do have a thorough thinking about this...

I think this touches Nathan's profile work...

/start brainwave

Because actually a 'project file' contains often just a part (and not
all) of what you actually need to startup the full project?

Is it an idea to see a 'profile'-directory as a 'temporary' addition of
the QGIS-paths? Like the 'svg' directory in the profile to use is
temporarily added to the svg-paths environment (there by making those
two icons available to the user of this profile).

The same could be done for expressions (the expressions/pythons would be
temporarily available to the project because they are available in the
profile).

Maybe a project 'file' should actually be a (zipped) directory?

During 'Essen' we had a short discussion that it QGIS maybe could
benefit from some more clear 'definition' of terms like: what is exactly
a 'legend', 'datastore', 'connection', 'profile', 'layer' etc etc (as
part of the discussion 'one button to rule them all': is it a 'add layer
dialog' or a 'data manager' or 'datastore manager' or...

/stop brainwave

It is good to have some discussion about this here I think (instead of
patching it into current structures)

Regards,

Richard Duivenvoorde








More information about the QGIS-Developer mailing list