452 Commits

Author SHA1 Message Date
Nyall Dawson
59dc4079a5 Add missing function help (fix #15264) 2016-07-19 12:12:32 +10:00
Juergen E. Fischer
4677a3ac12 spatial bookmarks: remove inaccessible context help 2016-06-22 12:35:17 +02:00
Juergen E. Fischer
3c06341aa9 add context help for the "add oracle layers" dialog and use QTextBrowser in qgis_help (fixes #8477) 2016-06-21 16:48:53 +02:00
Harrissou Sant-anna
386fcc67ab Add more example 2016-05-24 12:24:12 +02:00
Harrissou Sant-anna
1a3c41657f Add more example 2016-05-24 12:21:00 +02:00
Denis Rouzaud
69a8c381ab Precise that scale function returns the denominator and not the scale itself 2016-05-18 10:43:19 +02:00
Nyall Dawson
307aabd66a [FEATURE] Aggregates for expressions
This commit adds a number of different forms of aggregates to
the expression engine.

1. Aggregates within the current layer, eg sum("passengers")
Supports sub expressions (ie sum("passengers"/2) ), group by
( sum("passengers", group_by:="line_segment") ), and optional
filters ( sum("passengers", filter:= "station_class" > 3 ) )

2. Relational aggregates, which calculate an aggregate over
all matching child features from a relation, eg
relation_aggregate( 'my_relation', 'mean', "some_child_field" )

3. A summary aggregate function, for calculating aggregates
on other layers. Eg aggregate('rail_station_layer','sum',"passengers")
The summary aggregate function supports an optional filter,
making it possible to calculate things like:

aggregate('rail_stations','sum',"passengers",
  intersects(@atlas_geometry, $geometry ) )

for calculating the total number of passengers for the stations
inside the current atlas feature

In all cases the calculations are cached inside the expression
context, so they only need to be calculated once for each
set of expression evaluations.

Sponsored by Kanton of Zug, Switzerland
2016-05-17 10:53:25 +10:00
Jürgen Fischer
60ada1185e Merge pull request #2946 from sebastic/debian
Debian packaging improvements
2016-04-07 08:59:58 +02:00
Nyall Dawson
fd7a4bd900 [FEATURE] New project(point, distance, bearing) expression function
Projects a point geometry by the specified distance and bearing
2016-04-06 20:55:26 +10:00
Nyall Dawson
ae00eb965c [FEATURE] Allow expression functions to use named parameters
This commit sets the framework for allowing expression functions to
use named parameters. Ie, instead of:

clamp(1,2,3)

you can use:

clamp( min:=1, value:=2, max:=3)

This also allows arguments to be switched, eg:

clamp( value:=2, max:=3, min:=1)

Additionally, it allows for a more structured definition of function
parameters to handle optional arguments and default values for
parameters. These are currently being done using a hacky infinite
argument list.

I've utilised the postgres ':=' syntax for specifying named arguments
to avoid potential collisions which may arise with the equality test
if we re-used just the '=' operator alone.

Sponsored by North Road
2016-04-04 13:59:13 +10:00
Matthias Kuhn
ec17e3cc8e Fix expression "if" documentation 2016-03-31 13:13:32 +02:00
Harrissou Sant-anna
b3edfa8080 Fix if function example 2016-03-31 13:12:35 +02:00
Bas Couwenberg
7248d586bf Fix 'nubmer' typo, replace with 'number'. 2016-03-25 16:55:24 +01:00
Juergen E. Fischer
b89956e247 fix linebreaks in function help and CASE (fixes #14189) 2016-02-26 00:27:48 +01:00
Nyall Dawson
c23e3096fe More descriptive function help for area/length/perimeter functions
...which better clarify how project ellipsoid and unit settings are
respected by the functions
2016-02-23 11:48:10 +11:00
Arjan Mossel
c4addc2d02 Fix typo in attribute table context help 2016-02-04 19:16:12 +01:00
Matthias Kuhn
a2030d53fe Fix 2.5D renderer problem when order of walls matters
E.g. when the walls have different styles
2016-01-15 16:23:13 +01:00
Nyall Dawson
275eb9463d [FEATURE] Add closest_point and shortest_line expression functions
closest_point: returns closest point a geometry to a second geometry
shortest_line: returns the shortest possible line joining two
geometries
2016-01-15 12:50:17 +11:00
Matthias Kuhn
542541007c Add extrude function to QgsGeometry 2016-01-14 12:28:31 +01:00
Matthias Kuhn
b7170b82d3 Add azimuth function 2016-01-13 11:14:25 +01:00
pavlova-marina
1d42ac568b fixed link to gdal page 2015-12-19 20:20:43 +03:00
Juergen E. Fischer
89583b74e4 avoid core relinking on cmake changes 2015-12-19 15:09:43 +01:00
Nyall Dawson
5b244ae88c [FEATURE] More geometry functions for expressions
- add accessors: geometry_n, interior_ring_n
- add num_geometries, num_rings, num_interior_rings
- add nodes_to_points for converting every node in a geometry
to a multipoint geometry
- add segments_to_lines for converting every segment in a geometry
to a multiline geometry

nodes_to_points and segments_to_lines are intended for use with
geometry generator symbology, eg to allow use of m and z values
for nodes/lines with data defined symbology.
2015-12-15 11:22:39 +11:00
Nyall Dawson
ceddb7eb97 [FEATURE] is_closed function for expressions
Returns whether a linestring is closed
2015-12-13 22:06:22 +11:00
Nyall Dawson
262514d97d [FEATURE] exterior_ring function for expressions
Returns exterior ring of a polygon as a line. Useful for geometry
generator symbology for styling only the exterior ring of
polygons.
2015-12-13 20:11:19 +11:00
nirvn
35fea9c986 [expression] add point_on_surface function 2015-12-12 17:16:34 +07:00
Matthias Kuhn
28cabbe4d0 [Expression] radians and degrees 2015-12-10 00:41:42 +01:00
nirvn
a5d670233b [FEATURE] add darker() and lighter() expression functions 2015-12-09 15:50:59 +11:00
Juergen E. Fischer
269f709285 [FEATURE] postgres provider: refine warning about estimated metadata (fixes #13947) 2015-12-08 11:05:49 +01:00
Matthias Kuhn
4b3083d9a7 [FEATURE] Add translate expression function
Funded by
 * Regional Council of Picardy
 * ADUGA
 * Ville de Nyon
 * Wetu GIT cc
2015-12-08 08:49:05 +01:00
Matthias Kuhn
f961ecef46 [FEATURE] Add an eval expression
Funded by
 * Regional Council of Picardy
 * ADUGA
 * Ville de Nyon
 * Wetu GIT cc
2015-12-08 08:43:45 +01:00
Nyall Dawson
da436f926b [FEATURE] New 'reverse' expression for reversing linestrings 2015-11-26 16:53:55 +11:00
Matthias Kuhn
504c252c05 Merge pull request #2327 from DelazJ/ConsistentTerms2
Add consistency to attribute's dialogs
2015-11-21 14:41:59 +01:00
Juergen E. Fischer
90053c52d6 also update strpos function help (followup 2a557db) 2015-11-20 19:53:30 +01:00
Harrissou Sant-anna
a4b61fbd1f fix typo 2015-11-06 10:53:03 +01:00
Nyall Dawson
de1540357b [expressions] Add make_line and make_polygon functions 2015-11-06 20:09:48 +11:00
Nyall Dawson
12e34f2672 [expressions] Allow make_point to accept z/m values, add new
make_point_m for creation of PointM geometries. Also add
m(point) and z(point) functions for retrieving z/m value of
a point or node.
2015-11-06 20:09:13 +11:00
Nyall Dawson
da942233e7 Add DE-9IM variant which tests against a specified pattern
(available in PyQGIS/expression engine)
2015-11-04 16:03:55 +11:00
Nyall Dawson
9d4e995de6 [FEATURE] Add geometry relation DE-9IM expression function 2015-10-26 22:46:53 +11:00
Juergen E. Fischer
83fd65ab61 only update qgsexpression_texts.cpp if there are actual changes 2015-09-30 18:17:51 +02:00
Salvatore Larosa
36919937b3 close the qgsexpression_texts.cpp file generated by resources/process_function_template.py 2015-09-29 17:01:11 +02:00
Juergen E. Fischer
3c324c9985 fix lpad/rpad context help (followup b46cbbe) 2015-09-27 01:52:20 +02:00
Juergen E. Fischer
b46cbbe425 fix mixup between lpad/rpad help (fixes #13433) 2015-09-26 21:32:27 +02:00
Nyall Dawson
a4d980d055 Port from expressions+ plugin: color_part, set_color_part, day_of_week 2015-09-21 19:57:58 +10:00
DelazJ
f748c127ab enforces consistency 2015-09-20 23:31:35 +02:00
Juergen E. Fischer
82b34afe03 move remaining function_help to json and update it's translation handling 2015-09-20 18:35:27 +02:00
Matthias Kuhn
41a330f271 More expression help 2015-09-20 14:18:25 +02:00
Matthias Kuhn
2a6cff403b More examples for the expression function help 2015-09-20 13:59:54 +02:00
Matthias Kuhn
b2c404d17c Improve expression help 2015-09-20 13:51:10 +02:00
Nyall Dawson
55027e545f Clean up and extend expression geometry functions:
- New expression functions for area(geom), perimeter(geom),
point_n(geom), start_point(geom), end_point(geom), make_point(x,y)
- Add new variant to length() function which takes a geometry object,
allows for length(geom) evaluation.
- Rename x_at, y_at to $x_at, $y_at (alias old names) to reflect that
these only work on current feature geometry
- Add x(geom), y(geom) functions which return x and y coordinate
for point geometries or centroid x/y for non-point geometries
(fix #11008)
2015-09-18 09:09:09 +10:00