QGIS API Documentation  2.4.0-Chugiak
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsexpression_texts.cpp
Go to the documentation of this file.
1 #include "qgsexpression.h"
2 #include <QCoreApplication>
3 
4 QHash<QString, QString> QgsExpression::gFunctionHelpTexts;
5 
7 {
8  if( !gFunctionHelpTexts.isEmpty() )
9  return;
10 
11  gFunctionHelpTexts.insert( "$area", QCoreApplication::translate( "function_help", "<h3>$area function</h3>\n"
12 "Returns the area size of the current feature.\n"
13 "\n"
14 "<h4>Syntax</h4>\n"
15 "<pre>$area</pre>\n"
16 "\n"
17 "<h4>Arguments</h4>\n"
18 "None\n"
19 "\n"
20 "<h4>Example</h4>\n"
21 "<pre>$area &rarr; 42</pre>\n"
22 "\n"
23 "") );
24  gFunctionHelpTexts.insert( "$atlasfeatureid", QCoreApplication::translate( "function_help", "<h3>$atlasfeatureid function</h3>\n"
25 "Returns the feature id of the current row while using atlas.\n"
26 "This enables you to use features of atlas in rules \n"
27 "and for example show or hide features based on their id.\n"
28 "\n"
29 "<h4>Syntax</h4>\n"
30 "<pre>$atlasfeatureid</pre>\n"
31 "\n"
32 "<h4>Arguments</h4>\n"
33 "None\n"
34 "\n"
35 "<h4>Example</h4>\n"
36 "<pre>$atlasfeatureid = $id</pre>\n"
37 "\n"
38 "") );
39  gFunctionHelpTexts.insert( "$atlasgeometry", QCoreApplication::translate( "function_help", "<h3>$atlasgeometry function</h3>\n"
40 "Returns the geometry of the current feature iterated in atlas.\n"
41 "Can be used for rule based display of geometry when using atlas.\n"
42 "For example to only show geometries of other layers when their geometry \n"
43 "intersects the iterated geometry of features using atlas.\n"
44 "\n"
45 "<h4>Syntax</h4>\n"
46 "<pre>$atlasgeometry</pre>\n"
47 "\n"
48 "<h4>Arguments</h4>\n"
49 "None\n"
50 "\n"
51 "<h4>Example</h4>\n"
52 "<pre> intersects( $atlasgeometry, $geometry ) </pre>\n"
53 "\n"
54 "") );
55  gFunctionHelpTexts.insert( "$feature", QCoreApplication::translate( "function_help", "<h3>$feature function</h3>\n"
56 "In atlas generation, returns the current feature number that is iterated over on the coverage layer.\n"
57 "\n"
58 "<h4>Syntax</h4>\n"
59 "<pre>$feature</pre>\n"
60 "\n"
61 "<h4>Arguments</h4>\n"
62 "None\n"
63 "\n"
64 "<h4>Example</h4>\n"
65 "<pre>$feature &rarr; 2</pre>\n"
66 "\n"
67 "") );
68  gFunctionHelpTexts.insert( "$geometry", QCoreApplication::translate( "function_help", "<h3>$geometry function</h3>\n"
69 "Returns the geometry of the current feature. Can be used for processing with other functions.\n"
70 "\n"
71 "<h4>Syntax</h4>\n"
72 "<pre>$geometry</pre>\n"
73 "\n"
74 "<h4>Arguments</h4>\n"
75 "None\n"
76 "\n"
77 "<h4>Example</h4>\n"
78 "<pre> geomToWKT( $geometry ) &rarr; POINT(6 50)</pre>\n"
79 "\n"
80 "") );
81  gFunctionHelpTexts.insert( "$id", QCoreApplication::translate( "function_help", "<h3>$id function</h3>\n"
82 "Returns the feature id of the current row.\n"
83 "\n"
84 "<h4>Syntax</h4>\n"
85 "<pre>$id</pre>\n"
86 "\n"
87 "<h4>Arguments</h4>\n"
88 "None\n"
89 "\n"
90 "<h4>Example</h4>\n"
91 "<pre>$id &rarr; 42</pre>\n"
92 "\n"
93 "") );
94  gFunctionHelpTexts.insert( "$length", QCoreApplication::translate( "function_help", "<h3>$length function</h3>\n"
95 "Returns the length of the current feature.\n"
96 "\n"
97 "<h4>Syntax</h4>\n"
98 "<pre>$length</pre>\n"
99 "\n"
100 "<h4>Arguments</h4>\n"
101 "None\n"
102 "\n"
103 "<h4>Example</h4>\n"
104 "<pre>$length &rarr; 42.4711</pre>\n"
105 "") );
106  gFunctionHelpTexts.insert( "$map", QCoreApplication::translate( "function_help", "<h3>$map function</h3>\n"
107 "Returns the id of the current map item if the map is being drawn in a composition, or \"canvas\" if the map is being\n"
108 "drawn within the main QGIS window.\n"
109 "\n"
110 "<h4>Syntax</h4>\n"
111 "<pre>$map</pre>\n"
112 "\n"
113 "<h4>Arguments</h4>\n"
114 "None\n"
115 "\n"
116 "<h4>Example</h4>\n"
117 "<!-- Show example of function.-->\n"
118 "<pre>$map &rarr; \"overview_map\" (within a composer item)<br />\n"
119 "$map &rarr; \"canvas\" (within the main QGIS main canvas)</pre>\n"
120 "\n"
121 "\n"
122 "") );
123  gFunctionHelpTexts.insert( "$now", QCoreApplication::translate( "function_help", "<h3>$now function</h3>\n"
124 "Returns the current date and time\n"
125 "\n"
126 "<h4>Syntax</h4>\n"
127 "<pre>$now</pre>\n"
128 "\n"
129 "<h4>Arguments</h4>\n"
130 "None\n"
131 "\n"
132 "<h4>Example</h4>\n"
133 "<pre>$now &rarr; 2012-07-22T13:24:57</pre>\n"
134 "\n"
135 "") );
136  gFunctionHelpTexts.insert( "$numfeatures", QCoreApplication::translate( "function_help", "<h3>$numfeatures function</h3>\n"
137 "In atlas generation, returns the total number of features within the coverage layer.\n"
138 "\n"
139 "<h4>Syntax</h4>\n"
140 "<pre>$numfeatures</pre>\n"
141 "\n"
142 "<h4>Arguments</h4>\n"
143 "None\n"
144 "\n"
145 "<h4>Example</h4>\n"
146 "<pre>$numfeatures &rarr; 42</pre>\n"
147 "\n"
148 "") );
149  gFunctionHelpTexts.insert( "$numpages", QCoreApplication::translate( "function_help", "<h3>$numpages function</h3>\n"
150 "Returns the total number of pages in the composition.\n"
151 "\n"
152 "<h4>Syntax</h4>\n"
153 "<pre>$numpages</pre>\n"
154 "\n"
155 "<h4>Arguments</h4>\n"
156 "None\n"
157 "\n"
158 "<h4>Example</h4>\n"
159 "<pre>$numpages &rarr; 42</pre>\n"
160 "\n"
161 "") );
162  gFunctionHelpTexts.insert( "$page", QCoreApplication::translate( "function_help", "<h3>$page function</h3>\n"
163 "Returns the current page number within a composition.\n"
164 "\n"
165 "<h4>Syntax</h4>\n"
166 "<pre>$page</pre>\n"
167 "\n"
168 "<h4>Arguments</h4>\n"
169 "None\n"
170 "\n"
171 "<h4>Example</h4>\n"
172 "<pre>$page &rarr; 2</pre>\n"
173 "\n"
174 "") );
175  gFunctionHelpTexts.insert( "$perimeter", QCoreApplication::translate( "function_help", "<h3>$perimeter function</h3>\n"
176 "Returns the perimeter length of the current feature.\n"
177 "\n"
178 "<h4>Syntax</h4>\n"
179 "<pre>$perimeter</pre>\n"
180 "\n"
181 "<h4>Arguments</h4>\n"
182 "None\n"
183 "\n"
184 "<h4>Example</h4>\n"
185 "<pre>$perimeter &rarr; 42</pre>\n"
186 "\n"
187 "") );
188  gFunctionHelpTexts.insert( "$pi", QCoreApplication::translate( "function_help", "<h3>$pi constant</h3>\n"
189 "Returns pi as value for calculations\n"
190 "\n"
191 "<h4>Syntax</h4>\n"
192 "<pre>$pi</pre>\n"
193 "\n"
194 "<h4>Arguments</h4>\n"
195 "None\n"
196 "\n"
197 "<h4>Example</h4>\n"
198 "<pre>$pi &rarr; 3.14159265358979</pre>\n"
199 "") );
200  gFunctionHelpTexts.insert( "$rownum", QCoreApplication::translate( "function_help", "<h3>$rownum function</h3>\n"
201 "Returns the number of the current row.\n"
202 "\n"
203 "<h4>Syntax</h4>\n"
204 "<pre>$rownum</pre>\n"
205 "\n"
206 "<h4>Arguments</h4>\n"
207 "None\n"
208 "\n"
209 "<h4>Example</h4>\n"
210 "<pre>$rownum &rarr; 4711</pre>\n"
211 "\n"
212 "") );
213  gFunctionHelpTexts.insert( "$scale", QCoreApplication::translate( "function_help", "<h3>$scale function</h3>\n"
214 "Returns the current scale of the map canvas.\n"
215 "<br>\n"
216 "Note: This function is only available in some contexts and will be 0 otherwise. \n"
217 "<h4>Syntax</h4>\n"
218 "<code>$scale</code><br>\n"
219 "\n"
220 "<h4>Example</h4>\n"
221 "<!-- Show example of function.-->\n"
222 "<code>$scale &rarr; 10000</code><br>\n"
223 "\n"
224 "\n"
225 "") );
226  gFunctionHelpTexts.insert( "$uuid", QCoreApplication::translate( "function_help", "<h3>$uuid function</h3>\n"
227 "Generates a Universally Unique Identifier (UUID) for each row using the Qt\n"
228 "<a href='http://qt-project.org/doc/qt-4.8/quuid.html#createUuid'>QUuid::createUuid</a>\n"
229 "method. Each UUID is 38 characters long.\n"
230 "\n"
231 "<h4>Syntax</h4>\n"
232 "<pre>$uuid</pre>\n"
233 "\n"
234 "<h4>Arguments</h4>\n"
235 "None\n"
236 "\n"
237 "<h4>Example</h4>\n"
238 "<pre>$uuid &rarr; {0bd2f60f-f157-4a6d-96af-d4ba4cb366a1}</pre>\n"
239 "") );
240  gFunctionHelpTexts.insert( "$x", QCoreApplication::translate( "function_help", "<h3>$x function</h3>\n"
241 "Returns the x coordinate of the current feature.\n"
242 "\n"
243 "<h4>Syntax</h4>\n"
244 "<pre>$x</pre>\n"
245 "\n"
246 "<h4>Arguments</h4>\n"
247 "None\n"
248 "\n"
249 "<h4>Example</h4>\n"
250 "<pre>$x &rarr; 42</pre>\n"
251 "\n"
252 "") );
253  gFunctionHelpTexts.insert( "$y", QCoreApplication::translate( "function_help", "<h3>$y function</h3>\n"
254 "Returns the y coordinate of the current feature.\n"
255 "\n"
256 "<h4>Syntax</h4>\n"
257 "<pre>$y</pre>\n"
258 "\n"
259 "<h4>Arguments</h4>\n"
260 "None\n"
261 "\n"
262 "<h4>Example</h4>\n"
263 "<pre>$y &rarr; 42</pre>\n"
264 "\n"
265 "") );
266  gFunctionHelpTexts.insert( "AND", QCoreApplication::translate( "function_help", "<h3>AND logical operator</h3>\n"
267 "Returns 1 when condition a and b are true.\n"
268 "\n"
269 "<h4>Syntax</h4>\n"
270 "<pre> condition a AND condition b </pre>\n"
271 "\n"
272 "<h4>Arguments</h4>\n"
273 "None\n"
274 "\n"
275 "<h4>Example</h4>\n"
276 "<pre> 4 = 2+2 AND 1 = 1 &rarr; returns 1 </pre>\n"
277 "<pre> 4 = 2+2 AND 1 = 2 &rarr; returns 0 </pre>\n"
278 "\n"
279 "") );
280  gFunctionHelpTexts.insert( "CASE", QCoreApplication::translate( "function_help", "<h3>CASE expression</h3>\n"
281 "A conditional expression that can be used to evaluate multiple expressions and\n"
282 "return a result.\n"
283 "\n"
284 "<h4>Syntax</h4>\n"
285 "<pre>\n"
286 " CASE\n"
287 " WHEN <i>condition</i> THEN <i>result</i>\n"
288 " [ ...n ]\n"
289 " [ ELSE <i>result</i> ]\n"
290 " END\n"
291 "</pre>\n"
292 "[ ] marks optional components\n"
293 "\n"
294 "<h4>Arguments</h4>\n"
295 "<!-- List args for functions here-->\n"
296 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
297 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
298 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
299 "\n"
300 "<h4>Example</h4>\n"
301 "<!-- Show example of function.-->\n"
302 "<pre>\n"
303 " CASE\n"
304 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
305 " END\n"
306 "</pre>\n"
307 "") );
308  gFunctionHelpTexts.insert( "CASE ELSE", QCoreApplication::translate( "function_help", "<h3>CASE expression</h3>\n"
309 "A conditional expression that can be used to evaluate multiple expressions and\n"
310 "return a result.\n"
311 "\n"
312 "<h4>Syntax</h4>\n"
313 "<pre>\n"
314 " CASE\n"
315 " WHEN <i>condition</i> THEN <i>result</i>\n"
316 " [ ...n ]\n"
317 " [ ELSE <i>result</i> ]\n"
318 " END\n"
319 "</pre>\n"
320 "[ ] marks optional components\n"
321 "\n"
322 "<h4>Arguments</h4>\n"
323 "<!-- List args for functions here-->\n"
324 "<i> WHEN condition</i> - The condition expression to evaluate. <br>\n"
325 "<i> THEN result</i> - If <i>condition</i> evaluates to True then <i>result</i> is evaluated and returned. <br>\n"
326 "<i> ELSE result</i> - If none of the above conditions evaluated to True then <i>result</i> is evaluated and returned. <br>\n"
327 "\n"
328 "<h4>Example</h4>\n"
329 "<!-- Show example of function.-->\n"
330 "<pre>\n"
331 " CASE\n"
332 " WHEN <i>\"column\" IS NULL</i> THEN <i>'None'</i>\n"
333 " ELSE <i>\"column\"</i>\n"
334 " END\n"
335 "</pre>\n"
336 "") );
337  gFunctionHelpTexts.insert( "Color", QCoreApplication::translate( "function_help", "\n"
338 "<h3>Color Group</h3>\n"
339 "This group contains functions for manipulating colors\n"
340 "") );
341  gFunctionHelpTexts.insert( "Conditionals", QCoreApplication::translate( "function_help", "<h3>Conditionals Group</h3>\n"
342 "This group contains functions to handle conditional checks in expressions.\n"
343 "") );
344  gFunctionHelpTexts.insert( "Conditions", QCoreApplication::translate( "function_help", "<h3>Conditions Group</h3>\n"
345 "This group contains functions that operate on condition.\n"
346 "") );
347  gFunctionHelpTexts.insert( "Conversions", QCoreApplication::translate( "function_help", "<h3>Conversions Group</h3>\n"
348 "This group contains functions to convert on data type to another e.g string to integer, integer to string.\n"
349 "") );
350  gFunctionHelpTexts.insert( "Date and Time", QCoreApplication::translate( "function_help", "<h3>Date and Time Group</h3>\n"
351 "This group contains functions for handling date and time data.\n"
352 "") );
353  gFunctionHelpTexts.insert( "Field", QCoreApplication::translate( "function_help", "<h3>Field</h3>\n"
354 "Double click to add field name to expression string.\n"
355 "<br><br>\n"
356 "Right-Click on field name to open context menu sample value loading options.\n"
357 "\n"
358 "<p><h4>Note:</h4>\n"
359 "Loading field values from WFS layers isn't supported, before the layer is\n"
360 "actually inserted, ie. when building queries.\n"
361 "</p>\n"
362 "") );
363  gFunctionHelpTexts.insert( "Fields and Values", QCoreApplication::translate( "function_help", "<h3>Fields and Values</h3>\n"
364 "Contains a list of fields from the layer. Sample values can also be accessed via right-click.\n"
365 "<br><br>\n"
366 "Select the field name from the list then right-click to access context menu with options to load sample values from the selected field.\n"
367 "\n"
368 "<p><h4>Note:</h4>\n"
369 "Loading field values from WFS layers isn't supported, before the layer is\n"
370 "actually inserted, ie. when building queries.\n"
371 "</p>\n"
372 "") );
373  gFunctionHelpTexts.insert( "Geometry", QCoreApplication::translate( "function_help", "<h3>Geometry Group</h3>\n"
374 "This group contains functions that operate on geometry objects e.g length, area.\n"
375 "") );
376  gFunctionHelpTexts.insert( "ILIKE", QCoreApplication::translate( "function_help", "<h3>ILIKE expression</h3>\n"
377 "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.\n"
378 "\n"
379 "<h4>Syntax</h4>\n"
380 "<pre>string/number ILIKE pattern</pre>\n"
381 "\n"
382 "<h4>Arguments</h4>\n"
383 "None\n"
384 "\n"
385 "<h4>Example</h4>\n"
386 "<pre> 'A' ILIKE 'A' &rarr; returns 1 </pre>\n"
387 "<pre> 'A' ILIKE 'a' &rarr; returns 1 </pre>\n"
388 "<pre> 'A' ILIKE 'B' &rarr; returns 0 </pre>\n"
389 "") );
390  gFunctionHelpTexts.insert( "IS", QCoreApplication::translate( "function_help", "<h3>IS expression</h3>\n"
391 "Returns 1 if a is the same as b.\n"
392 "\n"
393 "<h4>Syntax</h4>\n"
394 "<pre>a IS b</pre>\n"
395 "\n"
396 "<h4>Arguments</h4>\n"
397 "None\n"
398 "\n"
399 "<h4>Example</h4>\n"
400 "<pre> 'A' IS 'A' &rarr; returns 1 </pre>\n"
401 "<pre> 'A' IS 'a' &rarr; returns 0 </pre>\n"
402 "<pre> 4 IS 4 &rarr; returns 1 </pre>\n"
403 "<pre> 4 IS 2+2 &rarr; returns 1 </pre>\n"
404 "<pre> 4 IS 2 &rarr; returns 0 </pre>\n"
405 "<pre> $geometry IS NULL &rarr; returns 0, if your geometry is not NULL</pre>\n"
406 "\n"
407 "") );
408  gFunctionHelpTexts.insert( "LIKE", QCoreApplication::translate( "function_help", "<h3>LIKE expression</h3>\n"
409 "Returns 1 if the first parameter matches the supplied pattern. Works with numbers also.\n"
410 "\n"
411 "<h4>Syntax</h4>\n"
412 "<pre>string/number LIKE pattern</pre>\n"
413 "\n"
414 "<h4>Arguments</h4>\n"
415 "None\n"
416 "\n"
417 "<h4>Example</h4>\n"
418 "<pre> 'A' LIKE 'A' &rarr; returns 1 </pre>\n"
419 "<pre> 'A' LIKE 'a' &rarr; returns 0 </pre>\n"
420 "<pre> 'A' LIKE 'B' &rarr; returns 0 </pre>\n"
421 "") );
422  gFunctionHelpTexts.insert( "Math", QCoreApplication::translate( "function_help", "<h3>Math Group</h3>\n"
423 "This group contains math functions e.g square root, sin and cos\n"
424 "") );
425  gFunctionHelpTexts.insert( "NOT", QCoreApplication::translate( "function_help", "<h3>NOT</h3>\n"
426 "Returns 1 if a is not the same as b.\n"
427 "\n"
428 "<h4>Syntax</h4>\n"
429 "<pre> a NOT b </pre>\n"
430 "\n"
431 "<h4>Arguments</h4>\n"
432 "None\n"
433 "\n"
434 "<h4>Example</h4>\n"
435 "<pre> 'a' IS NOT 'b' &rarr; returns 1 </pre>\n"
436 "<pre> 'a' IS NOT 'a' &rarr; returns 0 </pre>\n"
437 "<pre> 4 IS NOT 2+2 &rarr; returns 0 </pre>\n"
438 "\n"
439 "") );
440  gFunctionHelpTexts.insert( "OR", QCoreApplication::translate( "function_help", "<h3>OR logical operator</h3>\n"
441 "Returns 1 when condition a or b is true.\n"
442 "\n"
443 "<h4>Syntax</h4>\n"
444 "<pre> condition a OR condition b </pre>\n"
445 "\n"
446 "<h4>Arguments</h4>\n"
447 "None\n"
448 "\n"
449 "<h4>Example</h4>\n"
450 "<pre> 4 = 2+2 OR 1 = 1 &rarr; returns 1 </pre>\n"
451 "<pre> 4 = 2+2 OR 1 = 2 &rarr; returns 1 </pre>\n"
452 "<pre> 4 = 2 OR 1 = 2 &rarr; returns 0 </pre>\n"
453 "") );
454  gFunctionHelpTexts.insert( "Operators", QCoreApplication::translate( "function_help", "<h3>Operators Group</h3>\n"
455 "This group contains operators e.g + - * \n"
456 "") );
457  gFunctionHelpTexts.insert( "Record", QCoreApplication::translate( "function_help", "<h3>Record Group</h3>\n"
458 "This group contains functions that operate on record identifiers.\n"
459 "") );
460  gFunctionHelpTexts.insert( "String", QCoreApplication::translate( "function_help", "<h3>String Group</h3>\n"
461 "This group contains functions that operate on strings e.g replace, convert to upper case.\n"
462 "") );
463  gFunctionHelpTexts.insert( "abs", QCoreApplication::translate( "function_help", "<h3>abs() function</h3>\n"
464 "Returns the absolute value of a number.<br>\n"
465 "\n"
466 "\n"
467 "<h4>Syntax</h4>\n"
468 "abs(<i>value</i>)<br>\n"
469 "\n"
470 "<h4>Arguments</h4>\n"
471 "<code>value</code> - a number.<br>\n"
472 "\n"
473 "<h4>Example</h4>\n"
474 "<code>abs(-2) &rarr; 2</code><br>\n"
475 "") );
476  gFunctionHelpTexts.insert( "acos", QCoreApplication::translate( "function_help", "<h3>acos() function</h3>\n"
477 "Returns arcuscosinus of a value in radians.\n"
478 "\n"
479 "\n"
480 "<p><h4>Syntax</h4>\n"
481 " acos(<i>real</i>)</p>\n"
482 "\n"
483 "<p><h4>Arguments</h4>\n"
484 "<i>real</i> &rarr; cos of an angle.</p>\n"
485 "\n"
486 "<p><h4>Example</h4>\n"
487 " acos(0.5) &rarr; 1.0471975511966</p>\n"
488 "") );
489  gFunctionHelpTexts.insert( "age", QCoreApplication::translate( "function_help", "<h3>age() function</h3>\n"
490 "Returns the difference between two dates.\n"
491 "<br><br>\n"
492 "The difference is returned as a <code>Interval</code> \n"
493 "and needs to be used with one of the following functions\n"
494 "in order to extract useful information:\n"
495 "<ul>\n"
496 "<li><code>year</code>\n"
497 "<li><code>month</code>\n"
498 "<li><code>week</code>\n"
499 "<li><code>day</code>\n"
500 "<li><code>hour</code>\n"
501 "<li><code>minute</code>\n"
502 "<li><code>second</code>\n"
503 "</ul>\n"
504 "<h4>Syntax</h4>\n"
505 "<code>age(string,string)</code><br>\n"
506 "<code>age(datetime,datetime)</code><br>\n"
507 "<code>age(string,datetime)</code><br>\n"
508 "<code>age(datetime,string)</code><br>\n"
509 "\n"
510 "<h4>Arguments</h4>\n"
511 "<code>string</code> - is string. A string in date format.\n"
512 "<br>\n"
513 "<code>datetime</code> - is date or datetime. A date or datetime type.\n"
514 "\n"
515 "<h4>Example</h4>\n"
516 "<!-- Show example of function.-->\n"
517 "<code>age('2012-05-12','2012-05-2') &rarr; Interval</code><br>\n"
518 "use <code>day</code> to extract number of days<br>\n"
519 "<code>day(age('2012-05-12','2012-05-2')) &rarr; 10</code><br>\n"
520 "\n"
521 "") );
522  gFunctionHelpTexts.insert( "asin", QCoreApplication::translate( "function_help", "<h3>asin() function</h3>\n"
523 "Returns arcussinus of a value in radians.\n"
524 "\n"
525 "\n"
526 "<p><h4>Syntax</h4>\n"
527 " asin(<i>real</i>)</p>\n"
528 "\n"
529 "<p><h4>Arguments</h4>\n"
530 "<i>real</i> &rarr; sin of an angle.</p>\n"
531 "\n"
532 "<p><h4>Example</h4>\n"
533 " asin(1.0) &rarr; 1.5707963267949</p>\n"
534 "") );
535  gFunctionHelpTexts.insert( "atan", QCoreApplication::translate( "function_help", "<h3>atan() function</h3>\n"
536 "Returns arcustanget of a value in radians.\n"
537 "\n"
538 "\n"
539 "<p><h4>Syntax</h4>\n"
540 " atan(<i>real</i>)</p>\n"
541 "\n"
542 "<p><h4>Arguments</h4>\n"
543 "<i>real</i> &rarr; tan of an angle.</p>\n"
544 "\n"
545 "<p><h4>Example</h4>\n"
546 " atan(0.5) &rarr; 0.463647609000806</p>\n"
547 "") );
548  gFunctionHelpTexts.insert( "atan2", QCoreApplication::translate( "function_help", "<h3>atan2() function</h3>\n"
549 "Returns arcustangens of y/x using the signs of the two \n"
550 "arguments to determine the quadrant of the result\n"
551 "\n"
552 "\n"
553 "\n"
554 "<p><h4>Syntax</h4>\n"
555 " atan2(<i>real</i>, <i>real</i>)</p>\n"
556 "\n"
557 "<p><h4>Arguments</h4>\n"
558 "<i>real</i> &rarr; y coordinate difference<br>\n"
559 "<i>real</i> &rarr; x coordinate difference</p>\n"
560 "\n"
561 "<p><h4>Example</h4>\n"
562 " atan2(1.0, 1.732) &rarr; 0.523611477769969</p>\n"
563 "") );
564  gFunctionHelpTexts.insert( "bbox", QCoreApplication::translate( "function_help", "<h3>bbox function</h3>\n"
565 "Returns 1 if the geometries spatially intersect the bounding box defined and 0 if they don't.\n"
566 "\n"
567 "<h4>Syntax</h4>\n"
568 "<pre>bbox( a, b )</pre>\n"
569 "\n"
570 "<h4>Arguments</h4>\n"
571 "a &rarr; geometry\n"
572 "b &rarr; geometry\n"
573 "\n"
574 "<h4>Example</h4>\n"
575 "<pre>bbox( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
576 "<pre>bbox( geomFromWKT( 'POINT(6 5)' ) , geomFromWKT( 'POLYGON((3 3 , 4 4 , 5 5, 3 3))' )) &rarr; returns 0</pre>\n"
577 "") );
578  gFunctionHelpTexts.insert( "bounds", QCoreApplication::translate( "function_help", "<h3>bounds function</h3>\n"
579 "Returns a geometry which represents the bounding box of an input geometry. Calculations are in the Spatial Reference System of this Geometry. \n"
580 "\n"
581 "<h4>Syntax</h4>\n"
582 "<pre>bounds(geom)</pre>\n"
583 "\n"
584 "<h4>Arguments</h4>\n"
585 "geom &rarr; a geometry\n"
586 "\n"
587 "<h4>Example</h4>\n"
588 "<pre> bounds($geometry) &rarr; returns bounding box of $geometry</pre>\n"
589 "\n"
590 "") );
591  gFunctionHelpTexts.insert( "bounds_height", QCoreApplication::translate( "function_help", "<h3>bounds_height function</h3>\n"
592 "Returns the height of the bounding box of a geometry. Calculations are in the Spatial Reference System of this Geometry. \n"
593 "\n"
594 "<h4>Syntax</h4>\n"
595 "<pre>bounds_height(geom)</pre>\n"
596 "\n"
597 "<h4>Arguments</h4>\n"
598 "geom &rarr; a geometry\n"
599 "\n"
600 "<h4>Example</h4>\n"
601 "<pre> bounds_height($geometry) &rarr; returns height of bounding box of $geometry</pre>\n"
602 "\n"
603 "") );
604  gFunctionHelpTexts.insert( "bounds_width", QCoreApplication::translate( "function_help", "<h3>bounds_width function</h3>\n"
605 "Returns the width of the bounding box of a geometry. Calculations are in the Spatial Reference System of this Geometry. \n"
606 "\n"
607 "<h4>Syntax</h4>\n"
608 "<pre>bounds_width(geom)</pre>\n"
609 "\n"
610 "<h4>Arguments</h4>\n"
611 "geom &rarr; a geometry\n"
612 "\n"
613 "<h4>Example</h4>\n"
614 "<pre> bounds_width($geometry) &rarr; returns width of bounding box of $geometry</pre>\n"
615 "\n"
616 "") );
617  gFunctionHelpTexts.insert( "buffer", QCoreApplication::translate( "function_help", "<h3>buffer function</h3>\n"
618 "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. \n"
619 "\n"
620 "<h4>Syntax</h4>\n"
621 "<pre>buffer(a, b)</pre>\n"
622 "\n"
623 "<h4>Arguments</h4>\n"
624 "a &rarr; geometry\n"
625 "b &rarr; distance for the buffer\n"
626 "\n"
627 "<h4>Example</h4>\n"
628 "<pre> buffer($geometry, 10.5 ) &rarr; returns a polygon</pre>\n"
629 "\n"
630 "") );
631  gFunctionHelpTexts.insert( "ceil", QCoreApplication::translate( "function_help", "<h3>ceil() function</h3>\n"
632 "Rounds a number upwards.\n"
633 "\n"
634 "<h4>Syntax</h4>\n"
635 "<code>ceil(value)</code><br>\n"
636 "\n"
637 "<h4>Arguments</h4>\n"
638 "<code>value</code> - a number.\n"
639 "<br>\n"
640 "\n"
641 "<h4>Example</h4>\n"
642 "<!-- Show example of function.-->\n"
643 "<code>ceil(4.9) &rarr; 5</code><br>\n"
644 "<code>ceil(-4.9) &rarr; -4</code><br>\n"
645 "") );
646  gFunctionHelpTexts.insert( "centroid", QCoreApplication::translate( "function_help", "<h3>centroid function</h3>\n"
647 "Returns the geometric center of a geometry.\n"
648 "\n"
649 "<h4>Syntax</h4>\n"
650 "<pre>centroid(a)</pre>\n"
651 "\n"
652 "<h4>Arguments</h4>\n"
653 "b &rarr; geometry\n"
654 "\n"
655 "<h4>Example</h4>\n"
656 "<pre> centroid($geometry) &rarr; returns a point geometry</pre>\n"
657 "\n"
658 "") );
659  gFunctionHelpTexts.insert( "clamp", QCoreApplication::translate( "function_help", "<h3>clamp() function</h3>\n"
660 "Restricts an input value to a specified range.\n"
661 "\n"
662 "<p><h4>Syntax</h4>\n"
663 " clamp(<i>minimum</i>,<i>input</i>,<i>maximum</i>)</p>\n"
664 "\n"
665 "<p><h4>Arguments</h4>\n"
666 "<!-- List args for functions here-->\n"
667 "<i> minimum</i> &rarr; The smallest value <i>input</i> is allowed to take.<br>\n"
668 "<i> input</i> &rarr; a value which will be restricted to the range specified by <i>minimum</i> and <i>maximum</i>.<br>\n"
669 "<i> maximum</i> &rarr; The largest value <i>input</i> is allowed to take.<br>\n"
670 "\n"
671 "<h4>Example</h4>\n"
672 "<!-- Show example of function.-->\n"
673 " clamp(1,5,10) &rarr; 5 (<i>input</i> is between 1 and 10 so is returned unchanged)<br>\n"
674 " clamp(1,0,10) &rarr; 1 (<i>input</i> is less than minimum value of 1, so function returns 1)<br>\n"
675 " clamp(1,11,10) &rarr; 10 (<i>input</i> is greater than maximum value of 10, so function returns 10)<br>\n"
676 " \n"
677 " \n"
678 "") );
679  gFunctionHelpTexts.insert( "coalesce", QCoreApplication::translate( "function_help", "<h3>coalesce() function</h3>\n"
680 "Returns the first non-NULL value from the expression list.\n"
681 "<br>\n"
682 "This function can take any number of arguments.\n"
683 "<h4>Syntax</h4>\n"
684 "<code>coalesce(expression1, expression2 ...)</code><br>\n"
685 "\n"
686 "<h4>Arguments</h4>\n"
687 "<code>expression</code> - any valid expression or value, irregardless of type.\n"
688 "<br>\n"
689 "\n"
690 "<h4>Example</h4>\n"
691 "<!-- Show example of function.-->\n"
692 "<code>coalesce(NULL, 2) &rarr; 2</code><br>\n"
693 "<code>coalesce(NULL, 2, 3) &rarr; 2</code><br>\n"
694 "<code>coalesce(7, NULL, 3*2) &rarr; 7</code><br><br>\n"
695 "<code>coalesce(\"fieldA\", \"fallbackField\", 'ERROR') &rarr; value of fieldA if it is non-NULL\n"
696 " else the value of \"fallbackField\" or the string 'ERROR' if both are NULL</code><br>\n"
697 "\n"
698 "") );
699  gFunctionHelpTexts.insert( "color_cmyk", QCoreApplication::translate( "function_help", "\n"
700 "<h3>color_cmyk() function</h3>\n"
701 "Returns a string representation of a color based on its cyan, magenta, yellow and black components\n"
702 "\n"
703 "<p><h4>Syntax</h4>\n"
704 " color_cmyk(<i>cyan, magenta, yellow, black</i>)</p>\n"
705 "\n"
706 "<p><h4>Arguments</h4>\n"
707 "<!-- List args for functions here-->\n"
708 "<i> cyan</i> &rarr; the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
709 "<i> magenta</i> &rarr; the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
710 "<i> yellow</i> &rarr; the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
711 "<i> black</i> &rarr; the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
712 "\n"
713 "<p><h4>Example</h4>\n"
714 "<!-- Show example of function.-->\n"
715 " color_cmyk(100,50,0,10) &rarr; '0,115,230'</p>\n"
716 "") );
717  gFunctionHelpTexts.insert( "color_cmyka", QCoreApplication::translate( "function_help", "\n"
718 "<h3>color_cmyka() function</h3>\n"
719 "Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components\n"
720 "\n"
721 "<p><h4>Syntax</h4>\n"
722 " color_cmyka(<i>cyan, magenta, yellow, black, alpha</i>)</p>\n"
723 "\n"
724 "<p><h4>Arguments</h4>\n"
725 "<!-- List args for functions here-->\n"
726 "<i> cyan</i> &rarr; the cyan component of the color, as a percentage integer value from 0 to 100.<br>\n"
727 "<i> magenta</i> &rarr; the magenta component of the color, as a percentage integer value from 0 to 100.<br>\n"
728 "<i> yellow</i> &rarr; the yellow component of the color, as a percentage integer value from 0 to 100.<br>\n"
729 "<i> black</i> &rarr; the black component of the color, as a percentage integer value from 0 to 100.<br>\n"
730 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
731 "\n"
732 "<p><h4>Example</h4>\n"
733 "<!-- Show example of function.-->\n"
734 " color_cmyka(100,50,0,10,200) &rarr; '0,115,230,200'</p>\n"
735 "") );
736  gFunctionHelpTexts.insert( "color_hsl", QCoreApplication::translate( "function_help", "<h3>color_hsl() function</h3>\n"
737 "Returns a string representation of a color based on its hue, saturation, and lightness attributes\n"
738 "\n"
739 "<p><h4>Syntax</h4>\n"
740 " color_hsl(<i>hue, saturation, lightness</i>)</p>\n"
741 "\n"
742 "<p><h4>Arguments</h4>\n"
743 "<!-- List args for functions here-->\n"
744 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
745 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
746 "<i> lightness</i> &rarr; the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
747 "\n"
748 "<p><h4>Example</h4>\n"
749 "<!-- Show example of function.-->\n"
750 " color_hsl(100,50,70) &rarr; '166,217,140'</p>\n"
751 "") );
752  gFunctionHelpTexts.insert( "color_hsla", QCoreApplication::translate( "function_help", "<h3>color_hsla() function</h3>\n"
753 "Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes\n"
754 "\n"
755 "<p><h4>Syntax</h4>\n"
756 " color_hsla(<i>hue, saturation, lightness, alpha</i>)</p>\n"
757 "\n"
758 "<p><h4>Arguments</h4>\n"
759 "<!-- List args for functions here-->\n"
760 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
761 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
762 "<i> lightness</i> &rarr; the lightness percentage of the color as an integer value from 0 to 100.<br>\n"
763 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
764 "\n"
765 "<p><h4>Example</h4>\n"
766 "<!-- Show example of function.-->\n"
767 " color_hsla(100,50,70,200) &rarr; '166,217,140,200'</p>\n"
768 "") );
769  gFunctionHelpTexts.insert( "color_hsv", QCoreApplication::translate( "function_help", "<h3>color_hsv() function</h3>\n"
770 "Returns a string representation of a color based on its hue, saturation, and value attributes\n"
771 "\n"
772 "<p><h4>Syntax</h4>\n"
773 " color_hsv(<i>hue, saturation, value</i>)</p>\n"
774 "\n"
775 "<p><h4>Arguments</h4>\n"
776 "<!-- List args for functions here-->\n"
777 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
778 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
779 "<i> value</i> &rarr; the value percentage of the color as an integer from 0 to 100.<br>\n"
780 "\n"
781 "<p><h4>Example</h4>\n"
782 "<!-- Show example of function.-->\n"
783 " color_hsv(40,100,100) &rarr; '255,170,0'</p>\n"
784 "") );
785  gFunctionHelpTexts.insert( "color_hsva", QCoreApplication::translate( "function_help", "<h3>color_hsva() function</h3>\n"
786 "Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes\n"
787 "\n"
788 "<p><h4>Syntax</h4>\n"
789 " color_hsva(<i>hue, saturation, value, alpha</i>)</p>\n"
790 "\n"
791 "<p><h4>Arguments</h4>\n"
792 "<!-- List args for functions here-->\n"
793 "<i> hue</i> &rarr; the hue of the color, as an integer value from 0 to 360.<br>\n"
794 "<i> saturation</i> &rarr; the saturation percentage of the color as an integer value from 0 to 100.<br>\n"
795 "<i> value</i> &rarr; the value percentage of the color as an integer from 0 to 100.<br>\n"
796 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
797 "\n"
798 "<p><h4>Example</h4>\n"
799 "<!-- Show example of function.-->\n"
800 " color_hsva(40,100,100,200) &rarr; '255,170,0,200'</p>\n"
801 "") );
802  gFunctionHelpTexts.insert( "color_rgb", QCoreApplication::translate( "function_help", "\n"
803 "<h3>color_rgb() function</h3>\n"
804 "Returns a string representation of a color based on its red, green, and blue components\n"
805 "\n"
806 "<p><h4>Syntax</h4>\n"
807 " color_rgb(<i>red, green, blue</i>)</p>\n"
808 "\n"
809 "<p><h4>Arguments</h4>\n"
810 "<!-- List args for functions here-->\n"
811 "<i> red</i> &rarr; the red component as an integer value from 0 to 255.<br>\n"
812 "<i> green</i> &rarr; the green component as an integer value from 0 to 255.<br>\n"
813 "<i> blue</i> &rarr; the blue component as an integer value from 0 to 255.<br>\n"
814 "\n"
815 "<p><h4>Example</h4>\n"
816 "<!-- Show example of function.-->\n"
817 " color_rgb(255,127,0) &rarr; '255,127,0'</p>\n"
818 "") );
819  gFunctionHelpTexts.insert( "color_rgba", QCoreApplication::translate( "function_help", "\n"
820 "<h3>color_rgba() function</h3>\n"
821 "Returns a string representation of a color based on its red, green, blue, and alpha (transparency) components\n"
822 "\n"
823 "<p><h4>Syntax</h4>\n"
824 " color_rgba(<i>red, green, blue, alpha</i>)</p>\n"
825 "\n"
826 "<p><h4>Arguments</h4>\n"
827 "<!-- List args for functions here-->\n"
828 "<i> red</i> &rarr; the red component as an integer value from 0 to 255.<br>\n"
829 "<i> green</i> &rarr; the green component as an integer value from 0 to 255.<br>\n"
830 "<i> blue</i> &rarr; the blue component as an integer value from 0 to 255.<br>\n"
831 "<i> alpha</i> &rarr; the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br>\n"
832 "\n"
833 "<p><h4>Example</h4>\n"
834 "<!-- Show example of function.-->\n"
835 " color_rgba(255,127,0,200) &rarr; '255,127,0,200'</p>\n"
836 "") );
837  gFunctionHelpTexts.insert( "combine", QCoreApplication::translate( "function_help", "<h3>combine function</h3>\n"
838 "Returns the combination of geometry a and geometry b.\n"
839 "\n"
840 "<h4>Syntax</h4>\n"
841 "<pre>combine( geometry a , geometry b)</pre>\n"
842 "\n"
843 "<h4>Arguments</h4>\n"
844 "geometry &rarr; geometry\n"
845 "geometry &rarr; geometry\n"
846 "\n"
847 "<h4>Example</h4>\n"
848 "<pre> geomToWKT( combine( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5 )' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4, 2 1 )' )) ) &rarr; returns MULTILINESTRING((4 4, 2 1), (3 3, 4 4), (4 4, 5 5)) </pre>\n"
849 "<pre> geomToWKT( combine( geomFromWKT( 'LINESTRING(3 3 , 4 4 )' ) , geomFromWKT( 'LINESTRING(3 3 , 6 6, 2 1 )' )) ) &rarr; returns LINESTRING(3 3, 4 4, 6 6, 2 1) </pre>\n"
850 "") );
851  gFunctionHelpTexts.insert( "concat", QCoreApplication::translate( "function_help", "<h3>concat() function</h3>\n"
852 "Concatenates several strings to one.\n"
853 "\n"
854 "<h4>Syntax</h4>\n"
855 " concat(<i>string<i>[,<i>string</i>...])\n"
856 "\n"
857 "<h4>Arguments</h4>\n"
858 "<!-- List args for functions here-->\n"
859 "<i> string</i> &rarr; is string. a string.<br>\n"
860 "\n"
861 "<h4>Example</h4>\n"
862 "<!-- Show example of function.-->\n"
863 " concat('a','b','c','d','e') &rarr; 'abcde'\n"
864 "") );
865  gFunctionHelpTexts.insert( "contains", QCoreApplication::translate( "function_help", "<h3>contains function</h3>\n"
866 "Returns true if and only if no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a. \n"
867 "\n"
868 "<h4>Syntax</h4>\n"
869 "<pre>contains( geometry a , geometry b)</pre>\n"
870 "\n"
871 "<h4>Arguments</h4>\n"
872 "geometry &rarr; geometry\n"
873 "geometry &rarr; geometry\n"
874 "\n"
875 "<h4>Example</h4>\n"
876 "<pre> contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'POINT( 0.5 0.5 )' )) &rarr; returns 1</pre>\n"
877 "<pre> contains( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 0</pre>\n"
878 "") );
879  gFunctionHelpTexts.insert( "convexHull", QCoreApplication::translate( "function_help", "<h3>convexHull function</h3>\n"
880 "Returns the convex hull of a geometry. It represents the minimum convex geometry that encloses all geometries within the set.\n"
881 "\n"
882 "<h4>Syntax</h4>\n"
883 "<pre>convexHull( a, b )</pre>\n"
884 "\n"
885 "<h4>Arguments</h4>\n"
886 "a &rarr; geometry\n"
887 "a &rarr; geometry\n"
888 "\n"
889 "<h4>Example</h4>\n"
890 "<pre> geomToWKT( convexHull( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 4 10)' )) ) &rarr; returns POLYGON((3 3,4 10,4 4,3 3)) </pre>\n"
891 "") );
892  gFunctionHelpTexts.insert( "cos", QCoreApplication::translate( "function_help", "<h3>cos() function</h3>\n"
893 "Returns cosinus of an angle.\n"
894 "\n"
895 "\n"
896 "<p><h4>Syntax</h4>\n"
897 " cos(<i>real</i>)</p>\n"
898 "\n"
899 "<p><h4>Arguments</h4>\n"
900 "<i>real</i> &rarr; angle in radians.</p>\n"
901 "\n"
902 "<p><h4>Example</h4>\n"
903 " cos(1.571) &rarr; 0.000796326710733263</p>\n"
904 "") );
905  gFunctionHelpTexts.insert( "crosses", QCoreApplication::translate( "function_help", "<h3>crosses function</h3>\n"
906 "Returns 1 if the supplied geometries have some, but not all, interior points in common.\n"
907 "\n"
908 "<h4>Syntax</h4>\n"
909 "<pre>crosses( $geometry , $geometry)</pre>\n"
910 "\n"
911 "<h4>Arguments</h4>\n"
912 "geometry &rarr; geometry\n"
913 "geometry &rarr; geometry\n"
914 "\n"
915 "<h4>Example</h4>\n"
916 "<pre> crosses( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
917 "<pre> crosses( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 0</pre>\n"
918 "") );
919  gFunctionHelpTexts.insert( "day", QCoreApplication::translate( "function_help", "<h3>day() function</h3>\n"
920 "Extract the day from a date, or the number of days\n"
921 "from a <code>Interval</code>\n"
922 "\n"
923 "<h4>Syntax</h4>\n"
924 "<code>day(date)</code><br>\n"
925 "<code>day(Interval)</code><br>\n"
926 "\n"
927 "<h4>Arguments</h4>\n"
928 "<code>date</code> - is date or datetime. The date to extract the day from.\n"
929 "<br>\n"
930 "<code>Interval</code> - is Interval. The Interval to return the number of days from.\n"
931 "\n"
932 "<h4>Example</h4>\n"
933 "<!-- Show example of function.-->\n"
934 "<code>day('2012-05-12') &rarr; 12</code><br>\n"
935 "<code>day(tointerval('3 days')) &rarr; 3</code><br>\n"
936 "<code>day(age('2012-01-01','2010-01-01')) &rarr; 730</code><br>\n"
937 "\n"
938 "") );
939  gFunctionHelpTexts.insert( "difference", QCoreApplication::translate( "function_help", "<h3>difference function</h3>\n"
940 "Returns a geometry that represents that part of geometry a that does not intersect with geometry b.\n"
941 "\n"
942 "<h4>Syntax</h4>\n"
943 "<pre>difference( a, b )</pre>\n"
944 "\n"
945 "<h4>Arguments</h4>\n"
946 "geometry &rarr; geometry\n"
947 "geometry &rarr; geometry\n"
948 "\n"
949 "<h4>Example</h4>\n"
950 "<pre> geomToWKT( difference( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4)' )) ) &rarr; returns LINESTRING(4 4, 5 5)</pre>\n"
951 "") );
952  gFunctionHelpTexts.insert( "disjoint", QCoreApplication::translate( "function_help", "<h3>disjoint function</h3>\n"
953 "Returns 1 if the geometries do not \"spatially intersect\" - if they do not share any space together. \n"
954 "\n"
955 "<h4>Syntax</h4>\n"
956 "<pre>disjoint( a, b )</pre>\n"
957 "\n"
958 "<h4>Arguments</h4>\n"
959 "a &rarr; geometry\n"
960 "b &rarr; geometry\n"
961 "\n"
962 "<h4>Example</h4>\n"
963 "<pre> disjoint( geomFromWKT( 'POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
964 "<pre> disjoint( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'POINT(4 4)' )) &rarr; returns 0</pre>\n"
965 "") );
966  gFunctionHelpTexts.insert( "distance", QCoreApplication::translate( "function_help", "<h3>distance function</h3>\n"
967 " Returns the minimum distance (based on spatial ref) between two geometries in projected units.\n"
968 "\n"
969 "<h4>Syntax</h4>\n"
970 "<pre>distance( a, b )</pre>\n"
971 "\n"
972 "<h4>Arguments</h4>\n"
973 "a &rarr; geometry\n"
974 "b &rarr; geometry\n"
975 "\n"
976 "<h4>Example</h4>\n"
977 "<pre> distance( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(4 8)' )) &rarr; returns 4</pre>\n"
978 "") );
979  gFunctionHelpTexts.insert( "exp", QCoreApplication::translate( "function_help", "<h3>exp() function</h3>\n"
980 "Returns exponential of an value.\n"
981 "\n"
982 "\n"
983 "<p><h4>Syntax</h4>\n"
984 " exp(<i>real</i>)</p>\n"
985 "\n"
986 "<p><h4>Arguments</h4>\n"
987 "<i>real</i> &rarr; number.</p>\n"
988 "\n"
989 "<p><h4>Example</h4>\n"
990 " exp(1.0) &rarr; 2.71828182845905</p>\n"
991 "") );
992  gFunctionHelpTexts.insert( "floor", QCoreApplication::translate( "function_help", "<h3>floor() function</h3>\n"
993 "Rounds a number downwards.\n"
994 "\n"
995 "<h4>Syntax</h4>\n"
996 "<code>floor(value)</code><br>\n"
997 "\n"
998 "<h4>Arguments</h4>\n"
999 "<code>value</code> - a number.\n"
1000 "<br>\n"
1001 "\n"
1002 "<h4>Example</h4>\n"
1003 "<!-- Show example of function.-->\n"
1004 "<code>floor(4.9) &rarr; 4</code><br>\n"
1005 "<code>floor(-4.9) &rarr; -5</code><br>\n"
1006 "") );
1007  gFunctionHelpTexts.insert( "format", QCoreApplication::translate( "function_help", "<h3>format() function</h3>\n"
1008 "Format a string using supplied arguments. \n"
1009 "\n"
1010 "<h4>Syntax</h4>\n"
1011 "<code>format('string', arg, [arg...n])</code><br>\n"
1012 "\n"
1013 "<h4>Arguments</h4>\n"
1014 "<code>string</code> - is string. String with Qt QString place holders. Use %1, %2, etc for placeholders. Placeholders can be repeated. \n"
1015 "<br>\n"
1016 "<code>arg [arg...n]</code> - any type. Any number of args. \n"
1017 "\n"
1018 "<h4>Example</h4>\n"
1019 "<!-- Show example of function.-->\n"
1020 "<code>format('This %1 a %2','is', 'test') &rarr; This is a test</code><br>") );
1021  gFunctionHelpTexts.insert( "format_date", QCoreApplication::translate( "function_help", "<h3>format_date() function</h3>\n"
1022 "Format a date type or string into a custom string format. Uses Qt data time format strings. See <a href='http://qt-project.org/doc/qt-4.8/qdatetime.html#toString'>QDateTime::toString</a>\n"
1023 "\n"
1024 "<h4>Syntax</h4>\n"
1025 "<code>format_date('string', 'format_string')</code><br>\n"
1026 "\n"
1027 "<h4>Arguments</h4>\n"
1028 "<code>string</code> - is string. Date/Time/DateTime string.\n"
1029 "<br>\n"
1030 "<code>format_string</code> - is string. String template used to format the string.\n"
1031 "\n"
1032 " <table>\n"
1033 " <thead>\n"
1034 " <tr>\n"
1035 " <th>Expression</th>\n"
1036 "\n"
1037 " <th>Output</th>\n"
1038 " </tr>\n"
1039 " </thead>\n"
1040 "\n"
1041 " <tr valign=\"top\">\n"
1042 " <td>d</td>\n"
1043 "\n"
1044 " <td>the day as number without a leading zero (1 to 31)</td>\n"
1045 " </tr>\n"
1046 "\n"
1047 " <tr valign=\"top\">\n"
1048 " <td>dd</td>\n"
1049 "\n"
1050 " <td>the day as number with a leading zero (01 to 31)</td>\n"
1051 " </tr>\n"
1052 "\n"
1053 " <tr valign=\"top\">\n"
1054 " <td>ddd</td>\n"
1055 "\n"
1056 " <td>the abbreviated localized day name (e.g. 'Mon' to 'Sun'). Uses <a href=\n"
1057 " \"qdate.html#shortDayName\">QDate::shortDayName</a>().</td>\n"
1058 " </tr>\n"
1059 "\n"
1060 " <tr valign=\"top\">\n"
1061 " <td>dddd</td>\n"
1062 "\n"
1063 " <td>the long localized day name (e.g. 'Monday' to 'Sunday'). Uses <a href=\n"
1064 " \"qdate.html#longDayName\">QDate::longDayName</a>().</td>\n"
1065 " </tr>\n"
1066 "\n"
1067 " <tr valign=\"top\">\n"
1068 " <td>M</td>\n"
1069 "\n"
1070 " <td>the month as number without a leading zero (1-12)</td>\n"
1071 " </tr>\n"
1072 "\n"
1073 " <tr valign=\"top\">\n"
1074 " <td>MM</td>\n"
1075 "\n"
1076 " <td>the month as number with a leading zero (01-12)</td>\n"
1077 " </tr>\n"
1078 "\n"
1079 " <tr valign=\"top\">\n"
1080 " <td>MMM</td>\n"
1081 "\n"
1082 " <td>the abbreviated localized month name (e.g. 'Jan' to 'Dec'). Uses <a href=\n"
1083 " \"qdate.html#shortMonthName\">QDate::shortMonthName</a>().</td>\n"
1084 " </tr>\n"
1085 "\n"
1086 " <tr valign=\"top\">\n"
1087 " <td>MMMM</td>\n"
1088 "\n"
1089 " <td>the long localized month name (e.g. 'January' to 'December'). Uses <a href=\n"
1090 " \"qdate.html#longMonthName\">QDate::longMonthName</a>().</td>\n"
1091 " </tr>\n"
1092 "\n"
1093 " <tr valign=\"top\">\n"
1094 " <td>yy</td>\n"
1095 "\n"
1096 " <td>the year as two digit number (00-99)</td>\n"
1097 " </tr>\n"
1098 "\n"
1099 " <tr valign=\"top\">\n"
1100 " <td>yyyy</td>\n"
1101 "\n"
1102 " <td>the year as four digit number</td>\n"
1103 " </tr>\n"
1104 " </table>\n"
1105 "\n"
1106 " <p>These expressions may be used for the time part of the format string:</p>\n"
1107 "\n"
1108 " <table>\n"
1109 " <thead>\n"
1110 " <tr>\n"
1111 " <th>Expression</th>\n"
1112 "\n"
1113 " <th>Output</th>\n"
1114 " </tr>\n"
1115 " </thead>\n"
1116 "\n"
1117 " <tr valign=\"top\">\n"
1118 " <td>h</td>\n"
1119 "\n"
1120 " <td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td>\n"
1121 " </tr>\n"
1122 "\n"
1123 " <tr valign=\"top\">\n"
1124 " <td>hh</td>\n"
1125 "\n"
1126 " <td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td>\n"
1127 " </tr>\n"
1128 "\n"
1129 " <tr valign=\"top\">\n"
1130 " <td>H</td>\n"
1131 "\n"
1132 " <td>the hour without a leading zero (0 to 23, even with AM/PM display)</td>\n"
1133 " </tr>\n"
1134 "\n"
1135 " <tr valign=\"top\">\n"
1136 " <td>HH</td>\n"
1137 "\n"
1138 " <td>the hour with a leading zero (00 to 23, even with AM/PM display)</td>\n"
1139 " </tr>\n"
1140 "\n"
1141 " <tr valign=\"top\">\n"
1142 " <td>m</td>\n"
1143 "\n"
1144 " <td>the minute without a leading zero (0 to 59)</td>\n"
1145 " </tr>\n"
1146 "\n"
1147 " <tr valign=\"top\">\n"
1148 " <td>mm</td>\n"
1149 "\n"
1150 " <td>the minute with a leading zero (00 to 59)</td>\n"
1151 " </tr>\n"
1152 "\n"
1153 " <tr valign=\"top\">\n"
1154 " <td>s</td>\n"
1155 "\n"
1156 " <td>the second without a leading zero (0 to 59)</td>\n"
1157 " </tr>\n"
1158 "\n"
1159 " <tr valign=\"top\">\n"
1160 " <td>ss</td>\n"
1161 "\n"
1162 " <td>the second with a leading zero (00 to 59)</td>\n"
1163 " </tr>\n"
1164 "\n"
1165 " <tr valign=\"top\">\n"
1166 " <td>z</td>\n"
1167 "\n"
1168 " <td>the milliseconds without leading zeroes (0 to 999)</td>\n"
1169 " </tr>\n"
1170 "\n"
1171 " <tr valign=\"top\">\n"
1172 " <td>zzz</td>\n"
1173 "\n"
1174 " <td>the milliseconds with leading zeroes (000 to 999)</td>\n"
1175 " </tr>\n"
1176 "\n"
1177 " <tr valign=\"top\">\n"
1178 " <td>AP or A</td>\n"
1179 "\n"
1180 " <td>interpret as an AM/PM time. <i>AP</i> must be either \"AM\" or \"PM\".</td>\n"
1181 " </tr>\n"
1182 "\n"
1183 " <tr valign=\"top\">\n"
1184 " <td>ap or a</td>\n"
1185 "\n"
1186 " <td>Interpret as an AM/PM time. <i>ap</i> must be either \"am\" or \"pm\".</td>\n"
1187 " </tr>\n"
1188 " </table>\n"
1189 "\n"
1190 "<br>\n"
1191 "\n"
1192 "<h4>Example</h4>\n"
1193 "<!-- Show example of function.-->\n"
1194 "<code>format_date('2012-05-15','dd.mm.yyyy') &rarr; 15.05.2012</code><br>\n"
1195 "") );
1196  gFunctionHelpTexts.insert( "format_number", QCoreApplication::translate( "function_help", "<h3>format_number() function</h3>\n"
1197 "Returns a number formatted with the locale separator for thousands. \n"
1198 "Also truncates the number to the number of supplied places. \n"
1199 "<h4>Syntax</h4>\n"
1200 "<code>format_number(number,places)</code><br>\n"
1201 "\n"
1202 "<h4>Arguments</h4>\n"
1203 "<code>number</code> - is number. The number to be formatted.\n"
1204 "<br>\n"
1205 "<code>places</code> - is int. The number of decimal places to truncate the string\n"
1206 "to.\n"
1207 "\n"
1208 "<h4>Example</h4>\n"
1209 "<!-- Show example of function.-->\n"
1210 "<code>format_number(10000000.332,2) &rarr; 10,000,000.33</code>\n"
1211 "\n"
1212 "") );
1213  gFunctionHelpTexts.insert( "geomFromGML", QCoreApplication::translate( "function_help", "<h3>geomFromGML function</h3>\n"
1214 "Returns a geometry from a GML representation of geometry\n"
1215 "\n"
1216 "<h4>Syntax</h4>\n"
1217 "<pre>geomFromGML(text)</pre>\n"
1218 "\n"
1219 "<h4>Arguments</h4>\n"
1220 "text &rarr; GML representation of a geometry\n"
1221 "\n"
1222 "<h4>Example</h4>\n"
1223 "<pre> geomFromGML( '<gml:LineString srsName=\"EPSG:4326\"><gml:coordinates>4,4 5,5 6,6</gml:coordinates></gml:LineString>') &rarr; returns a geometry</pre>\n"
1224 "\n"
1225 "") );
1226  gFunctionHelpTexts.insert( "geomFromWKT", QCoreApplication::translate( "function_help", "<h3>geomFromWKT function</h3>\n"
1227 "Returns a geometry created from a Well-Known Text (WKT) representation.\n"
1228 "\n"
1229 "<h4>Syntax</h4>\n"
1230 "<pre>geomFromWKT(text)</pre>\n"
1231 "\n"
1232 "<h4>Arguments</h4>\n"
1233 "text &rarr; Well-Known Text (WKT) representation of a geometry\n"
1234 "\n"
1235 "<h4>Example</h4>\n"
1236 "<pre> geomFromWKT( 'POINT(4 5)' ) &rarr; returns a geometry</pre>\n"
1237 "\n"
1238 "") );
1239  gFunctionHelpTexts.insert( "geomToWKT", QCoreApplication::translate( "function_help", "<h3>geomToWKT function</h3>\n"
1240 "Returns the Well-Known Text (WKT) representation of the geometry without SRID metadata.\n"
1241 "\n"
1242 "<h4>Syntax</h4>\n"
1243 "<pre>geomToWKT(a)</pre>\n"
1244 "\n"
1245 "<h4>Arguments</h4>\n"
1246 "a &rarr; geometry\n"
1247 "\n"
1248 "<h4>Example</h4>\n"
1249 "<pre> geomToWKT( $geometry ) &rarr; POINT(6 50)</pre>\n"
1250 "") );
1251  gFunctionHelpTexts.insert( "hour", QCoreApplication::translate( "function_help", "<h3>hour() function</h3>\n"
1252 "Extract the hour from a datetime or time, or the number of hours\n"
1253 "from a <code>Interval</code>\n"
1254 "\n"
1255 "<h4>Syntax</h4>\n"
1256 "<code>hour(datetime)</code><br>\n"
1257 "<code>hour(Interval)</code><br>\n"
1258 "\n"
1259 "<h4>Arguments</h4>\n"
1260 "<code>date</code> - is datetime or time. The date to extract the hour from.\n"
1261 "<br>\n"
1262 "<code>Interval</code> - is Interval. The Interval to return the number of hours from.\n"
1263 "\n"
1264 "<h4>Example</h4>\n"
1265 "<!-- Show example of function.-->\n"
1266 "<code>hour('2012-07-22T13:24:57') &rarr; 13</code><br>\n"
1267 "<code>hour(tointerval('3 hours')) &rarr; 3</code><br>\n"
1268 "<code>hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00')) &rarr; 3</code><br>\n"
1269 "<code>hour(age('2012-01-01','2010-01-01')) &rarr; 17520</code><br>\n"
1270 "\n"
1271 "") );
1272  gFunctionHelpTexts.insert( "intersection", QCoreApplication::translate( "function_help", "<h3>intersection function</h3>\n"
1273 "Returns a geometry that represents the shared portion of geometry a and geometry b.\n"
1274 "\n"
1275 "<h4>Syntax</h4>\n"
1276 "<pre>intersection( geometry a , geometry b)</pre>\n"
1277 "\n"
1278 "<h4>Arguments</h4>\n"
1279 "geometry &rarr; geometry\n"
1280 "geometry &rarr; geometry\n"
1281 "\n"
1282 "<h4>Example</h4>\n"
1283 "<pre> geomToWKT( intersection( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 )' )) ) &rarr; returns LINESTRING(3 3, 4 4)</pre>\n"
1284 "") );
1285  gFunctionHelpTexts.insert( "intersects", QCoreApplication::translate( "function_help", "<h3>intersects function</h3>\n"
1286 "Returns 1 if the geometries spatially intersect (share any portion of space) and 0 if they don't.\n"
1287 "\n"
1288 "<h4>Syntax</h4>\n"
1289 "<pre>intersects( a, b )</pre>\n"
1290 "\n"
1291 "<h4>Arguments</h4>\n"
1292 "a &rarr; geometry\n"
1293 "b &rarr; geometry\n"
1294 "\n"
1295 "<h4>Example</h4>\n"
1296 "<pre> intersects( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
1297 "<pre> intersects( geomFromWKT( 'POINT(4 5)' ) , geomFromWKT( 'POINT(5 5)' )) &rarr; returns 0</pre>\n"
1298 "") );
1299  gFunctionHelpTexts.insert( "left", QCoreApplication::translate( "function_help", "<h3>left() function</h3>\n"
1300 "Returns a substring that contains the <i>n</i> leftmost characters of the string.\n"
1301 "\n"
1302 "<h4>Syntax</h4>\n"
1303 "<code>left(string, length)</code><br>\n"
1304 "\n"
1305 "<h4>Arguments</h4>\n"
1306 "<code>string</code> - is string. The string.\n"
1307 "<br>\n"
1308 "<code>length</code> - is int. The number of characters from the left to return.\n"
1309 "\n"
1310 "<h4>Example</h4>\n"
1311 "<!-- Show example of function.-->\n"
1312 "<code>left('Hello World',5) &rarr; 'Hello'</code><br>\n"
1313 "\n"
1314 "") );
1315  gFunctionHelpTexts.insert( "length", QCoreApplication::translate( "function_help", "<h3>length() function</h3>\n"
1316 "Returns the length of a string.\n"
1317 "\n"
1318 "<p><h4>Syntax</h4>\n"
1319 " length(<i>string</i>)</p>\n"
1320 "\n"
1321 "<p><h4>Arguments</h4>\n"
1322 "<!-- List args for functions here-->\n"
1323 "<i> string</i> &rarr; is string. The String to count the length of.</p>\n"
1324 "\n"
1325 "<p><h4>Example</h4>\n"
1326 "<!-- Show example of function.-->\n"
1327 " length('HELLO') &rarr; 5</p>\n"
1328 "") );
1329  gFunctionHelpTexts.insert( "ln", QCoreApplication::translate( "function_help", "<h3>ln() function</h3>\n"
1330 "Returns the value of the natural logarithm of the passed expression.\n"
1331 "<br>\n"
1332 "This function takes one argument.\n"
1333 "<h4>Syntax</h4>\n"
1334 "<code>ln(value)</code><br>\n"
1335 "\n"
1336 "<h4>Arguments</h4>\n"
1337 "<code>value</code> - any positive number.\n"
1338 "<br>\n"
1339 "\n"
1340 "<h4>Example</h4>\n"
1341 "<!-- Show example of function.-->\n"
1342 "<code>ln(1) &rarr; 0</code><br>\n"
1343 "<code>ln(2.7182818284590452354) &rarr; 1</code><br>\n"
1344 "") );
1345  gFunctionHelpTexts.insert( "log", QCoreApplication::translate( "function_help", "<h3>log() function</h3>\n"
1346 "Returns the value of the logarithm of the passed value and base.\n"
1347 "<br>\n"
1348 "This function takes two arguments.\n"
1349 "<h4>Syntax</h4>\n"
1350 "<code>log(base, value)</code><br>\n"
1351 "\n"
1352 "<h4>Arguments</h4>\n"
1353 "<code>base</code> - any positive number.<br>\n"
1354 "<code>value</code> - any positive number.\n"
1355 "<br>\n"
1356 "\n"
1357 "<h4>Example</h4>\n"
1358 "<!-- Show example of function.-->\n"
1359 "<code>log(2, 32) &rarr; 5</code><br>\n"
1360 "<code>log(0.5, 32) &rarr; -5</code><br>\n"
1361 "") );
1362  gFunctionHelpTexts.insert( "log10", QCoreApplication::translate( "function_help", "<h3>log10() function</h3>\n"
1363 "Returns the value of the base 10 logarithm of the passed expression.\n"
1364 "<br>\n"
1365 "This function takes one argument.\n"
1366 "<h4>Syntax</h4>\n"
1367 "<code>log10(value)</code><br>\n"
1368 "\n"
1369 "<h4>Arguments</h4>\n"
1370 "<code>value</code> - any positive number.\n"
1371 "<br>\n"
1372 "\n"
1373 "<h4>Example</h4>\n"
1374 "<!-- Show example of function.-->\n"
1375 "<code>log10(1) &rarr; 0</code><br>\n"
1376 "<code>log10(100) &rarr; 2</code><br>\n"
1377 "") );
1378  gFunctionHelpTexts.insert( "lower", QCoreApplication::translate( "function_help", "<h3>lower() function</h3>\n"
1379 "Converts a string to lower case letters.\n"
1380 "\n"
1381 "<p><h4> Syntax</h4>\n"
1382 " lower(<i>string</i>)</p>\n"
1383 "\n"
1384 "<p><h4> Arguments</h4>\n"
1385 "<i> string</i> &rarr; is string. The String to convert to lower case.</p>\n"
1386 "\n"
1387 "<p><h4> Example</h4>\n"
1388 " lower('HELLO World') &rarr; 'hello world'</p>\n"
1389 "") );
1390  gFunctionHelpTexts.insert( "lpad", QCoreApplication::translate( "function_help", "<h3>lpad() function</h3>\n"
1391 "Returns a string with supplied width padded\n"
1392 "using the fill character.\n"
1393 "\n"
1394 "<h4>Syntax</h4>\n"
1395 "<code>lpad(string, length, fill)</code><br>\n"
1396 "\n"
1397 "<h4>Arguments</h4>\n"
1398 "<code>string</code> - is string. The string.\n"
1399 "<br>\n"
1400 "<code>length</code> - is int. The length of the new string.\n"
1401 "<br>\n"
1402 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
1403 "\n"
1404 "<h4>Example</h4>\n"
1405 "<!-- Show example of function.-->\n"
1406 "<code>lpad('Hello', 10, 'x') &rarr; 'Helloxxxxx'</code><br>\n"
1407 "") );
1408  gFunctionHelpTexts.insert( "max", QCoreApplication::translate( "function_help", "<h3>max() function</h3>\n"
1409 "Returns the largest value in a set of values.\n"
1410 "\n"
1411 "<h4>Syntax</h4>\n"
1412 " max(<i>value<i>[,<i>value</i>...])\n"
1413 "\n"
1414 "<h4>Arguments</h4>\n"
1415 "<!-- List args for functions here-->\n"
1416 "<i> value</i> &rarr; a number.<br>\n"
1417 "\n"
1418 "<h4>Example</h4>\n"
1419 "<!-- Show example of function.-->\n"
1420 " max(2,10.2,5.5) &rarr; 10.2\n"
1421 "") );
1422  gFunctionHelpTexts.insert( "min", QCoreApplication::translate( "function_help", "<h3>min() function</h3>\n"
1423 "Returns the smallest value in a set of values.\n"
1424 "\n"
1425 "<h4>Syntax</h4>\n"
1426 " min(<i>value<i>[,<i>value</i>...])\n"
1427 "\n"
1428 "<h4>Arguments</h4>\n"
1429 "<!-- List args for functions here-->\n"
1430 "<i> value</i> &rarr; a number.<br>\n"
1431 "\n"
1432 "<h4>Example</h4>\n"
1433 "<!-- Show example of function.-->\n"
1434 " min(20.5,10,6.2) &rarr; 6.2\n"
1435 "") );
1436  gFunctionHelpTexts.insert( "minute", QCoreApplication::translate( "function_help", "<h3>minute() function</h3>\n"
1437 "Extract the minute from a datetime or time, or the number of minutes\n"
1438 "from a <code>Interval</code>\n"
1439 "\n"
1440 "<h4>Syntax</h4>\n"
1441 "<code>minute(datetime)</code><br>\n"
1442 "<code>minute(Interval)</code><br>\n"
1443 "\n"
1444 "<h4>Arguments</h4>\n"
1445 "<code>date</code> - is datetime or time. The date to extract the minute from.\n"
1446 "<br>\n"
1447 "<code>Interval</code> - is Interval. The Interval to return the number of minutes from.\n"
1448 "\n"
1449 "<h4>Example</h4>\n"
1450 "<!-- Show example of function.-->\n"
1451 "<code>minute('2012-07-22T13:24:57') &rarr; 24</code><br>\n"
1452 "<code>minute(tointerval('3 minutes')) &rarr; 3</code><br>\n"
1453 "<code>minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) &rarr; 20</code><br>\n"
1454 "<code>minute(age('2012-01-01','2010-01-01')) &rarr; 1051200</code><br>\n"
1455 "\n"
1456 "") );
1457  gFunctionHelpTexts.insert( "month", QCoreApplication::translate( "function_help", "<h3>month() function</h3>\n"
1458 "Extract the month part from a date, or the number of months\n"
1459 "from a <code>Interval</code>\n"
1460 "\n"
1461 "<h4>Syntax</h4>\n"
1462 "<code>month(date)</code><br>\n"
1463 "<code>month(Interval)</code><br>\n"
1464 "\n"
1465 "<h4>Arguments</h4>\n"
1466 "<code>date</code> - is date or datetime. The date to extract the month from.\n"
1467 "<br>\n"
1468 "<code>Interval</code> - is Interval. The Interval to return the number of months from.\n"
1469 "\n"
1470 "<h4>Example</h4>\n"
1471 "<!-- Show example of function.-->\n"
1472 "<code>month('2012-05-12') &rarr; 05</code><br>\n"
1473 "<code>month(tointerval('3 months')) &rarr; 3</code><br>\n"
1474 "<code>month(age('2012-01-01','2010-01-01')) &rarr; 4.033...</code><br>\n"
1475 "\n"
1476 "") );
1477  gFunctionHelpTexts.insert( "overlaps", QCoreApplication::translate( "function_help", "<h3>overlaps function</h3>\n"
1478 "Returns 1 if the geometries share space, are of the same dimension, but are not completely contained by each other.\n"
1479 "\n"
1480 "<h4>Syntax</h4>\n"
1481 "<pre>overlaps( a, b )</pre>\n"
1482 "\n"
1483 "<h4>Arguments</h4>\n"
1484 "a &rarr; geometry\n"
1485 "b &rarr; geometry\n"
1486 "\n"
1487 "<h4>Example</h4>\n"
1488 "<pre> overlaps( geomFromWKT( 'LINESTRING(3 5 , 4 4 , 5 5 , 5 3)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
1489 "<pre> overlaps( geomFromWKT( 'LINESTRING(0 0 , 1 1)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 0</pre>\n"
1490 "") );
1491  gFunctionHelpTexts.insert( "ramp_color", QCoreApplication::translate( "function_help", "\n"
1492 "<h3>ramp_color() function</h3>\n"
1493 "Returns a string representing a color from a color ramp. \n"
1494 "\n"
1495 "<p><h4>Syntax</h4>\n"
1496 " ramp_color(<i>ramp_name,value</i>)</p>\n"
1497 "\n"
1498 "<p><h4>Arguments</h4>\n"
1499 "<!-- List args for functions here-->\n"
1500 "<i> ramp_name</i> &rarr; the name of the color ramp as a string, for example 'Spectral'.<br>\n"
1501 "<i> value</i> &rarr; the position on the ramp to select the color from as a real number between 0 and 1.<br>\n"
1502 "\n"
1503 "<p><h4>Example</h4>\n"
1504 "<!-- Show example of function.-->\n"
1505 " ramp_color('Spectral',0.3) &rarr; '253,190,115,255'</p>\n"
1506 "\n"
1507 "<p><h4>Note:</h4>\n"
1508 "The color ramps available vary between QGIS installations. This function\n"
1509 "may not give the expected results if you move your Quantum project.\n"
1510 "</p>\n"
1511 "") );
1512  gFunctionHelpTexts.insert( "rand", QCoreApplication::translate( "function_help", "<h3>rand() function</h3>\n"
1513 "Returns a random integer within the range specified by the minimum and \n"
1514 "maximum argument (inclusive).\n"
1515 "<br>\n"
1516 "This function takes two arguments.\n"
1517 "<h4>Syntax</h4>\n"
1518 "<code>rand(min, max)</code><br>\n"
1519 "\n"
1520 "<h4>Arguments</h4>\n"
1521 "<code>min</code> - an integer representing the smallest possible random number desired.<br>\n"
1522 "<code>max</code> - an integer representing the largest possible random number desired.\n"
1523 "<br>\n"
1524 "\n"
1525 "<h4>Example</h4>\n"
1526 "<!-- Show example of function.-->\n"
1527 "<code>rand(1, 10) &rarr; 8</code><br>\n"
1528 "") );
1529  gFunctionHelpTexts.insert( "randf", QCoreApplication::translate( "function_help", "<h3>randf() function</h3>\n"
1530 "Returns a random float within the range specified by the minimum and \n"
1531 "maximum argument (inclusive).\n"
1532 "<br>\n"
1533 "This function takes two arguments.\n"
1534 "<h4>Syntax</h4>\n"
1535 "<code>randf(min, max)</code><br>\n"
1536 "\n"
1537 "<h4>Arguments</h4>\n"
1538 "<code>min</code> - a float representing the smallest possible random number desired.<br>\n"
1539 "<code>max</code> - a float representing the largest possible random number desired.\n"
1540 "<br>\n"
1541 "\n"
1542 "<h4>Example</h4>\n"
1543 "<!-- Show example of function.-->\n"
1544 "<code>randf(1, 10) &rarr; 4.59258286403147</code><br>\n"
1545 "") );
1546  gFunctionHelpTexts.insert( "regexp_match", QCoreApplication::translate( "function_help", "<h3>regexp_match() function</h3>\n"
1547 "Returns true if any part of a string matches the supplied regular expression.\n"
1548 "\n"
1549 "<p><h4>Syntax</h4>\n"
1550 " regexp_match(<i>string,regex</i>)</p>\n"
1551 "\n"
1552 "<p><h4>Arguments</h4>\n"
1553 "<!-- List args for functions here-->\n"
1554 "<i> string</i> &rarr; is string. The string to test against the regular expression.<br>\n"
1555 "<i> regex</i> &rarr; is string. The regular expression to test against. Backslash characters must be double escaped (eg \"&#92;&#92;s\" to match a white space character). Non-greedy regular expressions are not supported.<br>\n"
1556 "\n"
1557 "<p><h4>Example</h4>\n"
1558 "<!-- Show example of function.-->\n"
1559 " regexp_match('QGIS ROCKS','&#92;&#92;sROCKS') &rarr; 1</p>\n"
1560 "") );
1561  gFunctionHelpTexts.insert( "regexp_replace", QCoreApplication::translate( "function_help", "<h3>regexp_replace() function</h3>\n"
1562 "Returns a string with the supplied regular expression replaced.\n"
1563 "\n"
1564 "<p><h4>Syntax</h4>\n"
1565 " regexp_replace(<i>string,regex,after</i>)</p>\n"
1566 "\n"
1567 "<p><h4>Arguments</h4>\n"
1568 "<!-- List args for functions here-->\n"
1569 "<i> string</i> &rarr; is string. The start string.<br>\n"
1570 "<i> regex</i> &rarr; is string. The regular expression to replace. Backslash characters must be double escaped (eg \"&#92;&#92;s\" to match a white space character). Non-greedy regular expressions are not supported.<br>\n"
1571 "<i> after</i> &rarr; is string. The string that will replace any matching occurences of the supplied regular expression. Captured groups can be inserted into the replacement string using &#92;&#92;1, &#92;&#92;2, etc. <br></p>\n"
1572 "\n"
1573 "<p><h4>Example</h4>\n"
1574 "<!-- Show example of function.-->\n"
1575 " regexp_replace('QGIS SHOULD ROCK','&#92;&#92;sSHOULD&#92;&#92;s',' DOES ') &rarr; 'QGIS DOES ROCK'</p>\n"
1576 "") );
1577  gFunctionHelpTexts.insert( "regexp_substr", QCoreApplication::translate( "function_help", "<h3>regexp_substr() function</h3>\n"
1578 "Returns the portion of a string which matches a supplied regular expression.\n"
1579 "\n"
1580 "<p><h4>Syntax</h4>\n"
1581 " regexp_substr(<i>string,regex</i>)</p>\n"
1582 "\n"
1583 "<p><h4>Arguments</h4>\n"
1584 "<!-- List args for functions here-->\n"
1585 "<i> string</i> &rarr; is string. The input string.<br>\n"
1586 "<i> regex</i> &rarr; is string. The regular expression to match against. Backslash characters must be double escaped (eg \"&#92;&#92;s\" to match a white space character). Non-greedy regular expressions are not supported.<br>\n"
1587 "\n"
1588 "<p><h4>Example</h4>\n"
1589 "<!-- Show example of function.-->\n"
1590 " regexp_substr('abc123','(&#92;&#92;d+)') &rarr; '123'</p>\n"
1591 "") );
1592  gFunctionHelpTexts.insert( "replace", QCoreApplication::translate( "function_help", "<h3>replace() function</h3>\n"
1593 "Returns a string with the the supplied string replaced.\n"
1594 "\n"
1595 "<p><h4>Syntax</h4>\n"
1596 " replace(<i>string,before,after</i>)</p>\n"
1597 "\n"
1598 "<p><h4>Arguments</h4>\n"
1599 "<!-- List args for functions here-->\n"
1600 "<i> string</i> &rarr; is string. The start string.<br>\n"
1601 "<i> before</i> &rarr; is string. The string to replace.<br>\n"
1602 "<i> after</i> &rarr; is string. The string that will replace <i>before</i><br></p>\n"
1603 "\n"
1604 "<p><h4>Example</h4>\n"
1605 "<!-- Show example of function.-->\n"
1606 " replace('QGIS SHOULD ROCK','SHOULD','DOES') &rarr; 'QGIS DOES ROCK'</p>\n"
1607 "") );
1608  gFunctionHelpTexts.insert( "right", QCoreApplication::translate( "function_help", "<h3>right() function</h3>\n"
1609 "Returns a substring that contains the <i>n</i> rightmost characters of the string.\n"
1610 "\n"
1611 "<h4>Syntax</h4>\n"
1612 "<code>right(string, pos)</code><br>\n"
1613 "\n"
1614 "<h4>Arguments</h4>\n"
1615 "<code>string</code> - is string. The string.\n"
1616 "<br>\n"
1617 "<code>length</code> - is int. The number of characters from the right to return.\n"
1618 "\n"
1619 "<h4>Example</h4>\n"
1620 "<!-- Show example of function.-->\n"
1621 "<code>right('Hello World',5) &rarr; 'World'</code><br>\n"
1622 "\n"
1623 "") );
1624  gFunctionHelpTexts.insert( "round", QCoreApplication::translate( "function_help", "<h3>round() function</h3>\n"
1625 "Rounds a number to number of decimal places.\n"
1626 "<br>\n"
1627 "This function can take one or two arguments depending on what is needed.\n"
1628 "<h4>Syntax</h4>\n"
1629 "<code>round(decimal,places)</code><br>\n"
1630 "<code>round(decimal)</code><br>\n"
1631 "\n"
1632 "<h4>Arguments</h4>\n"
1633 "<code>decimal</code> - is decimal. The decimal number to be rounded.\n"
1634 "<br>\n"
1635 "<code>places</code> - is int. The number of places to round decimal too. Can be negative.\n"
1636 "\n"
1637 "<h4>Example</h4>\n"
1638 "<!-- Show example of function.-->\n"
1639 "<code>round(1234.567, 2 ) &rarr; 1234.57</code><br>\n"
1640 "use <code>round(decimal)</code> to round to the nearest integer<br>\n"
1641 "<code>round(1234.567) &rarr; 1235</code><br>\n"
1642 "\n"
1643 "\n"
1644 "") );
1645  gFunctionHelpTexts.insert( "rpad", QCoreApplication::translate( "function_help", "<h3>rpad() function</h3>\n"
1646 "Returns a string with supplied width padded\n"
1647 "using the fill character.\n"
1648 "\n"
1649 "<h4>Syntax</h4>\n"
1650 "<code>rpad(string, width, fill)</code><br>\n"
1651 "\n"
1652 "<h4>Arguments</h4>\n"
1653 "<code>string</code> - is string. The string.\n"
1654 "<br>\n"
1655 "<code>width</code> - is int. The length of the new string.\n"
1656 "<br>\n"
1657 "<code>fill</code> - is char. The character to padd the remaining space with. \n"
1658 "\n"
1659 "<h4>Example</h4>\n"
1660 "<!-- Show example of function.-->\n"
1661 "<code>rpad('Hello', 10, 'x') &rarr; 'xxxxxHello'</code><br>\n"
1662 "\n"
1663 "") );
1664  gFunctionHelpTexts.insert( "scale_exp", QCoreApplication::translate( "function_help", "<h3>scale_exp() function</h3>\n"
1665 "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 \n"
1666 "of the specified output range. \n"
1667 "\n"
1668 "<p><h4>Syntax</h4>\n"
1669 " scale_exp(<i>val</i>,<i>domain_min</i>,<i>domain_max</i>,<i>range_min</i>,<i>range_max</i>,<i>exponent</i>)</p>\n"
1670 "\n"
1671 "<p><h4>Arguments</h4>\n"
1672 "<!-- List args for functions here-->\n"
1673 "<i> val</i> &rarr; is a value in the input domain. The function will return a corresponding scaled value in the output range.<br>\n"
1674 "<i> domain_min, domain_max</i> &rarr; specify the input domain, the smallest and largest values the input <i>val</i> should take.<br>\n"
1675 "<i> range_min, range_max</i> &rarr; specify the output range, the smallest and largest values which should be output by the function.<br>\n"
1676 "<i> exponent</i> &rarr; 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\n"
1677 "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.<br>\n"
1678 "\n"
1679 "<h4>Example</h4>\n"
1680 "<!-- Show example of function.-->\n"
1681 "<b>Easing in, using an exponent of 2:</b><br>\n"
1682 " scale_exp(5,0,10,0,100,2) &rarr; 25<br>\n"
1683 " scale_exp(7.5,0,10,0,100,2) &rarr; 56.25<br>\n"
1684 " scale_exp(9.5,0,10,0,100,2) &rarr; 90.25<br> \n"
1685 " <br>\n"
1686 "<b>Easing out, using an exponent of 0.5:</b><br> \n"
1687 " scale_exp(3,0,10,0,100,0.5) &rarr; 54.772<br>\n"
1688 " scale_exp(6,0,10,0,100,0.5) &rarr; 77.459<br>\n"
1689 " scale_exp(9,0,10,0,100,0.5) &rarr; 94.868<br> \n"
1690 " \n"
1691 " \n"
1692 "") );
1693  gFunctionHelpTexts.insert( "scale_linear", QCoreApplication::translate( "function_help", "<h3>scale_linear() function</h3>\n"
1694 "Transforms a given value from an input domain to an output range using linear interpolation. \n"
1695 "\n"
1696 "<p><h4>Syntax</h4>\n"
1697 " scale_linear(<i>val</i>,<i>domain_min</i>,<i>domain_max</i>,<i>range_min</i>,<i>range_max</i>)</p>\n"
1698 "\n"
1699 "<p><h4>Arguments</h4>\n"
1700 "<!-- List args for functions here-->\n"
1701 "<i> val</i> &rarr; is a value in the input domain. The function will return a corresponding scaled value in the output range.<br>\n"
1702 "<i> domain_min, domain_max</i> &rarr; specify the input domain, the smallest and largest values the input <i>val</i> should take.<br>\n"
1703 "<i> range_min, range_max</i> &rarr; specify the output range, the smallest and largest values which should be output by the function.<br>\n"
1704 "\n"
1705 "<h4>Example</h4>\n"
1706 "<!-- Show example of function.-->\n"
1707 " scale_linear(5,0,10,0,100) &rarr; 50<br>\n"
1708 " scale_linear(0.2,0,1,0,360) &rarr; 72 <i>(eg, scaling a value between 0 and 1 to an angle between 0 and 360)</i><br>\n"
1709 " scale_linear(1500,1000,10000,9,20) &rarr; 10.22 <i>(eg, scaling a population which varies between 1000 and 10000 to a font size between 9 and 20)</i><br>\n"
1710 " \n"
1711 " \n"
1712 "") );
1713  gFunctionHelpTexts.insert( "second", QCoreApplication::translate( "function_help", "<h3>second() function</h3>\n"
1714 "Extract the seconds from a datetime or time, or the number of seconds\n"
1715 "from a <code>Interval</code>\n"
1716 "\n"
1717 "<h4>Syntax</h4>\n"
1718 "<code>second(datetime)</code><br>\n"
1719 "<code>second(Interval)</code><br>\n"
1720 "\n"
1721 "<h4>Arguments</h4>\n"
1722 "<code>date</code> - is datetime or time. The date to extract the second from.\n"
1723 "<br>\n"
1724 "<code>Interval</code> - is Interval. The Interval to return the number of seconds from.\n"
1725 "\n"
1726 "<h4>Example</h4>\n"
1727 "<!-- Show example of function.-->\n"
1728 "<code>second('2012-07-22T13:24:57') &rarr; 57</code><br>\n"
1729 "<code>second(tointerval('3 seconds')) &rarr; 3</code><br>\n"
1730 "<code>second(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) &rarr; 1200</code><br>\n"
1731 "<code>second(age('2012-01-01','2010-01-01')) &rarr; 63072000</code><br>\n"
1732 "\n"
1733 "") );
1734  gFunctionHelpTexts.insert( "sin", QCoreApplication::translate( "function_help", "<h3>sin() function</h3>\n"
1735 "Returns sinus of an angle.\n"
1736 "\n"
1737 "\n"
1738 "<p><h4>Syntax</h4>\n"
1739 " sin(<i>real</i>)</p>\n"
1740 "\n"
1741 "<p><h4>Arguments</h4>\n"
1742 "<i>real</i> &rarr; angle in radians.</p>\n"
1743 "\n"
1744 "<p><h4>Example</h4>\n"
1745 " sin(1.571) &rarr; 0.999999682931835</p>\n"
1746 "") );
1747  gFunctionHelpTexts.insert( "sqrt", QCoreApplication::translate( "function_help", "<h3>sqrt() function</h3>\n"
1748 "Returns square root of a value\n"
1749 "\n"
1750 "\n"
1751 "<p><h4>Syntax</h4>\n"
1752 " sqrt(<i>real</i>)</p>\n"
1753 "\n"
1754 "<p><h4>Arguments</h4>\n"
1755 "<i>real</i> &rarr; number.</p>\n"
1756 "\n"
1757 "<p><h4>Example</h4>\n"
1758 " sqrt(9) &rarr; 3</p>\n"
1759 "") );
1760  gFunctionHelpTexts.insert( "strpos", QCoreApplication::translate( "function_help", "<h3>strpos() function</h3>\n"
1761 "Return the index of a regular expression in a string.\n"
1762 "\n"
1763 "<h4>Syntax</h4>\n"
1764 " strpos(<i>haystack</i>, <i>needle</i>)\n"
1765 "<br><br>\n"
1766 "Returns -1 if the expression isn't found.\n"
1767 "\n"
1768 "<p><h4>Arguments</h4>\n"
1769 "<!-- List args for functions here-->\n"
1770 "<i> haystack</i> &rarr; is string. The string that is to be searched.<br>\n"
1771 "<i> needle</i> &rarr; is string. The regular expression to look for.<br>\n"
1772 "\n"
1773 "<h4>Example</h4>\n"
1774 "<!-- Show example of function.-->\n"
1775 " strpos('HELLO WORLD','WORLD') &rarr; 6<br>\n"
1776 " strpos('HELLO WORLD','GOODBYE') &rarr; -1<br>\n"
1777 "") );
1778  gFunctionHelpTexts.insert( "substr", QCoreApplication::translate( "function_help", "<h3>substr() function</h3>\n"
1779 "Return a part of a string\n"
1780 "\n"
1781 "<p><h4>Syntax</h4>\n"
1782 " substr(<i>string,startpos,length</i>)</p>\n"
1783 "\n"
1784 "<p><h4>Arguments</h4>\n"
1785 "<!-- List args for functions here-->\n"
1786 "<i> string</i> &rarr; is string. The full string.<br>\n"
1787 "<i> startpos</i> &rarr; is number. The start position to extract from.<br>\n"
1788 "<i> length</i> &rarr; is number. The length of the string to extract.<br></p>\n"
1789 "\n"
1790 "<p><h4>Example</h4>\n"
1791 "<!-- Show example of function.-->\n"
1792 " substr('HELLO WORLD',3,5) &rarr; 'LLO W'</p>\n"
1793 "") );
1794  gFunctionHelpTexts.insert( "symDifference", QCoreApplication::translate( "function_help", "<h3>symDifference function</h3>\n"
1795 "Returns a geometry that represents the portions of a and b that do not intersect.\n"
1796 "\n"
1797 "<h4>Syntax</h4>\n"
1798 "<pre>symDifference( geometry a, geometry b)</pre>\n"
1799 "\n"
1800 "<h4>Arguments</h4>\n"
1801 "geometry &rarr; geometry\n"
1802 "geometry &rarr; geometry\n"
1803 "\n"
1804 "<h4>Example</h4>\n"
1805 "<pre> geomToWKT( symDifference( geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' ) , geomFromWKT( 'LINESTRING(3 3 , 8 8)' )) ) &rarr; returns LINESTRING(5 5, 8 8)</pre>\n"
1806 "") );
1807  gFunctionHelpTexts.insert( "tan", QCoreApplication::translate( "function_help", "<h3>tan() function</h3>\n"
1808 "Returns tangent of an angle.\n"
1809 "\n"
1810 "\n"
1811 "<p><h4>Syntax</h4>\n"
1812 " tan(<i>real</i>)</p>\n"
1813 "\n"
1814 "<p><h4>Arguments</h4>\n"
1815 "<i>real</i> &rarr; angle in radians.</p>\n"
1816 "\n"
1817 "<p><h4>Example</h4>\n"
1818 " tan(1.0) &rarr; 1.5574077246549</p>\n"
1819 "") );
1820  gFunctionHelpTexts.insert( "title", QCoreApplication::translate( "function_help", "<h3>title() function</h3>\n"
1821 "Converts all words of a string to title case (all words lower case with leading\n"
1822 "capital letter).\n"
1823 "\n"
1824 "<p><h4>Syntax</h4>\n"
1825 " title(<i>string</i>)</p>\n"
1826 "\n"
1827 "<p><h4>Arguments</h4>\n"
1828 "<!-- List args for functions here-->\n"
1829 "<i> string</i> &rarr; is string. The string to convert to title case.</p>\n"
1830 "\n"
1831 "<p><h4>Example</h4>\n"
1832 "<!-- Show example of function.-->\n"
1833 " upper('hello WOrld') &rarr; 'Hello World'</p>\n"
1834 "") );
1835  gFunctionHelpTexts.insert( "todate", QCoreApplication::translate( "function_help", "<h3>todate() function</h3>\n"
1836 "Convert a string into Qt data type.\n"
1837 "\n"
1838 "<h4>Syntax</h4>\n"
1839 "<code>todate('string')</code><br>\n"
1840 "\n"
1841 "<h4>Arguments</h4>\n"
1842 "<code>string</code> - is string in Qt date format.\n"
1843 "<br>\n"
1844 "\n"
1845 "<h4>Example</h4>\n"
1846 "<!-- Show example of function.-->\n"
1847 "<code>todate('2012-05-04') &rarr; 2012-05-04</code><br>") );
1848  gFunctionHelpTexts.insert( "todatetime", QCoreApplication::translate( "function_help", "<h3>todatetime() function</h3>\n"
1849 "Convert a string into Qt data time type.\n"
1850 "\n"
1851 "<h4>Syntax</h4>\n"
1852 "<code>todatetime('string')</code><br>\n"
1853 "\n"
1854 "<h4>Arguments</h4>\n"
1855 "<code>string</code> - is string in Qt date time format.\n"
1856 "<br>\n"
1857 "\n"
1858 "<h4>Example</h4>\n"
1859 "<!-- Show example of function.-->\n"
1860 "<code>todatetime('2012-05-04 12:50:00') &rarr; 2012-05-04T12:50:00</code><br>") );
1861  gFunctionHelpTexts.insert( "toint", QCoreApplication::translate( "function_help", "<h3>toint() function</h3>\n"
1862 "Converts a string to integer number. Nothing changed if a value cannot be converted to integer (e.g '123asd' is invalid).\n"
1863 "\n"
1864 "<p><h4>Syntax</h4>\n"
1865 " toint(<i>string</i>)</p>\n"
1866 "\n"
1867 "<p><h4>Arguments</h4>\n"
1868 "<!-- List args for functions here-->\n"
1869 "<i> string</i> &rarr; is string. The String to convert to integer number.</p>\n"
1870 "\n"
1871 "<p><h4>Example</h4>\n"
1872 "<!-- Show example of function.-->\n"
1873 " toint('123') &rarr; 123</p>\n"
1874 "") );
1875  gFunctionHelpTexts.insert( "tointerval", QCoreApplication::translate( "function_help", "<h3>tointerval() function</h3>\n"
1876 "Converts a string to a interval type. Can be used to take days, hours, month, etc off a date. \n"
1877 "\n"
1878 "<h4>Syntax</h4>\n"
1879 "<code>tointerval('string')</code><br>\n"
1880 "\n"
1881 "<h4>Arguments</h4>\n"
1882 "<code>string</code> - is string. Format {n} days {n} hours {n} months\n"
1883 "<br>\n"
1884 "\n"
1885 "<h4>Example</h4>\n"
1886 "<!-- Show example of function.-->\n"
1887 "<code>todatetime('2012-05-05 12:00:00') - tointerval('1 day 2 hours') &rarr; 2012-05-04T10:00:00</code><br>") );
1888  gFunctionHelpTexts.insert( "toreal", QCoreApplication::translate( "function_help", "<h3>toreal() function</h3>\n"
1889 "Converts a string to real number. Nothing changed 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.\n"
1890 "\n"
1891 "<p><h4>Syntax</h4>\n"
1892 " toreal(<i>string</i>)</p>\n"
1893 "\n"
1894 "<p><h4>Arguments</h4>\n"
1895 "<!-- List args for functions here-->\n"
1896 "<i> string</i> &rarr; is string. The String to convert to real number.</p>\n"
1897 "\n"
1898 "<p><h4>Example</h4>\n"
1899 "<!-- Show example of function.-->\n"
1900 " toreal('123.45') &rarr; 123.45</p>\n"
1901 "") );
1902  gFunctionHelpTexts.insert( "tostring", QCoreApplication::translate( "function_help", "<h3>tostring() function</h3>\n"
1903 "Converts a number to string.\n"
1904 "\n"
1905 "<p><h4>Syntax</h4>\n"
1906 " tostring(<i>number</i>)</p>\n"
1907 "\n"
1908 "<p><h4>Arguments</h4>\n"
1909 "<!-- List args for functions here-->\n"
1910 "<i>number</i> &rarr; is integer or real. The number to convert to string.</p>\n"
1911 "\n"
1912 "<p><h4>Example</h4>\n"
1913 "<!-- Show example of function.-->\n"
1914 " tostring(123) &rarr; '123'</p>\n"
1915 "") );
1916  gFunctionHelpTexts.insert( "totime", QCoreApplication::translate( "function_help", "<h3>totime() function</h3>\n"
1917 "Convert a string into Qt time type.\n"
1918 "\n"
1919 "<h4>Syntax</h4>\n"
1920 "<code>totime('string')</code><br>\n"
1921 "\n"
1922 "<h4>Arguments</h4>\n"
1923 "<code>string</code> - is string in Qt time format.\n"
1924 "<br>\n"
1925 "\n"
1926 "<h4>Example</h4>\n"
1927 "<!-- Show example of function.-->\n"
1928 "<code>totime('12:30:01') &rarr; 12:30:01</code><br>") );
1929  gFunctionHelpTexts.insert( "touches", QCoreApplication::translate( "function_help", "<h3>touches function</h3>\n"
1930 "Returns 1 if the geometries have at least one point in common, but their interiors do not intersect.\n"
1931 "\n"
1932 "<h4>Syntax</h4>\n"
1933 "<pre>touches( a, b )</pre>\n"
1934 "\n"
1935 "<h4>Arguments</h4>\n"
1936 "a &rarr; geometry\n"
1937 "b &rarr; geometry\n"
1938 "\n"
1939 "<h4>Example</h4>\n"
1940 "<pre> touches( geomFromWKT( 'LINESTRING(5 3 , 4 4)' ) , geomFromWKT( 'LINESTRING(3 3 , 4 4 , 5 5)' )) &rarr; returns 1</pre>\n"
1941 "<pre> touches( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) &rarr; returns 0</pre>\n"
1942 "") );
1943  gFunctionHelpTexts.insert( "trim", QCoreApplication::translate( "function_help", "<h3>trim() function</h3>\n"
1944 "Removes all leading and trailing whitespace (spaces, tabs, etc) from a string.\n"
1945 "\n"
1946 "<p><h4>Syntax</h4>\n"
1947 " trim(<i>string</i>)</p>\n"
1948 "\n"
1949 "<p><h4>Arguments</h4>\n"
1950 "<!-- List args for functions here-->\n"
1951 "<i> string</i> &rarr; is string. The string to trim.</p>\n"
1952 "\n"
1953 "<p><h4>Example</h4>\n"
1954 "<!-- Show example of function.-->\n"
1955 " trim(' hello world ') &rarr; 'hello world'</p>\n"
1956 "") );
1957  gFunctionHelpTexts.insert( "union", QCoreApplication::translate( "function_help", "<h3>union function</h3>\n"
1958 "Returns a geometry that represents the point set union of the geometries.\n"
1959 "\n"
1960 "<h4>Syntax</h4>\n"
1961 "<pre>union( a, b )</pre>\n"
1962 "\n"
1963 "<h4>Arguments</h4>\n"
1964 "a &rarr; geometry\n"
1965 "b &rarr; geometry\n"
1966 "\n"
1967 "<h4>Example</h4>\n"
1968 "<pre> geomToWKT( union( geomFromWKT( 'POINT(4 4)' ) , geomFromWKT( 'POINT(5 5)' )) ) &rarr; returns MULTIPOINT(4 4, 5 5)</pre>\n"
1969 "") );
1970  gFunctionHelpTexts.insert( "upper", QCoreApplication::translate( "function_help", "<h3>upper() function</h3>\n"
1971 "Converts a string to upper case letters.\n"
1972 "\n"
1973 "<p><h4>Syntax</h4>\n"
1974 " upper(<i>string</i>)</p>\n"
1975 "\n"
1976 "<p><h4>Arguments</h4>\n"
1977 "<!-- List args for functions here-->\n"
1978 "<i> string</i> &rarr; is string. The String to convert to upper case.</p>\n"
1979 "\n"
1980 "<p><h4>Example</h4>\n"
1981 "<!-- Show example of function.-->\n"
1982 " upper('hello WOrld') &rarr; 'HELLO WORLD'</p>\n"
1983 "") );
1984  gFunctionHelpTexts.insert( "week", QCoreApplication::translate( "function_help", "<h3>week() function</h3>\n"
1985 "Extract the week number from a date, or the number of weeks\n"
1986 "from a <code>Interval</code>\n"
1987 "\n"
1988 "<h4>Syntax</h4>\n"
1989 "<code>week(date)</code><br>\n"
1990 "<code>week(Interval)</code><br>\n"
1991 "\n"
1992 "<h4>Arguments</h4>\n"
1993 "<code>date</code> - is date or datetime. The date to extract the week from.\n"
1994 "<br>\n"
1995 "<code>Interval</code> - is Interval. The Interval to return the number of weeks from.\n"
1996 "\n"
1997 "<h4>Example</h4>\n"
1998 "<!-- Show example of function.-->\n"
1999 "<code>week('2012-05-12') &rarr; 19</code><br>\n"
2000 "<code>week(tointerval('3 weeks')) &rarr; 3</code><br>\n"
2001 "<code>week(age('2012-01-01','2010-01-01')) &rarr; 104.285...</code><br>\n"
2002 "\n"
2003 "") );
2004  gFunctionHelpTexts.insert( "within", QCoreApplication::translate( "function_help", "<h3>within function</h3>\n"
2005 "Returns 1 if the geometry a is completely inside geometry b\n"
2006 "\n"
2007 "<h4>Syntax</h4>\n"
2008 "<pre>within( geometry a , geometry b)</pre>\n"
2009 "\n"
2010 "<h4>Arguments</h4>\n"
2011 "geometry &rarr; geometry\n"
2012 "geometry &rarr; geometry\n"
2013 "\n"
2014 "<h4>Example</h4>\n"
2015 "<pre> within( geomFromWKT( 'POINT( 0.5 0.5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) &rarr; returns 1</pre>\n"
2016 "<pre> within( geomFromWKT( 'POINT( 5 5 )') , geomFromWKT('POLYGON((0 0 , 0 1 , 1 1 , 1 0 , 0 0 ))' ) ) &rarr; returns 0</pre>\n"
2017 "") );
2018  gFunctionHelpTexts.insert( "wordwrap", QCoreApplication::translate( "function_help", "<h3>wordwrap() function</h3>\n"
2019 "Returns a string wrapped to a maximum/minimum number of characters.\n"
2020 "\n"
2021 "<p><h4>Syntax</h4>\n"
2022 " wordwrap(<i>string,wrap_length[,delimiter_string]</i>)</p>\n"
2023 "\n"
2024 "<p><h4>Arguments</h4>\n"
2025 "<!-- List args for functions here-->\n"
2026 "<i> string</i> &rarr; is string. The string to be wrapped.<br>\n"
2027 "<i> wrap_length</i> &rarr; is number. If positive, the number represents the ideal maximum number of characters to wrap; if negative, the number represents the minimum number of characters to wrap.<br>\n"
2028 "<i> delimiter_string</i> &rarr; is string. The delimiter string to wrap to a new line (<u>optional</u>).<br></p>\n"
2029 "\n"
2030 "<p><h4>Example</h4>\n"
2031 "<!-- Show example of function.-->\n"
2032 " wordwrap('UNIVERSITY OF QGIS',13) &rarr; 'UNIVERSITY OF&#92;nQGIS'<br>\n"
2033 " wordwrap('UNIVERSITY OF QGIS',-3) &rarr; 'UNIVERSITY&#92;nOF QGIS'</p>\n"
2034 "") );
2035  gFunctionHelpTexts.insert( "xat", QCoreApplication::translate( "function_help", "<h3>xat() function</h3>\n"
2036 "Retrieves a x coordinate of the current feature\n"
2037 "\n"
2038 "<h4>Syntax</h4>\n"
2039 "<code>xat(i)</code>\n"
2040 "\n"
2041 "<h4>Arguments</h4>\n"
2042 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
2043 "\n"
2044 "<h4>Example</h4>\n"
2045 "<pre>xat(1) &rarr; 5</pre>\n"
2046 "") );
2047  gFunctionHelpTexts.insert( "xmax", QCoreApplication::translate( "function_help", "<h3>xmax function</h3>\n"
2048 "Returns the maximum x coordinate of a geometry. Calculations are in the Spatial Reference System of this Geometry. \n"
2049 "\n"
2050 "<h4>Syntax</h4>\n"
2051 "<pre>xmax(geom)</pre>\n"
2052 "\n"
2053 "<h4>Arguments</h4>\n"
2054 "geom &rarr; a geometry\n"
2055 "\n"
2056 "<h4>Example</h4>\n"
2057 "<pre> xmax($geometry) &rarr; returns maximum x coordinate of $geometry</pre>\n"
2058 "\n"
2059 "") );
2060  gFunctionHelpTexts.insert( "xmin", QCoreApplication::translate( "function_help", "<h3>xmin function</h3>\n"
2061 "Returns the minimum x coordinate of a geometry. Calculations are in the Spatial Reference System of this Geometry. \n"
2062 "\n"
2063 "<h4>Syntax</h4>\n"
2064 "<pre>xmin(geom)</pre>\n"
2065 "\n"
2066 "<h4>Arguments</h4>\n"
2067 "geom &rarr; a geometry\n"
2068 "\n"
2069 "<h4>Example</h4>\n"
2070 "<pre> xmin($geometry) &rarr; returns minimum x coordinate of $geometry</pre>\n"
2071 "\n"
2072 "") );
2073  gFunctionHelpTexts.insert( "yat", QCoreApplication::translate( "function_help", "<h3>yat() function</h3>\n"
2074 "Retrieves a y coordinate of the current feature\n"
2075 "\n"
2076 "<h4>Syntax</h4>\n"
2077 "<code>yat(i)</code>\n"
2078 "\n"
2079 "<h4>Arguments</h4>\n"
2080 "<code>i<code> - is int. index of point of a line (indices start at 0; negative values apply to the last index).\n"
2081 "\n"
2082 "<h4>Example</h4>\n"
2083 "<pre>yat(1) &rarr; 5</pre>\n"
2084 "") );
2085  gFunctionHelpTexts.insert( "year", QCoreApplication::translate( "function_help", "<h3>year() function</h3>\n"
2086 "Extract the year part from a date, or the number of years\n"
2087 "from a <code>Interval</code>\n"
2088 "\n"
2089 "<h4>Syntax</h4>\n"
2090 "<code>year(date)</code><br>\n"
2091 "<code>year(Interval)</code><br>\n"
2092 "\n"
2093 "<h4>Arguments</h4>\n"
2094 "<code>date</code> - is date or datetime. The date to extract the year from.\n"
2095 "<br>\n"
2096 "<code>Interval</code> - is Interval. The Interval to return the number of years from.\n"
2097 "\n"
2098 "<h4>Example</h4>\n"
2099 "<!-- Show example of function.-->\n"
2100 "<code>year('2012-05-12') &rarr; 2012</code><br>\n"
2101 "<code>year(tointerval('3 Years')) &rarr; 3</code><br>\n"
2102 "<code>year(age('2012-01-01','2010-01-01')) &rarr; 1.9986..</code><br>\n"
2103 "\n"
2104 "") );
2105  gFunctionHelpTexts.insert( "ymax", QCoreApplication::translate( "function_help", "<h3>ymax function</h3>\n"
2106 "Returns the maximum y coordinate of a geometry. Calculations are in the Spatial Reference System of this Geometry. \n"
2107 "\n"
2108 "<h4>Syntax</h4>\n"
2109 "<pre>ymax(geom)</pre>\n"
2110 "\n"
2111 "<h4>Arguments</h4>\n"
2112 "geom &rarr; a geometry\n"
2113 "\n"
2114 "<h4>Example</h4>\n"
2115 "<pre> ymax($geometry) &rarr; returns maximum y coordinate of $geometry</pre>\n"
2116 "\n"
2117 "") );
2118  gFunctionHelpTexts.insert( "ymin", QCoreApplication::translate( "function_help", "<h3>ymin function</h3>\n"
2119 "Returns the minimum y coordinate of a geometry. Calculations are in the Spatial Reference System of this Geometry. \n"
2120 "\n"
2121 "<h4>Syntax</h4>\n"
2122 "<pre>ymin(geom)</pre>\n"
2123 "\n"
2124 "<h4>Arguments</h4>\n"
2125 "geom &rarr; a geometry\n"
2126 "\n"
2127 "<h4>Example</h4>\n"
2128 "<pre> ymin($geometry) &rarr; returns minimum y coordinate of $geometry</pre>\n"
2129 "\n"
2130 "") );
2131 }
static QHash< QString, QString > gFunctionHelpTexts
static void initFunctionHelp()