290 Commits

Author SHA1 Message Date
Nyall Dawson
37f2d2d8ae Fix function help for project function
Fixes #33035
2019-11-26 03:58:51 +10:00
Matthias Kuhn
63911c1d01
Merge pull request #32551 from rduivenvoorde/from_epoch
[FEATURE] Add datetime_from_epoch (MSec from epoch) expression function
2019-11-22 11:09:37 +01:00
nirvn
617955ac1e [expression] Language support for format_date() and to_{date,datetime,time}()
By default, those expression use the application's locale. The addition of an optional
language parameter allows handling of dates that wouldn't match that default
locale (say for e.g. an English system running QGIS trying to transform a
French-formatted string into a date object).
2019-11-18 12:13:47 +07:00
Pete King
0e7edd5588 [feature] is_valid expression
Returns true if a geometry is considered valid according to the OGC validity rules
2019-11-18 02:31:48 +10:00
Nyall Dawson
fed75afa95 [FEATURE] Add expression functions for converting to/from wkb
Adds geom_from_wkb and geom_to_wkb, which mirror the existing
geom_from_wkt/geom_to_wkt functions but for WKB representations
of geometries.

Since QGIS 3.6 we've had good support for binary blob values in
expressions and field values, so adding these functions allows
users to work with binary blob fields containing WKB representations
of geometries (e.g. with a geometry generator showing the encoded
geometries)
2019-11-04 13:00:11 +10:00
Richard Duivenvoorde
f67fe846da Rename to 'DateTimeFromEpoch' and add 2 extra tests 2019-11-01 21:44:58 +01:00
Richard Duivenvoorde
ae0f8ffe8c
Update resources/function_help/json/from_epoch
Co-Authored-By: Étienne Trimaille <gustrimaille@yahoo.fr>
2019-10-31 19:59:56 +01:00
Richard Duivenvoorde
8f9d493cc2 Add from_epoch (MSec from epoch) expression function 2019-10-31 15:59:07 +01:00
Juergen E. Fischer
b81d306047 spelling fixes (closes #32408) 2019-10-26 10:50:30 +10:00
lbartoletti
3b9c240ba7 rewrite functions. Only hash(string, method), md5(string) and sha256(string) are available now 2019-10-26 08:32:26 +10:00
lbartoletti
ba7770c7cc fix build 2019-10-26 08:32:26 +10:00
lbartoletti
910c3c478e add help files 2019-10-26 08:32:26 +10:00
Richard Duivenvoorde
5f24a0b214 Change help answer to what is actually shown in the preview 2019-10-14 09:35:22 +10:00
Harrissou Sant-anna
575ecffe30 Add "concatenate_unique" as aggregate parameter
to relation_aggregate function
2019-10-03 13:28:36 +10:00
Harrissou Sant-anna
ef11da6359 Add "concatenate_unique" and "array_agg" as aggregate parameter
of aggregate function
2019-10-03 13:28:36 +10:00
Harrissou Sant-anna
f75a0cc4da Various fixes on date functions help
including replacement of todate and tointerval, use of third person
conjugation and addition/fix of examples
2019-09-27 17:44:11 +10:00
Nyall Dawson
80d77b4788 [FEATURE] Add make_line expression function variant which accepts
an array of points

Allows creation of lines from variable numbers of points, and
from sequences from aggregates/dynamically generated sequences

Fixes #31268
2019-08-29 19:33:43 +10:00
Nyall Dawson
36173d7c40 [FEATURE] New expression function "collect_geometries"
Collects a set of geometries into a multi-part geometry object.
Geometry parts can either be specified as seperate arguments to the
function, or (more flexibly), as an array of geometry parts.

This allows geometries to be generated using iterator based approaches,
such as transforming an array generated using generate_series, e.g:

  collect_geometries(
    array_foreach(
      generate_series( 0, 330, 30),
      project($geometry, .2, radians(@element))
    )
  )

Gives a nice radial effect of points surrounding the central feature
point when used as a MultiPoint geometry generator
2019-08-29 19:33:43 +10:00
Harrissou Sant-anna
bb8b1dd403 Fix typo 2019-08-26 08:45:54 +10:00
nirvn
3e2179e147 [expression] Update the format_date function help hyperlink to point to qt5 doc 2019-08-14 12:54:46 +07:00
nirvn
b58a2a6c21 [FEATURE][expression] Optional format parameter for to_date, to_datetime, to_time functions 2019-08-14 12:54:46 +07:00
Nyall Dawson
018ca7c447 [FEATURE] New expression function "attributes"
Returns a map containing all attributes from a feature, with field
names as map keys. We've got featureful, robust support for working
with maps in expressions now, so this allows rapid conversion
of all feature attributes to a map to use with these handy
functions.
2019-06-28 13:14:17 +10:00
David Signer
f8d1a02ea7 mentioning array_agg in relation_aggregate 2019-05-28 06:16:22 +10:00
Nyall Dawson
e5ab06fffa Add missing function group help 2019-05-22 03:45:00 +10:00
Nyall Dawson
2e5257372b [FEATURE] Add order by support to expression aggregate and concatenation functions
Because certain aggregates and concatenation requires results in
a certain order, this change allows specific control of the order
features are added to the aggregate during an expression evaluation.

E.g.

concatenate("Station",concatenator:=',', order_by:="Station")

will give a comma separated list of station names in alphabetical
order, rather than layer feature order.

Sponsored by SMEC/SJ
2019-05-10 06:23:56 +10:00
Nyall Dawson
5a088bfa2b Fix expression function examples 2019-04-28 15:47:35 +10:00
Nyall Dawson
762b2a423b [FEATURE] Expression functions which return file info
base_file_name: Returns the base name of the file without the directory or file suffix.
file_exists: Returns true if a file exists
file_name: Returns the file name from a full path
file_path: Returns the directory/path from a full file path
file_size: Returns a file size
file_suffix: Returns a files suffix/extension
is_directory: Returns true if a file path is a directory
is_file: Returns true if a file path is a file
2019-04-27 17:24:37 +10:00
nirvn
2582399ab5 [FEATURE][expression] New array_all() function to check whether
an array contains _all_ values of another given array.
2019-04-09 11:44:00 +07:00
nirvn
b97ef936be [expression] Negative index support to point_n(), angle_at_vertex(), distance_to_vertex() functions 2019-03-13 11:20:04 +07:00
Nyall Dawson
db1a1929a4 [FEATURE][expressions] Simplified variant of "attribute" function
This adds a second variant for the existing "attribute" function.
The current function requires both a target feature and attribute
name to be specified, while the NEW variant just uses the current
feature.

E.g.

NEW:

attribute( 'name' ) -> returns the value stored in 'name' attribute
for the current feature

EXISTING:

attribute( @atlas_feature, 'name' ) -> returns value stored in 'name'
attribute for the current atlas feature

It's just a faster shorthand version!
2019-02-23 05:20:52 +10:00
Mathieu Pellerin
7599d4f8d5
[expression] Add try() function to provide a way to detect and handle
expressions which can intermittently fail.
2019-02-20 06:27:43 +07:00
Etienne Trimaille
06fab90981 add some optional flags in make_polygon expression 2019-02-20 05:41:26 +10:00
Juergen E. Fischer
2bed7ab001 fix substr help (fixes #21192) 2019-02-07 11:17:57 +01:00
Matthias Kuhn
008dfeed40 Rename json functions to postgres names 2019-01-18 17:45:12 +07:00
Matthias Kuhn
fc548795a8 Add function docs for load_json and write_json 2019-01-18 17:45:12 +07:00
lbartoletti
aaede28b43 [feature] Add expression for square by diagonal and rectangle from 3 points
With the new class QgsQuadrilateral, we can add expressions to create a square by a diagonal and rectangles by 3 points
2019-01-17 03:42:20 +11:00
Matthias Kuhn
5962afdf21
Improve expression documentation for sqlite_fetch_and_increment 2019-01-11 10:53:17 +01:00
Matthias Kuhn
d3b4c7d83a
Add cached mode to sqlite_fetch_and_increment for transactions 2019-01-10 10:35:24 +01:00
Matthias Kuhn
8754d55a09
Fix JSON 2019-01-08 11:36:16 +01:00
Matthias Kuhn
af027d9d10
Add NULLIF expression function [FEATURE] 2019-01-08 10:56:34 +01:00
Matthias Kuhn
b4bc072030
Improve function help for sqlite_fetch_and_increment 2018-12-21 14:06:53 +01:00
Matthias Kuhn
e698ba877a
Fix JSON formatting 2018-12-21 09:14:44 +01:00
Matthias Kuhn
ff1f2dffea
Add sqlite_fetch_and increment docs 2018-12-20 14:32:24 +01:00
Mathieu Pellerin
e9e1e0d6f3
[FEATURE][expression] Brand new array_sort() function 2018-12-20 11:47:16 +07:00
Matthias Kuhn
0f037daf47
Merge pull request #8649 from qgis/expression_function_decode_uri
Expression function `decode_uri`
2018-12-19 08:32:09 +01:00
Nyall Dawson
06d5f924f6 More square brackets 2018-12-19 05:21:49 +10:00
Matthias Kuhn
08965487dd
Double escape for JSON and C++ 2018-12-18 17:04:50 +01:00
Matthias Kuhn
10140b1ed1
Fix JSON escaping 2018-12-18 14:57:23 +01:00
Matthias Kuhn
2b5830ec9c
Function help improvements 2018-12-18 14:54:58 +01:00
Matthias Kuhn
7a8939442f
Fix typo 2018-12-18 14:20:11 +01:00