Справка по функциям калькулятора полей QGIS: различия между версиями
Bolotoved (обсуждение | вклад) (Новая страница: «{{Статья|Черновик}} Справка по функциям калькулятора полей QGIS = Список функций = == Оператор...») |
Bolotoved (обсуждение | вклад) (→String) |
||
Строка 138: | Строка 138: | ||
=== lower === | === lower === | ||
lower() function | <span style="color:blue">lower() function</span> | ||
Converts a string to lower case letters. | Converts a string to lower case letters. | ||
Syntax | |||
<span style="color:blue">Syntax</span> | |||
lower(string) | lower(string) | ||
Arguments | |||
<span style="color:blue">Arguments</span> | |||
string -> is string. The String to convert to lower case. | string -> is string. The String to convert to lower case. | ||
Example | |||
<span style="color:blue">Example</span> | |||
lower('HELLO World') -> 'hello world' | lower('HELLO World') -> 'hello world' | ||
=== upper === | === upper === | ||
upper() function | <span style="color:blue">upper() function</span> | ||
Converts a string to upper case letters. | Converts a string to upper case letters. | ||
Syntax | |||
<span style="color:blue">Syntax</span> | |||
upper(string) | upper(string) | ||
Arguments | |||
<span style="color:blue">Arguments</span> | |||
string -> is string. The String to convert to upper case. | string -> is string. The String to convert to upper case. | ||
Example | |||
<span style="color:blue">Example</span> | |||
upper('hello WOrld') -> 'HELLO WORLD' | upper('hello WOrld') -> 'HELLO WORLD' | ||
=== lenght === | === lenght === | ||
length() function | <span style="color:blue">length() function</span> | ||
Returns the length of a string. | Returns the length of a string. | ||
Syntax | |||
<span style="color:blue">Syntax</span> | |||
length(string) | length(string) | ||
Arguments | |||
<span style="color:blue">Arguments</span> | |||
string -> is string. The String to count the length of. | string -> is string. The String to count the length of. | ||
Example | |||
<span style="color:blue">Example</span> | |||
length('HELLO') -> 5 | length('HELLO') -> 5 | ||
=== replace === | === replace === | ||
replace() function | <span style="color:blue">replace() function</span> | ||
Returns a string with the the supplied string replaced. | Returns a string with the the supplied string replaced. | ||
Syntax | |||
<span style="color:blue">Syntax</span> | |||
replace(string,before,after) | replace(string,before,after) | ||
Arguments | |||
<span style="color:blue">Arguments</span> | |||
string -> is string. The start string. | string -> is string. The start string. | ||
before -> is string. The string to replace. | before -> is string. The string to replace. | ||
after -> is string. The string that will replace before | after -> is string. The string that will replace before | ||
Example | <span style="color:blue">Example</span> | ||
replace('QGIS SHOULD ROCK','SHOULD','DOES') -> 'QGIS DOES ROCK' | replace('QGIS SHOULD ROCK','SHOULD','DOES') -> 'QGIS DOES ROCK' | ||
Строка 187: | Строка 216: | ||
=== substr === | === substr === | ||
substr() function | <span style="color:blue">substr() function</span> | ||
Return a part of a string | Return a part of a string | ||
Syntax | |||
<span style="color:blue">Syntax</span> | |||
substr(string,startpos,length) | substr(string,startpos,length) | ||
Arguments | |||
<span style="color:blue">Arguments</span> | |||
string -> is string. The full string. | string -> is string. The full string. | ||
startpos -> is number. The start position to extract from. | startpos -> is number. The start position to extract from. | ||
length -> is number. The length of the string to extract. | length -> is number. The length of the string to extract. | ||
Example | <span style="color:blue">Example</span> | ||
substr('HELLO WORLD',3,5) -> 'LLO W' | substr('HELLO WORLD',3,5) -> 'LLO W' | ||
== Geometry == | == Geometry == |
Версия от 04:38, 3 февраля 2012
Справка по функциям калькулятора полей QGIS
Список функций
Операторы
+
-
*
/
%
^
=
>
<
<>
<=
>=
||
LIKE
ILIKE
IS
OR
AND
NOT
Математические
Математические функции, такие как квадратный корень, sin и cos.
sqrt
sin
cos
tan
asin
acos
atan
atan2
exp
ln
log10
log
Преобразования
Функции для преобразования одного типа данных в другой, например для преобразования строковых данных в числовые, числовых в строковые.
toint
toreal
tostring
Строковые
Функции для работы со строковыми данными, например замена или преобразование в верхний регистр.
lower
upper
lenght
replace
regexp_replace
substr
Геометрические
Функции для операций с геометрией объектов, например для расчета длин и площадей.
xat
yat
$area
$length
$perimeter
$x
$y
Записи
$rownum
$id
Поля и значения
Содержит список полей слоя. Конкретные значения поля доступны по правому щелчку мыши.
Выберите значение поля из списка и щелкните по нему правой кнопкой мыши. Появится контекстное меню для загрузки значений из выбранного поля.
Function List
Operators
This group contains operators e.g + - *
+
-
*
/
%
^
=
>
<
<>
<=
>=
||
LIKE
ILIKE
IS
OR
AND
NOT
Math
This group contains math functions e.g square root, sin and cos
sqrt
sin
cos
tan
asin
acos
atan
atan2
exp
ln
log10
log
Conversions
This group contains functions to convert on data type to another e.g string to integer, integer to string.
toint
toreal
tostring
String
This group contains functions that operate on strings e.g replace, convert to upper case.
lower
lower() function
Converts a string to lower case letters.
Syntax
lower(string)
Arguments
string -> is string. The String to convert to lower case.
Example
lower('HELLO World') -> 'hello world'
upper
upper() function
Converts a string to upper case letters.
Syntax
upper(string)
Arguments
string -> is string. The String to convert to upper case.
Example
upper('hello WOrld') -> 'HELLO WORLD'
lenght
length() function
Returns the length of a string.
Syntax
length(string)
Arguments
string -> is string. The String to count the length of.
Example
length('HELLO') -> 5
replace
replace() function
Returns a string with the the supplied string replaced.
Syntax
replace(string,before,after)
Arguments
string -> is string. The start string.
before -> is string. The string to replace.
after -> is string. The string that will replace before
Example
replace('QGIS SHOULD ROCK','SHOULD','DOES') -> 'QGIS DOES ROCK'
regexp_replace
substr
substr() function
Return a part of a string
Syntax
substr(string,startpos,length)
Arguments
string -> is string. The full string.
startpos -> is number. The start position to extract from.
length -> is number. The length of the string to extract.
Example
substr('HELLO WORLD',3,5) -> 'LLO W'
Geometry
This group contains functions that operate on geometry objects e.g length, area.
xat
yat
$area
$length
$perimeter
$x
$y
Record
$rownum
$id
Fields and Values
Contains a list of fields from the layer. Sample values can also be accessed via right-click.
Select the field name from the list then right-click to access context menu with options to load sample values from the selected field.