479 Commits

Author SHA1 Message Date
Nyall Dawson
2b545822e7 [FEATURE] New expression function 'extend'
Extends linestrings by a specified amount at the start and
end of the line
2016-10-31 07:56:24 +10:00
nirvn
17fc7dbe53 [FEATURE] add array_distinct() function 2016-10-28 10:51:14 +07:00
Matthias Kuhn
adb184e435 Add documentation for @parent aggregate filter 2016-10-27 23:11:51 +02:00
Nyall Dawson
fb4578131f Merge pull request #3678 from nirvn/string_to_array_to_string
[FEATURE] add string_to_array() and array_to_string() functions
2016-10-28 04:44:25 +10:00
Matthias Kuhn
01f3c9ae38 [FEATURE] Add is_selected and num_selected functions
* is_selected() returns if the current feature is selected
* num_selected() returns the number of selected features on the current layer
* is_selected(layer, feature) returns if the "feature" is selected. "feature"
  must be on "layer".
* num_selected(layer) returns the number of selected features on "layer"
2016-10-27 17:24:15 +02:00
nirvn
7373036edf [FEATURE] add string_to_array() and array_to_string() functions 2016-10-27 22:12:59 +07:00
nirvn
3fb2d9e4e3 [expression] further improve replace() to support a map argument 2016-10-27 11:33:28 +07:00
nirvn
8b74201470 [FEATURE] array support for the replace() expression function 2016-10-26 17:01:56 +07:00
Nyall Dawson
6f82740670 [expressions] Allow non-greedy regex by switching to QRegularExpression 2016-10-26 16:04:38 +10:00
Juergen E. Fischer
2013984297 fix translation strings 2016-10-20 18:16:37 +02:00
Nyall Dawson
60cc853747 Add perceptually uniform colormaps to default styles
Adds the Viridis, Magma, Plasma and Inferno uniform color ramps
created by Stéfan van der Walt and Nathaniel Smith

See https://bids.github.io/colormap/ for more details

Note that I've thinned out the stops here, and only kept
every 5th stop from the original ramps
2016-10-11 16:46:43 +10:00
Nyall Dawson
e69dd9c9b2 Fix escaping in regexp function help 2016-10-10 19:53:15 +10:00
Juergen E. Fischer
22af5bf5d4 fix typos 2016-10-09 01:47:09 +02:00
Juergen E. Fischer
d9349e5bbb update configuration settings to qgis3 2016-10-06 11:40:42 +02:00
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