QGIS API Documentation  2.14.11-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 denominator 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 denominator 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, you can use '%' as a wildcard, '_' as a single char and '\\' to escape." ), 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  << HelpExample( tr( "'ABCD' ILIKE '_b_'" ), tr( "0" ), tr( "") )
421  << HelpExample( tr( "'ABCD' ILIKE '_B_'" ), tr( "0" ), tr( "") )
422  << HelpExample( tr( "'ABCD' ILIKE '_b%'" ), tr( "1" ), tr( "") )
423  << HelpExample( tr( "'ABCD' ILIKE '_B%'" ), tr( "1" ), tr( "") )
424  << HelpExample( tr( "'ABCD' ILIKE '%b%'" ), tr( "1" ), tr( "") )
425  << HelpExample( tr( "'ABCD' ILIKE '%B%'" ), tr( "1" ), tr( "") )
426  )
427  )
428  );
429 
430  gFunctionHelpTexts.insert( "IN",
431  Help( "IN", tr( "operator" ), tr( "Returns 1 if value is found within a list of values." ),
433  << HelpVariant( tr( "IN" ), tr( "Returns 1 if value is found within a list of values." ),
435  << HelpArg( tr( "a" ), tr( "value" ), false, false )
436  << HelpArg( tr( "b" ), tr( "list of values" ), false, false ),
437  /* variableLenArguments */ false,
439  << HelpExample( tr( "'A' IN ('A','B')" ), tr( "1" ), tr( "") )
440  << HelpExample( tr( "'A' IN ('C','B')" ), tr( "0" ), tr( "") )
441  )
442  )
443  );
444 
445  gFunctionHelpTexts.insert( "IS",
446  Help( "IS", tr( "operator" ), tr( "Returns 1 if a is the same as b." ),
448  << HelpVariant( tr( "IS" ), tr( "Returns 1 if a is the same as b." ),
450  << HelpArg( tr( "a" ), tr( "any value" ), false, false )
451  << HelpArg( tr( "b" ), tr( "any value" ), false, false ),
452  /* variableLenArguments */ false,
454  << HelpExample( tr( "'A' IS 'A'" ), tr( "1" ), tr( "") )
455  << HelpExample( tr( "'A' IS 'a'" ), tr( "0" ), tr( "") )
456  << HelpExample( tr( "4 IS 4" ), tr( "1" ), tr( "") )
457  << HelpExample( tr( "4 IS 2+2" ), tr( "1" ), tr( "") )
458  << HelpExample( tr( "4 IS 2" ), tr( "0" ), tr( "") )
459  << HelpExample( tr( "$geometry IS NULL" ), tr( "0, if your geometry is not NULL" ), tr( "") )
460  )
461  )
462  );
463 
464  gFunctionHelpTexts.insert( "IS NOT",
465  Help( "IS NOT", tr( "operator" ), tr( "Returns 1 if a is not the same as b." ),
467  << HelpVariant( tr( "IS NOT" ), tr( "Returns 1 if a is not the same as b." ),
469  << HelpArg( tr( "a" ), tr( "value" ), false, false )
470  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
471  /* variableLenArguments */ false,
473  << HelpExample( tr( "'a' IS NOT 'b'" ), tr( "1" ), tr( "") )
474  << HelpExample( tr( "'a' IS NOT 'a'" ), tr( "0" ), tr( "") )
475  << HelpExample( tr( "4 IS NOT 2+2" ), tr( "0" ), tr( "") )
476  )
477  )
478  );
479 
480  gFunctionHelpTexts.insert( "LIKE",
481  Help( "LIKE", tr( "operator" ), tr( "Returns 1 if the first parameter matches the supplied pattern. Works with numbers also." ),
483  << HelpVariant( tr( "LIKE" ), tr( "Returns 1 if the first parameter matches the supplied pattern. Works with numbers also." ),
485  << HelpArg( tr( "string/number" ), tr( "value" ), false, false )
486  << HelpArg( tr( "pattern" ), tr( "pattern to compare value with, you can use '%' as a wildcard, '_' as a single char and '\\' to escape." ), false, false ),
487  /* variableLenArguments */ false,
489  << HelpExample( tr( "'A' LIKE 'A'" ), tr( "1" ), tr( "") )
490  << HelpExample( tr( "'A' LIKE 'a'" ), tr( "0" ), tr( "") )
491  << HelpExample( tr( "'A' LIKE 'B'" ), tr( "0" ), tr( "") )
492  << HelpExample( tr( "'ABC' LIKE 'B'" ), tr( "0" ), tr( "") )
493  << HelpExample( tr( "'ABC' LIKE '_B_'" ), tr( "1" ), tr( "") )
494  << HelpExample( tr( "'ABCD' LIKE '_B_'" ), tr( "0" ), tr( "") )
495  << HelpExample( tr( "'ABCD' LIKE '_B%'" ), tr( "1" ), tr( "") )
496  << HelpExample( tr( "'ABCD' LIKE '%B%'" ), tr( "1" ), tr( "") )
497  << HelpExample( tr( "'1%' LIKE '1\\%'" ), tr( "1" ), tr( "") )
498  << HelpExample( tr( "'1_' LIKE '1\\%'" ), tr( "0" ), tr( "") )
499  )
500  )
501  );
502 
503  gFunctionHelpTexts.insert( "Math",
504  Help( "Math", tr( "group" ), tr( "This group contains math functions e.g square root, sin and cos" ),
506  << HelpVariant( tr( "Math" ), tr( "This group contains math functions e.g square root, sin and cos" ),
507  QList<HelpArg>(),
508  /* variableLenArguments */ false,
510  )
511  )
512  );
513 
514  gFunctionHelpTexts.insert( "NOT",
515  Help( "NOT", tr( "operator" ), tr( "Negates a condition." ),
517  << HelpVariant( tr( "NOT" ), tr( "Negates a condition." ),
519  << HelpArg( tr( "a" ), tr( "condition" ), false, false ),
520  /* variableLenArguments */ false,
522  << HelpExample( tr( "NOT 1" ), tr( "0" ), tr( "") )
523  << HelpExample( tr( "NOT 0" ), tr( "1" ), tr( "") )
524  )
525  )
526  );
527 
528  gFunctionHelpTexts.insert( "NULL",
529  Help( "NULL", tr( "value" ), tr( "Equates to a null value." ),
531  << HelpVariant( tr( "NULL" ), tr( "Equates to a null value." ),
532  QList<HelpArg>(),
533  /* variableLenArguments */ false,
535  << HelpExample( tr( "NULL" ), tr( "a null value" ), tr( "") ),
536  tr( "To test for NULL use an <pre>IS NULL</pre> or <pre>IS NOT NULL</pre> expression." )
537  )
538  )
539  );
540 
541  gFunctionHelpTexts.insert( "OR",
542  Help( "OR", tr( "operator" ), tr( "Returns 1 when condition a or b is true." ),
544  << HelpVariant( tr( "OR" ), tr( "Returns 1 when condition a or b is true." ),
546  << HelpArg( tr( "a" ), tr( "condition" ), false, false )
547  << HelpArg( tr( "b" ), tr( "condition" ), false, false ),
548  /* variableLenArguments */ false,
550  << HelpExample( tr( "4 = 2+2 OR 1 = 1" ), tr( "1" ), tr( "") )
551  << HelpExample( tr( "4 = 2+2 OR 1 = 2" ), tr( "1" ), tr( "") )
552  << HelpExample( tr( "4 = 2 OR 1 = 2" ), tr( "0" ), tr( "") )
553  )
554  )
555  );
556 
557  gFunctionHelpTexts.insert( "Operators",
558  Help( "Operators", tr( "group" ), tr( "This group contains operators e.g + - *" ),
560  << HelpVariant( tr( "Operators" ), tr( "This group contains operators e.g + - *" ),
561  QList<HelpArg>(),
562  /* variableLenArguments */ false,
564  )
565  )
566  );
567 
568  gFunctionHelpTexts.insert( "Recent (Selection)",
569  Help( "Recent (Selection)", tr( "group" ), tr( "This group contains recently used expressions." ),
571  << HelpVariant( tr( "Recent (Selection)" ), tr( "This group contains recently used expressions." ),
572  QList<HelpArg>(),
573  /* variableLenArguments */ false,
575  )
576  )
577  );
578 
579  gFunctionHelpTexts.insert( "Record",
580  Help( "Record", tr( "group" ), tr( "This group contains functions that operate on record identifiers." ),
582  << HelpVariant( tr( "Record" ), tr( "This group contains functions that operate on record identifiers." ),
583  QList<HelpArg>(),
584  /* variableLenArguments */ false,
586  )
587  )
588  );
589 
590  gFunctionHelpTexts.insert( "String",
591  Help( "String", tr( "group" ), tr( "This group contains functions that operate on strings e.g replace, convert to upper case." ),
593  << HelpVariant( tr( "String" ), tr( "This group contains functions that operate on strings e.g replace, convert to upper case." ),
594  QList<HelpArg>(),
595  /* variableLenArguments */ false,
597  )
598  )
599  );
600 
601  gFunctionHelpTexts.insert( "Variables",
602  Help( "Variables", tr( "group" ), tr( "This group contains dynamic variables which can be inserted into your expressions." ),
604  << HelpVariant( tr( "Variables" ), tr( "This group contains dynamic variables which can be inserted into your expressions." ),
605  QList<HelpArg>(),
606  /* variableLenArguments */ false,
608  )
609  )
610  );
611 
612  gFunctionHelpTexts.insert( "abs",
613  Help( "abs", tr( "function" ), tr( "Returns the absolute value of a number." ),
615  << HelpVariant( tr( "abs" ), tr( "Returns the absolute value of a number." ),
617  << HelpArg( tr( "value" ), tr( "a number" ), false, false ),
618  /* variableLenArguments */ false,
620  << HelpExample( tr( "abs(-2)" ), tr( "2" ), tr( "") )
621  )
622  )
623  );
624 
625  gFunctionHelpTexts.insert( "acos",
626  Help( "acos", tr( "function" ), tr( "Returns the inverse cosine of a value in radians." ),
628  << HelpVariant( tr( "acos" ), tr( "Returns the inverse cosine of a value in radians." ),
630  << HelpArg( tr( "value" ), tr( "cosine of an angle in radians" ), false, false ),
631  /* variableLenArguments */ false,
633  << HelpExample( tr( "acos(0.5)" ), tr( "1.0471975511966" ), tr( "") )
634  )
635  )
636  );
637 
638  gFunctionHelpTexts.insert( "age",
639  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>" ),
641  << 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>" ),
643  << HelpArg( tr( "datetime1" ), tr( "a string, date or datetime representing the later date" ), false, false )
644  << HelpArg( tr( "datetime2" ), tr( "a string, date or datetime representing the earlier date" ), false, false ),
645  /* variableLenArguments */ false,
647  << HelpExample( tr( "age('2012-05-12','2012-05-2')" ), tr( "interval" ), tr( "use <code>day</code> to extract number of days") )
648  << HelpExample( tr( "day(age('2012-05-12','2012-05-2'))" ), tr( "10" ), tr( "") )
649  )
650  )
651  );
652 
653  gFunctionHelpTexts.insert( "area",
654  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." ),
656  << 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." ),
658  << HelpArg( tr( "geometry" ), tr( "polygon geometry object" ), false, false ),
659  /* variableLenArguments */ false,
661  << HelpExample( tr( "area(geom_from_wkt('POLYGON((0 0, 4 0, 4 2, 0 2, 0 0))'))" ), tr( "8.0" ), tr( "") )
662  )
663  )
664  );
665 
666  gFunctionHelpTexts.insert( "asin",
667  Help( "asin", tr( "function" ), tr( "Returns the inverse sine of a value in radians." ),
669  << HelpVariant( tr( "asin" ), tr( "Returns the inverse sine of a value in radians." ),
671  << HelpArg( tr( "value" ), tr( "sine of an angle in radians" ), false, false ),
672  /* variableLenArguments */ false,
674  << HelpExample( tr( "asin(1.0)" ), tr( "1.5707963267949" ), tr( "") )
675  )
676  )
677  );
678 
679  gFunctionHelpTexts.insert( "atan",
680  Help( "atan", tr( "function" ), tr( "Returns the inverse tangent of a value in radians." ),
682  << HelpVariant( tr( "atan" ), tr( "Returns the inverse tangent of a value in radians." ),
684  << HelpArg( tr( "value" ), tr( "tan of an angle in radians" ), false, false ),
685  /* variableLenArguments */ false,
687  << HelpExample( tr( "atan(0.5)" ), tr( "0.463647609000806" ), tr( "") )
688  )
689  )
690  );
691 
692  gFunctionHelpTexts.insert( "atan2",
693  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." ),
695  << 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." ),
697  << HelpArg( tr( "dy" ), tr( "y coordinate difference" ), false, false )
698  << HelpArg( tr( "dx" ), tr( "x coordinate difference" ), false, false ),
699  /* variableLenArguments */ false,
701  << HelpExample( tr( "atan2(1.0, 1.732)" ), tr( "0.523611477769969" ), tr( "") )
702  )
703  )
704  );
705 
706  gFunctionHelpTexts.insert( "attribute",
707  Help( "attribute", tr( "function" ), tr( "Returns the value of a specified attribute from a feature." ),
709  << HelpVariant( tr( "attribute" ), tr( "Returns the value of a specified attribute from a feature." ),
711  << HelpArg( tr( "feature" ), tr( "a feature" ), false, false )
712  << HelpArg( tr( "attribute_name" ), tr( "name of attribute to be returned" ), false, false ),
713  /* variableLenArguments */ false,
715  << HelpExample( tr( "attribute( $currentfeature, 'name' )" ), tr( "value stored in 'name' attribute for the current feature" ), tr( "") )
716  )
717  )
718  );
719 
720  gFunctionHelpTexts.insert( "azimuth",
721  Help( "azimuth", tr( "function" ), tr( "Returns the north-based azimuth as the angle in radians measured clockwise from the vertical on pointA to pointB." ),
723  << HelpVariant( tr( "azimuth" ), tr( "Returns the north-based azimuth as the angle in radians measured clockwise from the vertical on pointA to pointB." ),
725  << HelpArg( tr( "pointA" ), tr( "point geometry" ), false, false )
726  << HelpArg( tr( "pointB" ), tr( "point geometry" ), false, false ),
727  /* variableLenArguments */ false,
729  << HelpExample( tr( "degrees( azimuth( make_point(25, 45), make_point(75, 100) ) )" ), tr( "42.273689" ), tr( "") )
730  << HelpExample( tr( "degrees( azimuth( make_point(75, 100), make_point(25,45) ) )" ), tr( "222.273689" ), tr( "") )
731  )
732  )
733  );
734 
735  gFunctionHelpTexts.insert( "bounds",
736  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." ),
738  << 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." ),
740  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
741  /* variableLenArguments */ false,
743  << HelpExample( tr( "bounds($geometry)" ), tr( "bounding box of $geometry" ), tr( "") )
744  )
745  )
746  );
747 
748  gFunctionHelpTexts.insert( "bounds_height",
749  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." ),
751  << 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." ),
753  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
754  /* variableLenArguments */ false,
756  << HelpExample( tr( "bounds_height($geometry)" ), tr( "height of bounding box of $geometry" ), tr( "") )
757  )
758  )
759  );
760 
761  gFunctionHelpTexts.insert( "bounds_width",
762  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." ),
764  << 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." ),
766  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
767  /* variableLenArguments */ false,
769  << HelpExample( tr( "bounds_width($geometry)" ), tr( "width of bounding box of $geometry" ), tr( "") )
770  )
771  )
772  );
773 
774  gFunctionHelpTexts.insert( "buffer",
775  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." ),
777  << 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." ),
779  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false )
780  << HelpArg( tr( "distance" ), tr( "buffer distance in layer units" ), false, false ),
781  /* variableLenArguments */ false,
783  << HelpExample( tr( "buffer($geometry, 10.5)" ), tr( "polygon of $geometry buffered by 10.5 units" ), tr( "") )
784  )
785  )
786  );
787 
788  gFunctionHelpTexts.insert( "ceil",
789  Help( "ceil", tr( "function" ), tr( "Rounds a number upwards." ),
791  << HelpVariant( tr( "ceil" ), tr( "Rounds a number upwards." ),
793  << HelpArg( tr( "value" ), tr( "a number" ), false, false ),
794  /* variableLenArguments */ false,
796  << HelpExample( tr( "ceil(4.9)" ), tr( "5" ), tr( "") )
797  << HelpExample( tr( "ceil(-4.9)" ), tr( "-4" ), tr( "") )
798  )
799  )
800  );
801 
802  gFunctionHelpTexts.insert( "centroid",
803  Help( "centroid", tr( "function" ), tr( "Returns the geometric center of a geometry." ),
805  << HelpVariant( tr( "centroid" ), tr( "Returns the geometric center of a geometry." ),
807  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
808  /* variableLenArguments */ false,
810  << HelpExample( tr( "centroid($geometry)" ), tr( "a point geometry" ), tr( "") )
811  )
812  )
813  );
814 
815  gFunctionHelpTexts.insert( "clamp",
816  Help( "clamp", tr( "function" ), tr( "Restricts an input value to a specified range." ),
818  << HelpVariant( tr( "clamp" ), tr( "Restricts an input value to a specified range." ),
820  << HelpArg( tr( "minimum" ), tr( "the smallest value <i>input</i> is allowed to take." ), false, false )
821  << HelpArg( tr( "input" ), tr( "a value which will be restricted to the range specified by <i>minimum</i> and <i>maximum</i>" ), false, false )
822  << HelpArg( tr( "maximum" ), tr( "the largest value <i>input</i> is allowed to take" ), false, false ),
823  /* variableLenArguments */ false,
825  << HelpExample( tr( "clamp(1,5,10)" ), tr( "5" ), tr( "<i>input</i> is between 1 and 10 so is returned unchanged") )
826  << HelpExample( tr( "clamp(1,0,10)" ), tr( "1" ), tr( "<i>input</i> is less than minimum value of 1, so function returns 1") )
827  << HelpExample( tr( "clamp(1,11,10)" ), tr( "10" ), tr( "<i>input</i> is greater than maximum value of 10, so function returns 10") )
828  )
829  )
830  );
831 
832  gFunctionHelpTexts.insert( "closest_point",
833  Help( "closest_point", tr( "function" ), tr( "Returns the point on geometry 1 that is closest to geometry 2." ),
835  << HelpVariant( tr( "closest_point" ), tr( "Returns the point on geometry 1 that is closest to geometry 2." ),
837  << HelpArg( tr( "geometry 1" ), tr( "geometry to find closest point on" ), false, false )
838  << HelpArg( tr( "geometry 2" ), tr( "geometry to find closest point to" ), false, false ),
839  /* variableLenArguments */ false,
841  << 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( "") )
842  )
843  )
844  );
845 
846  gFunctionHelpTexts.insert( "coalesce",
847  Help( "coalesce", tr( "function" ), tr( "Returns the first non-NULL value from the expression list.<br>This function can take any number of arguments." ),
849  << HelpVariant( tr( "coalesce" ), tr( "Returns the first non-NULL value from the expression list.<br>This function can take any number of arguments." ),
851  << HelpArg( tr( "expression1" ), tr( "" ), false, true )
852  << HelpArg( tr( "expression2" ), tr( "" ), false, true )
853  << HelpArg( tr( "expression" ), tr( "any valid expression or value, irregardless of type." ), true, false ),
854  /* variableLenArguments */ true,
856  << HelpExample( tr( "coalesce(NULL, 2)" ), tr( "2" ), tr( "") )
857  << HelpExample( tr( "coalesce(NULL, 2, 3)" ), tr( "2" ), tr( "") )
858  << HelpExample( tr( "coalesce(7, NULL, 3*2)" ), tr( "7" ), tr( "") )
859  << 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( "") )
860  )
861  )
862  );
863 
864  gFunctionHelpTexts.insert( "color_cmyk",
865  Help( "color_cmyk", tr( "function" ), tr( "Returns a string representation of a color based on its cyan, magenta, yellow and black components" ),
867  << HelpVariant( tr( "color_cmyk" ), tr( "Returns a string representation of a color based on its cyan, magenta, yellow and black components" ),
869  << HelpArg( tr( "cyan" ), tr( "cyan component of the color, as a percentage integer value from 0 to 100" ), false, false )
870  << HelpArg( tr( "magenta" ), tr( "magenta component of the color, as a percentage integer value from 0 to 100" ), false, false )
871  << HelpArg( tr( "yellow" ), tr( "yellow component of the color, as a percentage integer value from 0 to 100" ), false, false )
872  << HelpArg( tr( "black" ), tr( "black component of the color, as a percentage integer value from 0 to 100" ), false, false ),
873  /* variableLenArguments */ false,
875  << HelpExample( tr( "color_cmyk(100,50,0,10)" ), tr( "0,115,230" ), tr( "") )
876  )
877  )
878  );
879 
880  gFunctionHelpTexts.insert( "color_cmyka",
881  Help( "color_cmyka", tr( "function" ), tr( "Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components" ),
883  << HelpVariant( tr( "color_cmyka" ), tr( "Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components" ),
885  << HelpArg( tr( "cyan" ), tr( "cyan component of the color, as a percentage integer value from 0 to 100" ), false, false )
886  << HelpArg( tr( "magenta" ), tr( "magenta component of the color, as a percentage integer value from 0 to 100" ), false, false )
887  << HelpArg( tr( "yellow" ), tr( "yellow component of the color, as a percentage integer value from 0 to 100" ), false, false )
888  << HelpArg( tr( "black" ), tr( "black component of the color, as a percentage integer value from 0 to 100" ), false, false )
889  << HelpArg( tr( "alpha" ), tr( "alpha component as an integer value from 0 (completely transparent) to 255 (opaque)." ), false, false ),
890  /* variableLenArguments */ false,
892  << HelpExample( tr( "color_cmyk(100,50,0,10,200)" ), tr( "0,115,230,200" ), tr( "") )
893  )
894  )
895  );
896 
897  gFunctionHelpTexts.insert( "color_hsl",
898  Help( "color_hsl", tr( "function" ), tr( "Returns a string representation of a color based on its hue, saturation, and lightness attributes." ),
900  << HelpVariant( tr( "color_hsl" ), tr( "Returns a string representation of a color based on its hue, saturation, and lightness attributes." ),
902  << HelpArg( tr( "hue" ), tr( "hue of the color, as an integer value from 0 to 360" ), false, false )
903  << HelpArg( tr( "saturation" ), tr( "saturation percentage of the color as an integer value from 0 to 100" ), false, false )
904  << HelpArg( tr( "lightness" ), tr( "lightness percentage of the color as an integer value from 0 to 100" ), false, false ),
905  /* variableLenArguments */ false,
907  << HelpExample( tr( "color_hsl(100,50,70)" ), tr( "166,217,140" ), tr( "") )
908  )
909  )
910  );
911 
912  gFunctionHelpTexts.insert( "color_hsla",
913  Help( "color_hsla", tr( "function" ), tr( "Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes" ),
915  << HelpVariant( tr( "color_hsla" ), tr( "Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes" ),
917  << HelpArg( tr( "hue" ), tr( "hue of the color, as an integer value from 0 to 360" ), false, false )
918  << HelpArg( tr( "saturation" ), tr( "saturation percentage of the color as an integer value from 0 to 100" ), false, false )
919  << HelpArg( tr( "lightness" ), tr( "lightness percentage of the color as an integer value from 0 to 100" ), false, false )
920  << HelpArg( tr( "alpha" ), tr( "alpha component as an integer value from 0 (completely transparent) to 255 (opaque)." ), false, false ),
921  /* variableLenArguments */ false,
923  << HelpExample( tr( "color_hsla(100,50,70,200)" ), tr( "166,217,140,200" ), tr( "") )
924  )
925  )
926  );
927 
928  gFunctionHelpTexts.insert( "color_hsv",
929  Help( "color_hsv", tr( "function" ), tr( "Returns a string representation of a color based on its hue, saturation, and value attributes." ),
931  << HelpVariant( tr( "color_hsv" ), tr( "Returns a string representation of a color based on its hue, saturation, and value attributes." ),
933  << HelpArg( tr( "hue" ), tr( "hue of the color, as an integer value from 0 to 360" ), false, false )
934  << HelpArg( tr( "saturation" ), tr( "saturation percentage of the color as an integer value from 0 to 100" ), false, false )
935  << HelpArg( tr( "value" ), tr( "value percentage of the color as an integer from 0 to 100" ), false, false ),
936  /* variableLenArguments */ false,
938  << HelpExample( tr( "color_hsv(40,100,100)" ), tr( "255,170,0" ), tr( "") )
939  )
940  )
941  );
942 
943  gFunctionHelpTexts.insert( "color_hsva",
944  Help( "color_hsva", tr( "function" ), tr( "Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes." ),
946  << HelpVariant( tr( "color_hsva" ), tr( "Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes." ),
948  << HelpArg( tr( "hue" ), tr( "hue of the color, as an integer value from 0 to 360" ), false, false )
949  << HelpArg( tr( "saturation" ), tr( "saturation percentage of the color as an integer value from 0 to 100" ), false, false )
950  << HelpArg( tr( "value" ), tr( "value percentage of the color as an integer from 0 to 100" ), false, false )
951  << HelpArg( tr( "alpha" ), tr( "alpha component as an integer value from 0 (completely transparent) to 255 (opaque)" ), false, false ),
952  /* variableLenArguments */ false,
954  << HelpExample( tr( "color_hsva(40,100,100,200)" ), tr( "255,170,0,200" ), tr( "") )
955  )
956  )
957  );
958 
959  gFunctionHelpTexts.insert( "color_part",
960  Help( "color_part", tr( "function" ), tr( "Returns a specific component from a color string, eg the red component or alpha component." ),
962  << HelpVariant( tr( "color_part" ), tr( "Returns a specific component from a color string, eg the red component or alpha component." ),
964  << HelpArg( tr( "color" ), tr( "a color string" ), false, false )
965  << 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 ),
966  /* variableLenArguments */ false,
968  << HelpExample( tr( "color_part('200,10,30','green')" ), tr( "10" ), tr( "") )
969  )
970  )
971  );
972 
973  gFunctionHelpTexts.insert( "color_rgb",
974  Help( "color_rgb", tr( "function" ), tr( "Returns a string representation of a color based on its red, green, and blue components." ),
976  << HelpVariant( tr( "color_rgb" ), tr( "Returns a string representation of a color based on its red, green, and blue components." ),
978  << HelpArg( tr( "red" ), tr( "red component as an integer value from 0 to 255" ), false, false )
979  << HelpArg( tr( "green" ), tr( "green component as an integer value from 0 to 255" ), false, false )
980  << HelpArg( tr( "blue" ), tr( "blue component as an integer value from 0 to 255" ), false, false ),
981  /* variableLenArguments */ false,
983  << HelpExample( tr( "color_rgb(255,127,0)" ), tr( "255,127,0" ), tr( "") )
984  )
985  )
986  );
987 
988  gFunctionHelpTexts.insert( "color_rgba",
989  Help( "color_rgba", tr( "function" ), tr( "Returns a string representation of a color based on its red, green, blue, and alpha (transparency) components." ),
991  << HelpVariant( tr( "color_rgba" ), tr( "Returns a string representation of a color based on its red, green, blue, and alpha (transparency) components." ),
993  << HelpArg( tr( "red" ), tr( "red component as an integer value from 0 to 255" ), false, false )
994  << HelpArg( tr( "green" ), tr( "green component as an integer value from 0 to 255" ), false, false )
995  << HelpArg( tr( "blue" ), tr( "blue component as an integer value from 0 to 255" ), false, false )
996  << HelpArg( tr( "alpha" ), tr( "alpha component as an integer value from 0 (completely transparent) to 255 (opaque)." ), false, false ),
997  /* variableLenArguments */ false,
999  << HelpExample( tr( "color_rgba(255,127,0,200)" ), tr( "255,127,0,200" ), tr( "") )
1000  )
1001  )
1002  );
1003 
1004  gFunctionHelpTexts.insert( "combine",
1005  Help( "combine", tr( "function" ), tr( "Returns the combination of two geometries." ),
1007  << HelpVariant( tr( "combine" ), tr( "Returns the combination of two geometries." ),
1008  QList<HelpArg>()
1009  << HelpArg( tr( "geometry1" ), tr( "a geometry" ), false, false )
1010  << HelpArg( tr( "geometry2" ), tr( "a geometry" ), false, false ),
1011  /* variableLenArguments */ false,
1013  << 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( "") )
1014  << 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( "") )
1015  )
1016  )
1017  );
1018 
1019  gFunctionHelpTexts.insert( "concat",
1020  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." ),
1022  << HelpVariant( tr( "concat" ), tr( "Concatenates several strings to one. NULL values are converted to empty strings. Other values (like numbers) are converted to strings." ),
1023  QList<HelpArg>()
1024  << HelpArg( tr( "string1" ), tr( "" ), false, true )
1025  << HelpArg( tr( "string2" ), tr( "" ), false, true )
1026  << HelpArg( tr( "string" ), tr( "a string value" ), true, false ),
1027  /* variableLenArguments */ true,
1029  << HelpExample( tr( "concat('sun', 'set')" ), tr( "'sunset'" ), tr( "") )
1030  << HelpExample( tr( "concat('a','b','c','d','e')" ), tr( "'abcde'" ), tr( "") )
1031  << HelpExample( tr( "concat('Anno ', 1984)" ), tr( "'Anno 1984'" ), tr( "") )
1032  << HelpExample( tr( "concat('The Wall', NULL)" ), tr( "'The Wall'" ), tr( "") )
1033  )
1034  )
1035  );
1036 
1037  gFunctionHelpTexts.insert( "contains",
1038  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." ),
1040  << 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." ),
1041  QList<HelpArg>()
1042  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
1043  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
1044  /* variableLenArguments */ false,
1046  << 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( "") )
1047  << 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( "") )
1048  << 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( "") )
1049  )
1050  )
1051  );
1052 
1053  gFunctionHelpTexts.insert( "convex_hull",
1054  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." ),
1056  << 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." ),
1057  QList<HelpArg>()
1058  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false ),
1059  /* variableLenArguments */ false,
1061  << 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( "") )
1062  << 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( "") )
1063  )
1064  )
1065  );
1066 
1067  gFunctionHelpTexts.insert( "cos",
1068  Help( "cos", tr( "function" ), tr( "Returns cosine of an angle." ),
1070  << HelpVariant( tr( "cos" ), tr( "Returns cosine of an angle." ),
1071  QList<HelpArg>()
1072  << HelpArg( tr( "angle" ), tr( "angle in radians" ), false, false ),
1073  /* variableLenArguments */ false,
1075  << HelpExample( tr( "cos(1.571)" ), tr( "0.000796326710733263" ), tr( "") )
1076  )
1077  )
1078  );
1079 
1080  gFunctionHelpTexts.insert( "crosses",
1081  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." ),
1083  << 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." ),
1084  QList<HelpArg>()
1085  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
1086  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
1087  /* variableLenArguments */ false,
1089  << 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( "") )
1090  << HelpExample( tr( "crosses( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "false" ), tr( "") )
1091  )
1092  )
1093  );
1094 
1095  gFunctionHelpTexts.insert( "darker",
1096  Help( "darker", tr( "function" ), tr( "Returns a darker (or lighter) color string" ),
1098  << HelpVariant( tr( "darker" ), tr( "Returns a darker (or lighter) color string" ),
1099  QList<HelpArg>()
1100  << HelpArg( tr( "color" ), tr( "a color string" ), false, false )
1101  << 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 ),
1102  /* variableLenArguments */ false,
1104  << HelpExample( tr( "darker('200,10,30',300)" ), tr( "'66,3,10,255'" ), tr( "") )
1105  )
1106  )
1107  );
1108 
1109  gFunctionHelpTexts.insert( "day",
1110  Help( "day", tr( "function" ), tr( "Extract the day from a date, or the number of days from an interval." ),
1112  << HelpVariant( tr( "Date variant" ), tr( "Extract the day from a date or datetime." ),
1113  QList<HelpArg>()
1114  << HelpArg( tr( "date" ), tr( "a date or datetime value" ), false, false ),
1115  /* variableLenArguments */ false,
1117  << HelpExample( tr( "day('2012-05-12')" ), tr( "12" ), tr( "") )
1118  )
1119  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in days of an interval." ),
1120  QList<HelpArg>()
1121  << HelpArg( tr( "interval" ), tr( "interval value to return number of days from" ), false, false ),
1122  /* variableLenArguments */ false,
1124  << HelpExample( tr( "day(tointerval('3 days'))" ), tr( "3" ), tr( "") )
1125  << HelpExample( tr( "day(age('2012-01-01','2010-01-01'))" ), tr( "730" ), tr( "") )
1126  )
1127  )
1128  );
1129 
1130  gFunctionHelpTexts.insert( "day_of_week",
1131  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." ),
1133  << 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." ),
1134  QList<HelpArg>()
1135  << HelpArg( tr( "date" ), tr( "date or datetime value" ), false, false ),
1136  /* variableLenArguments */ false,
1138  << HelpExample( tr( "day_of_week(todate('2015-09-21'))" ), tr( "1" ), tr( "") )
1139  )
1140  )
1141  );
1142 
1143  gFunctionHelpTexts.insert( "degrees",
1144  Help( "degrees", tr( "function" ), tr( "Converts from radians to degrees." ),
1146  << HelpVariant( tr( "degrees" ), tr( "Converts from radians to degrees." ),
1147  QList<HelpArg>()
1148  << HelpArg( tr( "radians" ), tr( "numeric value" ), false, false ),
1149  /* variableLenArguments */ false,
1151  << HelpExample( tr( "degrees(3.14159)" ), tr( "180" ), tr( "") )
1152  << HelpExample( tr( "degrees(1)" ), tr( "57.2958" ), tr( "") )
1153  )
1154  )
1155  );
1156 
1157  gFunctionHelpTexts.insert( "difference",
1158  Help( "difference", tr( "function" ), tr( "Returns a geometry that represents that part of geometry_a that does not intersect with geometry_b." ),
1160  << HelpVariant( tr( "difference" ), tr( "Returns a geometry that represents that part of geometry_a that does not intersect with geometry_b." ),
1161  QList<HelpArg>()
1162  << HelpArg( tr( "geometry_a" ), tr( "a geometry" ), false, false )
1163  << HelpArg( tr( "geometry_b" ), tr( "a geometry" ), false, false ),
1164  /* variableLenArguments */ false,
1166  << 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( "") )
1167  )
1168  )
1169  );
1170 
1171  gFunctionHelpTexts.insert( "disjoint",
1172  Help( "disjoint", tr( "function" ), tr( "Tests whether geometries do not spatially intersect. Returns true if the geometries do not share any space together." ),
1174  << HelpVariant( tr( "disjoint" ), tr( "Tests whether geometries do not spatially intersect. Returns true if the geometries do not share any space together." ),
1175  QList<HelpArg>()
1176  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
1177  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
1178  /* variableLenArguments */ false,
1180  << 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( "") )
1181  << HelpExample( tr( "disjoint( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'POINT(4 4)' ))" ), tr( "false" ), tr( "") )
1182  )
1183  )
1184  );
1185 
1186  gFunctionHelpTexts.insert( "distance",
1187  Help( "distance", tr( "function" ), tr( "Returns the minimum distance (based on spatial ref) between two geometries in projected units." ),
1189  << HelpVariant( tr( "distance" ), tr( "Returns the minimum distance (based on spatial ref) between two geometries in projected units." ),
1190  QList<HelpArg>()
1191  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
1192  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
1193  /* variableLenArguments */ false,
1195  << HelpExample( tr( "distance( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(4 8)' ) )" ), tr( "4" ), tr( "") )
1196  )
1197  )
1198  );
1199 
1200  gFunctionHelpTexts.insert( "end_point",
1201  Help( "end_point", tr( "function" ), tr( "Returns the last node from a geometry." ),
1203  << HelpVariant( tr( "end_point" ), tr( "Returns the last node from a geometry." ),
1204  QList<HelpArg>()
1205  << HelpArg( tr( "geometry" ), tr( "geometry object" ), false, false ),
1206  /* variableLenArguments */ false,
1208  << HelpExample( tr( "geom_to_wkt(end_point(geom_from_wkt('LINESTRING(4 0, 4 2, 0 2)')))" ), tr( "'Point (0 2)'" ), tr( "") )
1209  )
1210  )
1211  );
1212 
1213  gFunctionHelpTexts.insert( "eval",
1214  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." ),
1216  << HelpVariant( tr( "eval" ), tr( "Evaluates an expression which is passed in a string. Useful to expand dynamic parameters passed as context variables or fields." ),
1217  QList<HelpArg>()
1218  << HelpArg( tr( "expression" ), tr( "an expression string" ), false, false ),
1219  /* variableLenArguments */ false,
1221  << HelpExample( tr( "eval('\'nice\'')" ), tr( "'nice'" ), tr( "") )
1222  << HelpExample( tr( "eval(@expression_var)" ), tr( "[whatever the result of evaluating @expression_var might be...]" ), tr( "") )
1223  )
1224  )
1225  );
1226 
1227  gFunctionHelpTexts.insert( "exp",
1228  Help( "exp", tr( "function" ), tr( "Returns exponential of an value." ),
1230  << HelpVariant( tr( "exp" ), tr( "Returns exponential of an value." ),
1231  QList<HelpArg>()
1232  << HelpArg( tr( "value" ), tr( "number to return exponent of" ), false, false ),
1233  /* variableLenArguments */ false,
1235  << HelpExample( tr( "exp(1.0)" ), tr( "2.71828182845905" ), tr( "") )
1236  )
1237  )
1238  );
1239 
1240  gFunctionHelpTexts.insert( "exterior_ring",
1241  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." ),
1243  << 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." ),
1244  QList<HelpArg>()
1245  << HelpArg( tr( "geom" ), tr( "a polygon geometry" ), false, false ),
1246  /* variableLenArguments */ false,
1248  << 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( "") )
1249  )
1250  )
1251  );
1252 
1253  gFunctionHelpTexts.insert( "extrude",
1254  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." ),
1256  << 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." ),
1257  QList<HelpArg>()
1258  << HelpArg( tr( "geom" ), tr( "a polygon geometry" ), false, false )
1259  << HelpArg( tr( "x" ), tr( "x extension, numeric value" ), false, false )
1260  << HelpArg( tr( "y" ), tr( "y extension, numeric value" ), false, false ),
1261  /* variableLenArguments */ false,
1263  << 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( "") )
1264  << 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( "") )
1265  )
1266  )
1267  );
1268 
1269  gFunctionHelpTexts.insert( "floor",
1270  Help( "floor", tr( "function" ), tr( "Rounds a number downwards." ),
1272  << HelpVariant( tr( "floor" ), tr( "Rounds a number downwards." ),
1273  QList<HelpArg>()
1274  << HelpArg( tr( "value" ), tr( "a number" ), false, false ),
1275  /* variableLenArguments */ false,
1277  << HelpExample( tr( "floor(4.9)" ), tr( "4" ), tr( "") )
1278  << HelpExample( tr( "floor(-4.9)" ), tr( "-5" ), tr( "") )
1279  )
1280  )
1281  );
1282 
1283  gFunctionHelpTexts.insert( "format",
1284  Help( "format", tr( "function" ), tr( "Format a string using supplied arguments." ),
1286  << HelpVariant( tr( "format" ), tr( "Format a string using supplied arguments." ),
1287  QList<HelpArg>()
1288  << HelpArg( tr( "string" ), tr( "A string with place holders for the arguments. Use %1, %2, etc for placeholders. Placeholders can be repeated." ), false, false )
1289  << HelpArg( tr( "arg1" ), tr( "" ), false, true )
1290  << HelpArg( tr( "arg2" ), tr( "" ), false, true )
1291  << HelpArg( tr( "arg" ), tr( "any type. Any number of arguments." ), true, false ),
1292  /* variableLenArguments */ true,
1294  << HelpExample( tr( "format('This %1 a %2','is', 'test')" ), tr( "'This is a test''" ), tr( "") )
1295  )
1296  )
1297  );
1298 
1299  gFunctionHelpTexts.insert( "format_date",
1300  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>." ),
1302  << 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>." ),
1303  QList<HelpArg>()
1304  << HelpArg( tr( "datetime" ), tr( "date, time or datetime value" ), false, false )
1305  << 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 ),
1306  /* variableLenArguments */ false,
1308  << HelpExample( tr( "format_date('2012-05-15','dd.MM.yyyy')" ), tr( "'15.05.2012'" ), tr( "") )
1309  )
1310  )
1311  );
1312 
1313  gFunctionHelpTexts.insert( "format_number",
1314  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." ),
1316  << 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." ),
1317  QList<HelpArg>()
1318  << HelpArg( tr( "number" ), tr( "number to be formatted" ), false, false )
1319  << HelpArg( tr( "places" ), tr( "integer representing the number of decimal places to truncate the string to." ), false, false ),
1320  /* variableLenArguments */ false,
1322  << HelpExample( tr( "format_number(10000000.332,2)" ), tr( "'10,000,000.33'" ), tr( "") )
1323  )
1324  )
1325  );
1326 
1327  gFunctionHelpTexts.insert( "geom_from_gml",
1328  Help( "geom_from_gml", tr( "function" ), tr( "Returns a geometry from a GML representation of geometry." ),
1330  << HelpVariant( tr( "geom_from_gml" ), tr( "Returns a geometry from a GML representation of geometry." ),
1331  QList<HelpArg>()
1332  << HelpArg( tr( "gml" ), tr( "GML representation of a geometry as a string" ), false, false ),
1333  /* variableLenArguments */ false,
1335  << 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( "") )
1336  )
1337  )
1338  );
1339 
1340  gFunctionHelpTexts.insert( "geom_from_wkt",
1341  Help( "geom_from_wkt", tr( "function" ), tr( "Returns a geometry created from a Well-Known Text (WKT) representation." ),
1343  << HelpVariant( tr( "geom_from_wkt" ), tr( "Returns a geometry created from a Well-Known Text (WKT) representation." ),
1344  QList<HelpArg>()
1345  << HelpArg( tr( "text" ), tr( "Well-Known Text (WKT) representation of a geometry" ), false, false ),
1346  /* variableLenArguments */ false,
1348  << HelpExample( tr( "geom_from_wkt( 'POINT(4 5)' )" ), tr( "a geometry object" ), tr( "") )
1349  )
1350  )
1351  );
1352 
1353  gFunctionHelpTexts.insert( "geom_to_wkt",
1354  Help( "geom_to_wkt", tr( "function" ), tr( "Returns the Well-Known Text (WKT) representation of the geometry without SRID metadata." ),
1356  << HelpVariant( tr( "geom_to_wkt" ), tr( "Returns the Well-Known Text (WKT) representation of the geometry without SRID metadata." ),
1357  QList<HelpArg>()
1358  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false ),
1359  /* variableLenArguments */ false,
1361  << HelpExample( tr( "geom_to_wkt( $geometry )" ), tr( "POINT(6 50)" ), tr( "") )
1362  )
1363  )
1364  );
1365 
1366  gFunctionHelpTexts.insert( "geometry",
1367  Help( "geometry", tr( "function" ), tr( "Returns a feature's geometry." ),
1369  << HelpVariant( tr( "geometry" ), tr( "Returns a feature's geometry." ),
1370  QList<HelpArg>()
1371  << HelpArg( tr( "feature" ), tr( "a feature object" ), false, false ),
1372  /* variableLenArguments */ false,
1374  << HelpExample( tr( "geom_to_wkt( geometry( get_feature( layer, attributeField, value ) ) )" ), tr( "'POINT(6 50)'" ), tr( "") )
1375  << HelpExample( tr( "intersects( $geometry, geometry( get_feature( layer, attributeField, value ) ) )" ), tr( "true" ), tr( "") )
1376  )
1377  )
1378  );
1379 
1380  gFunctionHelpTexts.insert( "geometry_n",
1381  Help( "geometry_n", tr( "function" ), tr( "Returns a specific geometry from a geometry collection, or null if the input geometry is not a collection." ),
1383  << HelpVariant( tr( "geometry_n" ), tr( "Returns a specific geometry from a geometry collection, or null if the input geometry is not a collection." ),
1384  QList<HelpArg>()
1385  << HelpArg( tr( "geometry" ), tr( "geometry collection" ), false, false )
1386  << HelpArg( tr( "index" ), tr( "index of geometry to return, where 1 is the first geometry in the collection" ), false, false ),
1387  /* variableLenArguments */ false,
1389  << 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( "") )
1390  )
1391  )
1392  );
1393 
1394  gFunctionHelpTexts.insert( "get_feature",
1395  Help( "get_feature", tr( "function" ), tr( "Returns the first feature of a layer matching a given attribute value." ),
1397  << HelpVariant( tr( "get_feature" ), tr( "Returns the first feature of a layer matching a given attribute value." ),
1398  QList<HelpArg>()
1399  << HelpArg( tr( "layer" ), tr( "layer name or ID" ), false, false )
1400  << HelpArg( tr( "attribute" ), tr( "attribute name" ), false, false )
1401  << HelpArg( tr( "value" ), tr( "attribute value to match" ), false, false ),
1402  /* variableLenArguments */ false,
1404  << HelpExample( tr( "get_feature('streets','name','main st')" ), tr( "first feature found in \"streets\" layer with \"main st\" value in the \"name\" field" ), tr( "") )
1405  )
1406  )
1407  );
1408 
1409  gFunctionHelpTexts.insert( "hamming_distance",
1410  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." ),
1412  << 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." ),
1413  QList<HelpArg>()
1414  << HelpArg( tr( "string1" ), tr( "a string" ), false, false )
1415  << HelpArg( tr( "string2" ), tr( "a string" ), false, false ),
1416  /* variableLenArguments */ false,
1418  << HelpExample( tr( "hamming_distance('abc','xec')" ), tr( "2" ), tr( "") )
1419  << HelpExample( tr( "hamming_distance('abc','ABc')" ), tr( "2" ), tr( "") )
1420  << HelpExample( tr( "hamming_distance(upper('abc'),upper('ABC'))" ), tr( "0" ), tr( "") )
1421  )
1422  )
1423  );
1424 
1425  gFunctionHelpTexts.insert( "hour",
1426  Help( "hour", tr( "function" ), tr( "Extract the hour part from a datetime or time, or the number of hours from an interval." ),
1428  << HelpVariant( tr( "Time variant" ), tr( "Extract the hour part from a time or datetime." ),
1429  QList<HelpArg>()
1430  << HelpArg( tr( "datetime" ), tr( "a time or datetime value" ), false, false ),
1431  /* variableLenArguments */ false,
1433  << HelpExample( tr( "hour('2012-07-22T13:24:57')" ), tr( "13" ), tr( "") )
1434  )
1435  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in hours of an interval." ),
1436  QList<HelpArg>()
1437  << HelpArg( tr( "interval" ), tr( "interval value to return number of hours from" ), false, false ),
1438  /* variableLenArguments */ false,
1440  << HelpExample( tr( "hour(tointerval('3 hours'))" ), tr( "3" ), tr( "") )
1441  << HelpExample( tr( "hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00'))" ), tr( "3" ), tr( "") )
1442  << HelpExample( tr( "hour(age('2012-01-01','2010-01-01'))" ), tr( "17520" ), tr( "") )
1443  )
1444  )
1445  );
1446 
1447  gFunctionHelpTexts.insert( "if",
1448  Help( "if", tr( "function" ), tr( "Tests a condition and returns a different result depending on the conditional check." ),
1450  << HelpVariant( tr( "if" ), tr( "Tests a condition and returns a different result depending on the conditional check." ),
1451  QList<HelpArg>()
1452  << HelpArg( tr( "condition" ), tr( "the condition which should be checked" ), false, false )
1453  << HelpArg( tr( "result_when_true" ), tr( "the result which will be returned when the condition is True" ), false, false )
1454  << HelpArg( tr( "result_when_false" ), tr( "the result which will be returned when the condition is False" ), false, false ),
1455  /* variableLenArguments */ false,
1457  << HelpExample( tr( "if( 1, 'One', 'Not One' )" ), tr( "'One'" ), tr( "") )
1458  << HelpExample( tr( "if( 8, 'One', 'Not One' )" ), tr( "'Not One'" ), tr( "") )
1459  )
1460  )
1461  );
1462 
1463  gFunctionHelpTexts.insert( "interior_ring_n",
1464  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." ),
1466  << HelpVariant( tr( "interior_ring_n" ), tr( "Returns a specific interior ring from a polygon geometry, or null if the geometry is not a polygon." ),
1467  QList<HelpArg>()
1468  << HelpArg( tr( "geometry" ), tr( "polygon geometry" ), false, false )
1469  << HelpArg( tr( "index" ), tr( "index of interior to return, where 1 is the first interior ring" ), false, false ),
1470  /* variableLenArguments */ false,
1472  << 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( "") )
1473  )
1474  )
1475  );
1476 
1477  gFunctionHelpTexts.insert( "intersection",
1478  Help( "intersection", tr( "function" ), tr( "Returns a geometry that represents the shared portion of two geometries." ),
1480  << HelpVariant( tr( "intersection" ), tr( "Returns a geometry that represents the shared portion of two geometries." ),
1481  QList<HelpArg>()
1482  << HelpArg( tr( "geometry1" ), tr( "a geometry" ), false, false )
1483  << HelpArg( tr( "geometry2" ), tr( "a geometry" ), false, false ),
1484  /* variableLenArguments */ false,
1486  << 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( "") )
1487  )
1488  )
1489  );
1490 
1491  gFunctionHelpTexts.insert( "intersects",
1492  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." ),
1494  << 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." ),
1495  QList<HelpArg>()
1496  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
1497  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
1498  /* variableLenArguments */ false,
1500  << HelpExample( tr( "intersects( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "true" ), tr( "") )
1501  << HelpExample( tr( "intersects( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'POINT(5 5)' ) )" ), tr( "false" ), tr( "") )
1502  )
1503  )
1504  );
1505 
1506  gFunctionHelpTexts.insert( "intersects_bbox",
1507  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." ),
1509  << 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." ),
1510  QList<HelpArg>()
1511  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false )
1512  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false ),
1513  /* variableLenArguments */ false,
1515  << HelpExample( tr( "intersects_bbox( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "true" ), tr( "") )
1516  << 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( "") )
1517  )
1518  )
1519  );
1520 
1521  gFunctionHelpTexts.insert( "is_closed",
1522  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." ),
1524  << 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." ),
1525  QList<HelpArg>()
1526  << HelpArg( tr( "geom" ), tr( "a line string geometry" ), false, false ),
1527  /* variableLenArguments */ false,
1529  << HelpExample( tr( "is_closed(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)'))" ), tr( "false" ), tr( "") )
1530  << HelpExample( tr( "is_closed(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2, 0 0)'))" ), tr( "true" ), tr( "") )
1531  )
1532  )
1533  );
1534 
1535  gFunctionHelpTexts.insert( "layer_property",
1536  Help( "layer_property", tr( "function" ), tr( "Returns a matching layer property or metadata value." ),
1538  << HelpVariant( tr( "layer_property" ), tr( "Returns a matching layer property or metadata value." ),
1539  QList<HelpArg>()
1540  << HelpArg( tr( "layer" ), tr( "a string, representing either a layer name or layer ID" ), false, false )
1541  << 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 ),
1542  /* variableLenArguments */ false,
1544  << HelpExample( tr( "layer_property('streets','title')" ), tr( "'Basemap Streets'" ), tr( "") )
1545  << HelpExample( tr( "layer_property('airports','feature_count')" ), tr( "120" ), tr( "") )
1546  << HelpExample( tr( "layer_property('landsat','crs')" ), tr( "'EPSG:4326'" ), tr( "") )
1547  )
1548  )
1549  );
1550 
1551  gFunctionHelpTexts.insert( "left",
1552  Help( "left", tr( "function" ), tr( "Returns a substring that contains the <i>n</i> leftmost characters of the string." ),
1554  << HelpVariant( tr( "left" ), tr( "Returns a substring that contains the <i>n</i> leftmost characters of the string." ),
1555  QList<HelpArg>()
1556  << HelpArg( tr( "string" ), tr( "a string" ), false, false )
1557  << HelpArg( tr( "length" ), tr( "integer. The number of characters from the left of the string to return." ), false, false ),
1558  /* variableLenArguments */ false,
1560  << HelpExample( tr( "left('Hello World',5)" ), tr( "'Hello'" ), tr( "") )
1561  )
1562  )
1563  );
1564 
1565  gFunctionHelpTexts.insert( "length",
1566  Help( "length", tr( "function" ), tr( "Returns the number of characters in a string or the length of a geometry linestring." ),
1568  << HelpVariant( tr( "String variant" ), tr( "Returns the number of characters in a string." ),
1569  QList<HelpArg>()
1570  << HelpArg( tr( "string" ), tr( "string to count length of" ), false, false ),
1571  /* variableLenArguments */ false,
1573  << HelpExample( tr( "length('hello')" ), tr( "5" ), tr( "") )
1574  )
1575  << 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." ),
1576  QList<HelpArg>()
1577  << HelpArg( tr( "geometry" ), tr( "line geometry object" ), false, false ),
1578  /* variableLenArguments */ false,
1580  << HelpExample( tr( "length(geom_from_wkt('LINESTRING(0 0, 4 0)'))" ), tr( "4.0" ), tr( "") )
1581  )
1582  )
1583  );
1584 
1585  gFunctionHelpTexts.insert( "levenshtein",
1586  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." ),
1588  << 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." ),
1589  QList<HelpArg>()
1590  << HelpArg( tr( "string1" ), tr( "a string" ), false, false )
1591  << HelpArg( tr( "string2" ), tr( "a string" ), false, false ),
1592  /* variableLenArguments */ false,
1594  << HelpExample( tr( "levenshtein('kittens','mitten')" ), tr( "2" ), tr( "") )
1595  << HelpExample( tr( "levenshtein('Kitten','kitten')" ), tr( "1" ), tr( "") )
1596  << HelpExample( tr( "levenshtein(upper('Kitten'),upper('kitten'))" ), tr( "0" ), tr( "") )
1597  )
1598  )
1599  );
1600 
1601  gFunctionHelpTexts.insert( "lighter",
1602  Help( "lighter", tr( "function" ), tr( "Returns a lighter (or darker) color string" ),
1604  << HelpVariant( tr( "lighter" ), tr( "Returns a lighter (or darker) color string" ),
1605  QList<HelpArg>()
1606  << HelpArg( tr( "color" ), tr( "a color string" ), false, false )
1607  << 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 ),
1608  /* variableLenArguments */ false,
1610  << HelpExample( tr( "lighter('200,10,30',200)" ), tr( "'255,158,168,255'" ), tr( "") )
1611  )
1612  )
1613  );
1614 
1615  gFunctionHelpTexts.insert( "ln",
1616  Help( "ln", tr( "function" ), tr( "Returns the natural logarithm of a value." ),
1618  << HelpVariant( tr( "ln" ), tr( "Returns the natural logarithm of a value." ),
1619  QList<HelpArg>()
1620  << HelpArg( tr( "value" ), tr( "numeric value" ), false, false ),
1621  /* variableLenArguments */ false,
1623  << HelpExample( tr( "ln(1)" ), tr( "0" ), tr( "") )
1624  << HelpExample( tr( "ln(2.7182818284590452354)" ), tr( "1" ), tr( "") )
1625  )
1626  )
1627  );
1628 
1629  gFunctionHelpTexts.insert( "log",
1630  Help( "log", tr( "function" ), tr( "Returns the value of the logarithm of the passed value and base." ),
1632  << HelpVariant( tr( "log" ), tr( "Returns the value of the logarithm of the passed value and base." ),
1633  QList<HelpArg>()
1634  << HelpArg( tr( "base" ), tr( "any positive number" ), false, false )
1635  << HelpArg( tr( "value" ), tr( "any positive number" ), false, false ),
1636  /* variableLenArguments */ false,
1638  << HelpExample( tr( "log(2, 32)" ), tr( "5" ), tr( "") )
1639  << HelpExample( tr( "log(0.5, 32)" ), tr( "-5" ), tr( "") )
1640  )
1641  )
1642  );
1643 
1644  gFunctionHelpTexts.insert( "log10",
1645  Help( "log10", tr( "function" ), tr( "Returns the value of the base 10 logarithm of the passed expression." ),
1647  << HelpVariant( tr( "log10" ), tr( "Returns the value of the base 10 logarithm of the passed expression." ),
1648  QList<HelpArg>()
1649  << HelpArg( tr( "value" ), tr( "any positive number" ), false, false ),
1650  /* variableLenArguments */ false,
1652  << HelpExample( tr( "log10(1)" ), tr( "0" ), tr( "") )
1653  << HelpExample( tr( "log10(100)" ), tr( "2" ), tr( "") )
1654  )
1655  )
1656  );
1657 
1658  gFunctionHelpTexts.insert( "longest_common_substring",
1659  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." ),
1661  << 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." ),
1662  QList<HelpArg>()
1663  << HelpArg( tr( "string1" ), tr( "a string" ), false, false )
1664  << HelpArg( tr( "string2" ), tr( "a string" ), false, false ),
1665  /* variableLenArguments */ false,
1667  << HelpExample( tr( "longest_common_substring('ABABC','BABCA')" ), tr( "'ABC'" ), tr( "") )
1668  << HelpExample( tr( "longest_common_substring('abcDeF','abcdef')" ), tr( "'abc'" ), tr( "") )
1669  << HelpExample( tr( "longest_common_substring(upper('abcDeF'),upper('abcdex'))" ), tr( "'ABCDE'" ), tr( "") )
1670  )
1671  )
1672  );
1673 
1674  gFunctionHelpTexts.insert( "lower",
1675  Help( "lower", tr( "function" ), tr( "Converts a string to lower case letters." ),
1677  << HelpVariant( tr( "lower" ), tr( "Converts a string to lower case letters." ),
1678  QList<HelpArg>()
1679  << HelpArg( tr( "string" ), tr( "the string to convert to lower case" ), false, false ),
1680  /* variableLenArguments */ false,
1682  << HelpExample( tr( "lower('HELLO World')" ), tr( "'hello world'" ), tr( "") )
1683  )
1684  )
1685  );
1686 
1687  gFunctionHelpTexts.insert( "lpad",
1688  Help( "lpad", tr( "function" ), tr( "Returns a string padded to supplied width using a fill character." ),
1690  << HelpVariant( tr( "lpad" ), tr( "Returns a string padded to supplied width using a fill character." ),
1691  QList<HelpArg>()
1692  << HelpArg( tr( "string" ), tr( "string to pad" ), false, false )
1693  << HelpArg( tr( "width" ), tr( "length of new string" ), false, false )
1694  << HelpArg( tr( "fill" ), tr( "character to pad the remaining space with" ), false, false ),
1695  /* variableLenArguments */ false,
1697  << HelpExample( tr( "lpad('Hello', 10, 'x')" ), tr( "'xxxxxHello'" ), tr( "") )
1698  )
1699  )
1700  );
1701 
1702  gFunctionHelpTexts.insert( "m",
1703  Help( "m", tr( "function" ), tr( "Returns the m value of a point geometry." ),
1705  << HelpVariant( tr( "m" ), tr( "Returns the m value of a point geometry." ),
1706  QList<HelpArg>()
1707  << HelpArg( tr( "geom" ), tr( "a point geometry" ), false, false ),
1708  /* variableLenArguments */ false,
1710  << HelpExample( tr( "m( geom_from_wkt( 'POINTM(2 5 4)' ) )" ), tr( "4" ), tr( "") )
1711  )
1712  )
1713  );
1714 
1715  gFunctionHelpTexts.insert( "make_line",
1716  Help( "make_line", tr( "function" ), tr( "Creates a line geometry from a series of point geometries." ),
1718  << HelpVariant( tr( "make_line" ), tr( "Creates a line geometry from a series of point geometries." ),
1719  QList<HelpArg>()
1720  << HelpArg( tr( "point1" ), tr( "" ), false, true )
1721  << HelpArg( tr( "point2" ), tr( "" ), false, true )
1722  << HelpArg( tr( "point" ), tr( "a point geometry" ), true, false ),
1723  /* variableLenArguments */ true,
1725  << HelpExample( tr( "geom_to_wkt(make_line(make_point(2,4),make_point(3,5)))" ), tr( "'LineString (2 4, 3 5)'" ), tr( "") )
1726  << 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( "") )
1727  )
1728  )
1729  );
1730 
1731  gFunctionHelpTexts.insert( "make_point",
1732  Help( "make_point", tr( "function" ), tr( "Creates a point geometry from an x and y (and optional z and m) value." ),
1734  << HelpVariant( tr( "make_point" ), tr( "Creates a point geometry from an x and y (and optional z and m) value." ),
1735  QList<HelpArg>()
1736  << HelpArg( tr( "x" ), tr( "x coordinate of point" ), false, false )
1737  << HelpArg( tr( "y" ), tr( "y coordinate of point" ), false, false )
1738  << HelpArg( tr( "z" ), tr( "optional z coordinate of point" ), false, false )
1739  << HelpArg( tr( "m" ), tr( "optional m value of point" ), false, false ),
1740  /* variableLenArguments */ false,
1742  << HelpExample( tr( "geom_to_wkt(make_point(2,4))" ), tr( "'Point (2 4)'" ), tr( "") )
1743  << HelpExample( tr( "geom_to_wkt(make_point(2,4,6))" ), tr( "'PointZ (2 4 6)'" ), tr( "") )
1744  << HelpExample( tr( "geom_to_wkt(make_point(2,4,6,8))" ), tr( "'PointZM (2 4 6 8)'" ), tr( "") )
1745  )
1746  )
1747  );
1748 
1749  gFunctionHelpTexts.insert( "make_point_m",
1750  Help( "make_point_m", tr( "function" ), tr( "Creates a point geometry from an x, y coordinate and m value." ),
1752  << HelpVariant( tr( "make_point_m" ), tr( "Creates a point geometry from an x, y coordinate and m value." ),
1753  QList<HelpArg>()
1754  << HelpArg( tr( "x" ), tr( "x coordinate of point" ), false, false )
1755  << HelpArg( tr( "y" ), tr( "y coordinate of point" ), false, false )
1756  << HelpArg( tr( "m" ), tr( "m value of point" ), false, false ),
1757  /* variableLenArguments */ false,
1759  << HelpExample( tr( "geom_to_wkt(make_point_m(2,4,6))" ), tr( "'PointM (2 4 6)'" ), tr( "") )
1760  )
1761  )
1762  );
1763 
1764  gFunctionHelpTexts.insert( "make_polygon",
1765  Help( "make_polygon", tr( "function" ), tr( "Creates a polygon geometry from an outer ring and optional series of inner ring geometries." ),
1767  << HelpVariant( tr( "make_polygon" ), tr( "Creates a polygon geometry from an outer ring and optional series of inner ring geometries." ),
1768  QList<HelpArg>()
1769  << HelpArg( tr( "outerRing" ), tr( "closed line geometry for polygon's outer ring" ), false, false )
1770  << HelpArg( tr( "innerRing1" ), tr( "" ), false, true )
1771  << HelpArg( tr( "innerRing2" ), tr( "" ), false, true )
1772  << HelpArg( tr( "innerRing" ), tr( "optional closed line geometry for inner ring" ), true, false ),
1773  /* variableLenArguments */ true,
1775  << 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( "") )
1776  << 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( "") )
1777  )
1778  )
1779  );
1780 
1781  gFunctionHelpTexts.insert( "max",
1782  Help( "max", tr( "function" ), tr( "Returns the largest value in a set of values." ),
1784  << HelpVariant( tr( "max" ), tr( "Returns the largest value in a set of values." ),
1785  QList<HelpArg>()
1786  << HelpArg( tr( "value1" ), tr( "" ), false, true )
1787  << HelpArg( tr( "value2" ), tr( "" ), false, true )
1788  << HelpArg( tr( "value" ), tr( "a number" ), true, false ),
1789  /* variableLenArguments */ true,
1791  << HelpExample( tr( "max(2,10.2,5.5)" ), tr( "10.2" ), tr( "") )
1792  )
1793  )
1794  );
1795 
1796  gFunctionHelpTexts.insert( "min",
1797  Help( "min", tr( "function" ), tr( "Returns the smallest value in a set of values." ),
1799  << HelpVariant( tr( "min" ), tr( "Returns the smallest value in a set of values." ),
1800  QList<HelpArg>()
1801  << HelpArg( tr( "value1" ), tr( "" ), false, true )
1802  << HelpArg( tr( "value2" ), tr( "" ), false, true )
1803  << HelpArg( tr( "value" ), tr( "a number" ), true, false ),
1804  /* variableLenArguments */ true,
1806  << HelpExample( tr( "min(20.5,10,6.2)" ), tr( "6.2" ), tr( "") )
1807  )
1808  )
1809  );
1810 
1811  gFunctionHelpTexts.insert( "minute",
1812  Help( "minute", tr( "function" ), tr( "Extract the minutes part from a datetime or time, or the number of minutes from an interval." ),
1814  << HelpVariant( tr( "Time variant" ), tr( "Extract the minutes part from a time or datetime." ),
1815  QList<HelpArg>()
1816  << HelpArg( tr( "datetime" ), tr( "a time or datetime value" ), false, false ),
1817  /* variableLenArguments */ false,
1819  << HelpExample( tr( "minute('2012-07-22T13:24:57')" ), tr( "24" ), tr( "") )
1820  )
1821  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in minutes of an interval." ),
1822  QList<HelpArg>()
1823  << HelpArg( tr( "interval" ), tr( "interval value to return number of minutes from" ), false, false ),
1824  /* variableLenArguments */ false,
1826  << HelpExample( tr( "minute(tointerval('3 minutes'))" ), tr( "3" ), tr( "") )
1827  << HelpExample( tr( "minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00'))" ), tr( "20" ), tr( "") )
1828  << HelpExample( tr( "minute(age('2012-01-01','2010-01-01'))" ), tr( "1051200" ), tr( "") )
1829  )
1830  )
1831  );
1832 
1833  gFunctionHelpTexts.insert( "month",
1834  Help( "month", tr( "function" ), tr( "Extract the month part from a date, or the number of months from an interval." ),
1836  << HelpVariant( tr( "Date variant" ), tr( "Extract the month part from a date or datetime." ),
1837  QList<HelpArg>()
1838  << HelpArg( tr( "date" ), tr( "a date or datetime value" ), false, false ),
1839  /* variableLenArguments */ false,
1841  << HelpExample( tr( "month('2012-05-12')" ), tr( "05" ), tr( "") )
1842  )
1843  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in months of an interval." ),
1844  QList<HelpArg>()
1845  << HelpArg( tr( "interval" ), tr( "interval value to return number of months from" ), false, false ),
1846  /* variableLenArguments */ false,
1848  << HelpExample( tr( "month(to_interval('3 months'))" ), tr( "3" ), tr( "") )
1849  << HelpExample( tr( "month(age('2012-01-01','2010-01-01'))" ), tr( "4.03333" ), tr( "") )
1850  )
1851  )
1852  );
1853 
1854  gFunctionHelpTexts.insert( "nodes_to_points",
1855  Help( "nodes_to_points", tr( "function" ), tr( "Returns a multipoint geometry consisting of every node in the input geometry." ),
1857  << HelpVariant( tr( "nodes_to_points" ), tr( "Returns a multipoint geometry consisting of every node in the input geometry." ),
1858  QList<HelpArg>()
1859  << HelpArg( tr( "geometry" ), tr( "geometry object" ), false, false )
1860  << 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 ),
1861  /* variableLenArguments */ false,
1863  << 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( "") )
1864  << 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( "") )
1865  )
1866  )
1867  );
1868 
1869  gFunctionHelpTexts.insert( "now",
1870  Help( "now", tr( "function" ), tr( "Returns the current date and time." ),
1872  << HelpVariant( tr( "now" ), tr( "Returns the current date and time." ),
1873  QList<HelpArg>(),
1874  /* variableLenArguments */ false,
1876  << HelpExample( tr( "now()" ), tr( "2012-07-22T13:24:57" ), tr( "") )
1877  )
1878  )
1879  );
1880 
1881  gFunctionHelpTexts.insert( "num_geometries",
1882  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." ),
1884  << HelpVariant( tr( "num_geometries" ), tr( "Returns the number of geometries in a geometry collection, or null if the input geometry is not a collection." ),
1885  QList<HelpArg>()
1886  << HelpArg( tr( "geometry" ), tr( "geometry collection" ), false, false ),
1887  /* variableLenArguments */ false,
1889  << HelpExample( tr( "num_geometries(geom_from_wkt('GEOMETRYCOLLECTION(POINT(0 1), POINT(0 0), POINT(1 0), POINT(1 1))'))'),3))" ), tr( "4" ), tr( "") )
1890  )
1891  )
1892  );
1893 
1894  gFunctionHelpTexts.insert( "num_interior_rings",
1895  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." ),
1897  << 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." ),
1898  QList<HelpArg>()
1899  << HelpArg( tr( "geometry" ), tr( "input geometry" ), false, false ),
1900  /* variableLenArguments */ false,
1902  << 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( "") )
1903  )
1904  )
1905  );
1906 
1907  gFunctionHelpTexts.insert( "num_points",
1908  Help( "num_points", tr( "function" ), tr( "Returns the number of vertices in a geometry." ),
1910  << HelpVariant( tr( "num_points" ), tr( "Returns the number of vertices in a geometry." ),
1911  QList<HelpArg>()
1912  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
1913  /* variableLenArguments */ false,
1915  << HelpExample( tr( "num_points($geometry)" ), tr( "number of vertices in $geometry" ), tr( "") )
1916  )
1917  )
1918  );
1919 
1920  gFunctionHelpTexts.insert( "num_rings",
1921  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." ),
1923  << 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." ),
1924  QList<HelpArg>()
1925  << HelpArg( tr( "geometry" ), tr( "input geometry" ), false, false ),
1926  /* variableLenArguments */ false,
1928  << 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( "") )
1929  )
1930  )
1931  );
1932 
1933  gFunctionHelpTexts.insert( "*",
1934  Help( "*", tr( "operator" ), tr( "Multiplication of two values" ),
1936  << HelpVariant( tr( "*" ), tr( "Multiplication of two values" ),
1937  QList<HelpArg>()
1938  << HelpArg( tr( "a" ), tr( "value" ), false, false )
1939  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
1940  /* variableLenArguments */ false,
1942  << HelpExample( tr( "5 * 4" ), tr( "20" ), tr( "") )
1943  << HelpExample( tr( "5 * NULL" ), tr( "NULL" ), tr( "") )
1944  )
1945  )
1946  );
1947 
1948  gFunctionHelpTexts.insert( "||",
1949  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." ),
1951  << 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." ),
1952  QList<HelpArg>()
1953  << HelpArg( tr( "a" ), tr( "value" ), false, false )
1954  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
1955  /* variableLenArguments */ false,
1957  << HelpExample( tr( "'Here' || ' and ' || 'there'" ), tr( "'Here and there'" ), tr( "") )
1958  << HelpExample( tr( "'Nothing' || NULL" ), tr( "NULL" ), tr( "") )
1959  << HelpExample( tr( "'Dia: ' || \"Diameter\"" ), tr( "'Dia: 25'" ), tr( "") )
1960  << HelpExample( tr( "1 || 2" ), tr( "'12'" ), tr( "") )
1961  )
1962  )
1963  );
1964 
1965  gFunctionHelpTexts.insert( "/",
1966  Help( "/", tr( "operator" ), tr( "Division of two values" ),
1968  << HelpVariant( tr( "/" ), tr( "Division of two values" ),
1969  QList<HelpArg>()
1970  << HelpArg( tr( "a" ), tr( "value" ), false, false )
1971  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
1972  /* variableLenArguments */ false,
1974  << HelpExample( tr( "5 / 4" ), tr( "1.25" ), tr( "") )
1975  << HelpExample( tr( "5 / NULL" ), tr( "NULL" ), tr( "") )
1976  )
1977  )
1978  );
1979 
1980  gFunctionHelpTexts.insert( "=",
1981  Help( "=", tr( "operator" ), tr( "Compares two values and evaluates to 1 if they are equal." ),
1983  << HelpVariant( tr( "=" ), tr( "Compares two values and evaluates to 1 if they are equal." ),
1984  QList<HelpArg>()
1985  << HelpArg( tr( "a" ), tr( "value" ), false, false )
1986  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
1987  /* variableLenArguments */ false,
1989  << HelpExample( tr( "5 = 4" ), tr( "0" ), tr( "") )
1990  << HelpExample( tr( "4 = 4" ), tr( "1" ), tr( "") )
1991  << HelpExample( tr( "5 = NULL" ), tr( "NULL" ), tr( "") )
1992  << HelpExample( tr( "NULL = NULL" ), tr( "NULL" ), tr( "") )
1993  )
1994  )
1995  );
1996 
1997  gFunctionHelpTexts.insert( "^",
1998  Help( "^", tr( "operator" ), tr( "Power of two values." ),
2000  << HelpVariant( tr( "^" ), tr( "Power of two values." ),
2001  QList<HelpArg>()
2002  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2003  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2004  /* variableLenArguments */ false,
2006  << HelpExample( tr( "5 ^ 4" ), tr( "625" ), tr( "") )
2007  << HelpExample( tr( "5 ^ NULL" ), tr( "NULL" ), tr( "") )
2008  )
2009  )
2010  );
2011 
2012  gFunctionHelpTexts.insert( ">=",
2013  Help( ">=", tr( "operator" ), tr( "Compares two values and evaluates to 1 if the left value is greater or equal than the right value." ),
2015  << HelpVariant( tr( ">=" ), tr( "Compares two values and evaluates to 1 if the left value is greater or equal than the right value." ),
2016  QList<HelpArg>()
2017  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2018  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2019  /* variableLenArguments */ false,
2021  << HelpExample( tr( "5 &gt;= 4" ), tr( "1" ), tr( "") )
2022  << HelpExample( tr( "5 &gt;= 5" ), tr( "1" ), tr( "") )
2023  << HelpExample( tr( "4 &gt;= 5" ), tr( "0" ), tr( "") )
2024  )
2025  )
2026  );
2027 
2028  gFunctionHelpTexts.insert( ">",
2029  Help( ">", tr( "operator" ), tr( "Compares two values and evaluates to 1 if the left value is greater than the right value." ),
2031  << HelpVariant( tr( ">" ), tr( "Compares two values and evaluates to 1 if the left value is greater than the right value." ),
2032  QList<HelpArg>()
2033  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2034  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2035  /* variableLenArguments */ false,
2037  << HelpExample( tr( "5 &gt; 4" ), tr( "1" ), tr( "") )
2038  << HelpExample( tr( "5 &gt; 5" ), tr( "0" ), tr( "") )
2039  << HelpExample( tr( "4 &gt; 5" ), tr( "0" ), tr( "") )
2040  )
2041  )
2042  );
2043 
2044  gFunctionHelpTexts.insert( "<=",
2045  Help( "<=", tr( "operator" ), tr( "Compares two values and evaluates to 1 if the left value is less or equal than the right value." ),
2047  << HelpVariant( tr( "<=" ), tr( "Compares two values and evaluates to 1 if the left value is less or equal than the right value." ),
2048  QList<HelpArg>()
2049  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2050  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2051  /* variableLenArguments */ false,
2053  << HelpExample( tr( "5 &lt;= 4" ), tr( "0" ), tr( "") )
2054  << HelpExample( tr( "5 &lt;= 5" ), tr( "1" ), tr( "") )
2055  << HelpExample( tr( "4 &lt;= 5" ), tr( "1" ), tr( "") )
2056  )
2057  )
2058  );
2059 
2060  gFunctionHelpTexts.insert( "<",
2061  Help( "<", tr( "operator" ), tr( "Compares two values and evaluates to 1 if the left value is less than the right value." ),
2063  << HelpVariant( tr( "<" ), tr( "Compares two values and evaluates to 1 if the left value is less than the right value." ),
2064  QList<HelpArg>()
2065  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2066  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2067  /* variableLenArguments */ false,
2069  << HelpExample( tr( "5 &lt; 4" ), tr( "0" ), tr( "") )
2070  << HelpExample( tr( "5 &lt; 5" ), tr( "0" ), tr( "") )
2071  << HelpExample( tr( "4 &lt; 5" ), tr( "1" ), tr( "") )
2072  )
2073  )
2074  );
2075 
2076  gFunctionHelpTexts.insert( "-",
2077  Help( "-", tr( "operator" ), tr( "Subtraction of two values. If one of the values is NULL the result will be NULL." ),
2079  << HelpVariant( tr( "-" ), tr( "Subtraction of two values. If one of the values is NULL the result will be NULL." ),
2080  QList<HelpArg>()
2081  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2082  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2083  /* variableLenArguments */ false,
2085  << HelpExample( tr( "5 - 4" ), tr( "1" ), tr( "") )
2086  << HelpExample( tr( "5 - NULL" ), tr( "NULL" ), tr( "") )
2087  )
2088  )
2089  );
2090 
2091  gFunctionHelpTexts.insert( "%",
2092  Help( "%", tr( "operator" ), tr( "Remainder of division" ),
2094  << HelpVariant( tr( "%" ), tr( "Remainder of division" ),
2095  QList<HelpArg>()
2096  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2097  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2098  /* variableLenArguments */ false,
2100  << HelpExample( tr( "5 % 4" ), tr( "1" ), tr( "") )
2101  << HelpExample( tr( "5 % NULL" ), tr( "NULL" ), tr( "") )
2102  )
2103  )
2104  );
2105 
2106  gFunctionHelpTexts.insert( "<>",
2107  Help( "<>", tr( "operator" ), tr( "Compares two values and evaluates to 1 if they are not equal." ),
2109  << HelpVariant( tr( "<>" ), tr( "Compares two values and evaluates to 1 if they are not equal." ),
2110  QList<HelpArg>()
2111  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2112  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2113  /* variableLenArguments */ false,
2115  << HelpExample( tr( "5 &lt;&gt; 4" ), tr( "1" ), tr( "") )
2116  << HelpExample( tr( "4 &lt;&gt; 4" ), tr( "0" ), tr( "") )
2117  << HelpExample( tr( "5 &lt;&gt; NULL" ), tr( "NULL" ), tr( "") )
2118  << HelpExample( tr( "NULL &lt;&gt; NULL" ), tr( "NULL" ), tr( "") )
2119  )
2120  )
2121  );
2122 
2123  gFunctionHelpTexts.insert( "+",
2124  Help( "+", tr( "operator" ), tr( "Addition of two values. If one of the values is NULL the result will be NULL." ),
2126  << HelpVariant( tr( "+" ), tr( "Addition of two values. If one of the values is NULL the result will be NULL." ),
2127  QList<HelpArg>()
2128  << HelpArg( tr( "a" ), tr( "value" ), false, false )
2129  << HelpArg( tr( "b" ), tr( "value" ), false, false ),
2130  /* variableLenArguments */ false,
2132  << HelpExample( tr( "5 + 4" ), tr( "9" ), tr( "") )
2133  << HelpExample( tr( "5 + NULL" ), tr( "NULL" ), tr( "") )
2134  )
2135  )
2136  );
2137 
2138  gFunctionHelpTexts.insert( "order_parts",
2139  Help( "order_parts", tr( "function" ), tr( "Orders the parts of a MultiGeometry by a given criteria" ),
2141  << HelpVariant( tr( "order_parts" ), tr( "Orders the parts of a MultiGeometry by a given criteria" ),
2142  QList<HelpArg>()
2143  << HelpArg( tr( "geom" ), tr( "a multi-type geometry" ), false, false )
2144  << HelpArg( tr( "orderby" ), tr( "an expression string defining the order criteria" ), false, false )
2145  << HelpArg( tr( "ascending" ), tr( "boolean, True for ascending, False for descending" ), false, false ),
2146  /* variableLenArguments */ false,
2148  << 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( "") )
2149  << 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( "") )
2150  )
2151  )
2152  );
2153 
2154  gFunctionHelpTexts.insert( "overlaps",
2155  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." ),
2157  << 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." ),
2158  QList<HelpArg>()
2159  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
2160  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
2161  /* variableLenArguments */ false,
2163  << 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( "") )
2164  << HelpExample( tr( "overlaps( geom_from_wkt( 'LINESTRING(0 0, 1 1)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "false" ), tr( "") )
2165  )
2166  )
2167  );
2168 
2169  gFunctionHelpTexts.insert( "perimeter",
2170  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." ),
2172  << 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." ),
2173  QList<HelpArg>()
2174  << HelpArg( tr( "geometry" ), tr( "polygon geometry object" ), false, false ),
2175  /* variableLenArguments */ false,
2177  << HelpExample( tr( "perimeter(geom_from_wkt('POLYGON((0 0, 4 0, 4 2, 0 2, 0 0))'))" ), tr( "12.0" ), tr( "") )
2178  )
2179  )
2180  );
2181 
2182  gFunctionHelpTexts.insert( "pi",
2183  Help( "pi", tr( "function" ), tr( "Returns value of pi for calculations." ),
2185  << HelpVariant( tr( "pi" ), tr( "Returns value of pi for calculations." ),
2186  QList<HelpArg>(),
2187  /* variableLenArguments */ false,
2189  << HelpExample( tr( "pi()" ), tr( "3.14159265358979" ), tr( "") )
2190  )
2191  )
2192  );
2193 
2194  gFunctionHelpTexts.insert( "point_n",
2195  Help( "point_n", tr( "function" ), tr( "Returns a specific node from a geometry." ),
2197  << HelpVariant( tr( "point_n" ), tr( "Returns a specific node from a geometry." ),
2198  QList<HelpArg>()
2199  << HelpArg( tr( "geometry" ), tr( "geometry object" ), false, false )
2200  << HelpArg( tr( "index" ), tr( "index of node to return, where 1 is the first node" ), false, false ),
2201  /* variableLenArguments */ false,
2203  << 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( "") )
2204  )
2205  )
2206  );
2207 
2208  gFunctionHelpTexts.insert( "point_on_surface",
2209  Help( "point_on_surface", tr( "function" ), tr( "Returns a point guaranteed to lie on the surface of a geometry." ),
2211  << HelpVariant( tr( "point_on_surface" ), tr( "Returns a point guaranteed to lie on the surface of a geometry." ),
2212  QList<HelpArg>()
2213  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2214  /* variableLenArguments */ false,
2216  << HelpExample( tr( "point_on_surface($geometry)" ), tr( "a point geometry" ), tr( "") )
2217  )
2218  )
2219  );
2220 
2221  gFunctionHelpTexts.insert( "project_color",
2222  Help( "project_color", tr( "function" ), tr( "Returns a color from the project's color scheme." ),
2224  << HelpVariant( tr( "project_color" ), tr( "Returns a color from the project's color scheme." ),
2225  QList<HelpArg>()
2226  << HelpArg( tr( "name" ), tr( "a color name" ), false, false ),
2227  /* variableLenArguments */ false,
2229  << HelpExample( tr( "project_color('Logo color')" ), tr( "20,140,50" ), tr( "") )
2230  )
2231  )
2232  );
2233 
2234  gFunctionHelpTexts.insert( "radians",
2235  Help( "radians", tr( "function" ), tr( "Converts from degrees to radians." ),
2237  << HelpVariant( tr( "radians" ), tr( "Converts from degrees to radians." ),
2238  QList<HelpArg>()
2239  << HelpArg( tr( "degrees" ), tr( "numeric value" ), false, false ),
2240  /* variableLenArguments */ false,
2242  << HelpExample( tr( "radians(180)" ), tr( "3.14159" ), tr( "") )
2243  << HelpExample( tr( "radians(57.2958)" ), tr( "1" ), tr( "") )
2244  )
2245  )
2246  );
2247 
2248  gFunctionHelpTexts.insert( "ramp_color",
2249  Help( "ramp_color", tr( "function" ), tr( "Returns a string representing a color from a color ramp." ),
2251  << HelpVariant( tr( "ramp_color" ), tr( "Returns a string representing a color from a color ramp." ),
2252  QList<HelpArg>()
2253  << HelpArg( tr( "ramp_name" ), tr( "the name of the color ramp as a string, for example 'Spectral'" ), false, false )
2254  << HelpArg( tr( "value" ), tr( "the position on the ramp to select the color from as a real number between 0 and 1" ), false, false ),
2255  /* variableLenArguments */ false,
2257  << HelpExample( tr( "ramp_color('Spectral',0.3)" ), tr( "'253,190,115,255'" ), tr( "") ),
2258  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." )
2259  )
2260  )
2261  );
2262 
2263  gFunctionHelpTexts.insert( "rand",
2264  Help( "rand", tr( "function" ), tr( "Returns a random integer within the range specified by the minimum and maximum argument (inclusive)." ),
2266  << HelpVariant( tr( "rand" ), tr( "Returns a random integer within the range specified by the minimum and maximum argument (inclusive)." ),
2267  QList<HelpArg>()
2268  << HelpArg( tr( "min" ), tr( "an integer representing the smallest possible random number desired" ), false, false )
2269  << HelpArg( tr( "max" ), tr( "an integer representing the largest possible random number desired" ), false, false ),
2270  /* variableLenArguments */ false,
2272  << HelpExample( tr( "rand(1, 10)" ), tr( "8" ), tr( "") )
2273  )
2274  )
2275  );
2276 
2277  gFunctionHelpTexts.insert( "randf",
2278  Help( "randf", tr( "function" ), tr( "Returns a random float within the range specified by the minimum and maximum argument (inclusive)." ),
2280  << HelpVariant( tr( "randf" ), tr( "Returns a random float within the range specified by the minimum and maximum argument (inclusive)." ),
2281  QList<HelpArg>()
2282  << HelpArg( tr( "min" ), tr( "an float representing the smallest possible random number desired" ), false, false )
2283  << HelpArg( tr( "max" ), tr( "an float representing the largest possible random number desired" ), false, false ),
2284  /* variableLenArguments */ false,
2286  << HelpExample( tr( "randf(1, 10)" ), tr( "4.59258286403147" ), tr( "") )
2287  )
2288  )
2289  );
2290 
2291  gFunctionHelpTexts.insert( "regexp_match",
2292  Help( "regexp_match", tr( "function" ), tr( "Returns true if any part of a string matches the supplied regular expression." ),
2294  << HelpVariant( tr( "regexp_match" ), tr( "Returns true if any part of a string matches the supplied regular expression." ),
2295  QList<HelpArg>()
2296  << HelpArg( tr( "input_string" ), tr( "the string to test against the regular expression" ), false, false )
2297  << 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 ),
2298  /* variableLenArguments */ false,
2300  << HelpExample( tr( "regexp_match('QGIS ROCKS','\\\\sROCKS')" ), tr( "true" ), tr( "") )
2301  )
2302  )
2303  );
2304 
2305  gFunctionHelpTexts.insert( "regexp_replace",
2306  Help( "regexp_replace", tr( "function" ), tr( "Returns a string with the supplied regular expression replaced." ),
2308  << HelpVariant( tr( "regexp_replace" ), tr( "Returns a string with the supplied regular expression replaced." ),
2309  QList<HelpArg>()
2310  << HelpArg( tr( "input_string" ), tr( "the string to replace matches in" ), false, false )
2311  << 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 )
2312  << 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 ),
2313  /* variableLenArguments */ false,
2315  << HelpExample( tr( "regexp_replace('QGIS SHOULD ROCK','\\\\sSHOULD\\\\s',' DOES ')" ), tr( "'QGIS DOES ROCK'" ), tr( "") )
2316  )
2317  )
2318  );
2319 
2320  gFunctionHelpTexts.insert( "regexp_substr",
2321  Help( "regexp_substr", tr( "function" ), tr( "Returns the portion of a string which matches a supplied regular expression." ),
2323  << HelpVariant( tr( "regexp_substr" ), tr( "Returns the portion of a string which matches a supplied regular expression." ),
2324  QList<HelpArg>()
2325  << HelpArg( tr( "input_string" ), tr( "the string to find matches in" ), false, false )
2326  << 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 ),
2327  /* variableLenArguments */ false,
2329  << HelpExample( tr( "regexp_substr('abc123','(\\\\d+)')" ), tr( "'123'" ), tr( "") )
2330  )
2331  )
2332  );
2333 
2334  gFunctionHelpTexts.insert( "relate",
2335  Help( "relate", tr( "function" ), tr( "Tests the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the relationship between two geometries." ),
2337  << HelpVariant( tr( "Relationship variant" ), tr( "Returns the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the relationship between two geometries." ),
2338  QList<HelpArg>()
2339  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false )
2340  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false ),
2341  /* variableLenArguments */ false,
2343  << HelpExample( tr( "relate( geom_from_wkt( 'LINESTRING(40 40,120 120)' ), geom_from_wkt( 'LINESTRING(40 40,60 120)' ) )" ), tr( "'FF1F00102'" ), tr( "") )
2344  )
2345  << HelpVariant( tr( "Pattern match variant" ), tr( "Tests whether the DE-9IM relationship between two geometries matches a specified pattern." ),
2346  QList<HelpArg>()
2347  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false )
2348  << HelpArg( tr( "geometry" ), tr( "a geometry" ), false, false )
2349  << HelpArg( tr( "pattern" ), tr( "DE-9IM pattern to match" ), false, false ),
2350  /* variableLenArguments */ false,
2352  << HelpExample( tr( "relate( geom_from_wkt( 'LINESTRING(40 40,120 120)' ), geom_from_wkt( 'LINESTRING(40 40,60 120)' ), '**1F001**' )" ), tr( "True" ), tr( "") )
2353  )
2354  )
2355  );
2356 
2357  gFunctionHelpTexts.insert( "replace",
2358  Help( "replace", tr( "function" ), tr( "Returns a string with the the supplied string replaced." ),
2360  << HelpVariant( tr( "replace" ), tr( "Returns a string with the the supplied string replaced." ),
2361  QList<HelpArg>()
2362  << HelpArg( tr( "string" ), tr( "the input string" ), false, false )
2363  << HelpArg( tr( "before" ), tr( "the string to replace" ), false, false )
2364  << HelpArg( tr( "after" ), tr( "the string to use as a replacement" ), false, false ),
2365  /* variableLenArguments */ false,
2367  << HelpExample( tr( "replace('QGIS SHOULD ROCK','SHOULD','DOES')" ), tr( "'QGIS DOES ROCK'" ), tr( "") )
2368  )
2369  )
2370  );
2371 
2372  gFunctionHelpTexts.insert( "reverse",
2373  Help( "reverse", tr( "function" ), tr( "Reverses the direction of a line string by reversing the order of its vertices." ),
2375  << HelpVariant( tr( "reverse" ), tr( "Reverses the direction of a line string by reversing the order of its vertices." ),
2376  QList<HelpArg>()
2377  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2378  /* variableLenArguments */ false,
2380  << 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( "") )
2381  )
2382  )
2383  );
2384 
2385  gFunctionHelpTexts.insert( "right",
2386  Help( "right", tr( "function" ), tr( "Returns a substring that contains the <i>n</i> rightmost characters of the string." ),
2388  << HelpVariant( tr( "right" ), tr( "Returns a substring that contains the <i>n</i> rightmost characters of the string." ),
2389  QList<HelpArg>()
2390  << HelpArg( tr( "string" ), tr( "a string" ), false, false )
2391  << HelpArg( tr( "length" ), tr( "integer. The number of characters from the right of the string to return." ), false, false ),
2392  /* variableLenArguments */ false,
2394  << HelpExample( tr( "right('Hello World',5)" ), tr( "'World'" ), tr( "") )
2395  )
2396  )
2397  );
2398 
2399  gFunctionHelpTexts.insert( "round",
2400  Help( "round", tr( "function" ), tr( "Rounds a number to number of decimal places." ),
2402  << HelpVariant( tr( "round" ), tr( "Rounds a number to number of decimal places." ),
2403  QList<HelpArg>()
2404  << HelpArg( tr( "decimal" ), tr( "decimal number to be rounded" ), false, false )
2405  << HelpArg( tr( "places" ), tr( "Optional integer representing number of places to round decimals to. Can be negative." ), false, false ),
2406  /* variableLenArguments */ false,
2408  << HelpExample( tr( "round(1234.567, 2)" ), tr( "1234.57" ), tr( "") )
2409  << HelpExample( tr( "round(1234.567)" ), tr( "1235" ), tr( "") )
2410  )
2411  )
2412  );
2413 
2414  gFunctionHelpTexts.insert( "rpad",
2415  Help( "rpad", tr( "function" ), tr( "Returns a string padded to supplied width using a fill character." ),
2417  << HelpVariant( tr( "rpad" ), tr( "Returns a string padded to supplied width using a fill character." ),
2418  QList<HelpArg>()
2419  << HelpArg( tr( "string" ), tr( "string to pad" ), false, false )
2420  << HelpArg( tr( "width" ), tr( "length of new string" ), false, false )
2421  << HelpArg( tr( "fill" ), tr( "character to pad the remaining space with" ), false, false ),
2422  /* variableLenArguments */ false,
2424  << HelpExample( tr( "rpad('Hello', 10, 'x')" ), tr( "'Helloxxxxx'" ), tr( "") )
2425  )
2426  )
2427  );
2428 
2429  gFunctionHelpTexts.insert( "scale_exp",
2430  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." ),
2432  << 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." ),
2433  QList<HelpArg>()
2434  << HelpArg( tr( "val" ), tr( "A value in the input domain. The function will return a corresponding scaled value in the output range." ), false, false )
2435  << HelpArg( tr( "domain_min" ), tr( "Specifies the minimum value in the input domain, the smallest value the input value should take." ), false, false )
2436  << HelpArg( tr( "domain_max" ), tr( "Specifies the maximum value in the input domain, the largest value the input value should take." ), false, false )
2437  << 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 )
2438  << 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 )
2439  << 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 ),
2440  /* variableLenArguments */ false,
2442  << HelpExample( tr( "scale_exp(5,0,10,0,100,2)" ), tr( "25" ), tr( "easing in, using an exponent of 2") )
2443  << HelpExample( tr( "scale_exp(3,0,10,0,100,0.5)" ), tr( "54.772" ), tr( "easing out, using an exponent of 0.5") )
2444  )
2445  )
2446  );
2447 
2448  gFunctionHelpTexts.insert( "scale_linear",
2449  Help( "scale_linear", tr( "function" ), tr( "Transforms a given value from an input domain to an output range using linear interpolation." ),
2451  << HelpVariant( tr( "scale_linear" ), tr( "Transforms a given value from an input domain to an output range using linear interpolation." ),
2452  QList<HelpArg>()
2453  << HelpArg( tr( "val" ), tr( "A value in the input domain. The function will return a corresponding scaled value in the output range." ), false, false )
2454  << HelpArg( tr( "domain_min" ), tr( "Specifies the minimum value in the input domain, the smallest value the input value should take." ), false, false )
2455  << HelpArg( tr( "domain_max" ), tr( "Specifies the maximum value in the input domain, the largest value the input value should take." ), false, false )
2456  << 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 )
2457  << 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 ),
2458  /* variableLenArguments */ false,
2460  << HelpExample( tr( "scale_linear(5,0,10,0,100)" ), tr( "72" ), tr( "") )
2461  << 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") )
2462  << 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") )
2463  )
2464  )
2465  );
2466 
2467  gFunctionHelpTexts.insert( "second",
2468  Help( "second", tr( "function" ), tr( "Extract the seconds part from a datetime or time, or the number of seconds from an interval." ),
2470  << HelpVariant( tr( "Time variant" ), tr( "Extract the seconds part from a time or datetime." ),
2471  QList<HelpArg>()
2472  << HelpArg( tr( "datetime" ), tr( "a time or datetime value" ), false, false ),
2473  /* variableLenArguments */ false,
2475  << HelpExample( tr( "second('2012-07-22T13:24:57')" ), tr( "57" ), tr( "") )
2476  )
2477  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in seconds of an interval." ),
2478  QList<HelpArg>()
2479  << HelpArg( tr( "interval" ), tr( "interval value to return number of seconds from" ), false, false ),
2480  /* variableLenArguments */ false,
2482  << HelpExample( tr( "second(age('2012-07-22T00:20:00','2012-07-22T00:00:00'))" ), tr( "1200" ), tr( "") )
2483  << HelpExample( tr( "second(age('2012-01-01','2010-01-01'))" ), tr( "63072000" ), tr( "") )
2484  )
2485  )
2486  );
2487 
2488  gFunctionHelpTexts.insert( "segments_to_lines",
2489  Help( "segments_to_lines", tr( "function" ), tr( "Returns a multi line geometry consisting of a line for every segment in the input geometry." ),
2491  << HelpVariant( tr( "segments_to_lines" ), tr( "Returns a multi line geometry consisting of a line for every segment in the input geometry." ),
2492  QList<HelpArg>()
2493  << HelpArg( tr( "geometry" ), tr( "geometry object" ), false, false ),
2494  /* variableLenArguments */ false,
2496  << 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( "") )
2497  )
2498  )
2499  );
2500 
2501  gFunctionHelpTexts.insert( "set_color_part",
2502  Help( "set_color_part", tr( "function" ), tr( "Sets a specific color component for a color string, eg the red component or alpha component." ),
2504  << HelpVariant( tr( "set_color_part" ), tr( "Sets a specific color component for a color string, eg the red component or alpha component." ),
2505  QList<HelpArg>()
2506  << HelpArg( tr( "color" ), tr( "a color string" ), false, false )
2507  << 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 )
2508  << HelpArg( tr( "value" ), tr( "new value for color component, respecting the ranges listed above" ), false, false ),
2509  /* variableLenArguments */ false,
2511  << HelpExample( tr( "set_color_part('200,10,30','green',50)" ), tr( "200,50,30" ), tr( "") )
2512  )
2513  )
2514  );
2515 
2516  gFunctionHelpTexts.insert( "shortest_line",
2517  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." ),
2519  << 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." ),
2520  QList<HelpArg>()
2521  << HelpArg( tr( "geometry 1" ), tr( "geometry to find shortest line from" ), false, false )
2522  << HelpArg( tr( "geometry 2" ), tr( "geometry to find shortest line to" ), false, false ),
2523  /* variableLenArguments */ false,
2525  << 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( "") )
2526  )
2527  )
2528  );
2529 
2530  gFunctionHelpTexts.insert( "sin",
2531  Help( "sin", tr( "function" ), tr( "Returns the sine of an angle." ),
2533  << HelpVariant( tr( "sin" ), tr( "Returns the sine of an angle." ),
2534  QList<HelpArg>()
2535  << HelpArg( tr( "angle" ), tr( "angle in radians" ), false, false ),
2536  /* variableLenArguments */ false,
2538  << HelpExample( tr( "sin(1.571)" ), tr( "0.999999682931835" ), tr( "") )
2539  )
2540  )
2541  );
2542 
2543  gFunctionHelpTexts.insert( "soundex",
2544  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." ),
2546  << 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." ),
2547  QList<HelpArg>()
2548  << HelpArg( tr( "string" ), tr( "a string" ), false, false ),
2549  /* variableLenArguments */ false,
2551  << HelpExample( tr( "soundex('robert')" ), tr( "'R163'" ), tr( "") )
2552  << HelpExample( tr( "soundex('rupert')" ), tr( "'R163'" ), tr( "") )
2553  << HelpExample( tr( "soundex('rubin')" ), tr( "'R150'" ), tr( "") )
2554  )
2555  )
2556  );
2557 
2558  gFunctionHelpTexts.insert( "sqrt",
2559  Help( "sqrt", tr( "function" ), tr( "Returns square root of a value." ),
2561  << HelpVariant( tr( "sqrt" ), tr( "Returns square root of a value." ),
2562  QList<HelpArg>()
2563  << HelpArg( tr( "value" ), tr( "a number" ), false, false ),
2564  /* variableLenArguments */ false,
2566  << HelpExample( tr( "sqrt(9)" ), tr( "3" ), tr( "") )
2567  )
2568  )
2569  );
2570 
2571  gFunctionHelpTexts.insert( "start_point",
2572  Help( "start_point", tr( "function" ), tr( "Returns the first node from a geometry." ),
2574  << HelpVariant( tr( "start_point" ), tr( "Returns the first node from a geometry." ),
2575  QList<HelpArg>()
2576  << HelpArg( tr( "geometry" ), tr( "geometry object" ), false, false ),
2577  /* variableLenArguments */ false,
2579  << HelpExample( tr( "geom_to_wkt(start_point(geom_from_wkt('LINESTRING(4 0, 4 2, 0 2)')))" ), tr( "'Point (4 0)'" ), tr( "") )
2580  )
2581  )
2582  );
2583 
2584  gFunctionHelpTexts.insert( "strpos",
2585  Help( "strpos", tr( "function" ), tr( "Return the first matching position of a substring within another string, or 0 if the substring is not found." ),
2587  << HelpVariant( tr( "strpos" ), tr( "Return the first matching position of a substring within another string, or 0 if the substring is not found." ),
2588  QList<HelpArg>()
2589  << HelpArg( tr( "haystack" ), tr( "string that is to be searched" ), false, false )
2590  << HelpArg( tr( "needle" ), tr( "string to search for" ), false, false ),
2591  /* variableLenArguments */ false,
2593  << HelpExample( tr( "strpos('HELLO WORLD','WORLD')" ), tr( "7" ), tr( "") )
2594  << HelpExample( tr( "strpos('HELLO WORLD','GOODBYE')" ), tr( "0" ), tr( "") )
2595  )
2596  )
2597  );
2598 
2599  gFunctionHelpTexts.insert( "substr",
2600  Help( "substr", tr( "function" ), tr( "Returns a part of a string." ),
2602  << HelpVariant( tr( "substr" ), tr( "Returns a part of a string." ),
2603  QList<HelpArg>()
2604  << HelpArg( tr( "input_string" ), tr( "the full input string" ), false, false )
2605  << HelpArg( tr( "startpos" ), tr( "integer representing start position to extract from" ), false, false )
2606  << HelpArg( tr( "length" ), tr( "integer representing length of string to extract" ), false, false ),
2607  /* variableLenArguments */ false,
2609  << HelpExample( tr( "substr('HELLO WORLD',3,5)" ), tr( "'LLO W'" ), tr( "") )
2610  )
2611  )
2612  );
2613 
2614  gFunctionHelpTexts.insert( "sym_difference",
2615  Help( "sym_difference", tr( "function" ), tr( "Returns a geometry that represents the portions of two geometries that do not intersect." ),
2617  << HelpVariant( tr( "sym_difference" ), tr( "Returns a geometry that represents the portions of two geometries that do not intersect." ),
2618  QList<HelpArg>()
2619  << HelpArg( tr( "geometry1" ), tr( "a geometry" ), false, false )
2620  << HelpArg( tr( "geometry2" ), tr( "a geometry" ), false, false ),
2621  /* variableLenArguments */ false,
2623  << 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( "") )
2624  )
2625  )
2626  );
2627 
2628  gFunctionHelpTexts.insert( "tan",
2629  Help( "tan", tr( "function" ), tr( "Returns the tangent of an angle." ),
2631  << HelpVariant( tr( "tan" ), tr( "Returns the tangent of an angle." ),
2632  QList<HelpArg>()
2633  << HelpArg( tr( "angle" ), tr( "angle in radians" ), false, false ),
2634  /* variableLenArguments */ false,
2636  << HelpExample( tr( "tan(1.0)" ), tr( "1.5574077246549" ), tr( "") )
2637  )
2638  )
2639  );
2640 
2641  gFunctionHelpTexts.insert( "title",
2642  Help( "title", tr( "function" ), tr( "Converts all words of a string to title case (all words lower case with leading capital letter)." ),
2644  << HelpVariant( tr( "title" ), tr( "Converts all words of a string to title case (all words lower case with leading capital letter)." ),
2645  QList<HelpArg>()
2646  << HelpArg( tr( "string" ), tr( "the string to convert to title case" ), false, false ),
2647  /* variableLenArguments */ false,
2649  << HelpExample( tr( "title('hello WOrld')" ), tr( "'Hello World'" ), tr( "") )
2650  )
2651  )
2652  );
2653 
2654  gFunctionHelpTexts.insert( "to_date",
2655  Help( "to_date", tr( "function" ), tr( "Convert a string into a date object." ),
2657  << HelpVariant( tr( "to_date" ), tr( "Convert a string into a date object." ),
2658  QList<HelpArg>()
2659  << HelpArg( tr( "string" ), tr( "string representing a date value" ), false, false ),
2660  /* variableLenArguments */ false,
2662  << HelpExample( tr( "to_date('2012-05-04')" ), tr( "2012-05-04" ), tr( "") )
2663  )
2664  )
2665  );
2666 
2667  gFunctionHelpTexts.insert( "to_datetime",
2668  Help( "to_datetime", tr( "function" ), tr( "Convert a string into a datetime object." ),
2670  << HelpVariant( tr( "to_datetime" ), tr( "Convert a string into a datetime object." ),
2671  QList<HelpArg>()
2672  << HelpArg( tr( "string" ), tr( "string representing a datetime value" ), false, false ),
2673  /* variableLenArguments */ false,
2675  << HelpExample( tr( "to_datetime('2012-05-04 12:50:00')" ), tr( "2012-05-04T12:50:00" ), tr( "") )
2676  )
2677  )
2678  );
2679 
2680  gFunctionHelpTexts.insert( "to_int",
2681  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)." ),
2683  << 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)." ),
2684  QList<HelpArg>()
2685  << HelpArg( tr( "string" ), tr( "string to convert to integer number" ), false, false ),
2686  /* variableLenArguments */ false,
2688  << HelpExample( tr( "to_int('123')" ), tr( "123" ), tr( "") )
2689  )
2690  )
2691  );
2692 
2693  gFunctionHelpTexts.insert( "to_interval",
2694  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." ),
2696  << HelpVariant( tr( "to_interval" ), tr( "Converts a string to a interval type. Can be used to take days, hours, month, etc of a date." ),
2697  QList<HelpArg>()
2698  << HelpArg( tr( "string" ), tr( "a string representing an interval. Allowable formats include {n} days {n} hours {n} months." ), false, false ),
2699  /* variableLenArguments */ false,
2701  << HelpExample( tr( "to_datetime('2012-05-05 12:00:00') - to_interval('1 day 2 hours')" ), tr( "2012-05-04T10:00:00" ), tr( "") )
2702  )
2703  )
2704  );
2705 
2706  gFunctionHelpTexts.insert( "to_real",
2707  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." ),
2709  << 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." ),
2710  QList<HelpArg>()
2711  << HelpArg( tr( "string" ), tr( "string to convert to real number" ), false, false ),
2712  /* variableLenArguments */ false,
2714  << HelpExample( tr( "to_real('123.45')" ), tr( "123.45" ), tr( "") )
2715  )
2716  )
2717  );
2718 
2719  gFunctionHelpTexts.insert( "to_string",
2720  Help( "to_string", tr( "function" ), tr( "Converts a number to string." ),
2722  << HelpVariant( tr( "to_string" ), tr( "Converts a number to string." ),
2723  QList<HelpArg>()
2724  << HelpArg( tr( "number" ), tr( "Integer or real value. The number to convert to string." ), false, false ),
2725  /* variableLenArguments */ false,
2727  << HelpExample( tr( "to_string(123)" ), tr( "'123'" ), tr( "") )
2728  )
2729  )
2730  );
2731 
2732  gFunctionHelpTexts.insert( "to_time",
2733  Help( "to_time", tr( "function" ), tr( "Convert a string into a time object." ),
2735  << HelpVariant( tr( "to_time" ), tr( "Convert a string into a time object." ),
2736  QList<HelpArg>()
2737  << HelpArg( tr( "string" ), tr( "string representing a time value" ), false, false ),
2738  /* variableLenArguments */ false,
2740  << HelpExample( tr( "to_time('12:30:01')" ), tr( "12:30:01" ), tr( "") )
2741  )
2742  )
2743  );
2744 
2745  gFunctionHelpTexts.insert( "touches",
2746  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." ),
2748  << 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." ),
2749  QList<HelpArg>()
2750  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
2751  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
2752  /* variableLenArguments */ false,
2754  << HelpExample( tr( "touches( geom_from_wkt( 'LINESTRING(5 3, 4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )" ), tr( "true" ), tr( "") )
2755  << HelpExample( tr( "touches( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(5 5)' ) )" ), tr( "false" ), tr( "") )
2756  )
2757  )
2758  );
2759 
2760  gFunctionHelpTexts.insert( "transform",
2761  Help( "transform", tr( "function" ), tr( "Returns the geometry transformed from a source CRS to a destination CRS." ),
2763  << HelpVariant( tr( "transform" ), tr( "Returns the geometry transformed from a source CRS to a destination CRS." ),
2764  QList<HelpArg>()
2765  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false )
2766  << HelpArg( tr( "source_auth_id" ), tr( "the source auth CRS ID" ), false, false )
2767  << HelpArg( tr( "dest_auth_id" ), tr( "the destination auth CRS ID" ), false, false ),
2768  /* variableLenArguments */ false,
2770  << HelpExample( tr( "geom_to_wkt( transform( $geometry, 'EPSG:2154', 'EPSG:4326' ) )" ), tr( "POINT(0 51)" ), tr( "") )
2771  )
2772  )
2773  );
2774 
2775  gFunctionHelpTexts.insert( "translate",
2776  Help( "translate", tr( "function" ), tr( "Returns a translated version of a geometry. Calculations are in the Spatial Reference System of this geometry." ),
2778  << HelpVariant( tr( "translate" ), tr( "Returns a translated version of a geometry. Calculations are in the Spatial Reference System of this geometry." ),
2779  QList<HelpArg>()
2780  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false )
2781  << HelpArg( tr( "dx" ), tr( "delta x" ), false, false )
2782  << HelpArg( tr( "dy" ), tr( "delta y" ), false, false ),
2783  /* variableLenArguments */ false,
2785  << HelpExample( tr( "translate($geometry, 5, 10)" ), tr( "a geometry of the same type like the original one" ), tr( "") )
2786  )
2787  )
2788  );
2789 
2790  gFunctionHelpTexts.insert( "trim",
2791  Help( "trim", tr( "function" ), tr( "Removes all leading and trailing whitespace (spaces, tabs, etc) from a string." ),
2793  << HelpVariant( tr( "trim" ), tr( "Removes all leading and trailing whitespace (spaces, tabs, etc) from a string." ),
2794  QList<HelpArg>()
2795  << HelpArg( tr( "string" ), tr( "string to trim" ), false, false ),
2796  /* variableLenArguments */ false,
2798  << HelpExample( tr( "trim(' hello world ')" ), tr( "'hello world'" ), tr( "") )
2799  )
2800  )
2801  );
2802 
2803  gFunctionHelpTexts.insert( "union",
2804  Help( "union", tr( "function" ), tr( "Returns a geometry that represents the point set union of the geometries." ),
2806  << HelpVariant( tr( "union" ), tr( "Returns a geometry that represents the point set union of the geometries." ),
2807  QList<HelpArg>()
2808  << HelpArg( tr( "geometry1" ), tr( "a geometry" ), false, false )
2809  << HelpArg( tr( "geometry2" ), tr( "a geometry" ), false, false ),
2810  /* variableLenArguments */ false,
2812  << 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( "") )
2813  )
2814  )
2815  );
2816 
2817  gFunctionHelpTexts.insert( "upper",
2818  Help( "upper", tr( "function" ), tr( "Converts a string to upper case letters." ),
2820  << HelpVariant( tr( "upper" ), tr( "Converts a string to upper case letters." ),
2821  QList<HelpArg>()
2822  << HelpArg( tr( "string" ), tr( "the string to convert to upper case" ), false, false ),
2823  /* variableLenArguments */ false,
2825  << HelpExample( tr( "upper('hello WOrld')" ), tr( "'HELLO WORLD'" ), tr( "") )
2826  )
2827  )
2828  );
2829 
2830  gFunctionHelpTexts.insert( "uuid",
2831  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." ),
2833  << 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." ),
2834  QList<HelpArg>(),
2835  /* variableLenArguments */ false,
2837  << HelpExample( tr( "uuid()" ), tr( "'{0bd2f60f-f157-4a6d-96af-d4ba4cb366a1}'" ), tr( "") )
2838  )
2839  )
2840  );
2841 
2842  gFunctionHelpTexts.insert( "var",
2843  Help( "var", tr( "function" ), tr( "Returns the value stored within a specified variable." ),
2845  << HelpVariant( tr( "var" ), tr( "Returns the value stored within a specified variable." ),
2846  QList<HelpArg>()
2847  << HelpArg( tr( "name" ), tr( "a variable name" ), false, false ),
2848  /* variableLenArguments */ false,
2850  << HelpExample( tr( "var('qgis_version')" ), tr( "'2.12'" ), tr( "") )
2851  )
2852  )
2853  );
2854 
2855  gFunctionHelpTexts.insert( "week",
2856  Help( "week", tr( "function" ), tr( "Extract the week number from a date, or the number of weeks from an interval." ),
2858  << HelpVariant( tr( "Date variant" ), tr( "Extract the week number from a date or datetime." ),
2859  QList<HelpArg>()
2860  << HelpArg( tr( "date" ), tr( "a date or datetime value" ), false, false ),
2861  /* variableLenArguments */ false,
2863  << HelpExample( tr( "week('2012-05-12')" ), tr( "19" ), tr( "") )
2864  )
2865  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in weeks of an interval." ),
2866  QList<HelpArg>()
2867  << HelpArg( tr( "interval" ), tr( "interval value to return number of months from" ), false, false ),
2868  /* variableLenArguments */ false,
2870  << HelpExample( tr( "week(tointerval('3 weeks'))" ), tr( "3" ), tr( "") )
2871  << HelpExample( tr( "week(age('2012-01-01','2010-01-01'))" ), tr( "104.285" ), tr( "") )
2872  )
2873  )
2874  );
2875 
2876  gFunctionHelpTexts.insert( "within",
2877  Help( "within", tr( "function" ), tr( "Tests whether a geometry is within another. Returns true if the geometry a is completely within geometry b." ),
2879  << HelpVariant( tr( "within" ), tr( "Tests whether a geometry is within another. Returns true if the geometry a is completely within geometry b." ),
2880  QList<HelpArg>()
2881  << HelpArg( tr( "geometry a" ), tr( "a geometry" ), false, false )
2882  << HelpArg( tr( "geometry b" ), tr( "a geometry" ), false, false ),
2883  /* variableLenArguments */ false,
2885  << 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( "") )
2886  << 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( "") )
2887  )
2888  )
2889  );
2890 
2891  gFunctionHelpTexts.insert( "wordwrap",
2892  Help( "wordwrap", tr( "function" ), tr( "Returns a string wrapped to a maximum/minimum number of characters." ),
2894  << HelpVariant( tr( "wordwrap" ), tr( "Returns a string wrapped to a maximum/minimum number of characters." ),
2895  QList<HelpArg>()
2896  << HelpArg( tr( "string" ), tr( "the string to be wrapped" ), false, false )
2897  << 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 )
2898  << HelpArg( tr( "delimiter_string" ), tr( "the delimiter string to wrap to a new line (optional)." ), false, false ),
2899  /* variableLenArguments */ false,
2901  << HelpExample( tr( "wordwrap('UNIVERSITY OF QGIS',13)" ), tr( "'UNIVERSITY OF<br>QGIS'" ), tr( "") )
2902  << HelpExample( tr( "wordwrap('UNIVERSITY OF QGIS',-3)" ), tr( "'UNIVERSITY<br>OF QGIS'" ), tr( "") )
2903  )
2904  )
2905  );
2906 
2907  gFunctionHelpTexts.insert( "x",
2908  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." ),
2910  << HelpVariant( tr( "x" ), tr( "Returns the x coordinate of a point geometry, or the x-coordinate of the centroid for a non-point geometry." ),
2911  QList<HelpArg>()
2912  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2913  /* variableLenArguments */ false,
2915  << HelpExample( tr( "x( geom_from_wkt( 'POINT(2 5)' ) )" ), tr( "2" ), tr( "") )
2916  )
2917  )
2918  );
2919 
2920  gFunctionHelpTexts.insert( "x_max",
2921  Help( "x_max", tr( "function" ), tr( "Returns the maximum x coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2923  << HelpVariant( tr( "x_max" ), tr( "Returns the maximum x coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2924  QList<HelpArg>()
2925  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2926  /* variableLenArguments */ false,
2928  << HelpExample( tr( "x_max( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )" ), tr( "4" ), tr( "") )
2929  )
2930  )
2931  );
2932 
2933  gFunctionHelpTexts.insert( "x_min",
2934  Help( "x_min", tr( "function" ), tr( "Returns the minimum x coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2936  << HelpVariant( tr( "x_min" ), tr( "Returns the minimum x coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2937  QList<HelpArg>()
2938  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2939  /* variableLenArguments */ false,
2941  << HelpExample( tr( "x_min( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )" ), tr( "2" ), tr( "") )
2942  )
2943  )
2944  );
2945 
2946  gFunctionHelpTexts.insert( "y",
2947  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." ),
2949  << HelpVariant( tr( "y" ), tr( "Returns the y coordinate of a point geometry, or the y-coordinate of the centroid for a non-point geometry." ),
2950  QList<HelpArg>()
2951  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2952  /* variableLenArguments */ false,
2954  << HelpExample( tr( "y( geom_from_wkt( 'POINT(2 5)' ) )" ), tr( "5" ), tr( "") )
2955  )
2956  )
2957  );
2958 
2959  gFunctionHelpTexts.insert( "y_max",
2960  Help( "y_max", tr( "function" ), tr( "Returns the maximum y coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2962  << HelpVariant( tr( "y_max" ), tr( "Returns the maximum y coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2963  QList<HelpArg>()
2964  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2965  /* variableLenArguments */ false,
2967  << HelpExample( tr( "y_max( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )" ), tr( "8" ), tr( "") )
2968  )
2969  )
2970  );
2971 
2972  gFunctionHelpTexts.insert( "y_min",
2973  Help( "y_min", tr( "function" ), tr( "Returns the minimum y coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2975  << HelpVariant( tr( "y_min" ), tr( "Returns the minimum y coordinate of a geometry. Calculations are in the spatial reference system of this geometry." ),
2976  QList<HelpArg>()
2977  << HelpArg( tr( "geom" ), tr( "a geometry" ), false, false ),
2978  /* variableLenArguments */ false,
2980  << HelpExample( tr( "y_min( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )" ), tr( "5" ), tr( "") )
2981  )
2982  )
2983  );
2984 
2985  gFunctionHelpTexts.insert( "year",
2986  Help( "year", tr( "function" ), tr( "Extract the year part from a date, or the number of years from an interval." ),
2988  << HelpVariant( tr( "Date variant" ), tr( "Extract the year part from a date or datetime." ),
2989  QList<HelpArg>()
2990  << HelpArg( tr( "date" ), tr( "a date or datetime value" ), false, false ),
2991  /* variableLenArguments */ false,
2993  << HelpExample( tr( "year('2012-05-12')" ), tr( "2012" ), tr( "") )
2994  )
2995  << HelpVariant( tr( "Interval variant" ), tr( "Calculate the length in years of an interval." ),
2996  QList<HelpArg>()
2997  << HelpArg( tr( "interval" ), tr( "interval value to return number of years from" ), false, false ),
2998  /* variableLenArguments */ false,
3000  << HelpExample( tr( "year(to_interval('3 years'))" ), tr( "3" ), tr( "") )
3001  << HelpExample( tr( "year(age('2012-01-01','2010-01-01'))" ), tr( "1.9986" ), tr( "") )
3002  )
3003  )
3004  );
3005 
3006  gFunctionHelpTexts.insert( "z",
3007  Help( "z", tr( "function" ), tr( "Returns the z coordinate of a point geometry." ),
3009  << HelpVariant( tr( "z" ), tr( "Returns the z coordinate of a point geometry." ),
3010  QList<HelpArg>()
3011  << HelpArg( tr( "geom" ), tr( "a point geometry" ), false, false ),
3012  /* variableLenArguments */ false,
3014  << HelpExample( tr( "z( geom_from_wkt( 'POINTZ(2 5 7)' ) )" ), tr( "7" ), tr( "") )
3015  )
3016  )
3017  );
3018 }
static QHash< QString, Help > gFunctionHelpTexts
static void initFunctionHelp()
#define tr(sourceText)