465 Commits

Author SHA1 Message Date
Juergen E. Fischer
ffaffadbfa fix typos 2016-10-01 17:58:12 +02:00
rldhont
f47a7320d1 [BUGFIX] Expression in like escape % and _
The Expression LIKE binary operator does not care about escape % and _ char.
No-one has already open an issue about it but in the OGC element PropertyIsLike the user can defined is own wild and single char. This mean that QGIS has to escape % and _ if they are not used as wild and single char.
2016-09-30 14:27:53 +02:00
Patrick Valsecchi
f622c5bf2c Add expression functions for arrays and maps 2016-09-20 13:22:55 +02:00
Nyall Dawson
679797e22b [FEATURE] New simplify + smoothing expression functions
Exposes simplification and smoothing algorithms to expression
engine, via:

- simplify(): applies Douglas-Peucker geometry simplification
- simplify_vw(): applies Visvalingam-Whyatt geometry simplification
- smooth(): smoothes a geometry

Carto tip: use smooth along with geometry generators to minimise
the typical "GIS" noded look of rendered geometries!
2016-09-03 21:52:06 +10:00
Nyall Dawson
da78ddeb7c [FEATURE] New expression functions for angle/distance interpolation
angle_at_vertex: returns average (bisector) angle to a geometry
at a specified vertex index
distance_to_vertex: returns distance along geometry to a specified
vertex index
line_interpolate_angle: calculates the angle parallel to a geometry
at the specified distance along the geometry

Sponsored by Andreas Neumann
2016-08-29 11:02:17 +10:00
nirvn
2a326ef8ad [FEATURE] support aggregation of geometry
This feature adds a 'collect' aggregation method resulting in a
single multipart geometry from a list of geometries. This is exposed
in the expression engine via the existing aggregate() function,
as well as a new collect() function.
2016-08-24 08:39:05 +07:00
Nyall Dawson
e110ba7d54 [FEATURE] Add linear referencing functions to expression engine
Adds new functions
- line_interpolate_point: interpolates a point by a given distance
along a linestring geometry
- line_locate_point: returns the distance along a linestring to
the closest position on the linestring to a given point
2016-08-21 20:59:57 +10:00
Nyall Dawson
298d047125 [FEATURE] Expression functions for offset_curve and single_sided_buffer
Especially useful with geometry generators!
2016-08-17 06:43:02 +10:00
Harrissou Sant-anna
e3867832bb Remove duplicate example (#3360) 2016-08-10 14:45:34 +02:00
Denis Rouzaud
f2c3fb003e renamed QgsSymbolLevelsV2Dialog to QgsSymbolLevelsDialog 2016-08-05 08:22:43 +02:00
Denis Rouzaud
275736de92 removed V2 from QgsSymbolV2* 2016-08-05 08:22:21 +02:00
Nyall Dawson
10c92394e7 [FEATURE] API + expression function for merging linestrings
Adds a new method to QgsGeometry for merging linestrings.
By passing a multilinestring, any connected lines will
be joined into single linestrings. Behind the scenes this
uses GEOS' line merge.

A corresponding expression function "line_merge" has also
been added.
2016-07-28 20:33:27 +10:00
Nyall Dawson
1a4ceb1680 [FEATURE] Expression function for calculating geometry boundary
The new 'boundary(...)' function returns a geometry's topological
boundary, ie for polygons this is a multilinestring representing
the polygons rings
2016-07-28 08:16:57 +10:00
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