Diskussion:Workshop QGIS Python GeoPython 2017: Unterschied zwischen den Versionen

Aus Geoinformation HSR
Wechseln zu: Navigation, Suche
K
K
Zeile 19: Zeile 19:
 
## "Rule based labeling". Layer Properties > Labels > Select Rule based labeling from the drop-down menu > Click on the '+' button and add a CEF based filter (... button).
 
## "Rule based labeling". Layer Properties > Labels > Select Rule based labeling from the drop-down menu > Click on the '+' button and add a CEF based filter (... button).
 
## Part of "Geometry generator" in "Style > Symbol Layer Type"
 
## Part of "Geometry generator" in "Style > Symbol Layer Type"
 
 
 
''(Add other places to the list above if you find more)''.
 
''(Add other places to the list above if you find more)''.
 
  
 
== Possible examples ==
 
== Possible examples ==

Version vom 7. Mai 2017, 14:40 Uhr

See also

User Defined or Custom Expression Functions (custom EFns) can be used in ...

  1. "Server-side" / data-related:
    1. "Select features using an expression" (Layer property).
    2. "Filtering features" while loading from source. Switch to the form view in the attribute table (button on bottom right corner) > click on 'Show All Features' (bottom left) and select 'Advanced Filter (Expression)'.
    3. "Layer > Properties > Tab Fields" in Button "Text Edit" in Default- and in Constraints-Field.
    4. "Layer > Properties > Tab Style" in "Label with".
    5. "Field Calculator" to defining new or virtual fields (Layer property).
    6. "Conditional formatting" in the attribute table (Create a new rule and set the condition to the output of a custom EFn).
  2. Analysis-related:
    1. "Statistical Summary" Panel (Layer property).
    2. "Atlas Generation" in the Print Composer. Project > Print Composer > Check 'generate an atlas' > Set CEF based values for page name, filter and output filename.
  3. "Client-side" / style-related:
    1. "Map Tip" tool (Layer property).
    2. "Rule based labeling". Layer Properties > Labels > Select Rule based labeling from the drop-down menu > Click on the '+' button and add a CEF based filter (... button).
    3. Part of "Geometry generator" in "Style > Symbol Layer Type"

(Add other places to the list above if you find more).

Possible examples

  1. Function doing something "local" like from other field(s).
  2. Functions reading something like a "Singleton" like a system environment variable (usage "env('USERNAME')") layer properties or number sequence (spcial Plugin needed?).
  3. Function for remote webservice: geocoding (reading from the internet).
  4. Out of scope: Function reading from other layers (rather candidate for a plugin).

After the GeoPython Workshop, Simran makes pull request to Expression Plus Plugin adding "env()" fn.

Optional (but highly demanded) use case: A user wants to create a layer (table) which as a primary key (id) which behaves like 'autoincrement' when user edit a new feature. So user does not have to care about unique, sequential values for the PK, like autoincrement in MySQL). In QGIS 3 this is available when user chooses "UNIQUE" as constraint. In QGIS 2.18 (or before) there is a clever custom expression function needed. => Solution?

Notes

Collected (special) use cases:

Plugins:

Open: