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