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

Aus Geoinformation HSR
Wechseln zu: Navigation, Suche
K
(Usage of Expression Functions)
 
(14 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
 
See also
 
See also
* [[GeoPython Workshop Plan]]
+
* Step-by-step guide for the workshop on [https://github.com/simran001/GeoPython-Workshop/blob/master/README.md Github.]
 
* https://github.com/simran001/PyQGIS
 
* https://github.com/simran001/PyQGIS
 
* https://etherpad.coredump.ch/p/Python-Workshop
 
* https://etherpad.coredump.ch/p/Python-Workshop
  
User Defined or ''Custom Expression Functions (CEFs)'' can be used in ...
+
== Usage of Expression Functions ==
# "Layer > Properties > Tab Fields" in Button "Text Edit" in Default- and in Constraints-Field.
 
# "Layer > Properties > Tab Style" in "Label with".
 
# "Select features using an expression".
 
# "Field Calculator".
 
# "Statistical Summary" Panel.
 
# (other places?)
 
  
== Possible examples ==
+
Examples where Expression Functions (EFns) can be used in QGIS are: symbology, labeling, calculating fields, defining virtual fields, selecting and filtering data, layouts, atlas serial printing and reports, map tips, custom python expressions, parameters for processing, and many more.
 +
 
 +
This is a more systematic list:
 +
# "Server-side" / data-related:
 +
## "Select features using an expression" based on a field(Layer property).
 +
## "Filtering features" while loading from source. See form view of Attribute table (button on bottom right corner) > click on 'Show All Features' (bottom left) and select 'Advanced Filter (Expression)'.
 +
## "Layer > Properties > Tab Fields" in Button "Text Edit" in default- and in constraints field.
 +
## "Layer > Properties > Tab Style" in "Label with" field.
 +
## "Field Calculator" to defining new or virtual fields (Layer property).
 +
## "Conditional formatting" of a field in Attribute table (Create a new rule and set the condition to the output of a custom EFn).
 +
# Analysis-related:
 +
## "Statistics Panel" / "Statistical Summary" of a field.
 +
## "Atlas Generation" in the Print Composer. Project > Print Composer > Check 'generate an atlas' > Set EFn based values for page name, filter and output filename.
 +
## Processing
 +
# "Client-side" / style-related:
 +
## "Map Tip" tool (Layer property).
 +
## "Rule based labeling" (drop-down menu) in Layer Properties > Labels; click on '+' button and add a EFn based filter to a field.
 +
## Part of "Geometry generator" for geometry field in "Style > Symbol Layer Type"
 +
 
 +
== Possible examples of custom Custom Expression Functions ==
 
# Function doing something "local" like from other field(s).
 
# Function doing something "local" like from other field(s).
 
# Functions reading something like a "Singleton" like a system environment variable (usage "env('USERNAME')") layer properties or number sequence (spcial Plugin needed?).  
 
# Functions reading something like a "Singleton" like a system environment variable (usage "env('USERNAME')") layer properties or number sequence (spcial Plugin needed?).  
 
# Function for remote webservice: geocoding (reading from the internet).
 
# Function for remote webservice: geocoding (reading from the internet).
# Out of scope: Function reading from other layers (rather candidate for a plugin).
+
# Function reading from other layers (out of scope for a workshop rather, ev. also a processing or plugin candidate).
 
 
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 ==
 
== Notes ==

Aktuelle Version vom 20. April 2018, 01:10 Uhr

See also

Usage of Expression Functions

Examples where Expression Functions (EFns) can be used in QGIS are: symbology, labeling, calculating fields, defining virtual fields, selecting and filtering data, layouts, atlas serial printing and reports, map tips, custom python expressions, parameters for processing, and many more.

This is a more systematic list:

  1. "Server-side" / data-related:
    1. "Select features using an expression" based on a field(Layer property).
    2. "Filtering features" while loading from source. See form view of 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" field.
    5. "Field Calculator" to defining new or virtual fields (Layer property).
    6. "Conditional formatting" of a field in Attribute table (Create a new rule and set the condition to the output of a custom EFn).
  2. Analysis-related:
    1. "Statistics Panel" / "Statistical Summary" of a field.
    2. "Atlas Generation" in the Print Composer. Project > Print Composer > Check 'generate an atlas' > Set EFn based values for page name, filter and output filename.
    3. Processing
  3. "Client-side" / style-related:
    1. "Map Tip" tool (Layer property).
    2. "Rule based labeling" (drop-down menu) in Layer Properties > Labels; click on '+' button and add a EFn based filter to a field.
    3. Part of "Geometry generator" for geometry field in "Style > Symbol Layer Type"

Possible examples of custom Custom Expression Functions

  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. Function reading from other layers (out of scope for a workshop rather, ev. also a processing or plugin candidate).

Notes

Collected (special) use cases:

Plugins:

Open: