-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] add field calculator functions (implements #3177)
- add support for functions with 2 or three arguments - add function atan2(y,x) - add length(string) to determine string length - add replace(string,from,to) to do string replaces - add substr(string,from,length) to retrieve substrings - add (preliminary) online help to field calculator with a listing of operations. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14533 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
jef
committed
Nov 8, 2010
1 parent
a0671f1
commit 8fb07b0
Showing
8 changed files
with
170 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<h3>Field Calculator</h3> | ||
The field calculator allows you to update fields with expressions. | ||
|
||
<h4>Supported Operations</h4> | ||
|
||
<table border=1> | ||
<tr> | ||
<th>Operation</th> | ||
<th>Description</th> | ||
</tr> | ||
<tr> | ||
<td> | ||
<tt>column_name</tt><br> | ||
<tt>"column_name"</tt> | ||
</td> | ||
<td>value of field <tt>column_name</tt></td> | ||
</tr> | ||
<tr><td>'string'</td><td>literal string value</td></tr> | ||
<tr><td><i>number</i></td><td>number</td></tr> | ||
<tr><td>NULL</td><td>null value</td></tr> | ||
<tr><td><tt>a</tt> OR <tt>b</tt></td><td><tt>a</tt> or <tt>b</tt> are true.</td></tr> | ||
<tr><td><tt>a</tt> AND <tt>b</tt></td><td><tt>a</tt> and <tt>b</tt> are true.</td></tr> | ||
<tr><td>NOT <tt>a</tt></td><td>inverted boolean value of <tt>a</tt></td></tr> | ||
<tr><td><tt>a</tt> IS NULL</td><td><tt>a</tt> has no value</td></tr> | ||
<tr><td><tt>a</tt> IS NOT NULL</td><td><tt>a</tt> has <tt>a</tt> value</td></tr> | ||
<tr><td><tt>a</tt> IN ( value, [, value] )</td><td><tt>a</tt> is one of the listed values</td></tr> | ||
<tr><td><tt>a</tt> NOT IN ( value, [, value] )</td><td><tt>a</tt> is not one of the listed values</td></tr> | ||
<tr><td><tt>a</tt> = <tt>b</tt></td><td><tt>a</tt> and <tt>b</tt> are equal</td><tr> | ||
<tr> | ||
<td> | ||
<tt>a</tt> != <tt>b</tt><br> | ||
<tt>a</tt> <> <tt>b</tt> | ||
</td> | ||
<td><tt>a</tt> and <tt>b</tt> are not equal</td> | ||
</tr> | ||
<tr><td><tt>a</tt> <= <tt>b</tt></td><td><tt>a</tt> is less or equal <tt>b</tt></td></tr> | ||
<tr><td><tt>a</tt> >= <tt>b</tt></td><td><tt>a</tt> is greater or equal <tt>b</tt></td></tr> | ||
<tr><td><tt>a</tt> > <tt>b</tt></td><td><tt>a</tt> is greater than <tt>b</tt></td></tr> | ||
<tr><td><tt>a</tt> < <tt>b</tt></td><td><tt>a</tt> is less than <tt>b</tt></td></tr> | ||
<tr><td><tt>a</tt> ~ <tt>b</tt></td></td><td><tt>a</tt> matches regular expression <tt>b</tt></td></tr> | ||
<tr><td><tt>a</tt> LIKE <tt>b</tt></td><td><tt>a</tt> is like <tt>b</tt></td></tr> | ||
<tr><td><tt>a</tt> ILIKE <tt>b</tt></td><td><tt>a</tt> is like <tt>b</tt> (case insensitive)</td></tr> | ||
<tr><td>sqrt(<tt>a</tt>)</td><td>square root</td></tr> | ||
<tr><td>sin(<tt>a</tt>)</td><td>sinus of <tt>a</tt></td></tr> | ||
<tr><td>cos(<tt>a</tt>)</td><td>cosinus of <tt>b</tt></td></tr> | ||
<tr><td>tan(<tt>a</tt>)</td><td>tangens of <tt>a</tt></td></tr> | ||
<tr><td>asin(<tt>a</tt>)</td><td>arcussinus of <tt>a</tt></td></tr> | ||
<tr><td>acos(<tt>a</tt>)</td><td>arcuscosinus of <tt>a</tt></td></tr> | ||
<tr><td>atan(<tt>a</tt>)</td><td>arcustangens of <tt>a</tt></td></tr> | ||
<tr><td>to int(<tt>a</tt>)</td><td>convert string <tt>a</tt> to integer</td></tr> | ||
<tr><td>to real(<tt>a</tt>)</td><td>convert string <tt>a</tt> to real</td></tr> | ||
<tr><td>to string(<tt>a</tt>)</td><td>convert number <tt>a</tt> to string</td></tr> | ||
<tr><td>lower(<tt>a</tt>)</td><td>convert string <tt>a</tt> to lower case</td></tr> | ||
<tr><td>upper(<tt>a</tt>)</td><td>convert string <tt>a</tt> to upper case</td></tr> | ||
<tr><td>length(<tt>a</tt>)</td><td>length of string <tt>a</tt></td></tr> | ||
<tr><td>atan2(y,x)</td><td>arcustangens of y/x using the signs of the two arguments to determine the quadrant of the result.</td></tr> | ||
<tr><td>replace(<tt>a</tt>,replacethis,withthat)</td><td>replace replacethis with withthat in string <tt>a</tt></td></td> | ||
<tr><td>substr(<tt>a</tt>,from,len)</td><td>len characters of string <tt>a</tt> starting from from (first character index is 1)</td></td> | ||
<tr><td><tt>a</tt> || <tt>b</tt></td><td>concatenate strings <tt>a</tt> and <tt>b</tt></td></tr> | ||
<tr><td>$rownum</td><td>number current row</td></tr> | ||
<tr><td>$area</td><td>area of polygon</td></tr> | ||
<tr><td>$length</td><td>area of line</td></tr> | ||
<tr><td>$id</td><td>feature id</td></tr> | ||
<tr><td><tt>a</tt> ^ <tt>b</tt></td><td><tt>a</tt> raised to the power of <tt>b</tt></td></tr> | ||
<tr><td><tt>a</tt> * <tt>b</tt></td><td><tt>a</tt> multiplied by <tt>b</tt></td></tr> | ||
<tr><td><tt>a</tt> * <tt>b</tt></td><td><tt>a</tt> divided by <tt>b</tt></td></tr> | ||
<tr><td><tt>a</tt> + <tt>b</tt></td><td><tt>a</tt> plus <tt>b</tt></td></tr> | ||
<tr><td><tt>a</tt> - <tt>b</tt></td><td><tt>a</tt> minus <tt>b</tt></td></tr> | ||
<tr><td>+<tt>a</tt></td><td>positive sign</td></tr> | ||
<tr><td>-<tt>a</tt></td><td>negative value of <tt>a</tt></td></tr> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters