QGIS API Documentation  2.14.0-Essen
qgsexpression_texts.cpp
Go to the documentation of this file.
1 #include "qgsexpression.h"
2 
4 
6 {
7  if( !gFunctionHelpTexts.isEmpty() )
8  return;
9 
10  gFunctionHelpTexts.insert( "$area",
11  Help( "$area", tr( "function" ), tr( "Returns the area of the current feature. The area calculated by this function respects both the current project's ellipsoid setting and area unit settings. Eg, if an ellipsoid has been set for the project then the calculated area will be ellipsoidal, and if no ellipsoid is set then the calculated area will be planimetric." ),
13  << HelpVariant( tr( "$area" ), tr( "Returns the area of the current feature. The area calculated by this function respects both the current project's ellipsoid setting and area unit settings. Eg, if an ellipsoid has been set for the project then the calculated area will be ellipsoidal, and if no ellipsoid is set then the calculated area will be planimetric." ),
15  /* variableLenArguments */ false,
17  << HelpExample( tr( "$area" ), tr( "42" ), tr( "") )
18  )
19  )
20  );
21 
22  gFunctionHelpTexts.insert( "$atlasfeature",
23  Help( "$atlasfeature", tr( "function" ), tr( "In atlas generation, returns the current feature that is iterated over on the coverage layer. This can be used with the 'attribute' function to return attribute values from the current atlas feature." ),
25  << HelpVariant( tr( "$atlasfeature" ), tr( "In atlas generation, returns the current feature that is iterated over on the coverage layer. This can be used with the 'attribute' function to return attribute values from the current atlas feature." ),
27  /* variableLenArguments */ false,
29  << HelpExample( tr( "attribute( $atlasfeature, 'name' )" ), tr( "value stored in 'name' attribute for the current atlas feature" ), tr( "") )
30  )
31  )
32  );
33 
34  gFunctionHelpTexts.insert( "$atlasfeatureid",
35  Help( "$atlasfeatureid", tr( "function" ), tr( "Returns the feature id of the current row while using atlas. This enables you to use features of atlas in rules and for example show or hide features based on their id." ),
37  << HelpVariant( tr( "$atlasfeatureid" ), tr( "Returns the feature id of the current row while using atlas. This enables you to use features of atlas in rules and for example show or hide features based on their id." ),
39  /* variableLenArguments */ false,
41  << HelpExample( tr( "$atlasfeatureid = $id" ), tr( "true" ), tr( "") )
42  )
43  )
44  );
45 
46  gFunctionHelpTexts.insert( "$atlasgeometry",
47  Help( "$atlasgeometry", tr( "function" ), tr( "Returns the geometry of the current feature iterated in atlas. Can be used for rule based display of geometry when using atlas. For example to only show geometries of other layers when their geometry intersects the iterated geometry of features using atlas." ),
49  << HelpVariant( tr( "$atlasgeometry" ), tr( "Returns the geometry of the current feature iterated in atlas. Can be used for rule based display of geometry when using atlas. For example to only show geometries of other layers when their geometry intersects the iterated geometry of features using atlas." ),
51  /* variableLenArguments */ false,
53  << HelpExample( tr( "intersects( $atlasgeometry, $geometry )" ), tr( "true" ), tr( "") )
54  )
55  )
56  );
57 
58  gFunctionHelpTexts.insert( "$currentfeature",
59  Help( "$currentfeature", tr( "function" ), tr( "Returns the current feature being evaluated. This can be used with the 'attribute' function to evaluate attribute values from the current feature." ),
61  << HelpVariant( tr( "$currentfeature" ), tr( "Returns the current feature being evaluated. This can be used with the 'attribute' function to evaluate attribute values from the current feature." ),
63  /* variableLenArguments */ false,
65  << HelpExample( tr( "attribute( $currentfeature, 'name' )" ), tr( "value stored in 'name' attribute for the current feature" ), tr( "") )
66  )
67  )
68  );
69 
70  gFunctionHelpTexts.insert( "$feature",
71  Help( "$feature", tr( "function" ), tr( "In atlas generation, returns the current feature number that is iterated over on the coverage layer." ),
73  << HelpVariant( tr( "$feature" ), tr( "In atlas generation, returns the current feature number that is iterated over on the coverage layer." ),
75  /* variableLenArguments */ false,
77  << HelpExample( tr( "$feature" ), tr( "2" ), tr( "") )
78  )
79  )
80  );
81 
82  gFunctionHelpTexts.insert( "$geometry",
83  Help( "$geometry", tr( "function" ), tr( "Returns the geometry of the current feature. Can be used for processing with other functions." ),
85  << HelpVariant( tr( "$geometry" ), tr( "Returns the geometry of the current feature. Can be used for processing with other functions." ),
87  /* variableLenArguments */ false,
89  << HelpExample( tr( "geomToWKT( $geometry )" ), tr( "POINT(6 50)" ), tr( "") )
90  )
91  )
92  );
93 
94  gFunctionHelpTexts.insert( "$id",
95  Help( "$id", tr( "function" ), tr( "Returns the feature id of the current row." ),
97  << HelpVariant( tr( "$id" ), tr( "Returns the feature id of the current row." ),
99  /* variableLenArguments */ false,
101  << HelpExample( tr( "$id" ), tr( "42" ), tr( "") )
102  )
103  )
104  );
105 
106  gFunctionHelpTexts.insert( "$length",
107  Help( "$length", tr( "function" ), tr( "Returns the length of a linestring. If you need the length of a border of a polygon, use $perimeter instead. The length calculated by this function respects both the current project's ellipsoid setting and distance unit settings. Eg, if an ellipsoid has been set for the project then the calculated length will be ellipsoidal, and if no ellipsoid is set then the calculated length will be planimetric." ),
109  << HelpVariant( tr( "$length" ), tr( "Returns the length of a linestring. If you need the length of a border of a polygon, use $perimeter instead. The length calculated by this function respects both the current project's ellipsoid setting and distance unit settings. Eg, if an ellipsoid has been set for the project then the calculated length will be ellipsoidal, and if no ellipsoid is set then the calculated length will be planimetric." ),
110  QList<HelpArg>(),
111  /* variableLenArguments */ false,
113  << HelpExample( tr( "$length" ), tr( "42.4711" ), tr( "") )
114  )
115  )
116  );
117 
118  gFunctionHelpTexts.insert( "$map",
119  Help( "$map", tr( "function" ), tr( "Returns the id of the current map item if the map is being drawn in a composition, or \"canvas\" if the map is being drawn within the main QGIS window." ),
121  << HelpVariant( tr( "$map" ), tr( "Returns the id of the current map item if the map is being drawn in a composition, or \"canvas\" if the map is being drawn within the main QGIS window." ),
122  QList<HelpArg>(),
123  /* variableLenArguments */ false,
125  << HelpExample( tr( "$map" ), tr( "\"overview_map\"" ), tr( "") )
126  << HelpExample( tr( "$map" ), tr( "\"canvas\"" ), tr( "") )
127  )
128  )
129  );
130 
131  gFunctionHelpTexts.insert( "$numfeatures",
132  Help( "$numfeatures", tr( "function" ), tr( "In atlas generation, returns the total number of features within the coverage layer." ),
134  << HelpVariant( tr( "$numfeatures" ), tr( "In atlas generation, returns the total number of features within the coverage layer." ),
135  QList<HelpArg>(),
136  /* variableLenArguments */ false,
138  << HelpExample( tr( "$numfeatures" ), tr( "42" ), tr( "") )
139  )
140  )
141  );
142 
143  gFunctionHelpTexts.insert( "$numpages",
144  Help( "$numpages", tr( "function" ), tr( "Returns the total number of pages in the composition." ),
146  << HelpVariant( tr( "$numpages" ), tr( "Returns the total number of pages in the composition." ),
147  QList<HelpArg>(),
148  /* variableLenArguments */ false,
150  << HelpExample( tr( "$numpages" ), tr( "42" ), tr( "") )
151  )
152  )
153  );
154 
155  gFunctionHelpTexts.insert( "$page",
156  Help( "$page", tr( "function" ), tr( "Returns the current page number within a composition." ),
158  << HelpVariant( tr( "$page" ), tr( "Returns the current page number within a composition." ),
159  QList<HelpArg>(),
160  /* variableLenArguments */ false,
162  << HelpExample( tr( "$page" ), tr( "2" ), tr( "") )
163  )
164  )
165  );
166 
167  gFunctionHelpTexts.insert( "$perimeter",
168  Help( "$perimeter", tr( "function" ), tr( "Returns the perimeter length of the current feature. The perimeter calculated by this function respects both the current project's ellipsoid setting and distance unit settings. Eg, if an ellipsoid has been set for the project then the calculated perimeter will be ellipsoidal, and if no ellipsoid is set then the calculated perimeter will be planimetric." ),
170  << HelpVariant( tr( "$perimeter" ), tr( "Returns the perimeter length of the current feature. The perimeter calculated by this function respects both the current project's ellipsoid setting and distance unit settings. Eg, if an ellipsoid has been set for the project then the calculated perimeter will be ellipsoidal, and if no ellipsoid is set then the calculated perimeter will be planimetric." ),
171  QList<HelpArg>(),
172  /* variableLenArguments */ false,
174  << HelpExample( tr( "$perimeter" ), tr( "42" ), tr( "") )
175  )
176  )
177  );
178 
179  gFunctionHelpTexts.insert( "$rownum",
180  Help( "$rownum", tr( "function" ), tr( "Returns the number of the current row." ),
182  << HelpVariant( tr( "$rownum" ), tr( "Returns the number of the current row." ),
183  QList<HelpArg>(),
184  /* variableLenArguments */ false,
186  << HelpExample( tr( "$rownum" ), tr( "4711" ), tr( "") )
187  )
188  )
189  );
190 
191  gFunctionHelpTexts.insert( "$scale",
192  Help( "$scale", tr( "function" ), tr( "Returns the current scale of the map canvas.<br><br>Note: This function is only available in some contexts and will be 0 otherwise." ),
194  << HelpVariant( tr( "$scale" ), tr( "Returns the current scale of the map canvas.<br><br>Note: This function is only available in some contexts and will be 0 otherwise." ),
195  QList<HelpArg>(),
196  /* variableLenArguments */ false,
198  << HelpExample( tr( "$scale" ), tr( "10000" ), tr( "") )
199  )
200  )
201  );
202 
203  gFunctionHelpTexts.insert( "$x",
204  Help( "$x", tr( "function" ), tr( "Returns the x coordinate of the current feature." ),
206  << HelpVariant( tr( "$x" ), tr( "Returns the x coordinate of the current feature." ),
207  QList<HelpArg>(),
208  /* variableLenArguments */ false,
210  << HelpExample( tr( "$x" ), tr( "42" ), tr( "") )
211  )
212  )
213  );
214 
215  gFunctionHelpTexts.insert( "$x_at",
216  Help( "$x_at", tr( "function" ), tr( "Retrieves a x coordinate of the current feature's geometry." ),
218  << HelpVariant( tr( "$x_at" ), tr( "Retrieves a x coordinate of the current feature's geometry." ),
220  << HelpArg( tr( "i" ), tr( "index of point of a line (indices start at 0; negative values apply from the last index)" ), false, false ),
221  /* variableLenArguments */ false,
223  << HelpExample( tr( "$x_at(1)" ), tr( "5" ), tr( "") )
224  )
225  )
226  );
227 
228  gFunctionHelpTexts.insert( "$y",
229  Help( "$y", tr( "function" ), tr( "Returns the y coordinate of the current feature." ),
231  << HelpVariant( tr( "$y" ), tr( "Returns the y coordinate of the current feature." ),
232  QList<HelpArg>(),
233  /* variableLenArguments */ false,
235  << HelpExample( tr( "$y" ), tr( "42" ), tr( "") )
236  )
237  )
238  );
239 
240  gFunctionHelpTexts.insert( "$y_at",
241  Help( "$y_at", tr( "function" ), tr( "Retrieves a y coordinate of the current feature's geometry." ),
243  << HelpVariant( tr( "$y_at" ), tr( "Retrieves a y coordinate of the current feature's geometry." ),
245  << HelpArg( tr( "i" ), tr( "index of point of a line (indices start at 0; negative values apply from the last index)" ), false, false ),
246  /* variableLenArguments */ false,
248  << HelpExample( tr( "$y_at(1)" ), tr( "2" ), tr( "") )
249  )
250  )
251  );
252 
253  gFunctionHelpTexts.insert( "AND",
254  Help( "AND", tr( "operator" ), tr( "Returns 1 when condition a and b are true." ),
256  << HelpVariant( tr( "AND" ), tr( "Returns 1 when condition a and b are true." ),
258  << HelpArg( tr( "a" ), tr( "condition" ), false, false )
259  << HelpArg( tr( "b" ), tr( "condition" ), false, false ),
260  /* variableLenArguments */ false,
262  << HelpExample( tr( "TRUE AND TRUE" ), tr( "1" ), tr( "") )
263  << HelpExample( tr( "TRUE AND FALSE" ), tr( "0" ), tr( "") )
264  << HelpExample( tr( "4 = 2+2 AND 1 = 1" ), tr( "1" ), tr( "") )
265  << HelpExample( tr( "4 = 2+2 AND 1 = 2" ), tr( "0" ), tr( "") )
266  )
267  )
268  );
269 
270  gFunctionHelpTexts.insert( "CASE",
271  Help( "CASE", tr( "expression" ), tr( "<pre><br>CASE<br>WHEN <i>condition</i> THEN <i>result</i><br>[ ...n ]<br>[ ELSE <i>result</i> ]<br>END<br></pre>[ ] marks optional components<br><h4>Arguments</h4><br><i> WHEN condition</i> - The condition expression to evaluate. <br><br><i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br><br><i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned.<br><br><h4>Example</h4><pre>CASE<br>WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i><br>END</pre>" ),
273  << HelpVariant( tr( "CASE" ), tr( "<pre><br>CASE<br>WHEN <i>condition</i> THEN <i>result</i><br>[ ...n ]<br>[ ELSE <i>result</i> ]<br>END<br></pre>[ ] marks optional components<br><h4>Arguments</h4><br><i> WHEN condition</i> - The condition expression to evaluate. <br><br><i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br><br><i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned.<br><br><h4>Example</h4><pre>CASE<br>WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i><br>END</pre>" ),
274  QList<HelpArg>(),
275  /* variableLenArguments */ false,
277  )
278  )
279  );
280 
281  gFunctionHelpTexts.insert( "Color",
282  Help( "Color", tr( "group" ), tr( "This group contains functions for manipulating colors" ),
284  << HelpVariant( tr( "Color" ), tr( "This group contains functions for manipulating colors" ),
285  QList<HelpArg>(),
286  /* variableLenArguments */ false,
288  )
289  )
290  );
291 
292  gFunctionHelpTexts.insert( "Conditionals",
293  Help( "Conditionals", tr( "group" ), tr( "This group contains functions to handle conditional checks in expressions." ),
295  << HelpVariant( tr( "Conditionals" ), tr( "This group contains functions to handle conditional checks in expressions." ),
296  QList<HelpArg>(),
297  /* variableLenArguments */ false,
299  )
300  )
301  );
302 
303  gFunctionHelpTexts.insert( "Conditions",
304  Help( "Conditions", tr( "group" ), tr( "This group contains functions that operate on condition." ),
306  << HelpVariant( tr( "Conditions" ), tr( "This group contains functions that operate on condition." ),
307  QList<HelpArg>(),
308  /* variableLenArguments */ false,
310  )
311  )
312  );
313 
314  gFunctionHelpTexts.insert( "Conversions",
315  Help( "Conversions", tr( "group" ), tr( "This group contains functions to convert on data type to another e.g string to integer, integer to string." ),
317  << HelpVariant( tr( "Conversions" ), tr( "This group contains functions to convert on data type to another e.g string to integer, integer to string." ),
318  QList<HelpArg>(),
319  /* variableLenArguments */ false,
321  )
322  )
323  );
324 
325  gFunctionHelpTexts.insert( "Custom",
326  Help( "Custom", tr( "group" ), tr( "This group contains custom user-created Python functions." ),
328  << HelpVariant( tr( "Custom" ), tr( "This group contains custom user-created Python functions." ),
329  QList<HelpArg>(),
330  /* variableLenArguments */ false,
332  )
333  )
334  );
335 
336  gFunctionHelpTexts.insert( "Date and Time",
337  Help( "Date and Time", tr( "group" ), tr( "This group contains functions for handling date and time data." ),
339  << HelpVariant( tr( "Date and Time" ), tr( "This group contains functions for handling date and time data." ),
340  QList<HelpArg>(),
341  /* variableLenArguments */ false,
343  )
344  )
345  );
346 
347  gFunctionHelpTexts.insert( "Field",
348  Help( "Field", tr( "group" ), tr( "Double click to add field name to expression string.<br>Right-Click on field name to open context menu sample value loading options." ),
350  << HelpVariant( tr( "Field" ), tr( "Double click to add field name to expression string.<br>Right-Click on field name to open context menu sample value loading options." ),
351  QList<HelpArg>(),
352  /* variableLenArguments */ false,
354  tr( "Loading field values from WFS layers isn't supported, before the layer is actually inserted, ie. when building queries." )
355  )
356  )
357  );
358 
359  gFunctionHelpTexts.insert( "Fields and Values",
360  Help( "Fields and Values", tr( "group" ), tr( "Contains a list of fields from the layer. Sample values can also be accessed via right-click.<br>Select the field name from the list then right-click to access context menu with options to load sample values from the selected field." ),
362  << HelpVariant( tr( "Fields and Values" ), tr( "Contains a list of fields from the layer. Sample values can also be accessed via right-click.<br>Select the field name from the list then right-click to access context menu with options to load sample values from the selected field." ),
363  QList<HelpArg>(),
364  /* variableLenArguments */ false,
366  tr( "Loading field values from WFS layers isn't supported, before the layer is actually inserted, ie. when building queries." )
367  )
368  )
369  );
370 
371  gFunctionHelpTexts.insert( "Fuzzy Matching",
372  Help( "Fuzzy Matching", tr( "group" ), tr( "This group contains functions for fuzzy comparisons between values." ),
374  << HelpVariant( tr( "Fuzzy Matching" ), tr( "This group contains functions for fuzzy comparisons between values." ),
375  QList<HelpArg>(),
376  /* variableLenArguments */ false,
378  )
379  )
380  );
381 
382  gFunctionHelpTexts.insert( "General",
383  Help( "General", tr( "group" ), tr( "This group contains general assorted functions." ),
385  << HelpVariant( tr( "General" ), tr( "This group contains general assorted functions." ),
386  QList<HelpArg>(),
387  /* variableLenArguments */ false,
389  )
390  )
391  );
392 
393  gFunctionHelpTexts.insert( "GeometryGroup",
394  Help( "GeometryGroup", tr( "group" ), tr( "This group contains functions that operate on geometry objects e.g length, area." ),
396  << HelpVariant( tr( "GeometryGroup" ), tr( "This group contains functions that operate on geometry objects e.g length, area." ),
397  QList<HelpArg>(),
398  /* variableLenArguments */ false,
400  )
401  )
402  );
403 
404  gFunctionHelpTexts.insert( "ILIKE",
405  Help( "ILIKE", tr( "operator" ), tr( "Returns 1 if the first parameter matches case-insensitive the supplied pattern. LIKE can be used instead of ILIKE to make the match case-sensitive. Works with numbers also." ),
407  << HelpVariant( tr( "ILIKE" ), tr( "Returns 1 if the first parameter matches case-insensitive the supplied pattern. LIKE can be used instead of ILIKE to make the match case-sensitive. Works with numbers also." ),
409  << HelpArg( tr( "string/number" ), tr( "string to search" ), false, false )
410  << HelpArg( tr( "pattern" ), tr( "pattern to find" ), false, false ),
411  /* variableLenArguments */ false,
413  << HelpExample( tr( "'A' ILIKE 'A'" ), tr( "1" ), tr( "") )
414  << HelpExample( tr( "'A' ILIKE 'a'" ), tr( "1" ), tr( "") )
415  << HelpExample( tr( "'A' ILIKE 'B'" ), tr( "0" ), tr( "") )
416  << HelpExample( tr( "'ABC' ILIKE 'b'" ), tr( "0" ), tr( "") )
417  << HelpExample( tr( "'ABC' ILIKE 'B'" ), tr( "0" ), tr( "") )
418  << HelpExample( tr( "'ABC' ILIKE '%b%'" ), tr( "1" ), tr( "") )
419  << HelpExample( tr( "'ABC' ILIKE '%B%'" ), tr( "1" ), tr( "") )
420  )
421  )
422  );
423 
424  gFunctionHelpTexts.insert( "IN",
425  Help( "IN", tr( "operator" ), tr( "Returns 1 if value is found within a list of values." ),
427  << HelpVariant( tr( "IN" ), tr( "Returns 1 if value is found within a list of values." ),
429  << HelpArg( tr( "a" ), tr( "value" ), false, false )
430  << HelpArg( tr( "b" ), tr( "list of values" ), false, false ),
431  /* variableLenArguments */ false,
433  << HelpExample( tr( "'A' IN ('A','B')" ), tr( "1" ), tr( "") )
434  << HelpExample( tr( "'A' IN ('C','B')" ), tr( "0" ), tr( "") )
435  )
436  )
437  );
438 
439  gFunctionHelpTexts.insert( "IS",
440  Help( "IS", tr( "operator" ), tr( "Returns 1 if a is the same as b." ),
442  << HelpVariant( tr( "IS" ), tr( "Returns 1 if a is the same as b." ),
444  << HelpArg( tr( "a" ), tr( "any value" ), false, false )
445  << HelpArg( tr( "b" ), tr( "any value" ), false, false ),
446  /* variableLenArguments */ false,
448  << HelpExample( tr( "'A' IS 'A'" ), tr( "1" ), tr( "") )
449  << HelpExample( tr( "'A' IS 'a'" ), tr( "0" ), tr( "") )
450  << HelpExample( tr( "4 IS 4" ), tr( "1" ), tr( "") )
451  << HelpExample( tr( "4 IS 2+2" ), tr( "1" ), tr( "") )
452  << HelpExample( tr( "4 IS 2" ), tr( "0" ), tr( "") )
453  << HelpExample( tr( "$geometry IS NULL" ), tr( "0, if your geometry is not NULL" ), tr( "") )
454  )
455  )
456  );
457 
458  gFunctionHelpTexts.insert( "IS NOT",
459  Help( "IS NOT", tr( "operator" ), tr( "Returns 1 if a is not the same as b." ),
461  << HelpVariant( tr( "IS NOT" ), tr( "Returns 1 if a is not the same as b." ),
463  << HelpArg( tr( "a" ), tr( "value" ), false, false )
464  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
465  /* variableLenArguments */ false,
467  << HelpExample( tr( "'a' IS NOT 'b'" ), tr( "1" ), tr( "") )
468  << HelpExample( tr( "'a' IS NOT 'a'" ), tr( "0" ), tr( "") )
469  << HelpExample( tr( "4 IS NOT 2+2" ), tr( "0" ), tr( "") )
470  )
471  )
472  );
473 
474  gFunctionHelpTexts.insert( "LIKE",
475  Help( "LIKE", tr( "operator" ), tr( "Returns 1 if the first parameter matches the supplied pattern. Works with numbers also." ),
477  << HelpVariant( tr( "LIKE" ), tr( "Returns 1 if the first parameter matches the supplied pattern. Works with numbers also." ),
479  << HelpArg( tr( "string/number" ), tr( "value" ), false, false )
480  << HelpArg( tr( "pattern" ), tr( "pattern to compare value with" ), false, false ),
481  /* variableLenArguments */ false,
483  << HelpExample( tr( "'A' LIKE 'A'" ), tr( "1" ), tr( "") )
484  << HelpExample( tr( "'A' LIKE 'a'" ), tr( "0" ), tr( "") )
485  << HelpExample( tr( "'A' LIKE 'B'" ), tr( "0" ), tr( "") )
486  << HelpExample( tr( "'ABC' LIKE 'B'" ), tr( "0" ), tr( "") )
487  << HelpExample( tr( "'ABC' LIKE '%B%'" ), tr( "1" ), tr( "") )
488  )
489  )
490  );
491 
492  gFunctionHelpTexts.insert( "Math",
493  Help( "Math", tr( "group" ), tr( "This group contains math functions e.g square root, sin and cos" ),
495  << HelpVariant( tr( "Math" ), tr( "This group contains math functions e.g square root, sin and cos" ),
496  QList<HelpArg>(),
497  /* variableLenArguments */ false,
499  )
500  )
501  );
502 
503  gFunctionHelpTexts.insert( "NOT",
504  Help( "NOT", tr( "operator" ), tr( "Negates a condition." ),
506  << HelpVariant( tr( "NOT" ), tr( "Negates a condition." ),
508  << HelpArg( tr( "a" ), tr( "condition" ), false, false ),
509  /* variableLenArguments */ false,
511  << HelpExample( tr( "NOT 1" ), tr( "0" ), tr( "") )
512  << HelpExample( tr( "NOT 0" ), tr( "1" ), tr( "") )
513  )
514  )
515  );
516 
517  gFunctionHelpTexts.insert( "NULL",
518  Help( "NULL", tr( "value" ), tr( "Equates to a null value." ),
520  << HelpVariant( tr( "NULL" ), tr( "Equates to a null value." ),
521  QList<HelpArg>(),
522  /* variableLenArguments */ false,
524  << HelpExample( tr( "NULL" ), tr( "a null value" ), tr( "") ),
525  tr( "To test for NULL use an <pre>IS NULL</pre> or <pre>IS NOT NULL</pre> expression." )
526  )
527  )
528  );
529 
530  gFunctionHelpTexts.insert( "OR",
531  Help( "OR", tr( "operator" ), tr( "Returns 1 when condition a or b is true." ),
533  << HelpVariant( tr( "OR" ), tr( "Returns 1 when condition a or b is true." ),
535  << HelpArg( tr( "a" ), tr( "condition" ), false, false )
536  << HelpArg( tr( "b" ), tr( "condition" ), false, false ),
537  /* variableLenArguments */ false,
539  << HelpExample( tr( "4 = 2+2 OR 1 = 1" ), tr( "1" ), tr( "") )
540  << HelpExample( tr( "4 = 2+2 OR 1 = 2" ), tr( "1" ), tr( "") )
541  << HelpExample( tr( "4 = 2 OR 1 = 2" ), tr( "0" ), tr( "") )
542  )
543  )
544  );
545 
546  gFunctionHelpTexts.insert( "Operators",
547  Help( "Operators", tr( "group" ), tr( "This group contains operators e.g + - *" ),
549  << HelpVariant( tr( "Operators" ), tr( "This group contains operators e.g + - *" ),
550  QList<HelpArg>(),
551  /* variableLenArguments */ false,
553  )
554  )
555  );
556 
557  gFunctionHelpTexts.insert( "Recent (Selection)",
558  Help( "Recent (Selection)", tr( "group" ), tr( "This group contains recently used expressions." ),
560  << HelpVariant( tr( "Recent (Selection)" ), tr( "This group contains recently used expressions." ),
561  QList<HelpArg>(),
562  /* variableLenArguments */ false,
564  )
565  )
566  );
567 
568  gFunctionHelpTexts.insert( "Record",
569  Help( "Record", tr( "group" ), tr( "This group contains functions that operate on record identifiers." ),
571  << HelpVariant( tr( "Record" ), tr( "This group contains functions that operate on record identifiers." ),
572  QList<HelpArg>(),
573  /* variableLenArguments */ false,
575  )
576  )
577  );
578 
579  gFunctionHelpTexts.insert( "String",
580  Help( "String", tr( "group" ), tr( "This group contains functions that operate on strings e.g replace, convert to upper case." ),
582  << HelpVariant( tr( "String" ), tr( "This group contains functions that operate on strings e.g replace, convert to upper case." ),
583  QList<HelpArg>(),
584  /* variableLenArguments */ false,
586  )
587  )
588  );
589 
590  gFunctionHelpTexts.insert( "Variables",
591  Help( "Variables", tr( "group" ), tr( "This group contains dynamic variables which can be inserted into your expressions." ),
593  << HelpVariant( tr( "Variables" ), tr( "This group contains dynamic variables which can be inserted into your expressions." ),
594  QList<HelpArg>(),
595  /* variableLenArguments */ false,
597  )
598  )
599  );
600 
601  gFunctionHelpTexts.insert( "abs",
602  Help( "abs", tr( "function" ), tr( "Returns the absolute value of a number." ),
604  << HelpVariant( tr( "abs" ), tr( "Returns the absolute value of a number." ),
606  << HelpArg( tr( "value" ), tr( "a number" ), false, false ),
607  /* variableLenArguments */ false,
609  << HelpExample( tr( "abs(-2)" ), tr( "2" ), tr( "") )
610  )
611  )
612  );
613 
614  gFunctionHelpTexts.insert( "acos",
615  Help( "acos", tr( "function" ), tr( "Returns the inverse cosine of a value in radians." ),
617  << HelpVariant( tr( "acos" ), tr( "Returns the inverse cosine of a value in radians." ),
619  << HelpArg( tr( "value" ), tr( "cosine of an angle in radians" ), false, false ),
620  /* variableLenArguments */ false,
622  << HelpExample( tr( "acos(0.5)" ), tr( "1.0471975511966" ), tr( "") )
623  )
624  )
625  );
626 
627  gFunctionHelpTexts.insert( "age",
628  Help( "age", tr( "function" ), tr( "Returns the difference between two dates or datetimes.<br>The difference is returned as a <code>Interval</code> and needs to be used with one of the following functions in order to extract useful information:<br /><ul><li><code>year</code><li><code>month</code><li><code>week</code><li><code>day</code><li><code>hour</code><li><code>minute</code><li><code>second</code></ul>" ),
630  << HelpVariant( tr( "age" ), tr( "Returns the difference between two dates or datetimes.<br>The difference is returned as a <code>Interval</code> and needs to be used with one of the following functions in order to extract useful information:<br /><ul><li><code>year</code><li><code>month</code><li><code>week</code><li><code>day</code><li><code>hour</code><li><code>minute</code><li><code>second</code></ul>" ),
632  << HelpArg( tr( "datetime1" ), tr( "a string, date or datetime representing the later date" ), false, false )
633  << HelpArg( tr( "datetime2" ), tr( "a string, date or datetime representing the earlier date" ), false, false ),
634  /* variableLenArguments */ false,
636  << HelpExample( tr( "age('2012-05-12','2012-05-2')" ), tr( "interval" ), tr( "use <code>day</code> to extract number of days") )
637  << HelpExample( tr( "day(age('2012-05-12','2012-05-2'))" ), tr( "10" ), tr( "") )
638  )
639  )
640  );
641 
642  gFunctionHelpTexts.insert( "area",
643  Help( "area", tr( "function" ), tr( "Returns the area of a geometry polygon object. Calculations are always planimetric in the Spatial Reference System (SRS) of this geometry, and the units of the returned area will match the units for the SRS. This differs from the calculations performed by the $area function, which will perform ellipsoidal calculations based on the project's ellipsoid and area unit settings." ),
645  << HelpVariant( tr( "area" ), tr( "Returns the area of a geometry polygon object. Calculations are always planimetric in the Spatial Reference System (SRS) of this geometry, and the units of the returned area will match the units for the SRS. This differs from the calculations performed by the $area function, which will perform ellipsoidal calculations based on the project's ellipsoid and area unit settings." ),
647  << HelpArg( tr( "geometry" ), tr( "polygon geometry object" ), false, false ),
648  /* variableLenArguments */ false,
650  << HelpExample( tr( "area(geom_from_wkt('POLYGON((0 0, 4 0, 4 2, 0 2, 0 0))'))" ), tr( "8.0" ), tr( "") )
651  )
652  )
653  );
654 
655  gFunctionHelpTexts.insert( "asin",
656  Help( "asin", tr( "function" ), tr( "Returns the inverse sine of a value in radians." ),
658  << HelpVariant( tr( "asin" ), tr( "Returns the inverse sine of a value in radians." ),
660  << HelpArg( tr( "value" ), tr( "sine of an angle in radians" ), false, false ),
661  /* variableLenArguments */ false,
663  << HelpExample( tr( "asin(1.0)" ), tr( "1.5707963267949" ), tr( "") )
664  )
665  )
666  );
667 
668  gFunctionHelpTexts.insert( "atan",
669  Help( "atan", tr( "function" ), tr( "Returns the inverse tangent of a value in radians." ),
671  << HelpVariant( tr( "atan" ), tr( "Returns the inverse tangent of a value in radians." ),
673  << HelpArg( tr( "value" ), tr( "tan of an angle in radians" ), false, false ),
674  /* variableLenArguments */ false,
676  << HelpExample( tr( "atan(0.5)" ), tr( "0.463647609000806" ), tr( "") )
677  )
678  )
679  );
680 
681  gFunctionHelpTexts.insert( "atan2",
682  Help( "atan2", tr( "function" ), tr( "Returns the inverse tangent of dy/dx by using the signs of the two arguments to determine the quadrant of the result." ),
684  << HelpVariant( tr( "atan2" ), tr( "Returns the inverse tangent of dy/dx by using the signs of the two arguments to determine the quadrant of the result." ),
686  << HelpArg( tr( "dy" ), tr( "y coordinate difference" ), false, false )
687  << HelpArg( tr( "dx" ), tr( "x coordinate difference" ), false, false ),
688  /* variableLenArguments */ false,
690  << HelpExample( tr( "atan2(1.0, 1.732)" ), tr( "0.523611477769969" ), tr( "") )
691  )
692  )
693  );
694 
695  gFunctionHelpTexts.insert( "attribute",
696  Help( "attribute", tr( "function" ), tr( "Returns the value of a specified attribute from a feature." ),
698  << HelpVariant( tr( "attribute" ), tr( "Returns the value of a specified attribute from a feature." ),
700  << HelpArg( tr( "feature" ), tr( "a feature" ), false, false )
701  << HelpArg( tr( "attribute_name" ), tr( "name of attribute to be returned" ), false, false ),
702  /* variableLenArguments */ false,
704  << HelpExample( tr( "attribute( $currentfeature, 'name' )" ), tr( "value stored in 'name' attribute for the current feature" ), tr( "") )
705  )
706  )
707  );
708 
709  gFunctionHelpTexts.insert( "azimuth",
710  Help( "azimuth", tr( "function" ), tr( "Returns the north-based azimuth as the angle in radians measured clockwise from the vertical on pointA to pointB." ),
712  << HelpVariant( tr( "azimuth" ), tr( "Returns the north-based azimuth as the angle in radians measured clockwise from the vertical on pointA to pointB." ),
714  << HelpArg( tr( "pointA" ), tr( "point geometry" ), false, false )
715  << HelpArg( tr( "pointB" ), tr( "point geometry" ), false, false ),
716  /* variableLenArguments */ false,
718  << HelpExample( tr( "degrees( azimuth( make_point(25, 45), make_point(75, 100) ) )" ), tr( "42.273689" ), tr( "") )
719  << HelpExample( tr( "degrees( azimuth( make_point(75, 100), make_point(25,45) ) )" ), tr( "222.273689" ), tr( "") )
720  )
721  )
722  );
723 
724  gFunctionHelpTexts.insert( "bounds",
725  Help( "bounds", tr( "function" ), tr( "Returns a geometry which represents the bounding box of an input geometry. Calculations are in the Spatial Reference System of this geometry." ),
727  << HelpVariant( tr( "bounds" ), tr( "Returns a geometry which represents the bounding box of an input geometry. Calculations are in the Spatial Reference System of this geometry." ),
729  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
730  /* variableLenArguments */ false,
732  << HelpExample( tr( "bounds($geometry)" ), tr( "bounding box of $geometry" ), tr( "") )
733  )
734  )
735  );
736 
737  gFunctionHelpTexts.insert( "bounds_height",
738  Help( "bounds_height", tr( "function" ), tr( "Returns the height of the bounding box of a geometry. Calculations are in the Spatial Reference System of this geometry." ),
740  << HelpVariant( tr( "bounds_height" ), tr( "Returns the height of the bounding box of a geometry. Calculations are in the Spatial Reference System of this geometry." ),
742  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
743  /* variableLenArguments */ false,
745  << HelpExample( tr( "bounds_height($geometry)" ), tr( "height of bounding box of $geometry" ), tr( "") )
746  )
747  )
748  );
749 
750  gFunctionHelpTexts.insert( "bounds_width",
751  Help( "bounds_width", tr( "function" ), tr( "Returns the width of the bounding box of a geometry. Calculations are in the Spatial Reference System of this geometry." ),
753  << HelpVariant( tr( "bounds_width" ), tr( "Returns the width of the bounding box of a geometry. Calculations are in the Spatial Reference System of this geometry." ),
755  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
756  /* variableLenArguments */ false,
758  << HelpExample( tr( "bounds_width($geometry)" ), tr( "width of bounding box of $geometry" ), tr( "") )
759  )
760  )
761  );
762 
763  gFunctionHelpTexts.insert( "buffer",
764  Help( "buffer", tr( "function" ), tr( "Returns a geometry that represents all points whose distance from this geometry is less than or equal to distance. Calculations are in the Spatial Reference System of this geometry." ),
766  << HelpVariant( tr( "buffer" ), tr( "Returns a geometry that represents all points whose distance from this geometry is less than or equal to distance. Calculations are in the Spatial Reference System of this geometry." ),
768  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false )
769  << HelpArg( tr( "distance" ), tr( "buffer distance in layer units" ), false, false ),
770  /* variableLenArguments */ false,
772  << HelpExample( tr( "buffer($geometry, 10.5)" ), tr( "polygon of $geometry buffered by 10.5 units" ), tr( "") )
773  )
774  )
775  );
776 
777  gFunctionHelpTexts.insert( "ceil",
778  Help( "ceil", tr( "function" ), tr( "Rounds a number upwards." ),
780  << HelpVariant( tr( "ceil" ), tr( "Rounds a number upwards." ),
782  << HelpArg( tr( "value" ), tr( "a number" ), false, false ),
783  /* variableLenArguments */ false,
785  << HelpExample( tr( "ceil(4.9)" ), tr( "5" ), tr( "") )
786  << HelpExample( tr( "ceil(-4.9)" ), tr( "-4" ), tr( "") )
787  )
788  )
789  );
790 
791  gFunctionHelpTexts.insert( "centroid",
792  Help( "centroid", tr( "function" ), tr( "Returns the geometric center of a geometry." ),
794  << HelpVariant( tr( "centroid" ), tr( "Returns the geometric center of a geometry." ),
796  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
797  /* variableLenArguments */ false,
799  << HelpExample( tr( "centroid($geometry)" ), tr( "a point geometry" ), tr( "") )
800  )
801  )
802  );
803 
804  gFunctionHelpTexts.insert( "clamp",
805  Help( "clamp", tr( "function" ), tr( "Restricts an input value to a specified range." ),
807  << HelpVariant( tr( "clamp" ), tr( "Restricts an input value to a specified range." ),
809  << HelpArg( tr( "minimum" ), tr( "the smallest value <i>input</i> is allowed to take." ), false, false )
810  << HelpArg( tr( "input" ), tr( "a value which will be restricted to the range specified by <i>minimum</i> and <i>maximum</i>" ), false, false )
811  << HelpArg( tr( "maximum" ), tr( "the largest value <i>input</i> is allowed to take" ), false, false ),
812  /* variableLenArguments */ false,
814  << HelpExample( tr( "clamp(1,5,10)" ), tr( "5" ), tr( "<i>input</i> is between 1 and 10 so is returned unchanged") )
815  << HelpExample( tr( "clamp(1,0,10)" ), tr( "1" ), tr( "<i>input</i> is less than minimum value of 1, so function returns 1") )
816  << HelpExample( tr( "clamp(1,11,10)" ), tr( "10" ), tr( "<i>input</i> is greater than maximum value of 10, so function returns 10") )
817  )
818  )
819  );
820 
821  gFunctionHelpTexts.insert( "closest_point",
822  Help( "closest_point", tr( "function" ), tr( "Returns the point on geometry 1 that is closest to geometry 2." ),
824  << HelpVariant( tr( "closest_point" ), tr( "Returns the point on geometry 1 that is closest to geometry 2." ),
826  << HelpArg( tr( "geometry 1" ), tr( "geometry to find closest point on" ), false, false )
827  << HelpArg( tr( "geometry 2" ), tr( "geometry to find closest point to" ), false, false ),
828  /* variableLenArguments */ false,
830  << HelpExample( tr( "geom_to_wkt(closest_point(geom_from_wkt('LINESTRING (20 80, 98 190, 110 180, 50 75 )'),geom_from_wkt('POINT(100 100)')))" ), tr( "Point(73.0769 115.384)" ), tr( "") )
831  )
832  )
833  );
834 
835  gFunctionHelpTexts.insert( "coalesce",
836  Help( "coalesce", tr( "function" ), tr( "Returns the first non-NULL value from the expression list.<br>This function can take any number of arguments." ),
838  << HelpVariant( tr( "coalesce" ), tr( "Returns the first non-NULL value from the expression list.<br>This function can take any number of arguments." ),
840  << HelpArg( tr( "expression1" ), tr( "" ), false, true )
841  << HelpArg( tr( "expression2" ), tr( "" ), false, true )
842  << HelpArg( tr( "expression" ), tr( "any valid expression or value, irregardless of type." ), true, false ),
843  /* variableLenArguments */ true,
845  << HelpExample( tr( "coalesce(NULL, 2)" ), tr( "2" ), tr( "") )
846  << HelpExample( tr( "coalesce(NULL, 2, 3)" ), tr( "2" ), tr( "") )
847  << HelpExample( tr( "coalesce(7, NULL, 3*2)" ), tr( "7" ), tr( "") )
848  << HelpExample( tr( "coalesce(\"fieldA\", \"fallbackField\", 'ERROR')" ), tr( "value of fieldA if it is non-NULL else the value of \"fallbackField\" or the string 'ERROR' if both are NULL" ), tr( "") )
849  )
850  )
851  );
852 
853  gFunctionHelpTexts.insert( "color_cmyk",
854  Help( "color_cmyk", tr( "function" ), tr( "Returns a string representation of a color based on its cyan, magenta, yellow and black components" ),
856  << HelpVariant( tr( "color_cmyk" ), tr( "Returns a string representation of a color based on its cyan, magenta, yellow and black components" ),
858  << HelpArg( tr( "cyan" ), tr( "cyan component of the color, as a percentage integer value from 0 to 100" ), false, false )
859  << HelpArg( tr( "magenta" ), tr( "magenta component of the color, as a percentage integer value from 0 to 100" ), false, false )
860  << HelpArg( tr( "yellow" ), tr( "yellow component of the color, as a percentage integer value from 0 to 100" ), false, false )
861  << HelpArg( tr( "black" ), tr( "black component of the color, as a percentage integer value from 0 to 100" ), false, false ),
862  /* variableLenArguments */ false,
864  << HelpExample( tr( "color_cmyk(100,50,0,10)" ), tr( "0,115,230" ), tr( "") )
865  )
866  )
867  );
868 
869  gFunctionHelpTexts.insert( "color_cmyka",
870  Help( "color_cmyka", tr( "function" ), tr( "Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components" ),
872  << HelpVariant( tr( "color_cmyka" ), tr( "Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components" ),
874  << HelpArg( tr( "cyan" ), tr( "cyan component of the color, as a percentage integer value from 0 to 100" ), false, false )
875  << HelpArg( tr( "magenta" ), tr( "magenta component of the color, as a percentage integer value from 0 to 100" ), false, false )
876  << HelpArg( tr( "yellow" ), tr( "yellow component of the color, as a percentage integer value from 0 to 100" ), false, false )
877  << HelpArg( tr( "black" ), tr( "black component of the color, as a percentage integer value from 0 to 100" ), false, false )
878  << HelpArg( tr( "alpha" ), tr( "alpha component as an integer value from 0 (completely transparent) to 255 (opaque)." ), false, false ),
879  /* variableLenArguments */ false,
881  << HelpExample( tr( "color_cmyk(100,50,0,10,200)" ), tr( "0,115,230,200" ), tr( "") )
882  )
883  )
884  );
885 
886  gFunctionHelpTexts.insert( "color_hsl",
887  Help( "color_hsl", tr( "function" ), tr( "Returns a string representation of a color based on its hue, saturation, and lightness attributes." ),
889  << HelpVariant( tr( "color_hsl" ), tr( "Returns a string representation of a color based on its hue, saturation, and lightness attributes." ),
891  << HelpArg( tr( "hue" ), tr( "hue of the color, as an integer value from 0 to 360" ), false, false )
892  << HelpArg( tr( "saturation" ), tr( "saturation percentage of the color as an integer value from 0 to 100" ), false, false )
893  << HelpArg( tr( "lightness" ), tr( "lightness percentage of the color as an integer value from 0 to 100" ), false, false ),
894  /* variableLenArguments */ false,
896  << HelpExample( tr( "color_hsl(100,50,70)" ), tr( "166,217,140" ), tr( "") )
897  )
898  )
899  );
900 
901  gFunctionHelpTexts.insert( "color_hsla",
902  Help( "color_hsla", tr( "function" ), tr( "Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes" ),
904  << HelpVariant( tr( "color_hsla" ), tr( "Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes" ),
906  << HelpArg( tr( "hue" ), tr( "hue of the color, as an integer value from 0 to 360" ), false, false )
907  << HelpArg( tr( "saturation" ), tr( "saturation percentage of the color as an integer value from 0 to 100" ), false, false )
908  << HelpArg( tr( "lightness" ), tr( "lightness percentage of the color as an integer value from 0 to 100" ), false, false )
909  << HelpArg( tr( "alpha" ), tr( "alpha component as an integer value from 0 (completely transparent) to 255 (opaque)." ), false, false ),
910  /* variableLenArguments */ false,
912  << HelpExample( tr( "color_hsla(100,50,70,200)" ), tr( "166,217,140,200" ), tr( "") )
913  )
914  )
915  );
916 
917  gFunctionHelpTexts.insert( "color_hsv",
918  Help( "color_hsv", tr( "function" ), tr( "Returns a string representation of a color based on its hue, saturation, and value attributes." ),
920  << HelpVariant( tr( "color_hsv" ), tr( "Returns a string representation of a color based on its hue, saturation, and value attributes." ),
922  << HelpArg( tr( "hue" ), tr( "hue of the color, as an integer value from 0 to 360" ), false, false )
923  << HelpArg( tr( "saturation" ), tr( "saturation percentage of the color as an integer value from 0 to 100" ), false, false )
924  << HelpArg( tr( "value" ), tr( "value percentage of the color as an integer from 0 to 100" ), false, false ),
925  /* variableLenArguments */ false,
927  << HelpExample( tr( "color_hsv(40,100,100)" ), tr( "255,170,0" ), tr( "") )
928  )
929  )
930  );
931 
932  gFunctionHelpTexts.insert( "color_hsva",
933  Help( "color_hsva", tr( "function" ), tr( "Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes." ),
935  << HelpVariant( tr( "color_hsva" ), tr( "Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes." ),
937  << HelpArg( tr( "hue" ), tr( "hue of the color, as an integer value from 0 to 360" ), false, false )
938  << HelpArg( tr( "saturation" ), tr( "saturation percentage of the color as an integer value from 0 to 100" ), false, false )
939  << HelpArg( tr( "value" ), tr( "value percentage of the color as an integer from 0 to 100" ), false, false )
940  << HelpArg( tr( "alpha" ), tr( "alpha component as an integer value from 0 (completely transparent) to 255 (opaque)" ), false, false ),
941  /* variableLenArguments */ false,
943  << HelpExample( tr( "color_hsva(40,100,100,200)" ), tr( "255,170,0,200" ), tr( "") )
944  )
945  )
946  );
947 
948  gFunctionHelpTexts.insert( "color_part",
949  Help( "color_part", tr( "function" ), tr( "Returns a specific component from a color string, eg the red component or alpha component." ),
951  << HelpVariant( tr( "color_part" ), tr( "Returns a specific component from a color string, eg the red component or alpha component." ),
953  << HelpArg( tr( "color" ), tr( "a color string" ), false, false )
954  << HelpArg( tr( "component" ), tr( "a string corresponding to the color component to return. Valid options are:<br /><ul><li>red: RGB red component (0-255)</li><li>green: RGB green component (0-255)</li><li>blue: RGB blue component (0-255)</li><li>alpha: alpha (transparency) value (0-255)</li><li>hue: HSV hue (0-360)</li><li>saturation: HSV saturation (0-100)</li><li>value: HSV value (0-100)</li><li>hsl_hue: HSL hue (0-360)</li><li>hsl_saturation: HSL saturation (0-100)</li><li>lightness: HSL lightness (0-100)</li><li>cyan: CMYK cyan component (0-100)</li><li>magenta: CMYK magenta component (0-100)</li><li>yellow: CMYK yellow component (0-100)</li> <li>black: CMYK black component (0-100)</li></ul>" ), false, false ),
955  /* variableLenArguments */ false,
957  << HelpExample( tr( "color_part('200,10,30','green')" ), tr( "10" ), tr( "") )
958  )
959  )
960  );
961 
962  gFunctionHelpTexts.insert( "color_rgb",
963  Help( "color_rgb", tr( "function" ), tr( "Returns a string representation of a color based on its red, green, and blue components." ),
965  << HelpVariant( tr( "color_rgb" ), tr( "Returns a string representation of a color based on its red, green, and blue components." ),
967  << HelpArg( tr( "red" ), tr( "red component as an integer value from 0 to 255" ), false, false )
968  << HelpArg( tr( "green" ), tr( "green component as an integer value from 0 to 255" ), false, false )
969  << HelpArg( tr( "blue" ), tr( "blue component as an integer value from 0 to 255" ), false, false ),
970  /* variableLenArguments */ false,
972  << HelpExample( tr( "color_rgb(255,127,0)" ), tr( "255,127,0" ), tr( "") )
973  )
974  )
975  );
976 
977  gFunctionHelpTexts.insert( "color_rgba",
978  Help( "color_rgba", tr( "function" ), tr( "Returns a string representation of a color based on its red, green, blue, and alpha (transparency) components." ),
980  << HelpVariant( tr( "color_rgba" ), tr( "Returns a string representation of a color based on its red, green, blue, and alpha (transparency) components." ),
982  << HelpArg( tr( "red" ), tr( "red component as an integer value from 0 to 255" ), false, false )
983  << HelpArg( tr( "green" ), tr( "green component as an integer value from 0 to 255" ), false, false )
984  << HelpArg( tr( "blue" ), tr( "blue component as an integer value from 0 to 255" ), false, false )
985  << HelpArg( tr( "alpha" ), tr( "alpha component as an integer value from 0 (completely transparent) to 255 (opaque)." ), false, false ),
986  /* variableLenArguments */ false,
988  << HelpExample( tr( "color_rgba(255,127,0,200)" ), tr( "255,127,0,200" ), tr( "") )
989  )
990  )
991  );
992 
993  gFunctionHelpTexts.insert( "combine",
994  Help( "combine", tr( "function" ), tr( "Returns the combination of two geometries." ),
996  << HelpVariant( tr( "combine" ), tr( "Returns the combination of two geometries." ),
998  << HelpArg( tr( "geometry1" ), tr( "a geometry" ), false, false )
999  << HelpArg( tr( "geometry2" ), tr( "a geometry" ), false, false ),
1000  /* variableLenArguments */ false,
1002  << HelpExample( tr( "geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 2 1)' ) ) )" ), tr( "MULTILINESTRING((4 4, 2 1), (3 3, 4 4), (4 4, 5 5))" ), tr( "") )
1003  << HelpExample( tr( "geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 6 6, 2 1)' ) ) )" ), tr( "LINESTRING(3 3, 4 4, 6 6, 2 1)" ), tr( "") )
1004  )
1005  )
1006  );
1007 
1008  gFunctionHelpTexts.insert( "concat",
1009  Help( "concat", tr( "function" ), tr( "Concatenates several strings to one. NULL values are converted to empty strings. Other values (like numbers) are converted to strings." ),
1011  << HelpVariant( tr( "concat" ), tr( "Concatenates several strings to one. NULL values are converted to empty strings. Other values (like numbers) are converted to strings." ),
1012  QList<HelpArg>()
1013  << HelpArg( tr( "string1" ), tr( "" ), false, true )
1014  << HelpArg( tr( "string2" ), tr( "" ), false, true )
1015  << HelpArg( tr( "string" ), tr( "a string value" ), true, false ),
1016  /* variableLenArguments */ true,
1018  << HelpExample( tr( "concat('sun', 'set')" ), tr( "'sunset'" ), tr( "") )
1019  << HelpExample( tr( "concat('a','b','c','d','e')" ), tr( "'abcde'" ), tr( "") )
1020  << HelpExample( tr( "concat('Anno ', 1984)" ), tr( "'Anno 1984'" ), tr( "") )
1021  << HelpExample( tr( "concat('The Wall', NULL)" ), tr( "'The Wall'" ), tr( "") )
1022  )
1023  )
1024  );
1025 
1026  gFunctionHelpTexts.insert( "contains",
1027  Help( "contains", tr( "function" ), tr( "Tests whether a geometry contains another. Returns true if and only if no points of geometry b lie in the exterior of geometry a, and at least one point of the interior of b lies in the interior of a." ),
1029  << HelpVariant( tr( "contains" ), tr( "Tests whether a geometry contains another. Returns true if and only if no points of geometry b lie in the exterior of geometry a, and at least one point of the interior of b lies in the interior of a." ),
1030  QList<HelpArg>()
1031  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
1032  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
1033  /* variableLenArguments */ false,
1035  << HelpExample( tr( "geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 2 1)' ) ) )" ), tr( "MULTILINESTRING((4 4, 2 1), (3 3, 4 4), (4 4, 5 5))" ), tr( "") )
1036  << HelpExample( tr( "contains( geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))' ), geom_from_wkt( 'POINT(0.5 0.5 )' ) )" ), tr( "true" ), tr( "") )
1037  << HelpExample( tr( "contains( geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "false" ), tr( "") )
1038  )
1039  )
1040  );
1041 
1042  gFunctionHelpTexts.insert( "convex_hull",
1043  Help( "convex_hull", tr( "function" ), tr( "Returns the convex hull of a geometry. It represents the minimum convex geometry that encloses all geometries within the set." ),
1045  << HelpVariant( tr( "convex_hull" ), tr( "Returns the convex hull of a geometry. It represents the minimum convex geometry that encloses all geometries within the set." ),
1046  QList<HelpArg>()
1047  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false ),
1048  /* variableLenArguments */ false,
1050  << HelpExample( tr( "geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 2 1)' ) ) )" ), tr( "MULTILINESTRING((4 4, 2 1), (3 3, 4 4), (4 4, 5 5))" ), tr( "") )
1051  << HelpExample( tr( "geom_to_wkt( convex_hull( geom_from_wkt( 'LINESTRING(3 3, 4 4, 4 10)' ) ) )" ), tr( "POLYGON((3 3,4 10,4 4,3 3))" ), tr( "") )
1052  )
1053  )
1054  );
1055 
1056  gFunctionHelpTexts.insert( "cos",
1057  Help( "cos", tr( "function" ), tr( "Returns cosine of an angle." ),
1059  << HelpVariant( tr( "cos" ), tr( "Returns cosine of an angle." ),
1060  QList<HelpArg>()
1061  << HelpArg( tr( "angle" ), tr( "angle in radians" ), false, false ),
1062  /* variableLenArguments */ false,
1064  << HelpExample( tr( "cos(1.571)" ), tr( "0.000796326710733263" ), tr( "") )
1065  )
1066  )
1067  );
1068 
1069  gFunctionHelpTexts.insert( "crosses",
1070  Help( "crosses", tr( "function" ), tr( "Tests whether a geometry crosses another. Returns true if the supplied geometries have some, but not all, interior points in common." ),
1072  << HelpVariant( tr( "crosses" ), tr( "Tests whether a geometry crosses another. Returns true if the supplied geometries have some, but not all, interior points in common." ),
1073  QList<HelpArg>()
1074  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
1075  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
1076  /* variableLenArguments */ false,
1078  << HelpExample( tr( "crosses( geom_from_wkt( 'LINESTRING(3 5, 4 4, 5 3)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "true" ), tr( "") )
1079  << HelpExample( tr( "crosses( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "false" ), tr( "") )
1080  )
1081  )
1082  );
1083 
1084  gFunctionHelpTexts.insert( "darker",
1085  Help( "darker", tr( "function" ), tr( "Returns a darker (or lighter) color string" ),
1087  << HelpVariant( tr( "darker" ), tr( "Returns a darker (or lighter) color string" ),
1088  QList<HelpArg>()
1089  << HelpArg( tr( "color" ), tr( "a color string" ), false, false )
1090  << HelpArg( tr( "factor" ), tr( "a integer number corresponding to the darkening factor:<ul><li>if the factor is greater than 100, this functions returns a darker color (for e.g., setting factor to 300 returns a color that has one-third the brightness);</li><li>if the factor is less than 100, the return color is lighter, but using the lighter() function for this purpose is recommended;</li><li>if the factor is 0 or negative, the return value is unspecified.</li></ul>" ), false, false ),
1091  /* variableLenArguments */ false,
1093  << HelpExample( tr( "darker('200,10,30',300)" ), tr( "'66,3,10,255'" ), tr( "") )
1094  )
1095  )
1096  );
1097 
1098  gFunctionHelpTexts.insert( "day",
1099  Help( "day", tr( "function" ), tr( "Extract the day from a date, or the number of days from an interval." ),
1101  << HelpVariant( tr( "Date variant" ), tr( "Extract the day from a date or datetime." ),
1102  QList<HelpArg>()
1103  << HelpArg( tr( "date" ), tr( "a date or datetime value" ), false, false ),
1104  /* variableLenArguments */ false,
1106  << HelpExample( tr( "day('2012-05-12')" ), tr( "12" ), tr( "") )
1107  )
1108  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in days of an interval." ),
1109  QList<HelpArg>()
1110  << HelpArg( tr( "interval" ), tr( "interval value to return number of days from" ), false, false ),
1111  /* variableLenArguments */ false,
1113  << HelpExample( tr( "day(tointerval('3 days'))" ), tr( "3" ), tr( "") )
1114  << HelpExample( tr( "day(age('2012-01-01','2010-01-01'))" ), tr( "730" ), tr( "") )
1115  )
1116  )
1117  );
1118 
1119  gFunctionHelpTexts.insert( "day_of_week",
1120  Help( "day_of_week", tr( "function" ), tr( "Returns the day of the week for a specified date or datetime. The returned value ranges from 0 to 6, where 0 corresponds to a Sunday and 6 to a Saturday." ),
1122  << HelpVariant( tr( "day_of_week" ), tr( "Returns the day of the week for a specified date or datetime. The returned value ranges from 0 to 6, where 0 corresponds to a Sunday and 6 to a Saturday." ),
1123  QList<HelpArg>()
1124  << HelpArg( tr( "date" ), tr( "date or datetime value" ), false, false ),
1125  /* variableLenArguments */ false,
1127  << HelpExample( tr( "day_of_week(todate('2015-09-21'))" ), tr( "1" ), tr( "") )
1128  )
1129  )
1130  );
1131 
1132  gFunctionHelpTexts.insert( "degrees",
1133  Help( "degrees", tr( "function" ), tr( "Converts from radians to degrees." ),
1135  << HelpVariant( tr( "degrees" ), tr( "Converts from radians to degrees." ),
1136  QList<HelpArg>()
1137  << HelpArg( tr( "radians" ), tr( "numeric value" ), false, false ),
1138  /* variableLenArguments */ false,
1140  << HelpExample( tr( "degrees(3.14159)" ), tr( "180" ), tr( "") )
1141  << HelpExample( tr( "degrees(1)" ), tr( "57.2958" ), tr( "") )
1142  )
1143  )
1144  );
1145 
1146  gFunctionHelpTexts.insert( "difference",
1147  Help( "difference", tr( "function" ), tr( "Returns a geometry that represents that part of geometry_a that does not intersect with geometry_b." ),
1149  << HelpVariant( tr( "difference" ), tr( "Returns a geometry that represents that part of geometry_a that does not intersect with geometry_b." ),
1150  QList<HelpArg>()
1151  << HelpArg( tr( "geometry_a" ), tr( "a geometry" ), false, false )
1152  << HelpArg( tr( "geometry_b" ), tr( "a geometry" ), false, false ),
1153  /* variableLenArguments */ false,
1155  << HelpExample( tr( "geom_to_wkt( difference( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4)' ) ) )" ), tr( "LINESTRING(4 4, 5 5)" ), tr( "") )
1156  )
1157  )
1158  );
1159 
1160  gFunctionHelpTexts.insert( "disjoint",
1161  Help( "disjoint", tr( "function" ), tr( "Tests whether geometries do not spatially intersect. Returns true if the geometries do not share any space together." ),
1163  << HelpVariant( tr( "disjoint" ), tr( "Tests whether geometries do not spatially intersect. Returns true if the geometries do not share any space together." ),
1164  QList<HelpArg>()
1165  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
1166  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
1167  /* variableLenArguments */ false,
1169  << HelpExample( tr( "disjoint( geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0 ))' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "true" ), tr( "") )
1170  << HelpExample( tr( "disjoint( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'POINT(4 4)' ))" ), tr( "false" ), tr( "") )
1171  )
1172  )
1173  );
1174 
1175  gFunctionHelpTexts.insert( "distance",
1176  Help( "distance", tr( "function" ), tr( "Returns the minimum distance (based on spatial ref) between two geometries in projected units." ),
1178  << HelpVariant( tr( "distance" ), tr( "Returns the minimum distance (based on spatial ref) between two geometries in projected units." ),
1179  QList<HelpArg>()
1180  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
1181  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
1182  /* variableLenArguments */ false,
1184  << HelpExample( tr( "distance( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(4 8)' ) )" ), tr( "4" ), tr( "") )
1185  )
1186  )
1187  );
1188 
1189  gFunctionHelpTexts.insert( "end_point",
1190  Help( "end_point", tr( "function" ), tr( "Returns the last node from a geometry." ),
1192  << HelpVariant( tr( "end_point" ), tr( "Returns the last node from a geometry." ),
1193  QList<HelpArg>()
1194  << HelpArg( tr( "geometry" ), tr( "geometry object" ), false, false ),
1195  /* variableLenArguments */ false,
1197  << HelpExample( tr( "geom_to_wkt(end_point(geom_from_wkt('LINESTRING(4 0, 4 2, 0 2)')))" ), tr( "'Point (0 2)'" ), tr( "") )
1198  )
1199  )
1200  );
1201 
1202  gFunctionHelpTexts.insert( "eval",
1203  Help( "eval", tr( "function" ), tr( "Evaluates an expression which is passed in a string. Useful to expand dynamic parameters passed as context variables or fields." ),
1205  << HelpVariant( tr( "eval" ), tr( "Evaluates an expression which is passed in a string. Useful to expand dynamic parameters passed as context variables or fields." ),
1206  QList<HelpArg>()
1207  << HelpArg( tr( "expression" ), tr( "an expression string" ), false, false ),
1208  /* variableLenArguments */ false,
1210  << HelpExample( tr( "eval('\'nice\'')" ), tr( "'nice'" ), tr( "") )
1211  << HelpExample( tr( "eval(@expression_var)" ), tr( "[whatever the result of evaluating @expression_var might be...]" ), tr( "") )
1212  )
1213  )
1214  );
1215 
1216  gFunctionHelpTexts.insert( "exp",
1217  Help( "exp", tr( "function" ), tr( "Returns exponential of an value." ),
1219  << HelpVariant( tr( "exp" ), tr( "Returns exponential of an value." ),
1220  QList<HelpArg>()
1221  << HelpArg( tr( "value" ), tr( "number to return exponent of" ), false, false ),
1222  /* variableLenArguments */ false,
1224  << HelpExample( tr( "exp(1.0)" ), tr( "2.71828182845905" ), tr( "") )
1225  )
1226  )
1227  );
1228 
1229  gFunctionHelpTexts.insert( "exterior_ring",
1230  Help( "exterior_ring", tr( "function" ), tr( "Returns a line string representing the exterior ring of a polygon geometry. If the geometry is not a polygon then the result will be null." ),
1232  << HelpVariant( tr( "exterior_ring" ), tr( "Returns a line string representing the exterior ring of a polygon geometry. If the geometry is not a polygon then the result will be null." ),
1233  QList<HelpArg>()
1234  << HelpArg( tr( "geom" ), tr( "a polygon geometry" ), false, false ),
1235  /* variableLenArguments */ false,
1237  << HelpExample( tr( "geom_to_wkt(exterior_ring(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),( 0.1 0.1, 0.1 0.2, 0.2 0.2, 0.2, 0.1, 0.1 0.1))')))" ), tr( "'LineString (-1 -1, 4 0, 4 2, 0 2, -1 -1)'" ), tr( "") )
1238  )
1239  )
1240  );
1241 
1242  gFunctionHelpTexts.insert( "extrude",
1243  Help( "extrude", tr( "function" ), tr( "Returns an extruded version of the input (Multi-)Curve or (Multi-)Linestring geometry with an extension specified by x and y." ),
1245  << HelpVariant( tr( "extrude" ), tr( "Returns an extruded version of the input (Multi-)Curve or (Multi-)Linestring geometry with an extension specified by x and y." ),
1246  QList<HelpArg>()
1247  << HelpArg( tr( "geom" ), tr( "a polygon geometry" ), false, false )
1248  << HelpArg( tr( "x" ), tr( "x extension, numeric value" ), false, false )
1249  << HelpArg( tr( "y" ), tr( "y extension, numeric value" ), false, false ),
1250  /* variableLenArguments */ false,
1252  << HelpExample( tr( "extrude(geom_from_wkt('LineString(1 2, 3 2, 4 3)'), 1, 2)" ), tr( "Polygon ((1 2, 3 2, 4 3, 5 5, 4 4, 2 4, 1 2))" ), tr( "") )
1253  << HelpExample( tr( "extrude(geom_from_wkt('MultiLineString((1 2, 3 2), (4 3, 8 3)'), 1, 2)" ), tr( "MultiPolygon (((1 2, 3 2, 4 4, 2 4, 1 2)),((4 3, 8 3, 9 5, 5 5, 4 3)))" ), tr( "") )
1254  )
1255  )
1256  );
1257 
1258  gFunctionHelpTexts.insert( "floor",
1259  Help( "floor", tr( "function" ), tr( "Rounds a number downwards." ),
1261  << HelpVariant( tr( "floor" ), tr( "Rounds a number downwards." ),
1262  QList<HelpArg>()
1263  << HelpArg( tr( "value" ), tr( "a number" ), false, false ),
1264  /* variableLenArguments */ false,
1266  << HelpExample( tr( "floor(4.9)" ), tr( "4" ), tr( "") )
1267  << HelpExample( tr( "floor(-4.9)" ), tr( "-5" ), tr( "") )
1268  )
1269  )
1270  );
1271 
1272  gFunctionHelpTexts.insert( "format",
1273  Help( "format", tr( "function" ), tr( "Format a string using supplied arguments." ),
1275  << HelpVariant( tr( "format" ), tr( "Format a string using supplied arguments." ),
1276  QList<HelpArg>()
1277  << HelpArg( tr( "string" ), tr( "A string with place holders for the arguments. Use %1, %2, etc for placeholders. Placeholders can be repeated." ), false, false )
1278  << HelpArg( tr( "arg1" ), tr( "" ), false, true )
1279  << HelpArg( tr( "arg2" ), tr( "" ), false, true )
1280  << HelpArg( tr( "arg" ), tr( "any type. Any number of arguments." ), true, false ),
1281  /* variableLenArguments */ true,
1283  << HelpExample( tr( "format('This %1 a %2','is', 'test')" ), tr( "'This is a test''" ), tr( "") )
1284  )
1285  )
1286  );
1287 
1288  gFunctionHelpTexts.insert( "format_date",
1289  Help( "format_date", tr( "function" ), tr( "Format a date type or string into a custom string format. Uses Qt date/time format strings. See <a href='http://qt-project.org/doc/qt-4.8/qdatetime.html#toString'>QDateTime::toString</a>." ),
1291  << HelpVariant( tr( "format_date" ), tr( "Format a date type or string into a custom string format. Uses Qt date/time format strings. See <a href='http://qt-project.org/doc/qt-4.8/qdatetime.html#toString'>QDateTime::toString</a>." ),
1292  QList<HelpArg>()
1293  << HelpArg( tr( "datetime" ), tr( "date, time or datetime value" ), false, false )
1294  << HelpArg( tr( "format" ), tr( "String template used to format the string. <table><thead><tr><th>Expression</th><th>Output</th></tr></thead><tr valign=\"top\"><td>d</td><td>the day as number without a leading zero (1 to 31)</td></tr><tr valign=\"top\"><td>dd</td><td>the day as number with a leading zero (01 to 31)</td></tr><tr valign=\"top\"><td>ddd</td><td>the abbreviated localized day name (e.g. 'Mon' to 'Sun')</td></tr><tr valign=\"top\"><td>dddd</td><td>the long localized day name (e.g. 'Monday' to 'Sunday')</td></tr><tr valign=\"top\"><td>M</td><td>the month as number without a leading zero (1-12)</td></tr><tr valign=\"top\"><td>MM</td><td>the month as number with a leading zero (01-12)</td></tr><tr valign=\"top\"><td>MMM</td><td>the abbreviated localized month name (e.g. 'Jan' to 'Dec')</td></tr><tr valign=\"top\"><td>MMMM</td><td>the long localized month name (e.g. 'January' to 'December')</td></tr><tr valign=\"top\"><td>yy</td><td>the year as two digit number (00-99)</td></tr><tr valign=\"top\"><td>yyyy</td><td>the year as four digit number</td></tr></table><p>These expressions may be used for the time part of the format string:</p><table><thead><tr><th>Expression</th><th>Output</th></tr></thead><tr valign=\"top\"><td>h</td><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr><tr valign=\"top\"><td>hh</td><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr><tr valign=\"top\"><td>H</td><td>the hour without a leading zero (0 to 23, even with AM/PM display)</td></tr><tr valign=\"top\"><td>HH</td><td>the hour with a leading zero (00 to 23, even with AM/PM display)</td></tr><tr valign=\"top\"><td>m</td><td>the minute without a leading zero (0 to 59)</td></tr><tr valign=\"top\"><td>mm</td><td>the minute with a leading zero (00 to 59)</td></tr><tr valign=\"top\"><td>s</td><td>the second without a leading zero (0 to 59)</td></tr><tr valign=\"top\"><td>ss</td><td>the second with a leading zero (00 to 59)</td></tr><tr valign=\"top\"><td>z</td><td>the milliseconds without leading zeroes (0 to 999)</td></tr><tr valign=\"top\"><td>zzz</td><td>the milliseconds with leading zeroes (000 to 999)</td></tr><tr valign=\"top\"><td>AP or A</td><td>interpret as an AM/PM time. <i>AP</i> must be either \"AM\" or \"PM\".</td></tr><tr valign=\"top\"><td>ap or a</td><td>Interpret as an AM/PM time. <i>ap</i> must be either \"am\" or \"pm\".</td></tr></table>" ), false, false ),
1295  /* variableLenArguments */ false,
1297  << HelpExample( tr( "format_date('2012-05-15','dd.MM.yyyy')" ), tr( "'15.05.2012'" ), tr( "") )
1298  )
1299  )
1300  );
1301 
1302  gFunctionHelpTexts.insert( "format_number",
1303  Help( "format_number", tr( "function" ), tr( "Returns a number formatted with the locale separator for thousands. Also truncates the number to the number of supplied places." ),
1305  << HelpVariant( tr( "format_number" ), tr( "Returns a number formatted with the locale separator for thousands. Also truncates the number to the number of supplied places." ),
1306  QList<HelpArg>()
1307  << HelpArg( tr( "number" ), tr( "number to be formatted" ), false, false )
1308  << HelpArg( tr( "places" ), tr( "integer representing the number of decimal places to truncate the string to." ), false, false ),
1309  /* variableLenArguments */ false,
1311  << HelpExample( tr( "format_number(10000000.332,2)" ), tr( "'10,000,000.33'" ), tr( "") )
1312  )
1313  )
1314  );
1315 
1316  gFunctionHelpTexts.insert( "geom_from_gml",
1317  Help( "geom_from_gml", tr( "function" ), tr( "Returns a geometry from a GML representation of geometry." ),
1319  << HelpVariant( tr( "geom_from_gml" ), tr( "Returns a geometry from a GML representation of geometry." ),
1320  QList<HelpArg>()
1321  << HelpArg( tr( "gml" ), tr( "GML representation of a geometry as a string" ), false, false ),
1322  /* variableLenArguments */ false,
1324  << HelpExample( tr( "geom_from_gml( '<gml:LineString srsName=\"EPSG:4326\"><gml:coordinates>4,4 5,5 6,6</gml:coordinates></gml:LineString>')" ), tr( "a geometry object" ), tr( "") )
1325  )
1326  )
1327  );
1328 
1329  gFunctionHelpTexts.insert( "geom_from_wkt",
1330  Help( "geom_from_wkt", tr( "function" ), tr( "Returns a geometry created from a Well-Known Text (WKT) representation." ),
1332  << HelpVariant( tr( "geom_from_wkt" ), tr( "Returns a geometry created from a Well-Known Text (WKT) representation." ),
1333  QList<HelpArg>()
1334  << HelpArg( tr( "text" ), tr( "Well-Known Text (WKT) representation of a geometry" ), false, false ),
1335  /* variableLenArguments */ false,
1337  << HelpExample( tr( "geom_from_wkt( 'POINT(4 5)' )" ), tr( "a geometry object" ), tr( "") )
1338  )
1339  )
1340  );
1341 
1342  gFunctionHelpTexts.insert( "geom_to_wkt",
1343  Help( "geom_to_wkt", tr( "function" ), tr( "Returns the Well-Known Text (WKT) representation of the geometry without SRID metadata." ),
1345  << HelpVariant( tr( "geom_to_wkt" ), tr( "Returns the Well-Known Text (WKT) representation of the geometry without SRID metadata." ),
1346  QList<HelpArg>()
1347  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false ),
1348  /* variableLenArguments */ false,
1350  << HelpExample( tr( "geom_to_wkt( $geometry )" ), tr( "POINT(6 50)" ), tr( "") )
1351  )
1352  )
1353  );
1354 
1355  gFunctionHelpTexts.insert( "geometry",
1356  Help( "geometry", tr( "function" ), tr( "Returns a feature's geometry." ),
1358  << HelpVariant( tr( "geometry" ), tr( "Returns a feature's geometry." ),
1359  QList<HelpArg>()
1360  << HelpArg( tr( "feature" ), tr( "a feature object" ), false, false ),
1361  /* variableLenArguments */ false,
1363  << HelpExample( tr( "geom_to_wkt( geometry( get_feature( layer, attributeField, value ) ) )" ), tr( "'POINT(6 50)'" ), tr( "") )
1364  << HelpExample( tr( "intersects( $geometry, geometry( get_feature( layer, attributeField, value ) ) )" ), tr( "true" ), tr( "") )
1365  )
1366  )
1367  );
1368 
1369  gFunctionHelpTexts.insert( "geometry_n",
1370  Help( "geometry_n", tr( "function" ), tr( "Returns a specific geometry from a geometry collection, or null if the input geometry is not a collection." ),
1372  << HelpVariant( tr( "geometry_n" ), tr( "Returns a specific geometry from a geometry collection, or null if the input geometry is not a collection." ),
1373  QList<HelpArg>()
1374  << HelpArg( tr( "geometry" ), tr( "geometry collection" ), false, false )
1375  << HelpArg( tr( "index" ), tr( "index of geometry to return, where 1 is the first geometry in the collection" ), false, false ),
1376  /* variableLenArguments */ false,
1378  << HelpExample( tr( "geom_to_wkt(geometry_n(geom_from_wkt('GEOMETRYCOLLECTION(POINT(0 1), POINT(0 0), POINT(1 0), POINT(1 1))'),3))" ), tr( "'Point (1 0)'" ), tr( "") )
1379  )
1380  )
1381  );
1382 
1383  gFunctionHelpTexts.insert( "get_feature",
1384  Help( "get_feature", tr( "function" ), tr( "Returns the first feature of a layer matching a given attribute value." ),
1386  << HelpVariant( tr( "get_feature" ), tr( "Returns the first feature of a layer matching a given attribute value." ),
1387  QList<HelpArg>()
1388  << HelpArg( tr( "layer" ), tr( "layer name or ID" ), false, false )
1389  << HelpArg( tr( "attribute" ), tr( "attribute name" ), false, false )
1390  << HelpArg( tr( "value" ), tr( "attribute value to match" ), false, false ),
1391  /* variableLenArguments */ false,
1393  << HelpExample( tr( "get_feature('streets','name','main st')" ), tr( "first feature found in \"streets\" layer with \"main st\" value in the \"name\" field" ), tr( "") )
1394  )
1395  )
1396  );
1397 
1398  gFunctionHelpTexts.insert( "hamming_distance",
1399  Help( "hamming_distance", tr( "function" ), tr( "Returns the Hamming distance between two strings. This equates to the number of characters at corresponding positions within the input strings where the characters are different. The input strings must be the same length, and the comparison is case-sensitive." ),
1401  << HelpVariant( tr( "hamming_distance" ), tr( "Returns the Hamming distance between two strings. This equates to the number of characters at corresponding positions within the input strings where the characters are different. The input strings must be the same length, and the comparison is case-sensitive." ),
1402  QList<HelpArg>()
1403  << HelpArg( tr( "string1" ), tr( "a string" ), false, false )
1404  << HelpArg( tr( "string2" ), tr( "a string" ), false, false ),
1405  /* variableLenArguments */ false,
1407  << HelpExample( tr( "hamming_distance('abc','xec')" ), tr( "2" ), tr( "") )
1408  << HelpExample( tr( "hamming_distance('abc','ABc')" ), tr( "2" ), tr( "") )
1409  << HelpExample( tr( "hamming_distance(upper('abc'),upper('ABC'))" ), tr( "0" ), tr( "") )
1410  )
1411  )
1412  );
1413 
1414  gFunctionHelpTexts.insert( "hour",
1415  Help( "hour", tr( "function" ), tr( "Extract the hour part from a datetime or time, or the number of hours from an interval." ),
1417  << HelpVariant( tr( "Time variant" ), tr( "Extract the hour part from a time or datetime." ),
1418  QList<HelpArg>()
1419  << HelpArg( tr( "datetime" ), tr( "a time or datetime value" ), false, false ),
1420  /* variableLenArguments */ false,
1422  << HelpExample( tr( "hour('2012-07-22T13:24:57')" ), tr( "13" ), tr( "") )
1423  )
1424  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in hours of an interval." ),
1425  QList<HelpArg>()
1426  << HelpArg( tr( "interval" ), tr( "interval value to return number of hours from" ), false, false ),
1427  /* variableLenArguments */ false,
1429  << HelpExample( tr( "hour(tointerval('3 hours'))" ), tr( "3" ), tr( "") )
1430  << HelpExample( tr( "hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00'))" ), tr( "3" ), tr( "") )
1431  << HelpExample( tr( "hour(age('2012-01-01','2010-01-01'))" ), tr( "17520" ), tr( "") )
1432  )
1433  )
1434  );
1435 
1436  gFunctionHelpTexts.insert( "if",
1437  Help( "if", tr( "function" ), tr( "Tests a condition and returns a different result depending on the conditional check." ),
1439  << HelpVariant( tr( "if" ), tr( "Tests a condition and returns a different result depending on the conditional check." ),
1440  QList<HelpArg>()
1441  << HelpArg( tr( "condition" ), tr( "the condition which should be checked" ), false, false )
1442  << HelpArg( tr( "result_when_true" ), tr( "the result which will be returned when the condition is True" ), false, false )
1443  << HelpArg( tr( "result_when_false" ), tr( "the result which will be returned when the condition is False" ), false, false ),
1444  /* variableLenArguments */ false,
1446  << HelpExample( tr( "if( 1, 'One', 'Not One' )" ), tr( "'One'" ), tr( "") )
1447  << HelpExample( tr( "if( 8, 'One', 'Not One' )" ), tr( "'Not One'" ), tr( "") )
1448  )
1449  )
1450  );
1451 
1452  gFunctionHelpTexts.insert( "interior_ring_n",
1453  Help( "interior_ring_n", tr( "function" ), tr( "Returns a specific interior ring from a polygon geometry, or null if the geometry is not a polygon." ),
1455  << HelpVariant( tr( "interior_ring_n" ), tr( "Returns a specific interior ring from a polygon geometry, or null if the geometry is not a polygon." ),
1456  QList<HelpArg>()
1457  << HelpArg( tr( "geometry" ), tr( "polygon geometry" ), false, false )
1458  << HelpArg( tr( "index" ), tr( "index of interior to return, where 1 is the first interior ring" ), false, false ),
1459  /* variableLenArguments */ false,
1461  << HelpExample( tr( "geom_to_wkt(interior_ring_n(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),(-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1),(-1 -1, 4 0, 4 2, 0 2, -1 -1))'),1))" ), tr( "'LineString (-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1))'" ), tr( "") )
1462  )
1463  )
1464  );
1465 
1466  gFunctionHelpTexts.insert( "intersection",
1467  Help( "intersection", tr( "function" ), tr( "Returns a geometry that represents the shared portion of two geometries." ),
1469  << HelpVariant( tr( "intersection" ), tr( "Returns a geometry that represents the shared portion of two geometries." ),
1470  QList<HelpArg>()
1471  << HelpArg( tr( "geometry1" ), tr( "a geometry" ), false, false )
1472  << HelpArg( tr( "geometry2" ), tr( "a geometry" ), false, false ),
1473  /* variableLenArguments */ false,
1475  << HelpExample( tr( "geom_to_wkt( intersection( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4)' ) ) )" ), tr( "LINESTRING(3 3, 4 4)" ), tr( "") )
1476  )
1477  )
1478  );
1479 
1480  gFunctionHelpTexts.insert( "intersects",
1481  Help( "intersects", tr( "function" ), tr( "Tests whether a geometry intersects another. Returns true if the geometries spatially intersect (share any portion of space) and false if they do not." ),
1483  << HelpVariant( tr( "intersects" ), tr( "Tests whether a geometry intersects another. Returns true if the geometries spatially intersect (share any portion of space) and false if they do not." ),
1484  QList<HelpArg>()
1485  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
1486  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
1487  /* variableLenArguments */ false,
1489  << HelpExample( tr( "intersects( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "true" ), tr( "") )
1490  << HelpExample( tr( "intersects( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'POINT(5 5)' ) )" ), tr( "false" ), tr( "") )
1491  )
1492  )
1493  );
1494 
1495  gFunctionHelpTexts.insert( "intersects_bbox",
1496  Help( "intersects_bbox", tr( "function" ), tr( "Tests whether a geometry's bounding box overlaps another geometry's bounding box. Returns true if the geometries spatially intersect the bounding box defined and false if they do not." ),
1498  << HelpVariant( tr( "intersects_bbox" ), tr( "Tests whether a geometry's bounding box overlaps another geometry's bounding box. Returns true if the geometries spatially intersect the bounding box defined and false if they do not." ),
1499  QList<HelpArg>()
1500  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false )
1501  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false ),
1502  /* variableLenArguments */ false,
1504  << HelpExample( tr( "intersects_bbox( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "true" ), tr( "") )
1505  << HelpExample( tr( "intersects_bbox( geom_from_wkt( 'POINT(6 5)' ), geom_from_wkt( 'POLYGON((3 3, 4 4, 5 5, 3 3))' ) )" ), tr( "false" ), tr( "") )
1506  )
1507  )
1508  );
1509 
1510  gFunctionHelpTexts.insert( "is_closed",
1511  Help( "is_closed", tr( "function" ), tr( "Returns true if a line string is closed (start and end points are coincident), or false if a line string is not closed. If the geometry is not a line string then the result will be null." ),
1513  << HelpVariant( tr( "is_closed" ), tr( "Returns true if a line string is closed (start and end points are coincident), or false if a line string is not closed. If the geometry is not a line string then the result will be null." ),
1514  QList<HelpArg>()
1515  << HelpArg( tr( "geom" ), tr( "a line string geometry" ), false, false ),
1516  /* variableLenArguments */ false,
1518  << HelpExample( tr( "is_closed(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)'))" ), tr( "false" ), tr( "") )
1519  << HelpExample( tr( "is_closed(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2, 0 0)'))" ), tr( "true" ), tr( "") )
1520  )
1521  )
1522  );
1523 
1524  gFunctionHelpTexts.insert( "layer_property",
1525  Help( "layer_property", tr( "function" ), tr( "Returns a matching layer property or metadata value." ),
1527  << HelpVariant( tr( "layer_property" ), tr( "Returns a matching layer property or metadata value." ),
1528  QList<HelpArg>()
1529  << HelpArg( tr( "layer" ), tr( "a string, representing either a layer name or layer ID" ), false, false )
1530  << HelpArg( tr( "property" ), tr( "a string corresponding to the property to return. Valid options are:<br /><ul><li>name: layer name</li><li>id: layer ID</li><li>title: metadata title string</li><li>abstract: metadata abstract string</li><li>keywords: metadata keywords</li><li>data_url: metadata URL</li><li>attribution: metadata attribution string</li><li>attribution_url: metadata attribution URL</li><li>source: layer source</li><li>min_scale: minimum display scale for layer</li><li>max_scale: maximum display scale for layer</li><li>crs: layer CRS</li><li>crs_definition: layer CRS full definition</li> <li>extent: layer extent (as a geometry object)</li><li>type: layer type, eg Vector or Raster</li><li>storage_type: storage format (vector layers only)</li><li>geometry_type: geometry type, eg Point (vector layers only)</li><li>feature_count: approximate feature count for layer (vector layers only)</li></ul>" ), false, false ),
1531  /* variableLenArguments */ false,
1533  << HelpExample( tr( "layer_property('streets','title')" ), tr( "'Basemap Streets'" ), tr( "") )
1534  << HelpExample( tr( "layer_property('airports','feature_count')" ), tr( "120" ), tr( "") )
1535  << HelpExample( tr( "layer_property('landsat','crs')" ), tr( "'EPSG:4326'" ), tr( "") )
1536  )
1537  )
1538  );
1539 
1540  gFunctionHelpTexts.insert( "left",
1541  Help( "left", tr( "function" ), tr( "Returns a substring that contains the <i>n</i> leftmost characters of the string." ),
1543  << HelpVariant( tr( "left" ), tr( "Returns a substring that contains the <i>n</i> leftmost characters of the string." ),
1544  QList<HelpArg>()
1545  << HelpArg( tr( "string" ), tr( "a string" ), false, false )
1546  << HelpArg( tr( "length" ), tr( "integer. The number of characters from the left of the string to return." ), false, false ),
1547  /* variableLenArguments */ false,
1549  << HelpExample( tr( "left('Hello World',5)" ), tr( "'Hello'" ), tr( "") )
1550  )
1551  )
1552  );
1553 
1554  gFunctionHelpTexts.insert( "length",
1555  Help( "length", tr( "function" ), tr( "Returns the number of characters in a string or the length of a geometry linestring." ),
1557  << HelpVariant( tr( "String variant" ), tr( "Returns the number of characters in a string." ),
1558  QList<HelpArg>()
1559  << HelpArg( tr( "string" ), tr( "string to count length of" ), false, false ),
1560  /* variableLenArguments */ false,
1562  << HelpExample( tr( "length('hello')" ), tr( "5" ), tr( "") )
1563  )
1564  << HelpVariant( tr( "Geometry variant" ), tr( "Calculate the length of a geometry line object. Calculations are always planimetric in the Spatial Reference System (SRS) of this geometry, and the units of the returned length will match the units for the SRS. This differs from the calculations performed by the $length function, which will perform ellipsoidal calculations based on the project's ellipsoid and distance unit settings." ),
1565  QList<HelpArg>()
1566  << HelpArg( tr( "geometry" ), tr( "line geometry object" ), false, false ),
1567  /* variableLenArguments */ false,
1569  << HelpExample( tr( "length(geom_from_wkt('LINESTRING(0 0, 4 0)'))" ), tr( "4.0" ), tr( "") )
1570  )
1571  )
1572  );
1573 
1574  gFunctionHelpTexts.insert( "levenshtein",
1575  Help( "levenshtein", tr( "function" ), tr( "Returns the Levenshtein edit distance between two strings. This equates to the minimum number of character edits (insertions, deletions or substitutions) required to change one string to another.<br />The Levenshtein distance is a measure of the similarity between two strings. Smaller distances mean the strings are more similar, and larger distances indicate more different strings. The distance is case sensitive." ),
1577  << HelpVariant( tr( "levenshtein" ), tr( "Returns the Levenshtein edit distance between two strings. This equates to the minimum number of character edits (insertions, deletions or substitutions) required to change one string to another.<br />The Levenshtein distance is a measure of the similarity between two strings. Smaller distances mean the strings are more similar, and larger distances indicate more different strings. The distance is case sensitive." ),
1578  QList<HelpArg>()
1579  << HelpArg( tr( "string1" ), tr( "a string" ), false, false )
1580  << HelpArg( tr( "string2" ), tr( "a string" ), false, false ),
1581  /* variableLenArguments */ false,
1583  << HelpExample( tr( "levenshtein('kittens','mitten')" ), tr( "2" ), tr( "") )
1584  << HelpExample( tr( "levenshtein('Kitten','kitten')" ), tr( "1" ), tr( "") )
1585  << HelpExample( tr( "levenshtein(upper('Kitten'),upper('kitten'))" ), tr( "0" ), tr( "") )
1586  )
1587  )
1588  );
1589 
1590  gFunctionHelpTexts.insert( "lighter",
1591  Help( "lighter", tr( "function" ), tr( "Returns a lighter (or darker) color string" ),
1593  << HelpVariant( tr( "lighter" ), tr( "Returns a lighter (or darker) color string" ),
1594  QList<HelpArg>()
1595  << HelpArg( tr( "color" ), tr( "a color string" ), false, false )
1596  << HelpArg( tr( "factor" ), tr( "a integer number corresponding to the lightening factor:<ul><li>if the factor is greater than 100, this functions returns a lighter color (for e.g., setting factor to 150 returns a color that is 50% brighter);</li><li>if the factor is less than 100, the return color is darker, but using the darker() function for this purpose is recommended;</li><li>if the factor is 0 or negative, the return value is unspecified.</li></ul>" ), false, false ),
1597  /* variableLenArguments */ false,
1599  << HelpExample( tr( "lighter('200,10,30',200)" ), tr( "'255,158,168,255'" ), tr( "") )
1600  )
1601  )
1602  );
1603 
1604  gFunctionHelpTexts.insert( "ln",
1605  Help( "ln", tr( "function" ), tr( "Returns the natural logarithm of a value." ),
1607  << HelpVariant( tr( "ln" ), tr( "Returns the natural logarithm of a value." ),
1608  QList<HelpArg>()
1609  << HelpArg( tr( "value" ), tr( "numeric value" ), false, false ),
1610  /* variableLenArguments */ false,
1612  << HelpExample( tr( "ln(1)" ), tr( "0" ), tr( "") )
1613  << HelpExample( tr( "ln(2.7182818284590452354)" ), tr( "1" ), tr( "") )
1614  )
1615  )
1616  );
1617 
1618  gFunctionHelpTexts.insert( "log",
1619  Help( "log", tr( "function" ), tr( "Returns the value of the logarithm of the passed value and base." ),
1621  << HelpVariant( tr( "log" ), tr( "Returns the value of the logarithm of the passed value and base." ),
1622  QList<HelpArg>()
1623  << HelpArg( tr( "base" ), tr( "any positive number" ), false, false )
1624  << HelpArg( tr( "value" ), tr( "any positive number" ), false, false ),
1625  /* variableLenArguments */ false,
1627  << HelpExample( tr( "log(2, 32)" ), tr( "5" ), tr( "") )
1628  << HelpExample( tr( "log(0.5, 32)" ), tr( "-5" ), tr( "") )
1629  )
1630  )
1631  );
1632 
1633  gFunctionHelpTexts.insert( "log10",
1634  Help( "log10", tr( "function" ), tr( "Returns the value of the base 10 logarithm of the passed expression." ),
1636  << HelpVariant( tr( "log10" ), tr( "Returns the value of the base 10 logarithm of the passed expression." ),
1637  QList<HelpArg>()
1638  << HelpArg( tr( "value" ), tr( "any positive number" ), false, false ),
1639  /* variableLenArguments */ false,
1641  << HelpExample( tr( "log10(1)" ), tr( "0" ), tr( "") )
1642  << HelpExample( tr( "log10(100)" ), tr( "2" ), tr( "") )
1643  )
1644  )
1645  );
1646 
1647  gFunctionHelpTexts.insert( "longest_common_substring",
1648  Help( "longest_common_substring", tr( "function" ), tr( "Returns the longest common substring between two strings. This substring is the longest string that is a substring of the two input strings. Eg, the longest common substring of \"ABABC\" and \"BABCA\" is \"ABC\". The substring is case sensitive." ),
1650  << HelpVariant( tr( "longest_common_substring" ), tr( "Returns the longest common substring between two strings. This substring is the longest string that is a substring of the two input strings. Eg, the longest common substring of \"ABABC\" and \"BABCA\" is \"ABC\". The substring is case sensitive." ),
1651  QList<HelpArg>()
1652  << HelpArg( tr( "string1" ), tr( "a string" ), false, false )
1653  << HelpArg( tr( "string2" ), tr( "a string" ), false, false ),
1654  /* variableLenArguments */ false,
1656  << HelpExample( tr( "longest_common_substring('ABABC','BABCA')" ), tr( "'ABC'" ), tr( "") )
1657  << HelpExample( tr( "longest_common_substring('abcDeF','abcdef')" ), tr( "'abc'" ), tr( "") )
1658  << HelpExample( tr( "longest_common_substring(upper('abcDeF'),upper('abcdex'))" ), tr( "'ABCDE'" ), tr( "") )
1659  )
1660  )
1661  );
1662 
1663  gFunctionHelpTexts.insert( "lower",
1664  Help( "lower", tr( "function" ), tr( "Converts a string to lower case letters." ),
1666  << HelpVariant( tr( "lower" ), tr( "Converts a string to lower case letters." ),
1667  QList<HelpArg>()
1668  << HelpArg( tr( "string" ), tr( "the string to convert to lower case" ), false, false ),
1669  /* variableLenArguments */ false,
1671  << HelpExample( tr( "lower('HELLO World')" ), tr( "'hello world'" ), tr( "") )
1672  )
1673  )
1674  );
1675 
1676  gFunctionHelpTexts.insert( "lpad",
1677  Help( "lpad", tr( "function" ), tr( "Returns a string padded to supplied width using a fill character." ),
1679  << HelpVariant( tr( "lpad" ), tr( "Returns a string padded to supplied width using a fill character." ),
1680  QList<HelpArg>()
1681  << HelpArg( tr( "string" ), tr( "string to pad" ), false, false )
1682  << HelpArg( tr( "width" ), tr( "length of new string" ), false, false )
1683  << HelpArg( tr( "fill" ), tr( "character to pad the remaining space with" ), false, false ),
1684  /* variableLenArguments */ false,
1686  << HelpExample( tr( "lpad('Hello', 10, 'x')" ), tr( "'xxxxxHello'" ), tr( "") )
1687  )
1688  )
1689  );
1690 
1691  gFunctionHelpTexts.insert( "m",
1692  Help( "m", tr( "function" ), tr( "Returns the m value of a point geometry." ),
1694  << HelpVariant( tr( "m" ), tr( "Returns the m value of a point geometry." ),
1695  QList<HelpArg>()
1696  << HelpArg( tr( "geom" ), tr( "a point geometry" ), false, false ),
1697  /* variableLenArguments */ false,
1699  << HelpExample( tr( "m( geom_from_wkt( 'POINTM(2 5 4)' ) )" ), tr( "4" ), tr( "") )
1700  )
1701  )
1702  );
1703 
1704  gFunctionHelpTexts.insert( "make_line",
1705  Help( "make_line", tr( "function" ), tr( "Creates a line geometry from a series of point geometries." ),
1707  << HelpVariant( tr( "make_line" ), tr( "Creates a line geometry from a series of point geometries." ),
1708  QList<HelpArg>()
1709  << HelpArg( tr( "point1" ), tr( "" ), false, true )
1710  << HelpArg( tr( "point2" ), tr( "" ), false, true )
1711  << HelpArg( tr( "point" ), tr( "a point geometry" ), true, false ),
1712  /* variableLenArguments */ true,
1714  << HelpExample( tr( "geom_to_wkt(make_line(make_point(2,4),make_point(3,5)))" ), tr( "'LineString (2 4, 3 5)'" ), tr( "") )
1715  << HelpExample( tr( "geom_to_wkt(make_line(make_point(2,4),make_point(3,5),make_point(9,7)))" ), tr( "'LineString (2 4, 3 5, 9 7)'" ), tr( "") )
1716  )
1717  )
1718  );
1719 
1720  gFunctionHelpTexts.insert( "make_point",
1721  Help( "make_point", tr( "function" ), tr( "Creates a point geometry from an x and y (and optional z and m) value." ),
1723  << HelpVariant( tr( "make_point" ), tr( "Creates a point geometry from an x and y (and optional z and m) value." ),
1724  QList<HelpArg>()
1725  << HelpArg( tr( "x" ), tr( "x coordinate of point" ), false, false )
1726  << HelpArg( tr( "y" ), tr( "y coordinate of point" ), false, false )
1727  << HelpArg( tr( "z" ), tr( "optional z coordinate of point" ), false, false )
1728  << HelpArg( tr( "m" ), tr( "optional m value of point" ), false, false ),
1729  /* variableLenArguments */ false,
1731  << HelpExample( tr( "geom_to_wkt(make_point(2,4))" ), tr( "'Point (2 4)'" ), tr( "") )
1732  << HelpExample( tr( "geom_to_wkt(make_point(2,4,6))" ), tr( "'PointZ (2 4 6)'" ), tr( "") )
1733  << HelpExample( tr( "geom_to_wkt(make_point(2,4,6,8))" ), tr( "'PointZM (2 4 6 8)'" ), tr( "") )
1734  )
1735  )
1736  );
1737 
1738  gFunctionHelpTexts.insert( "make_point_m",
1739  Help( "make_point_m", tr( "function" ), tr( "Creates a point geometry from an x, y coordinate and m value." ),
1741  << HelpVariant( tr( "make_point_m" ), tr( "Creates a point geometry from an x, y coordinate and m value." ),
1742  QList<HelpArg>()
1743  << HelpArg( tr( "x" ), tr( "x coordinate of point" ), false, false )
1744  << HelpArg( tr( "y" ), tr( "y coordinate of point" ), false, false )
1745  << HelpArg( tr( "m" ), tr( "m value of point" ), false, false ),
1746  /* variableLenArguments */ false,
1748  << HelpExample( tr( "geom_to_wkt(make_point_m(2,4,6))" ), tr( "'PointM (2 4 6)'" ), tr( "") )
1749  )
1750  )
1751  );
1752 
1753  gFunctionHelpTexts.insert( "make_polygon",
1754  Help( "make_polygon", tr( "function" ), tr( "Creates a polygon geometry from an outer ring and optional series of inner ring geometries." ),
1756  << HelpVariant( tr( "make_polygon" ), tr( "Creates a polygon geometry from an outer ring and optional series of inner ring geometries." ),
1757  QList<HelpArg>()
1758  << HelpArg( tr( "outerRing" ), tr( "closed line geometry for polygon's outer ring" ), false, false )
1759  << HelpArg( tr( "innerRing1" ), tr( "" ), false, true )
1760  << HelpArg( tr( "innerRing2" ), tr( "" ), false, true )
1761  << HelpArg( tr( "innerRing" ), tr( "optional closed line geometry for inner ring" ), true, false ),
1762  /* variableLenArguments */ true,
1764  << HelpExample( tr( "geom_to_wkt(make_polygon(geom_from_wkt('LINESTRING( 0 0, 0 1, 1 1, 1 0, 0 0 )')))" ), tr( "'Polygon ((0 0, 0 1, 1 1, 1 0, 0 0))'" ), tr( "") )
1765  << HelpExample( tr( "geom_to_wkt(make_polygon(geom_from_wkt('LINESTRING( 0 0, 0 1, 1 1, 1 0, 0 0 )'),geom_from_wkt('LINESTRING( 0.1 0.1, 0.1 0.2, 0.2 0.2, 0.2 0.1, 0.1 0.1 )'),geom_from_wkt('LINESTRING( 0.8 0.8, 0.8 0.9, 0.9 0.9, 0.9 0.8, 0.8 0.8 )')))" ), tr( "'Polygon ((0 0, 0 1, 1 1, 1 0, 0 0),(0.1 0.1, 0.1 0.2, 0.2 0.2, 0.2 0.1, 0.1 0.1),(0.8 0.8, 0.8 0.9, 0.9 0.9, 0.9 0.8, 0.8 0.8))'" ), tr( "") )
1766  )
1767  )
1768  );
1769 
1770  gFunctionHelpTexts.insert( "max",
1771  Help( "max", tr( "function" ), tr( "Returns the largest value in a set of values." ),
1773  << HelpVariant( tr( "max" ), tr( "Returns the largest value in a set of values." ),
1774  QList<HelpArg>()
1775  << HelpArg( tr( "value1" ), tr( "" ), false, true )
1776  << HelpArg( tr( "value2" ), tr( "" ), false, true )
1777  << HelpArg( tr( "value" ), tr( "a number" ), true, false ),
1778  /* variableLenArguments */ true,
1780  << HelpExample( tr( "max(2,10.2,5.5)" ), tr( "10.2" ), tr( "") )
1781  )
1782  )
1783  );
1784 
1785  gFunctionHelpTexts.insert( "min",
1786  Help( "min", tr( "function" ), tr( "Returns the smallest value in a set of values." ),
1788  << HelpVariant( tr( "min" ), tr( "Returns the smallest value in a set of values." ),
1789  QList<HelpArg>()
1790  << HelpArg( tr( "value1" ), tr( "" ), false, true )
1791  << HelpArg( tr( "value2" ), tr( "" ), false, true )
1792  << HelpArg( tr( "value" ), tr( "a number" ), true, false ),
1793  /* variableLenArguments */ true,
1795  << HelpExample( tr( "min(20.5,10,6.2)" ), tr( "6.2" ), tr( "") )
1796  )
1797  )
1798  );
1799 
1800  gFunctionHelpTexts.insert( "minute",
1801  Help( "minute", tr( "function" ), tr( "Extract the minutes part from a datetime or time, or the number of minutes from an interval." ),
1803  << HelpVariant( tr( "Time variant" ), tr( "Extract the minutes part from a time or datetime." ),
1804  QList<HelpArg>()
1805  << HelpArg( tr( "datetime" ), tr( "a time or datetime value" ), false, false ),
1806  /* variableLenArguments */ false,
1808  << HelpExample( tr( "minute('2012-07-22T13:24:57')" ), tr( "24" ), tr( "") )
1809  )
1810  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in minutes of an interval." ),
1811  QList<HelpArg>()
1812  << HelpArg( tr( "interval" ), tr( "interval value to return number of minutes from" ), false, false ),
1813  /* variableLenArguments */ false,
1815  << HelpExample( tr( "minute(tointerval('3 minutes'))" ), tr( "3" ), tr( "") )
1816  << HelpExample( tr( "minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00'))" ), tr( "20" ), tr( "") )
1817  << HelpExample( tr( "minute(age('2012-01-01','2010-01-01'))" ), tr( "1051200" ), tr( "") )
1818  )
1819  )
1820  );
1821 
1822  gFunctionHelpTexts.insert( "month",
1823  Help( "month", tr( "function" ), tr( "Extract the month part from a date, or the number of months from an interval." ),
1825  << HelpVariant( tr( "Date variant" ), tr( "Extract the month part from a date or datetime." ),
1826  QList<HelpArg>()
1827  << HelpArg( tr( "date" ), tr( "a date or datetime value" ), false, false ),
1828  /* variableLenArguments */ false,
1830  << HelpExample( tr( "month('2012-05-12')" ), tr( "05" ), tr( "") )
1831  )
1832  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in months of an interval." ),
1833  QList<HelpArg>()
1834  << HelpArg( tr( "interval" ), tr( "interval value to return number of months from" ), false, false ),
1835  /* variableLenArguments */ false,
1837  << HelpExample( tr( "month(to_interval('3 months'))" ), tr( "3" ), tr( "") )
1838  << HelpExample( tr( "month(age('2012-01-01','2010-01-01'))" ), tr( "4.03333" ), tr( "") )
1839  )
1840  )
1841  );
1842 
1843  gFunctionHelpTexts.insert( "nodes_to_points",
1844  Help( "nodes_to_points", tr( "function" ), tr( "Returns a multipoint geometry consisting of every node in the input geometry." ),
1846  << HelpVariant( tr( "nodes_to_points" ), tr( "Returns a multipoint geometry consisting of every node in the input geometry." ),
1847  QList<HelpArg>()
1848  << HelpArg( tr( "geometry" ), tr( "geometry object" ), false, false )
1849  << HelpArg( tr( "ignore_closing_nodes" ), tr( "optional argument specifying whether to include duplicate nodes which close lines or polygons rings. Defaults to false, set to true to avoid including these duplicate nodes in the output collection." ), false, false ),
1850  /* variableLenArguments */ false,
1852  << HelpExample( tr( "geom_to_wkt(nodes_to_points(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))" ), tr( "'MultiPoint ((0 0),(1 1),(2 2))'" ), tr( "") )
1853  << HelpExample( tr( "geom_to_wkt(nodes_to_points(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1))'),true))" ), tr( "'MultiPoint ((-1 -1),(4 0),(4 2),(0 2))'" ), tr( "") )
1854  )
1855  )
1856  );
1857 
1858  gFunctionHelpTexts.insert( "now",
1859  Help( "now", tr( "function" ), tr( "Returns the current date and time." ),
1861  << HelpVariant( tr( "now" ), tr( "Returns the current date and time." ),
1862  QList<HelpArg>(),
1863  /* variableLenArguments */ false,
1865  << HelpExample( tr( "now()" ), tr( "2012-07-22T13:24:57" ), tr( "") )
1866  )
1867  )
1868  );
1869 
1870  gFunctionHelpTexts.insert( "num_geometries",
1871  Help( "num_geometries", tr( "function" ), tr( "Returns the number of geometries in a geometry collection, or null if the input geometry is not a collection." ),
1873  << HelpVariant( tr( "num_geometries" ), tr( "Returns the number of geometries in a geometry collection, or null if the input geometry is not a collection." ),
1874  QList<HelpArg>()
1875  << HelpArg( tr( "geometry" ), tr( "geometry collection" ), false, false ),
1876  /* variableLenArguments */ false,
1878  << HelpExample( tr( "num_geometries(geom_from_wkt('GEOMETRYCOLLECTION(POINT(0 1), POINT(0 0), POINT(1 0), POINT(1 1))'))'),3))" ), tr( "4" ), tr( "") )
1879  )
1880  )
1881  );
1882 
1883  gFunctionHelpTexts.insert( "num_interior_rings",
1884  Help( "num_interior_rings", tr( "function" ), tr( "Returns the number of interior rings in a polygon or geometry collection, or null if the input geometry is not a polygon or collection." ),
1886  << HelpVariant( tr( "num_interior_rings" ), tr( "Returns the number of interior rings in a polygon or geometry collection, or null if the input geometry is not a polygon or collection." ),
1887  QList<HelpArg>()
1888  << HelpArg( tr( "geometry" ), tr( "input geometry" ), false, false ),
1889  /* variableLenArguments */ false,
1891  << HelpExample( tr( "num_interior_rings(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),(-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1))'))" ), tr( "1" ), tr( "") )
1892  )
1893  )
1894  );
1895 
1896  gFunctionHelpTexts.insert( "num_points",
1897  Help( "num_points", tr( "function" ), tr( "Returns the number of vertices in a geometry." ),
1899  << HelpVariant( tr( "num_points" ), tr( "Returns the number of vertices in a geometry." ),
1900  QList<HelpArg>()
1901  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
1902  /* variableLenArguments */ false,
1904  << HelpExample( tr( "num_points($geometry)" ), tr( "number of vertices in $geometry" ), tr( "") )
1905  )
1906  )
1907  );
1908 
1909  gFunctionHelpTexts.insert( "num_rings",
1910  Help( "num_rings", tr( "function" ), tr( "Returns the number of rings (including exterior rings) in a polygon or geometry collection, or null if the input geometry is not a polygon or collection." ),
1912  << HelpVariant( tr( "num_rings" ), tr( "Returns the number of rings (including exterior rings) in a polygon or geometry collection, or null if the input geometry is not a polygon or collection." ),
1913  QList<HelpArg>()
1914  << HelpArg( tr( "geometry" ), tr( "input geometry" ), false, false ),
1915  /* variableLenArguments */ false,
1917  << HelpExample( tr( "num_rings(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),(-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1))'))" ), tr( "2" ), tr( "") )
1918  )
1919  )
1920  );
1921 
1922  gFunctionHelpTexts.insert( "*",
1923  Help( "*", tr( "operator" ), tr( "Multiplication of two values" ),
1925  << HelpVariant( tr( "*" ), tr( "Multiplication of two values" ),
1926  QList<HelpArg>()
1927  << HelpArg( tr( "a" ), tr( "value" ), false, false )
1928  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
1929  /* variableLenArguments */ false,
1931  << HelpExample( tr( "5 * 4" ), tr( "20" ), tr( "") )
1932  << HelpExample( tr( "5 * NULL" ), tr( "NULL" ), tr( "") )
1933  )
1934  )
1935  );
1936 
1937  gFunctionHelpTexts.insert( "||",
1938  Help( "||", tr( "operator" ), tr( "Joins two values together into a string.<br><br>If one of the values is NULL the result will be NULL. See the CONCAT function for a different behavior." ),
1940  << HelpVariant( tr( "||" ), tr( "Joins two values together into a string.<br><br>If one of the values is NULL the result will be NULL. See the CONCAT function for a different behavior." ),
1941  QList<HelpArg>()
1942  << HelpArg( tr( "a" ), tr( "value" ), false, false )
1943  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
1944  /* variableLenArguments */ false,
1946  << HelpExample( tr( "'Here' || ' and ' || 'there'" ), tr( "'Here and there'" ), tr( "") )
1947  << HelpExample( tr( "'Nothing' || NULL" ), tr( "NULL" ), tr( "") )
1948  << HelpExample( tr( "'Dia: ' || \"Diameter\"" ), tr( "'Dia: 25'" ), tr( "") )
1949  << HelpExample( tr( "1 || 2" ), tr( "'12'" ), tr( "") )
1950  )
1951  )
1952  );
1953 
1954  gFunctionHelpTexts.insert( "/",
1955  Help( "/", tr( "operator" ), tr( "Division of two values" ),
1957  << HelpVariant( tr( "/" ), tr( "Division of two values" ),
1958  QList<HelpArg>()
1959  << HelpArg( tr( "a" ), tr( "value" ), false, false )
1960  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
1961  /* variableLenArguments */ false,
1963  << HelpExample( tr( "5 / 4" ), tr( "1.25" ), tr( "") )
1964  << HelpExample( tr( "5 / NULL" ), tr( "NULL" ), tr( "") )
1965  )
1966  )
1967  );
1968 
1969  gFunctionHelpTexts.insert( "=",
1970  Help( "=", tr( "operator" ), tr( "Compares two values and evaluates to 1 if they are equal." ),
1972  << HelpVariant( tr( "=" ), tr( "Compares two values and evaluates to 1 if they are equal." ),
1973  QList<HelpArg>()
1974  << HelpArg( tr( "a" ), tr( "value" ), false, false )
1975  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
1976  /* variableLenArguments */ false,
1978  << HelpExample( tr( "5 = 4" ), tr( "0" ), tr( "") )
1979  << HelpExample( tr( "4 = 4" ), tr( "1" ), tr( "") )
1980  << HelpExample( tr( "5 = NULL" ), tr( "NULL" ), tr( "") )
1981  << HelpExample( tr( "NULL = NULL" ), tr( "NULL" ), tr( "") )
1982  )
1983  )
1984  );
1985 
1986  gFunctionHelpTexts.insert( "^",
1987  Help( "^", tr( "operator" ), tr( "Power of two values." ),
1989  << HelpVariant( tr( "^" ), tr( "Power of two values." ),
1990  QList<HelpArg>()
1991  << HelpArg( tr( "a" ), tr( "value" ), false, false )
1992  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
1993  /* variableLenArguments */ false,
1995  << HelpExample( tr( "5 ^ 4" ), tr( "625" ), tr( "") )
1996  << HelpExample( tr( "5 ^ NULL" ), tr( "NULL" ), tr( "") )
1997  )
1998  )
1999  );
2000 
2001  gFunctionHelpTexts.insert( ">=",
2002  Help( ">=", tr( "operator" ), tr( "Compares two values and evaluates to 1 if the left value is greater or equal than the right value." ),
2004  << HelpVariant( tr( ">=" ), tr( "Compares two values and evaluates to 1 if the left value is greater or equal than the right value." ),
2005  QList<HelpArg>()
2006  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2007  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2008  /* variableLenArguments */ false,
2010  << HelpExample( tr( "5 &gt;= 4" ), tr( "1" ), tr( "") )
2011  << HelpExample( tr( "5 &gt;= 5" ), tr( "1" ), tr( "") )
2012  << HelpExample( tr( "4 &gt;= 5" ), tr( "0" ), tr( "") )
2013  )
2014  )
2015  );
2016 
2017  gFunctionHelpTexts.insert( ">",
2018  Help( ">", tr( "operator" ), tr( "Compares two values and evaluates to 1 if the left value is greater than the right value." ),
2020  << HelpVariant( tr( ">" ), tr( "Compares two values and evaluates to 1 if the left value is greater than the right value." ),
2021  QList<HelpArg>()
2022  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2023  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2024  /* variableLenArguments */ false,
2026  << HelpExample( tr( "5 &gt; 4" ), tr( "1" ), tr( "") )
2027  << HelpExample( tr( "5 &gt; 5" ), tr( "0" ), tr( "") )
2028  << HelpExample( tr( "4 &gt; 5" ), tr( "0" ), tr( "") )
2029  )
2030  )
2031  );
2032 
2033  gFunctionHelpTexts.insert( "<=",
2034  Help( "<=", tr( "operator" ), tr( "Compares two values and evaluates to 1 if the left value is less or equal than the right value." ),
2036  << HelpVariant( tr( "<=" ), tr( "Compares two values and evaluates to 1 if the left value is less or equal than the right value." ),
2037  QList<HelpArg>()
2038  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2039  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2040  /* variableLenArguments */ false,
2042  << HelpExample( tr( "5 &lt;= 4" ), tr( "0" ), tr( "") )
2043  << HelpExample( tr( "5 &lt;= 5" ), tr( "1" ), tr( "") )
2044  << HelpExample( tr( "4 &lt;= 5" ), tr( "1" ), tr( "") )
2045  )
2046  )
2047  );
2048 
2049  gFunctionHelpTexts.insert( "<",
2050  Help( "<", tr( "operator" ), tr( "Compares two values and evaluates to 1 if the left value is less than the right value." ),
2052  << HelpVariant( tr( "<" ), tr( "Compares two values and evaluates to 1 if the left value is less than the right value." ),
2053  QList<HelpArg>()
2054  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2055  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2056  /* variableLenArguments */ false,
2058  << HelpExample( tr( "5 &lt; 4" ), tr( "0" ), tr( "") )
2059  << HelpExample( tr( "5 &lt; 5" ), tr( "0" ), tr( "") )
2060  << HelpExample( tr( "4 &lt; 5" ), tr( "1" ), tr( "") )
2061  )
2062  )
2063  );
2064 
2065  gFunctionHelpTexts.insert( "-",
2066  Help( "-", tr( "operator" ), tr( "Subtraction of two values. If one of the values is NULL the result will be NULL." ),
2068  << HelpVariant( tr( "-" ), tr( "Subtraction of two values. If one of the values is NULL the result will be NULL." ),
2069  QList<HelpArg>()
2070  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2071  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2072  /* variableLenArguments */ false,
2074  << HelpExample( tr( "5 - 4" ), tr( "1" ), tr( "") )
2075  << HelpExample( tr( "5 - NULL" ), tr( "NULL" ), tr( "") )
2076  )
2077  )
2078  );
2079 
2080  gFunctionHelpTexts.insert( "%",
2081  Help( "%", tr( "operator" ), tr( "Remainder of division" ),
2083  << HelpVariant( tr( "%" ), tr( "Remainder of division" ),
2084  QList<HelpArg>()
2085  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2086  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2087  /* variableLenArguments */ false,
2089  << HelpExample( tr( "5 % 4" ), tr( "1" ), tr( "") )
2090  << HelpExample( tr( "5 % NULL" ), tr( "NULL" ), tr( "") )
2091  )
2092  )
2093  );
2094 
2095  gFunctionHelpTexts.insert( "<>",
2096  Help( "<>", tr( "operator" ), tr( "Compares two values and evaluates to 1 if they are not equal." ),
2098  << HelpVariant( tr( "<>" ), tr( "Compares two values and evaluates to 1 if they are not equal." ),
2099  QList<HelpArg>()
2100  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2101  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2102  /* variableLenArguments */ false,
2104  << HelpExample( tr( "5 &lt;&gt; 4" ), tr( "1" ), tr( "") )
2105  << HelpExample( tr( "4 &lt;&gt; 4" ), tr( "0" ), tr( "") )
2106  << HelpExample( tr( "5 &lt;&gt; NULL" ), tr( "NULL" ), tr( "") )
2107  << HelpExample( tr( "NULL &lt;&gt; NULL" ), tr( "NULL" ), tr( "") )
2108  )
2109  )
2110  );
2111 
2112  gFunctionHelpTexts.insert( "+",
2113  Help( "+", tr( "operator" ), tr( "Addition of two values. If one of the values is NULL the result will be NULL." ),
2115  << HelpVariant( tr( "+" ), tr( "Addition of two values. If one of the values is NULL the result will be NULL." ),
2116  QList<HelpArg>()
2117  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2118  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2119  /* variableLenArguments */ false,
2121  << HelpExample( tr( "5 + 4" ), tr( "9" ), tr( "") )
2122  << HelpExample( tr( "5 + NULL" ), tr( "NULL" ), tr( "") )
2123  )
2124  )
2125  );
2126 
2127  gFunctionHelpTexts.insert( "order_parts",
2128  Help( "order_parts", tr( "function" ), tr( "Orders the parts of a MultiGeometry by a given criteria" ),
2130  << HelpVariant( tr( "order_parts" ), tr( "Orders the parts of a MultiGeometry by a given criteria" ),
2131  QList<HelpArg>()
2132  << HelpArg( tr( "geom" ), tr( "a multi-type geometry" ), false, false )
2133  << HelpArg( tr( "orderby" ), tr( "an expression string defining the order criteria" ), false, false )
2134  << HelpArg( tr( "ascending" ), tr( "boolean, True for ascending, False for descending" ), false, false ),
2135  /* variableLenArguments */ false,
2137  << HelpExample( tr( "order_parts(geom_from_wkt('MultiPolygon (((1 1, 5 1, 5 5, 1 5, 1 1)),((1 1, 9 1, 9 9, 1 9, 1 1)))'), 'area($geometry)', False)" ), tr( "MultiPolygon (((1 1, 9 1, 9 9, 1 9, 1 1)),((1 1, 5 1, 5 5, 1 5, 1 1)))" ), tr( "") )
2138  << HelpExample( tr( "order_parts(geom_from_wkt('LineString(1 2, 3 2, 4 3)'), '1', True)" ), tr( "LineString(1 2, 3 2, 4 3)" ), tr( "") )
2139  )
2140  )
2141  );
2142 
2143  gFunctionHelpTexts.insert( "overlaps",
2144  Help( "overlaps", tr( "function" ), tr( "Tests whether a geometry overlaps another. Returns true if the geometries share space, are of the same dimension, but are not completely contained by each other." ),
2146  << HelpVariant( tr( "overlaps" ), tr( "Tests whether a geometry overlaps another. Returns true if the geometries share space, are of the same dimension, but are not completely contained by each other." ),
2147  QList<HelpArg>()
2148  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
2149  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
2150  /* variableLenArguments */ false,
2152  << HelpExample( tr( "overlaps( geom_from_wkt( 'LINESTRING(3 5, 4 4, 5 5, 5 3)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "true" ), tr( "") )
2153  << HelpExample( tr( "overlaps( geom_from_wkt( 'LINESTRING(0 0, 1 1)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "false" ), tr( "") )
2154  )
2155  )
2156  );
2157 
2158  gFunctionHelpTexts.insert( "perimeter",
2159  Help( "perimeter", tr( "function" ), tr( "Returns the perimeter of a geometry polygon object. Calculations are always planimetric in the Spatial Reference System (SRS) of this geometry, and the units of the returned perimeter will match the units for the SRS. This differs from the calculations performed by the $perimeter function, which will perform ellipsoidal calculations based on the project's ellipsoid and distance unit settings." ),
2161  << HelpVariant( tr( "perimeter" ), tr( "Returns the perimeter of a geometry polygon object. Calculations are always planimetric in the Spatial Reference System (SRS) of this geometry, and the units of the returned perimeter will match the units for the SRS. This differs from the calculations performed by the $perimeter function, which will perform ellipsoidal calculations based on the project's ellipsoid and distance unit settings." ),
2162  QList<HelpArg>()
2163  << HelpArg( tr( "geometry" ), tr( "polygon geometry object" ), false, false ),
2164  /* variableLenArguments */ false,
2166  << HelpExample( tr( "perimeter(geom_from_wkt('POLYGON((0 0, 4 0, 4 2, 0 2, 0 0))'))" ), tr( "12.0" ), tr( "") )
2167  )
2168  )
2169  );
2170 
2171  gFunctionHelpTexts.insert( "pi",
2172  Help( "pi", tr( "function" ), tr( "Returns value of pi for calculations." ),
2174  << HelpVariant( tr( "pi" ), tr( "Returns value of pi for calculations." ),
2175  QList<HelpArg>(),
2176  /* variableLenArguments */ false,
2178  << HelpExample( tr( "pi()" ), tr( "3.14159265358979" ), tr( "") )
2179  )
2180  )
2181  );
2182 
2183  gFunctionHelpTexts.insert( "point_n",
2184  Help( "point_n", tr( "function" ), tr( "Returns a specific node from a geometry." ),
2186  << HelpVariant( tr( "point_n" ), tr( "Returns a specific node from a geometry." ),
2187  QList<HelpArg>()
2188  << HelpArg( tr( "geometry" ), tr( "geometry object" ), false, false )
2189  << HelpArg( tr( "index" ), tr( "index of node to return, where 1 is the first node" ), false, false ),
2190  /* variableLenArguments */ false,
2192  << HelpExample( tr( "geom_to_wkt(point_n(geom_from_wkt('POLYGON((0 0, 4 0, 4 2, 0 2, 0 0))'),2))" ), tr( "'Point (4 0)'" ), tr( "") )
2193  )
2194  )
2195  );
2196 
2197  gFunctionHelpTexts.insert( "point_on_surface",
2198  Help( "point_on_surface", tr( "function" ), tr( "Returns a point guaranteed to lie on the surface of a geometry." ),
2200  << HelpVariant( tr( "point_on_surface" ), tr( "Returns a point guaranteed to lie on the surface of a geometry." ),
2201  QList<HelpArg>()
2202  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2203  /* variableLenArguments */ false,
2205  << HelpExample( tr( "point_on_surface($geometry)" ), tr( "a point geometry" ), tr( "") )
2206  )
2207  )
2208  );
2209 
2210  gFunctionHelpTexts.insert( "project_color",
2211  Help( "project_color", tr( "function" ), tr( "Returns a color from the project's color scheme." ),
2213  << HelpVariant( tr( "project_color" ), tr( "Returns a color from the project's color scheme." ),
2214  QList<HelpArg>()
2215  << HelpArg( tr( "name" ), tr( "a color name" ), false, false ),
2216  /* variableLenArguments */ false,
2218  << HelpExample( tr( "project_color('Logo color')" ), tr( "20,140,50" ), tr( "") )
2219  )
2220  )
2221  );
2222 
2223  gFunctionHelpTexts.insert( "radians",
2224  Help( "radians", tr( "function" ), tr( "Converts from degrees to radians." ),
2226  << HelpVariant( tr( "radians" ), tr( "Converts from degrees to radians." ),
2227  QList<HelpArg>()
2228  << HelpArg( tr( "degrees" ), tr( "numeric value" ), false, false ),
2229  /* variableLenArguments */ false,
2231  << HelpExample( tr( "radians(180)" ), tr( "3.14159" ), tr( "") )
2232  << HelpExample( tr( "radians(57.2958)" ), tr( "1" ), tr( "") )
2233  )
2234  )
2235  );
2236 
2237  gFunctionHelpTexts.insert( "ramp_color",
2238  Help( "ramp_color", tr( "function" ), tr( "Returns a string representing a color from a color ramp." ),
2240  << HelpVariant( tr( "ramp_color" ), tr( "Returns a string representing a color from a color ramp." ),
2241  QList<HelpArg>()
2242  << HelpArg( tr( "ramp_name" ), tr( "the name of the color ramp as a string, for example 'Spectral'" ), false, false )
2243  << HelpArg( tr( "value" ), tr( "the position on the ramp to select the color from as a real number between 0 and 1" ), false, false ),
2244  /* variableLenArguments */ false,
2246  << HelpExample( tr( "ramp_color('Spectral',0.3)" ), tr( "'253,190,115,255'" ), tr( "") ),
2247  tr( "The color ramps available vary between QGIS installations. This function may not give the expected results if you move your QGIS project between installations." )
2248  )
2249  )
2250  );
2251 
2252  gFunctionHelpTexts.insert( "rand",
2253  Help( "rand", tr( "function" ), tr( "Returns a random integer within the range specified by the minimum and maximum argument (inclusive)." ),
2255  << HelpVariant( tr( "rand" ), tr( "Returns a random integer within the range specified by the minimum and maximum argument (inclusive)." ),
2256  QList<HelpArg>()
2257  << HelpArg( tr( "min" ), tr( "an integer representing the smallest possible random number desired" ), false, false )
2258  << HelpArg( tr( "max" ), tr( "an integer representing the largest possible random number desired" ), false, false ),
2259  /* variableLenArguments */ false,
2261  << HelpExample( tr( "rand(1, 10)" ), tr( "8" ), tr( "") )
2262  )
2263  )
2264  );
2265 
2266  gFunctionHelpTexts.insert( "randf",
2267  Help( "randf", tr( "function" ), tr( "Returns a random float within the range specified by the minimum and maximum argument (inclusive)." ),
2269  << HelpVariant( tr( "randf" ), tr( "Returns a random float within the range specified by the minimum and maximum argument (inclusive)." ),
2270  QList<HelpArg>()
2271  << HelpArg( tr( "min" ), tr( "an float representing the smallest possible random number desired" ), false, false )
2272  << HelpArg( tr( "max" ), tr( "an float representing the largest possible random number desired" ), false, false ),
2273  /* variableLenArguments */ false,
2275  << HelpExample( tr( "randf(1, 10)" ), tr( "4.59258286403147" ), tr( "") )
2276  )
2277  )
2278  );
2279 
2280  gFunctionHelpTexts.insert( "regexp_match",
2281  Help( "regexp_match", tr( "function" ), tr( "Returns true if any part of a string matches the supplied regular expression." ),
2283  << HelpVariant( tr( "regexp_match" ), tr( "Returns true if any part of a string matches the supplied regular expression." ),
2284  QList<HelpArg>()
2285  << HelpArg( tr( "input_string" ), tr( "the string to test against the regular expression" ), false, false )
2286  << HelpArg( tr( "regex" ), tr( "The regular expression to test against. Backslash characters must be double escaped (eg \"\\s\" to match a white space character). Non-greedy regular expressions are not supported." ), false, false ),
2287  /* variableLenArguments */ false,
2289  << HelpExample( tr( "regexp_match('QGIS ROCKS','\\sROCKS')" ), tr( "true" ), tr( "") )
2290  )
2291  )
2292  );
2293 
2294  gFunctionHelpTexts.insert( "regexp_replace",
2295  Help( "regexp_replace", tr( "function" ), tr( "Returns a string with the supplied regular expression replaced." ),
2297  << HelpVariant( tr( "regexp_replace" ), tr( "Returns a string with the supplied regular expression replaced." ),
2298  QList<HelpArg>()
2299  << HelpArg( tr( "input_string" ), tr( "the string to replace matches in" ), false, false )
2300  << HelpArg( tr( "regex" ), tr( "The regular expression to replace. Backslash characters must be double escaped (eg \"\\s\" to match a white space character). Non-greedy regular expressions are not supported." ), false, false )
2301  << HelpArg( tr( "replacement" ), tr( "The string that will replace any matching occurrences of the supplied regular expression. Captured groups can be inserted into the replacement string using \\1, \\2, etc." ), false, false ),
2302  /* variableLenArguments */ false,
2304  << HelpExample( tr( "regexp_replace('QGIS SHOULD ROCK','\\sSHOULD\\s',' DOES ')" ), tr( "'QGIS DOES ROCK'" ), tr( "") )
2305  )
2306  )
2307  );
2308 
2309  gFunctionHelpTexts.insert( "regexp_substr",
2310  Help( "regexp_substr", tr( "function" ), tr( "Returns the portion of a string which matches a supplied regular expression." ),
2312  << HelpVariant( tr( "regexp_substr" ), tr( "Returns the portion of a string which matches a supplied regular expression." ),
2313  QList<HelpArg>()
2314  << HelpArg( tr( "input_string" ), tr( "the string to find matches in" ), false, false )
2315  << HelpArg( tr( "regex" ), tr( "The regular expression to match against. Backslash characters must be double escaped (eg \"\\s\" to match a white space character). Non-greedy regular expressions are not supported." ), false, false ),
2316  /* variableLenArguments */ false,
2318  << HelpExample( tr( "regexp_substr('abc123','(\\d+)')" ), tr( "'123'" ), tr( "") )
2319  )
2320  )
2321  );
2322 
2323  gFunctionHelpTexts.insert( "relate",
2324  Help( "relate", tr( "function" ), tr( "Tests the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the relationship between two geometries." ),
2326  << HelpVariant( tr( "Relationship variant" ), tr( "Returns the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the relationship between two geometries." ),
2327  QList<HelpArg>()
2328  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false )
2329  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false ),
2330  /* variableLenArguments */ false,
2332  << HelpExample( tr( "relate( geom_from_wkt( 'LINESTRING(40 40,120 120)' ), geom_from_wkt( 'LINESTRING(40 40,60 120)' ) )" ), tr( "'FF1F00102'" ), tr( "") )
2333  )
2334  << HelpVariant( tr( "Pattern match variant" ), tr( "Tests whether the DE-9IM relationship between two geometries matches a specified pattern." ),
2335  QList<HelpArg>()
2336  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false )
2337  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false )
2338  << HelpArg( tr( "pattern" ), tr( "DE-9IM pattern to match" ), false, false ),
2339  /* variableLenArguments */ false,
2341  << HelpExample( tr( "relate( geom_from_wkt( 'LINESTRING(40 40,120 120)' ), geom_from_wkt( 'LINESTRING(40 40,60 120)' ), '**1F001**' )" ), tr( "True" ), tr( "") )
2342  )
2343  )
2344  );
2345 
2346  gFunctionHelpTexts.insert( "replace",
2347  Help( "replace", tr( "function" ), tr( "Returns a string with the the supplied string replaced." ),
2349  << HelpVariant( tr( "replace" ), tr( "Returns a string with the the supplied string replaced." ),
2350  QList<HelpArg>()
2351  << HelpArg( tr( "string" ), tr( "the input string" ), false, false )
2352  << HelpArg( tr( "before" ), tr( "the string to replace" ), false, false )
2353  << HelpArg( tr( "after" ), tr( "the string to use as a replacement" ), false, false ),
2354  /* variableLenArguments */ false,
2356  << HelpExample( tr( "replace('QGIS SHOULD ROCK','SHOULD','DOES')" ), tr( "'QGIS DOES ROCK'" ), tr( "") )
2357  )
2358  )
2359  );
2360 
2361  gFunctionHelpTexts.insert( "reverse",
2362  Help( "reverse", tr( "function" ), tr( "Reverses the direction of a line string by reversing the order of its vertices." ),
2364  << HelpVariant( tr( "reverse" ), tr( "Reverses the direction of a line string by reversing the order of its vertices." ),
2365  QList<HelpArg>()
2366  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2367  /* variableLenArguments */ false,
2369  << HelpExample( tr( "geom_to_wkt(reverse(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))" ), tr( "'LINESTRING(2 2, 1 1, 0 0)'" ), tr( "") )
2370  )
2371  )
2372  );
2373 
2374  gFunctionHelpTexts.insert( "right",
2375  Help( "right", tr( "function" ), tr( "Returns a substring that contains the <i>n</i> rightmost characters of the string." ),
2377  << HelpVariant( tr( "right" ), tr( "Returns a substring that contains the <i>n</i> rightmost characters of the string." ),
2378  QList<HelpArg>()
2379  << HelpArg( tr( "string" ), tr( "a string" ), false, false )
2380  << HelpArg( tr( "length" ), tr( "integer. The number of characters from the right of the string to return." ), false, false ),
2381  /* variableLenArguments */ false,
2383  << HelpExample( tr( "right('Hello World',5)" ), tr( "'World'" ), tr( "") )
2384  )
2385  )
2386  );
2387 
2388  gFunctionHelpTexts.insert( "round",
2389  Help( "round", tr( "function" ), tr( "Rounds a number to number of decimal places." ),
2391  << HelpVariant( tr( "round" ), tr( "Rounds a number to number of decimal places." ),
2392  QList<HelpArg>()
2393  << HelpArg( tr( "decimal" ), tr( "decimal number to be rounded" ), false, false )
2394  << HelpArg( tr( "places" ), tr( "Optional integer representing number of places to round decimals to. Can be negative." ), false, false ),
2395  /* variableLenArguments */ false,
2397  << HelpExample( tr( "round(1234.567, 2)" ), tr( "1234.57" ), tr( "") )
2398  << HelpExample( tr( "round(1234.567)" ), tr( "1235" ), tr( "") )
2399  )
2400  )
2401  );
2402 
2403  gFunctionHelpTexts.insert( "rpad",
2404  Help( "rpad", tr( "function" ), tr( "Returns a string padded to supplied width using a fill character." ),
2406  << HelpVariant( tr( "rpad" ), tr( "Returns a string padded to supplied width using a fill character." ),
2407  QList<HelpArg>()
2408  << HelpArg( tr( "string" ), tr( "string to pad" ), false, false )
2409  << HelpArg( tr( "width" ), tr( "length of new string" ), false, false )
2410  << HelpArg( tr( "fill" ), tr( "character to pad the remaining space with" ), false, false ),
2411  /* variableLenArguments */ false,
2413  << HelpExample( tr( "rpad('Hello', 10, 'x')" ), tr( "'Helloxxxxx'" ), tr( "") )
2414  )
2415  )
2416  );
2417 
2418  gFunctionHelpTexts.insert( "scale_exp",
2419  Help( "scale_exp", tr( "function" ), tr( "Transforms a given value from an input domain to an output range using an exponential curve. This function can be used to ease values in or out of the specified output range." ),
2421  << HelpVariant( tr( "scale_exp" ), tr( "Transforms a given value from an input domain to an output range using an exponential curve. This function can be used to ease values in or out of the specified output range." ),
2422  QList<HelpArg>()
2423  << HelpArg( tr( "val" ), tr( "A value in the input domain. The function will return a corresponding scaled value in the output range." ), false, false )
2424  << HelpArg( tr( "domain_min" ), tr( "Specifies the minimum value in the input domain, the smallest value the input value should take." ), false, false )
2425  << HelpArg( tr( "domain_max" ), tr( "Specifies the maximum value in the input domain, the largest value the input value should take." ), false, false )
2426  << HelpArg( tr( "range_min" ), tr( "Specifies the minimum value in the output range, the smallest value which should be output by the function." ), false, false )
2427  << HelpArg( tr( "range_max" ), tr( "Specifies the maximum value in the output range, the largest value which should be output by the function." ), false, false )
2428  << HelpArg( tr( "exponent" ), tr( "A positive value (greater than 0), which dictates the way input values are mapped to the output range. Large exponents will cause the output values to 'ease in', starting slowly before accelerating as the input values approach the domain maximum. Smaller exponents (less than 1) will cause output values to 'ease out', where the mapping starts quickly but slows as it approaches the domain maximum." ), false, false ),
2429  /* variableLenArguments */ false,
2431  << HelpExample( tr( "scale_exp(5,0,10,0,100,2)" ), tr( "25" ), tr( "easing in, using an exponent of 2") )
2432  << HelpExample( tr( "scale_exp(3,0,10,0,100,0.5)" ), tr( "54.772" ), tr( "easing out, using an exponent of 0.5") )
2433  )
2434  )
2435  );
2436 
2437  gFunctionHelpTexts.insert( "scale_linear",
2438  Help( "scale_linear", tr( "function" ), tr( "Transforms a given value from an input domain to an output range using linear interpolation." ),
2440  << HelpVariant( tr( "scale_linear" ), tr( "Transforms a given value from an input domain to an output range using linear interpolation." ),
2441  QList<HelpArg>()
2442  << HelpArg( tr( "val" ), tr( "A value in the input domain. The function will return a corresponding scaled value in the output range." ), false, false )
2443  << HelpArg( tr( "domain_min" ), tr( "Specifies the minimum value in the input domain, the smallest value the input value should take." ), false, false )
2444  << HelpArg( tr( "domain_max" ), tr( "Specifies the maximum value in the input domain, the largest value the input value should take." ), false, false )
2445  << HelpArg( tr( "range_min" ), tr( "Specifies the minimum value in the output range, the smallest value which should be output by the function." ), false, false )
2446  << HelpArg( tr( "range_max" ), tr( "Specifies the maximum value in the output range, the largest value which should be output by the function." ), false, false ),
2447  /* variableLenArguments */ false,
2449  << HelpExample( tr( "scale_linear(5,0,10,0,100)" ), tr( "72" ), tr( "") )
2450  << HelpExample( tr( "scale_linear(0.2,0,1,0,360)" ), tr( "72" ), tr( "scaling a value between 0 and 1 to an angle between 0 and 360") )
2451  << HelpExample( tr( "scale_linear(1500,1000,10000,9,20)" ), tr( "10.22" ), tr( "scaling a population which varies between 1000 and 10000 to a font size between 9 and 20") )
2452  )
2453  )
2454  );
2455 
2456  gFunctionHelpTexts.insert( "second",
2457  Help( "second", tr( "function" ), tr( "Extract the seconds part from a datetime or time, or the number of seconds from an interval." ),
2459  << HelpVariant( tr( "Time variant" ), tr( "Extract the seconds part from a time or datetime." ),
2460  QList<HelpArg>()
2461  << HelpArg( tr( "datetime" ), tr( "a time or datetime value" ), false, false ),
2462  /* variableLenArguments */ false,
2464  << HelpExample( tr( "second('2012-07-22T13:24:57')" ), tr( "57" ), tr( "") )
2465  )
2466  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in seconds of an interval." ),
2467  QList<HelpArg>()
2468  << HelpArg( tr( "interval" ), tr( "interval value to return number of seconds from" ), false, false ),
2469  /* variableLenArguments */ false,
2471  << HelpExample( tr( "second(age('2012-07-22T00:20:00','2012-07-22T00:00:00'))" ), tr( "1200" ), tr( "") )
2472  << HelpExample( tr( "second(age('2012-01-01','2010-01-01'))" ), tr( "63072000" ), tr( "") )
2473  )
2474  )
2475  );
2476 
2477  gFunctionHelpTexts.insert( "segments_to_lines",
2478  Help( "segments_to_lines", tr( "function" ), tr( "Returns a multi line geometry consisting of a line for every segment in the input geometry." ),
2480  << HelpVariant( tr( "segments_to_lines" ), tr( "Returns a multi line geometry consisting of a line for every segment in the input geometry." ),
2481  QList<HelpArg>()
2482  << HelpArg( tr( "geometry" ), tr( "geometry object" ), false, false ),
2483  /* variableLenArguments */ false,
2485  << HelpExample( tr( "geom_to_wkt(segments_to_lines(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))" ), tr( "'MultiLineString ((0 0, 1 1),(1 1, 2 2))'" ), tr( "") )
2486  )
2487  )
2488  );
2489 
2490  gFunctionHelpTexts.insert( "set_color_part",
2491  Help( "set_color_part", tr( "function" ), tr( "Sets a specific color component for a color string, eg the red component or alpha component." ),
2493  << HelpVariant( tr( "set_color_part" ), tr( "Sets a specific color component for a color string, eg the red component or alpha component." ),
2494  QList<HelpArg>()
2495  << HelpArg( tr( "color" ), tr( "a color string" ), false, false )
2496  << HelpArg( tr( "component" ), tr( "a string corresponding to the color component to set. Valid options are:<br /><ul><li>red: RGB red component (0-255)</li><li>green: RGB green component (0-255)</li><li>blue: RGB blue component (0-255)</li><li>alpha: alpha (transparency) value (0-255)</li><li>hue: HSV hue (0-360)</li><li>saturation: HSV saturation (0-100)</li><li>value: HSV value (0-100)</li><li>hsl_hue: HSL hue (0-360)</li><li>hsl_saturation: HSL saturation (0-100)</li><li>lightness: HSL lightness (0-100)</li><li>cyan: CMYK cyan component (0-100)</li><li>magenta: CMYK magenta component (0-100)</li><li>yellow: CMYK yellow component (0-100)</li> <li>black: CMYK black component (0-100)</li></ul>" ), false, false )
2497  << HelpArg( tr( "value" ), tr( "new value for color component, respecting the ranges listed above" ), false, false ),
2498  /* variableLenArguments */ false,
2500  << HelpExample( tr( "set_color_part('200,10,30','green',50)" ), tr( "200,50,30" ), tr( "") )
2501  )
2502  )
2503  );
2504 
2505  gFunctionHelpTexts.insert( "shortest_line",
2506  Help( "shortest_line", tr( "function" ), tr( "Returns the shortest line joining geometry 1 to geometry 2. The resultant line will start at geometry 1 and end at geometry 2." ),
2508  << HelpVariant( tr( "shortest_line" ), tr( "Returns the shortest line joining geometry 1 to geometry 2. The resultant line will start at geometry 1 and end at geometry 2." ),
2509  QList<HelpArg>()
2510  << HelpArg( tr( "geometry 1" ), tr( "geometry to find shortest line from" ), false, false )
2511  << HelpArg( tr( "geometry 2" ), tr( "geometry to find shortest line to" ), false, false ),
2512  /* variableLenArguments */ false,
2514  << HelpExample( tr( "geom_to_wkt(shortest_line(geom_from_wkt('LINESTRING (20 80, 98 190, 110 180, 50 75 )'),geom_from_wkt('POINT(100 100)')))" ), tr( "LineString(73.0769 115.384, 100 100)" ), tr( "") )
2515  )
2516  )
2517  );
2518 
2519  gFunctionHelpTexts.insert( "sin",
2520  Help( "sin", tr( "function" ), tr( "Returns the sine of an angle." ),
2522  << HelpVariant( tr( "sin" ), tr( "Returns the sine of an angle." ),
2523  QList<HelpArg>()
2524  << HelpArg( tr( "angle" ), tr( "angle in radians" ), false, false ),
2525  /* variableLenArguments */ false,
2527  << HelpExample( tr( "sin(1.571)" ), tr( "0.999999682931835" ), tr( "") )
2528  )
2529  )
2530  );
2531 
2532  gFunctionHelpTexts.insert( "soundex",
2533  Help( "soundex", tr( "function" ), tr( "Returns the Soundex representation of a string. Soundex is a phonetic matching algorithm, so strings with similar sounds should be represented by the same Soundex code." ),
2535  << HelpVariant( tr( "soundex" ), tr( "Returns the Soundex representation of a string. Soundex is a phonetic matching algorithm, so strings with similar sounds should be represented by the same Soundex code." ),
2536  QList<HelpArg>()
2537  << HelpArg( tr( "string" ), tr( "a string" ), false, false ),
2538  /* variableLenArguments */ false,
2540  << HelpExample( tr( "soundex('robert')" ), tr( "'R163'" ), tr( "") )
2541  << HelpExample( tr( "soundex('rupert')" ), tr( "'R163'" ), tr( "") )
2542  << HelpExample( tr( "soundex('rubin')" ), tr( "'R150'" ), tr( "") )
2543  )
2544  )
2545  );
2546 
2547  gFunctionHelpTexts.insert( "sqrt",
2548  Help( "sqrt", tr( "function" ), tr( "Returns square root of a value." ),
2550  << HelpVariant( tr( "sqrt" ), tr( "Returns square root of a value." ),
2551  QList<HelpArg>()
2552  << HelpArg( tr( "value" ), tr( "a number" ), false, false ),
2553  /* variableLenArguments */ false,
2555  << HelpExample( tr( "sqrt(9)" ), tr( "3" ), tr( "") )
2556  )
2557  )
2558  );
2559 
2560  gFunctionHelpTexts.insert( "start_point",
2561  Help( "start_point", tr( "function" ), tr( "Returns the first node from a geometry." ),
2563  << HelpVariant( tr( "start_point" ), tr( "Returns the first node from a geometry." ),
2564  QList<HelpArg>()
2565  << HelpArg( tr( "geometry" ), tr( "geometry object" ), false, false ),
2566  /* variableLenArguments */ false,
2568  << HelpExample( tr( "geom_to_wkt(start_point(geom_from_wkt('LINESTRING(4 0, 4 2, 0 2)')))" ), tr( "'Point (4 0)'" ), tr( "") )
2569  )
2570  )
2571  );
2572 
2573  gFunctionHelpTexts.insert( "strpos",
2574  Help( "strpos", tr( "function" ), tr( "Return the first matching position of a substring within another string, or 0 if the substring is not found." ),
2576  << HelpVariant( tr( "strpos" ), tr( "Return the first matching position of a substring within another string, or 0 if the substring is not found." ),
2577  QList<HelpArg>()
2578  << HelpArg( tr( "haystack" ), tr( "string that is to be searched" ), false, false )
2579  << HelpArg( tr( "needle" ), tr( "string to search for" ), false, false ),
2580  /* variableLenArguments */ false,
2582  << HelpExample( tr( "strpos('HELLO WORLD','WORLD')" ), tr( "7" ), tr( "") )
2583  << HelpExample( tr( "strpos('HELLO WORLD','GOODBYE')" ), tr( "0" ), tr( "") )
2584  )
2585  )
2586  );
2587 
2588  gFunctionHelpTexts.insert( "substr",
2589  Help( "substr", tr( "function" ), tr( "Returns a part of a string." ),
2591  << HelpVariant( tr( "substr" ), tr( "Returns a part of a string." ),
2592  QList<HelpArg>()
2593  << HelpArg( tr( "input_string" ), tr( "the full input string" ), false, false )
2594  << HelpArg( tr( "startpos" ), tr( "integer representing start position to extract from" ), false, false )
2595  << HelpArg( tr( "length" ), tr( "integer representing length of string to extract" ), false, false ),
2596  /* variableLenArguments */ false,
2598  << HelpExample( tr( "substr('HELLO WORLD',3,5)" ), tr( "'LLO W'" ), tr( "") )
2599  )
2600  )
2601  );
2602 
2603  gFunctionHelpTexts.insert( "sym_difference",
2604  Help( "sym_difference", tr( "function" ), tr( "Returns a geometry that represents the portions of two geometries that do not intersect." ),
2606  << HelpVariant( tr( "sym_difference" ), tr( "Returns a geometry that represents the portions of two geometries that do not intersect." ),
2607  QList<HelpArg>()
2608  << HelpArg( tr( "geometry1" ), tr( "a geometry" ), false, false )
2609  << HelpArg( tr( "geometry2" ), tr( "a geometry" ), false, false ),
2610  /* variableLenArguments */ false,
2612  << HelpExample( tr( "geom_to_wkt( sym_difference( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 8 8)' ) ) )" ), tr( "LINESTRING(5 5, 8 8)" ), tr( "") )
2613  )
2614  )
2615  );
2616 
2617  gFunctionHelpTexts.insert( "tan",
2618  Help( "tan", tr( "function" ), tr( "Returns the tangent of an angle." ),
2620  << HelpVariant( tr( "tan" ), tr( "Returns the tangent of an angle." ),
2621  QList<HelpArg>()
2622  << HelpArg( tr( "angle" ), tr( "angle in radians" ), false, false ),
2623  /* variableLenArguments */ false,
2625  << HelpExample( tr( "tan(1.0)" ), tr( "1.5574077246549" ), tr( "") )
2626  )
2627  )
2628  );
2629 
2630  gFunctionHelpTexts.insert( "title",
2631  Help( "title", tr( "function" ), tr( "Converts all words of a string to title case (all words lower case with leading capital letter)." ),
2633  << HelpVariant( tr( "title" ), tr( "Converts all words of a string to title case (all words lower case with leading capital letter)." ),
2634  QList<HelpArg>()
2635  << HelpArg( tr( "string" ), tr( "the string to convert to title case" ), false, false ),
2636  /* variableLenArguments */ false,
2638  << HelpExample( tr( "title('hello WOrld')" ), tr( "'Hello World'" ), tr( "") )
2639  )
2640  )
2641  );
2642 
2643  gFunctionHelpTexts.insert( "to_date",
2644  Help( "to_date", tr( "function" ), tr( "Convert a string into a date object." ),
2646  << HelpVariant( tr( "to_date" ), tr( "Convert a string into a date object." ),
2647  QList<HelpArg>()
2648  << HelpArg( tr( "string" ), tr( "string representing a date value" ), false, false ),
2649  /* variableLenArguments */ false,
2651  << HelpExample( tr( "to_date('2012-05-04')" ), tr( "2012-05-04" ), tr( "") )
2652  )
2653  )
2654  );
2655 
2656  gFunctionHelpTexts.insert( "to_datetime",
2657  Help( "to_datetime", tr( "function" ), tr( "Convert a string into a datetime object." ),
2659  << HelpVariant( tr( "to_datetime" ), tr( "Convert a string into a datetime object." ),
2660  QList<HelpArg>()
2661  << HelpArg( tr( "string" ), tr( "string representing a datetime value" ), false, false ),
2662  /* variableLenArguments */ false,
2664  << HelpExample( tr( "to_datetime('2012-05-04 12:50:00')" ), tr( "2012-05-04T12:50:00" ), tr( "") )
2665  )
2666  )
2667  );
2668 
2669  gFunctionHelpTexts.insert( "to_int",
2670  Help( "to_int", tr( "function" ), tr( "Converts a string to integer number. Nothing is returned if a value cannot be converted to integer (e.g '123asd' is invalid)." ),
2672  << HelpVariant( tr( "to_int" ), tr( "Converts a string to integer number. Nothing is returned if a value cannot be converted to integer (e.g '123asd' is invalid)." ),
2673  QList<HelpArg>()
2674  << HelpArg( tr( "string" ), tr( "string to convert to integer number" ), false, false ),
2675  /* variableLenArguments */ false,
2677  << HelpExample( tr( "to_int('123')" ), tr( "123" ), tr( "") )
2678  )
2679  )
2680  );
2681 
2682  gFunctionHelpTexts.insert( "to_interval",
2683  Help( "to_interval", tr( "function" ), tr( "Converts a string to a interval type. Can be used to take days, hours, month, etc of a date." ),
2685  << HelpVariant( tr( "to_interval" ), tr( "Converts a string to a interval type. Can be used to take days, hours, month, etc of a date." ),
2686  QList<HelpArg>()
2687  << HelpArg( tr( "string" ), tr( "a string representing an interval. Allowable formats include {n} days {n} hours {n} months." ), false, false ),
2688  /* variableLenArguments */ false,
2690  << HelpExample( tr( "to_datetime('2012-05-05 12:00:00') - to_interval('1 day 2 hours')" ), tr( "2012-05-04T10:00:00" ), tr( "") )
2691  )
2692  )
2693  );
2694 
2695  gFunctionHelpTexts.insert( "to_real",
2696  Help( "to_real", tr( "function" ), tr( "Converts a string to a real number. Nothing is returned if a value cannot be converted to real (e.g '123.56asd' is invalid). Numbers are rounded after saving changes if the precision is smaller than the result of the conversion." ),
2698  << HelpVariant( tr( "to_real" ), tr( "Converts a string to a real number. Nothing is returned if a value cannot be converted to real (e.g '123.56asd' is invalid). Numbers are rounded after saving changes if the precision is smaller than the result of the conversion." ),
2699  QList<HelpArg>()
2700  << HelpArg( tr( "string" ), tr( "string to convert to real number" ), false, false ),
2701  /* variableLenArguments */ false,
2703  << HelpExample( tr( "to_real('123.45')" ), tr( "123.45" ), tr( "") )
2704  )
2705  )
2706  );
2707 
2708  gFunctionHelpTexts.insert( "to_string",
2709  Help( "to_string", tr( "function" ), tr( "Converts a number to string." ),
2711  << HelpVariant( tr( "to_string" ), tr( "Converts a number to string." ),
2712  QList<HelpArg>()
2713  << HelpArg( tr( "number" ), tr( "Integer or real value. The number to convert to string." ), false, false ),
2714  /* variableLenArguments */ false,
2716  << HelpExample( tr( "to_string(123)" ), tr( "'123'" ), tr( "") )
2717  )
2718  )
2719  );
2720 
2721  gFunctionHelpTexts.insert( "to_time",
2722  Help( "to_time", tr( "function" ), tr( "Convert a string into a time object." ),
2724  << HelpVariant( tr( "to_time" ), tr( "Convert a string into a time object." ),
2725  QList<HelpArg>()
2726  << HelpArg( tr( "string" ), tr( "string representing a time value" ), false, false ),
2727  /* variableLenArguments */ false,
2729  << HelpExample( tr( "to_time('12:30:01')" ), tr( "12:30:01" ), tr( "") )
2730  )
2731  )
2732  );
2733 
2734  gFunctionHelpTexts.insert( "touches",
2735  Help( "touches", tr( "function" ), tr( "Tests whether a geometry touches another. Returns true if the geometries have at least one point in common, but their interiors do not intersect." ),
2737  << HelpVariant( tr( "touches" ), tr( "Tests whether a geometry touches another. Returns true if the geometries have at least one point in common, but their interiors do not intersect." ),
2738  QList<HelpArg>()
2739  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
2740  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
2741  /* variableLenArguments */ false,
2743  << HelpExample( tr( "touches( geom_from_wkt( 'LINESTRING(5 3, 4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "true" ), tr( "") )
2744  << HelpExample( tr( "touches( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(5 5)' ) )" ), tr( "false" ), tr( "") )
2745  )
2746  )
2747  );
2748 
2749  gFunctionHelpTexts.insert( "transform",
2750  Help( "transform", tr( "function" ), tr( "Returns the geometry transformed from a source CRS to a destination CRS." ),
2752  << HelpVariant( tr( "transform" ), tr( "Returns the geometry transformed from a source CRS to a destination CRS." ),
2753  QList<HelpArg>()
2754  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false )
2755  << HelpArg( tr( "source_auth_id" ), tr( "the source auth CRS ID" ), false, false )
2756  << HelpArg( tr( "dest_auth_id" ), tr( "the destination auth CRS ID" ), false, false ),
2757  /* variableLenArguments */ false,
2759  << HelpExample( tr( "geom_to_wkt( transform( $geometry, 'EPSG:2154', 'EPSG:4326' ) )" ), tr( "POINT(0 51)" ), tr( "") )
2760  )
2761  )
2762  );
2763 
2764  gFunctionHelpTexts.insert( "translate",
2765  Help( "translate", tr( "function" ), tr( "Returns a translated version of a geometry. Calculations are in the Spatial Reference System of this geometry." ),
2767  << HelpVariant( tr( "translate" ), tr( "Returns a translated version of a geometry. Calculations are in the Spatial Reference System of this geometry." ),
2768  QList<HelpArg>()
2769  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false )
2770  << HelpArg( tr( "dx" ), tr( "delta x" ), false, false )
2771  << HelpArg( tr( "dy" ), tr( "delta y" ), false, false ),
2772  /* variableLenArguments */ false,
2774  << HelpExample( tr( "translate($geometry, 5, 10)" ), tr( "a geometry of the same type like the original one" ), tr( "") )
2775  )
2776  )
2777  );
2778 
2779  gFunctionHelpTexts.insert( "trim",
2780  Help( "trim", tr( "function" ), tr( "Removes all leading and trailing whitespace (spaces, tabs, etc) from a string." ),
2782  << HelpVariant( tr( "trim" ), tr( "Removes all leading and trailing whitespace (spaces, tabs, etc) from a string." ),
2783  QList<HelpArg>()
2784  << HelpArg( tr( "string" ), tr( "string to trim" ), false, false ),
2785  /* variableLenArguments */ false,
2787  << HelpExample( tr( "trim(' hello world ')" ), tr( "'hello world'" ), tr( "") )
2788  )
2789  )
2790  );
2791 
2792  gFunctionHelpTexts.insert( "union",
2793  Help( "union", tr( "function" ), tr( "Returns a geometry that represents the point set union of the geometries." ),
2795  << HelpVariant( tr( "union" ), tr( "Returns a geometry that represents the point set union of the geometries." ),
2796  QList<HelpArg>()
2797  << HelpArg( tr( "geometry1" ), tr( "a geometry" ), false, false )
2798  << HelpArg( tr( "geometry2" ), tr( "a geometry" ), false, false ),
2799  /* variableLenArguments */ false,
2801  << HelpExample( tr( "geom_to_wkt( union( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(5 5)' ) ) )" ), tr( "MULTIPOINT(4 4, 5 5)" ), tr( "") )
2802  )
2803  )
2804  );
2805 
2806  gFunctionHelpTexts.insert( "upper",
2807  Help( "upper", tr( "function" ), tr( "Converts a string to upper case letters." ),
2809  << HelpVariant( tr( "upper" ), tr( "Converts a string to upper case letters." ),
2810  QList<HelpArg>()
2811  << HelpArg( tr( "string" ), tr( "the string to convert to upper case" ), false, false ),
2812  /* variableLenArguments */ false,
2814  << HelpExample( tr( "upper('hello WOrld')" ), tr( "'HELLO WORLD'" ), tr( "") )
2815  )
2816  )
2817  );
2818 
2819  gFunctionHelpTexts.insert( "uuid",
2820  Help( "uuid", tr( "function" ), tr( "Generates a Universally Unique Identifier (UUID) for each row using the Qt <a href='http://qt-project.org/doc/qt-4.8/quuid.html#createUuid'>QUuid::createUuid</a> method. Each UUID is 38 characters long." ),
2822  << HelpVariant( tr( "uuid" ), tr( "Generates a Universally Unique Identifier (UUID) for each row using the Qt <a href='http://qt-project.org/doc/qt-4.8/quuid.html#createUuid'>QUuid::createUuid</a> method. Each UUID is 38 characters long." ),
2823  QList<HelpArg>(),
2824  /* variableLenArguments */ false,
2826  << HelpExample( tr( "uuid()" ), tr( "'{0bd2f60f-f157-4a6d-96af-d4ba4cb366a1}'" ), tr( "") )
2827  )
2828  )
2829  );
2830 
2831  gFunctionHelpTexts.insert( "var",
2832  Help( "var", tr( "function" ), tr( "Returns the value stored within a specified variable." ),
2834  << HelpVariant( tr( "var" ), tr( "Returns the value stored within a specified variable." ),
2835  QList<HelpArg>()
2836  << HelpArg( tr( "name" ), tr( "a variable name" ), false, false ),
2837  /* variableLenArguments */ false,
2839  << HelpExample( tr( "var('qgis_version')" ), tr( "'2.12'" ), tr( "") )
2840  )
2841  )
2842  );
2843 
2844  gFunctionHelpTexts.insert( "week",
2845  Help( "week", tr( "function" ), tr( "Extract the week number from a date, or the number of weeks from an interval." ),
2847  << HelpVariant( tr( "Date variant" ), tr( "Extract the week number from a date or datetime." ),
2848  QList<HelpArg>()
2849  << HelpArg( tr( "date" ), tr( "a date or datetime value" ), false, false ),
2850  /* variableLenArguments */ false,
2852  << HelpExample( tr( "week('2012-05-12')" ), tr( "19" ), tr( "") )
2853  )
2854  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in weeks of an interval." ),
2855  QList<HelpArg>()
2856  << HelpArg( tr( "interval" ), tr( "interval value to return number of months from" ), false, false ),
2857  /* variableLenArguments */ false,
2859  << HelpExample( tr( "week(tointerval('3 weeks'))" ), tr( "3" ), tr( "") )
2860  << HelpExample( tr( "week(age('2012-01-01','2010-01-01'))" ), tr( "104.285" ), tr( "") )
2861  )
2862  )
2863  );
2864 
2865  gFunctionHelpTexts.insert( "within",
2866  Help( "within", tr( "function" ), tr( "Tests whether a geometry is within another. Returns true if the geometry a is completely within geometry b." ),
2868  << HelpVariant( tr( "within" ), tr( "Tests whether a geometry is within another. Returns true if the geometry a is completely within geometry b." ),
2869  QList<HelpArg>()
2870  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
2871  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
2872  /* variableLenArguments */ false,
2874  << HelpExample( tr( "within( geom_from_wkt( 'POINT( 0.5 0.5)' ), geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))' ) )" ), tr( "true" ), tr( "") )
2875  << HelpExample( tr( "within( geom_from_wkt( 'POINT( 5 5 )' ), geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0 ))' ) )" ), tr( "false" ), tr( "") )
2876  )
2877  )
2878  );
2879 
2880  gFunctionHelpTexts.insert( "wordwrap",
2881  Help( "wordwrap", tr( "function" ), tr( "Returns a string wrapped to a maximum/minimum number of characters." ),
2883  << HelpVariant( tr( "wordwrap" ), tr( "Returns a string wrapped to a maximum/minimum number of characters." ),
2884  QList<HelpArg>()
2885  << HelpArg( tr( "string" ), tr( "the string to be wrapped" ), false, false )
2886  << HelpArg( tr( "wrap_length" ), tr( "an integer. If wrap_length is positive the number represents the ideal maximum number of characters to wrap; if negative, the number represents the minimum number of characters to wrap." ), false, false )
2887  << HelpArg( tr( "delimiter_string" ), tr( "the delimiter string to wrap to a new line (optional)." ), false, false ),
2888  /* variableLenArguments */ false,
2890  << HelpExample( tr( "wordwrap('UNIVERSITY OF QGIS',13)" ), tr( "'UNIVERSITY OF<br>QGIS'" ), tr( "") )
2891  << HelpExample( tr( "wordwrap('UNIVERSITY OF QGIS',-3)" ), tr( "'UNIVERSITY<br>OF QGIS'" ), tr( "") )
2892  )
2893  )
2894  );
2895 
2896  gFunctionHelpTexts.insert( "x",
2897  Help( "x", tr( "function" ), tr( "Returns the x coordinate of a point geometry, or the x-coordinate of the centroid for a non-point geometry." ),
2899  << HelpVariant( tr( "x" ), tr( "Returns the x coordinate of a point geometry, or the x-coordinate of the centroid for a non-point geometry." ),
2900  QList<HelpArg>()
2901  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2902  /* variableLenArguments */ false,
2904  << HelpExample( tr( "x( geom_from_wkt( 'POINT(2 5)' ) )" ), tr( "2" ), tr( "") )
2905  )
2906  )
2907  );
2908 
2909  gFunctionHelpTexts.insert( "x_max",
2910  Help( "x_max", tr( "function" ), tr( "Returns the maximum x coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2912  << HelpVariant( tr( "x_max" ), tr( "Returns the maximum x coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2913  QList<HelpArg>()
2914  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2915  /* variableLenArguments */ false,
2917  << HelpExample( tr( "x_max( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )" ), tr( "4" ), tr( "") )
2918  )
2919  )
2920  );
2921 
2922  gFunctionHelpTexts.insert( "x_min",
2923  Help( "x_min", tr( "function" ), tr( "Returns the minimum x coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2925  << HelpVariant( tr( "x_min" ), tr( "Returns the minimum x coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2926  QList<HelpArg>()
2927  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2928  /* variableLenArguments */ false,
2930  << HelpExample( tr( "x_min( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )" ), tr( "2" ), tr( "") )
2931  )
2932  )
2933  );
2934 
2935  gFunctionHelpTexts.insert( "y",
2936  Help( "y", tr( "function" ), tr( "Returns the y coordinate of a point geometry, or the y-coordinate of the centroid for a non-point geometry." ),
2938  << HelpVariant( tr( "y" ), tr( "Returns the y coordinate of a point geometry, or the y-coordinate of the centroid for a non-point geometry." ),
2939  QList<HelpArg>()
2940  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2941  /* variableLenArguments */ false,
2943  << HelpExample( tr( "y( geom_from_wkt( 'POINT(2 5)' ) )" ), tr( "5" ), tr( "") )
2944  )
2945  )
2946  );
2947 
2948  gFunctionHelpTexts.insert( "y_max",
2949  Help( "y_max", tr( "function" ), tr( "Returns the maximum y coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2951  << HelpVariant( tr( "y_max" ), tr( "Returns the maximum y coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2952  QList<HelpArg>()
2953  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2954  /* variableLenArguments */ false,
2956  << HelpExample( tr( "y_max( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )" ), tr( "8" ), tr( "") )
2957  )
2958  )
2959  );
2960 
2961  gFunctionHelpTexts.insert( "y_min",
2962  Help( "y_min", tr( "function" ), tr( "Returns the minimum y coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2964  << HelpVariant( tr( "y_min" ), tr( "Returns the minimum y coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2965  QList<HelpArg>()
2966  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2967  /* variableLenArguments */ false,
2969  << HelpExample( tr( "y_min( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )" ), tr( "5" ), tr( "") )
2970  )
2971  )
2972  );
2973 
2974  gFunctionHelpTexts.insert( "year",
2975  Help( "year", tr( "function" ), tr( "Extract the year part from a date, or the number of years from an interval." ),
2977  << HelpVariant( tr( "Date variant" ), tr( "Extract the year part from a date or datetime." ),
2978  QList<HelpArg>()
2979  << HelpArg( tr( "date" ), tr( "a date or datetime value" ), false, false ),
2980  /* variableLenArguments */ false,
2982  << HelpExample( tr( "year('2012-05-12')" ), tr( "2012" ), tr( "") )
2983  )
2984  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in years of an interval." ),
2985  QList<HelpArg>()
2986  << HelpArg( tr( "interval" ), tr( "interval value to return number of years from" ), false, false ),
2987  /* variableLenArguments */ false,
2989  << HelpExample( tr( "year(to_interval('3 years'))" ), tr( "3" ), tr( "") )
2990  << HelpExample( tr( "year(age('2012-01-01','2010-01-01'))" ), tr( "1.9986" ), tr( "") )
2991  )
2992  )
2993  );
2994 
2995  gFunctionHelpTexts.insert( "z",
2996  Help( "z", tr( "function" ), tr( "Returns the z coordinate of a point geometry." ),
2998  << HelpVariant( tr( "z" ), tr( "Returns the z coordinate of a point geometry." ),
2999  QList<HelpArg>()
3000  << HelpArg( tr( "geom" ), tr( "a point geometry" ), false, false ),
3001  /* variableLenArguments */ false,
3003  << HelpExample( tr( "z( geom_from_wkt( 'POINTZ(2 5 7)' ) )" ), tr( "7" ), tr( "") )
3004  )
3005  )
3006  );
3007 }
static QHash< QString, Help > gFunctionHelpTexts
static void initFunctionHelp()
#define tr(sourceText)