Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Last active June 21, 2020 10:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasG77/0c6862fb2b6b3fc301ea994733688ea5 to your computer and use it in GitHub Desktop.
Save ThomasG77/0c6862fb2b6b3fc301ea994733688ea5 to your computer and use it in GitHub Desktop.
Script to write QGIS expressions on one page (easy to reference to help people on the web, text search from your browser) https://gist.githack.com/ThomasG77/0c6862fb2b6b3fc301ea994733688ea5/raw/99ecc5e6127e7238814da330a4d5d0b9fa2afe4e/qgis-3-12-expressions-single-page.html

Generate single page documentation for expressions

Why?

The goal was a single page documentation on expression

One approach could have been about using scripts/process_function_template.py and/or files in resources/function_help/json/. As there is no link between groups and functions documented in these json files, you need to look for the relation in the source src/core/expression/qgsexpressionfunction.cpp. You would also need to manage translations. FYI, all paths are relative to the root of the source code repo.

So, instead we've made the choice to use HTML generated doc for expressions from PyQGIS docs. It works for any languages

How to

You need to install third party Python library BeautifulSoup4 into the version of Python used by QGIS. For Linux, do it with

pip install beautifulsoup4

Then, run the script pyqgis-list-expressions.py within PyQGIS console.

As the script is generated dynamically within QGIS and we need to change the locale each time we want to generate a new lang doc, we only produced some translations. Feel free to ask in the comments for another languages.

Current generated docs

import itertools
from bs4 import BeautifulSoup
from qgis.core import Qgis
unique_groups = set(itertools.chain.from_iterable([fct.groups() for fct in QgsExpression.Functions() if ('deprecated' not in fct.groups() and 'Custom' not in fct.groups())]))
unique_sorted_groups = sorted(unique_groups)
functions_list_no_deprecated = [[
fct.name(),
fct.groups(),
BeautifulSoup(QgsExpression.helpText(fct.name())).prettify() # Sanitize HTML to fix unbalalanced tags
] for fct in QgsExpression.Functions() if ('deprecated' not in fct.groups() and 'Custom' not in fct.groups())]
sorted_functions = sorted(functions_list_no_deprecated)
# Styles excerpt from QGIS CSS internal styles
styles = '''
.overview{
font: 1.82em;
font-weight: bold;
}
body{
background: white;
color: black;
font-family: 'Lato', 'Ubuntu', 'Lucida Grande', 'Segoe UI', 'Arial', sans-serif;
width: 100%;
}
h1{
background-color: #F6F6F6;
color: #589632;
font-size: x-large;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 3em;
}
h2{
background-color: #F6F6F6;
color: #589632;
font-size: medium;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 1.1em;
}
h3{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: large;
text-align: left;
border-bottom: 5px solid #DCEB5C;
}
h4{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: medium;
text-align: left;
}
h5{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: small;
text-align: left;
}
a{
color: #729FCF;
font-family: arial,sans-serif;
}
label{
background-color: #FFFFCC;
border: 1px solid black;
margin: 1px;
padding: 0px 3px;
font-size: small;
}
th .strong {
font-weight: bold;
}
hr {
border: 0;
height: 0;
border-top: 1px solid black;
}
.list-view .highlight {
text-align: left;
border: 0px;
width: 20%;
padding-right: 15px;
padding-left: 20px;
font-weight: bold;
}
.tabular-view .odd-row {
background-color: #f9f9f9;
}
.section {
font-weight: bold;
padding-top:25px;
}
.tabular-view{
border-collapse: collapse;
width: 95%;
}
.tabular-view th, .tabular-view td {
border:10px solid black;
}
.overview{
font: 1.82em;
font-weight: bold;
}
body{
background: white;
color: black;
font-family: 'Lato', 'Ubuntu', 'Lucida Grande', 'Segoe UI', 'Arial', sans-serif;
width: 100%;
}
h1{
background-color: #F6F6F6;
color: #589632;
font-size: x-large;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 3em;
}
h2{
background-color: #F6F6F6;
color: #589632;
font-size: medium;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 1.1em;
}
h3{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: large;
text-align: left;
border-bottom: 5px solid #DCEB5C;
}
h4{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: medium;
text-align: left;
}
h5{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: small;
text-align: left;
}
a{
color: #729FCF;
font-family: arial,sans-serif;
}
label{
background-color: #FFFFCC;
border: 1px solid black;
margin: 1px;
padding: 0px 3px;
font-size: small;
}
th .strong {
font-weight: bold;
}
hr {
border: 0;
height: 0;
border-top: 1px solid black;
}
.list-view .highlight {
text-align: left;
border: 0px;
width: 20%;
padding-right: 15px;
padding-left: 20px;
font-weight: bold;
}
.tabular-view .odd-row {
background-color: #f9f9f9;
}
.section {
font-weight: bold;
padding-top:25px;
}
'''
overloaded_style = '''
body {
margin-left: 50px;
}
.group {
margin-bottom: 30px;
}
.function {
margin-left: 20px;
}
'''
content = []
toc = []
for group in unique_sorted_groups:
anchor_group_id = group.lower().replace(' ', '-')
# Not enough generic but did not found better way...
if group == 'Form':
group_locale_name = QgsApplication.translate("Form", "Form")
elif group == 'Layout':
group_locale_name = QgsApplication.translate("QObject", "Layout")
elif group == 'GeometryGroup':
group_locale_name = QgsApplication.translate("QgsExpression", "Geometry")
else:
group_locale_name = QgsApplication.translate("QgsExpression", group)
mygroup = {
'name': group,
'locale_name': group_locale_name,
'id': anchor_group_id,
'functions': []
}
content.append('<div id="' + anchor_group_id + '" class="group">' +
QgsExpression.helpText(group).replace('<h3>', '<h2><a href="#' + anchor_group_id + '-idx' + '">').replace('</h3>', '</a></h2>') + '</div>')
# content.append(QgsExpression.helpText(group).replace('h3', 'h2'))
for fct in sorted_functions:
if group in fct[1]:
anchor_function_name = fct[0].lower().replace(' ', '-').replace('$', 'dollar-')
anchor_function_id = anchor_group_id + '-' + anchor_function_name
mygroup['functions'].append({
'name': fct[0],
'id': anchor_function_id
})
content.append(
'<div class="function">' + fct[2].replace('<h3>', '<h3 id="{}"><a href="#{}">'.format(anchor_function_id, anchor_function_id + '-idx')).replace('</h3>', '</a></h3>') + '</div>'
)
toc.append(mygroup)
html_toc = ''.join([
'<a href="#' + group['id'] +'">' + '<h2 id="' + group['id'] + '-idx' +'">' + group['locale_name'] + "</h2>" + "</a>" +
"<ul>" + ''.join([
'<li>' + '<a href="#' + fct['id'] + '">' + '<span id="' + fct['id'] + '-idx' + '">' + fct['name'] + '</span>' + "</a>" + "</li>" for fct in group['functions']
]) + "</ul>" for group in toc
])
content = ["<style>{}</style>".format(styles + overloaded_style)] + ["<h1>Expressions documentation single page (locale " + QgsApplication.locale() + ")</h1>"] + [html_toc] + content
with open('/tmp/qgis-' + '-'.join(Qgis.QGIS_VERSION.split('.')[0:2]) + '-' + QgsApplication.locale() + '-expressions-single-page.html', 'w') as f:
f.write('\n'.join(content))
<style>
.overview{
font: 1.82em;
font-weight: bold;
}
body{
background: white;
color: black;
font-family: 'Lato', 'Ubuntu', 'Lucida Grande', 'Segoe UI', 'Arial', sans-serif;
width: 100%;
}
h1{
background-color: #F6F6F6;
color: #589632;
font-size: x-large;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 3em;
}
h2{
background-color: #F6F6F6;
color: #589632;
font-size: medium;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 1.1em;
}
h3{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: large;
text-align: left;
border-bottom: 5px solid #DCEB5C;
}
h4{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: medium;
text-align: left;
}
h5{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: small;
text-align: left;
}
a{
color: #729FCF;
font-family: arial,sans-serif;
}
label{
background-color: #FFFFCC;
border: 1px solid black;
margin: 1px;
padding: 0px 3px;
font-size: small;
}
th .strong {
font-weight: bold;
}
hr {
border: 0;
height: 0;
border-top: 1px solid black;
}
.list-view .highlight {
text-align: left;
border: 0px;
width: 20%;
padding-right: 15px;
padding-left: 20px;
font-weight: bold;
}
.tabular-view .odd-row {
background-color: #f9f9f9;
}
.section {
font-weight: bold;
padding-top:25px;
}
.tabular-view{
border-collapse: collapse;
width: 95%;
}
.tabular-view th, .tabular-view td {
border:10px solid black;
}
.overview{
font: 1.82em;
font-weight: bold;
}
body{
background: white;
color: black;
font-family: 'Lato', 'Ubuntu', 'Lucida Grande', 'Segoe UI', 'Arial', sans-serif;
width: 100%;
}
h1{
background-color: #F6F6F6;
color: #589632;
font-size: x-large;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 3em;
}
h2{
background-color: #F6F6F6;
color: #589632;
font-size: medium;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 1.1em;
}
h3{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: large;
text-align: left;
border-bottom: 5px solid #DCEB5C;
}
h4{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: medium;
text-align: left;
}
h5{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: small;
text-align: left;
}
a{
color: #729FCF;
font-family: arial,sans-serif;
}
label{
background-color: #FFFFCC;
border: 1px solid black;
margin: 1px;
padding: 0px 3px;
font-size: small;
}
th .strong {
font-weight: bold;
}
hr {
border: 0;
height: 0;
border-top: 1px solid black;
}
.list-view .highlight {
text-align: left;
border: 0px;
width: 20%;
padding-right: 15px;
padding-left: 20px;
font-weight: bold;
}
.tabular-view .odd-row {
background-color: #f9f9f9;
}
.section {
font-weight: bold;
padding-top:25px;
}
body {
margin-left: 50px;
}
.group {
margin-bottom: 30px;
}
.function {
margin-left: 20px;
}
</style>
<h1>Expressions documentation single page (locale en)</h1>
<a href="#aggregates"><h2 id="aggregates-idx">Aggregates</h2></a><ul><li><a href="#aggregates-aggregate"><span id="aggregates-aggregate-idx">aggregate</span></a></li><li><a href="#aggregates-array_agg"><span id="aggregates-array_agg-idx">array_agg</span></a></li><li><a href="#aggregates-collect"><span id="aggregates-collect-idx">collect</span></a></li><li><a href="#aggregates-concatenate"><span id="aggregates-concatenate-idx">concatenate</span></a></li><li><a href="#aggregates-concatenate_unique"><span id="aggregates-concatenate_unique-idx">concatenate_unique</span></a></li><li><a href="#aggregates-count"><span id="aggregates-count-idx">count</span></a></li><li><a href="#aggregates-count_distinct"><span id="aggregates-count_distinct-idx">count_distinct</span></a></li><li><a href="#aggregates-count_missing"><span id="aggregates-count_missing-idx">count_missing</span></a></li><li><a href="#aggregates-iqr"><span id="aggregates-iqr-idx">iqr</span></a></li><li><a href="#aggregates-majority"><span id="aggregates-majority-idx">majority</span></a></li><li><a href="#aggregates-max_length"><span id="aggregates-max_length-idx">max_length</span></a></li><li><a href="#aggregates-maximum"><span id="aggregates-maximum-idx">maximum</span></a></li><li><a href="#aggregates-mean"><span id="aggregates-mean-idx">mean</span></a></li><li><a href="#aggregates-median"><span id="aggregates-median-idx">median</span></a></li><li><a href="#aggregates-min_length"><span id="aggregates-min_length-idx">min_length</span></a></li><li><a href="#aggregates-minimum"><span id="aggregates-minimum-idx">minimum</span></a></li><li><a href="#aggregates-minority"><span id="aggregates-minority-idx">minority</span></a></li><li><a href="#aggregates-q1"><span id="aggregates-q1-idx">q1</span></a></li><li><a href="#aggregates-q3"><span id="aggregates-q3-idx">q3</span></a></li><li><a href="#aggregates-range"><span id="aggregates-range-idx">range</span></a></li><li><a href="#aggregates-relation_aggregate"><span id="aggregates-relation_aggregate-idx">relation_aggregate</span></a></li><li><a href="#aggregates-stdev"><span id="aggregates-stdev-idx">stdev</span></a></li><li><a href="#aggregates-sum"><span id="aggregates-sum-idx">sum</span></a></li></ul><a href="#arrays"><h2 id="arrays-idx">Arrays</h2></a><ul><li><a href="#arrays-array"><span id="arrays-array-idx">array</span></a></li><li><a href="#arrays-array_all"><span id="arrays-array_all-idx">array_all</span></a></li><li><a href="#arrays-array_append"><span id="arrays-array_append-idx">array_append</span></a></li><li><a href="#arrays-array_cat"><span id="arrays-array_cat-idx">array_cat</span></a></li><li><a href="#arrays-array_contains"><span id="arrays-array_contains-idx">array_contains</span></a></li><li><a href="#arrays-array_distinct"><span id="arrays-array_distinct-idx">array_distinct</span></a></li><li><a href="#arrays-array_filter"><span id="arrays-array_filter-idx">array_filter</span></a></li><li><a href="#arrays-array_find"><span id="arrays-array_find-idx">array_find</span></a></li><li><a href="#arrays-array_first"><span id="arrays-array_first-idx">array_first</span></a></li><li><a href="#arrays-array_foreach"><span id="arrays-array_foreach-idx">array_foreach</span></a></li><li><a href="#arrays-array_get"><span id="arrays-array_get-idx">array_get</span></a></li><li><a href="#arrays-array_insert"><span id="arrays-array_insert-idx">array_insert</span></a></li><li><a href="#arrays-array_intersect"><span id="arrays-array_intersect-idx">array_intersect</span></a></li><li><a href="#arrays-array_last"><span id="arrays-array_last-idx">array_last</span></a></li><li><a href="#arrays-array_length"><span id="arrays-array_length-idx">array_length</span></a></li><li><a href="#arrays-array_prepend"><span id="arrays-array_prepend-idx">array_prepend</span></a></li><li><a href="#arrays-array_remove_all"><span id="arrays-array_remove_all-idx">array_remove_all</span></a></li><li><a href="#arrays-array_remove_at"><span id="arrays-array_remove_at-idx">array_remove_at</span></a></li><li><a href="#arrays-array_reverse"><span id="arrays-array_reverse-idx">array_reverse</span></a></li><li><a href="#arrays-array_slice"><span id="arrays-array_slice-idx">array_slice</span></a></li><li><a href="#arrays-array_sort"><span id="arrays-array_sort-idx">array_sort</span></a></li><li><a href="#arrays-array_to_string"><span id="arrays-array_to_string-idx">array_to_string</span></a></li><li><a href="#arrays-generate_series"><span id="arrays-generate_series-idx">generate_series</span></a></li><li><a href="#arrays-regexp_matches"><span id="arrays-regexp_matches-idx">regexp_matches</span></a></li><li><a href="#arrays-string_to_array"><span id="arrays-string_to_array-idx">string_to_array</span></a></li></ul><a href="#color"><h2 id="color-idx">Color</h2></a><ul><li><a href="#color-color_cmyk"><span id="color-color_cmyk-idx">color_cmyk</span></a></li><li><a href="#color-color_cmyka"><span id="color-color_cmyka-idx">color_cmyka</span></a></li><li><a href="#color-color_grayscale_average"><span id="color-color_grayscale_average-idx">color_grayscale_average</span></a></li><li><a href="#color-color_hsl"><span id="color-color_hsl-idx">color_hsl</span></a></li><li><a href="#color-color_hsla"><span id="color-color_hsla-idx">color_hsla</span></a></li><li><a href="#color-color_hsv"><span id="color-color_hsv-idx">color_hsv</span></a></li><li><a href="#color-color_hsva"><span id="color-color_hsva-idx">color_hsva</span></a></li><li><a href="#color-color_mix_rgb"><span id="color-color_mix_rgb-idx">color_mix_rgb</span></a></li><li><a href="#color-color_part"><span id="color-color_part-idx">color_part</span></a></li><li><a href="#color-color_rgb"><span id="color-color_rgb-idx">color_rgb</span></a></li><li><a href="#color-color_rgba"><span id="color-color_rgba-idx">color_rgba</span></a></li><li><a href="#color-create_ramp"><span id="color-create_ramp-idx">create_ramp</span></a></li><li><a href="#color-darker"><span id="color-darker-idx">darker</span></a></li><li><a href="#color-lighter"><span id="color-lighter-idx">lighter</span></a></li><li><a href="#color-project_color"><span id="color-project_color-idx">project_color</span></a></li><li><a href="#color-ramp_color"><span id="color-ramp_color-idx">ramp_color</span></a></li><li><a href="#color-set_color_part"><span id="color-set_color_part-idx">set_color_part</span></a></li></ul><a href="#conditionals"><h2 id="conditionals-idx">Conditionals</h2></a><ul><li><a href="#conditionals-coalesce"><span id="conditionals-coalesce-idx">coalesce</span></a></li><li><a href="#conditionals-if"><span id="conditionals-if-idx">if</span></a></li><li><a href="#conditionals-nullif"><span id="conditionals-nullif-idx">nullif</span></a></li><li><a href="#conditionals-regexp_match"><span id="conditionals-regexp_match-idx">regexp_match</span></a></li><li><a href="#conditionals-try"><span id="conditionals-try-idx">try</span></a></li></ul><a href="#conversions"><h2 id="conversions-idx">Conversions</h2></a><ul><li><a href="#conversions-hash"><span id="conversions-hash-idx">hash</span></a></li><li><a href="#conversions-md5"><span id="conversions-md5-idx">md5</span></a></li><li><a href="#conversions-sha256"><span id="conversions-sha256-idx">sha256</span></a></li><li><a href="#conversions-to_date"><span id="conversions-to_date-idx">to_date</span></a></li><li><a href="#conversions-to_datetime"><span id="conversions-to_datetime-idx">to_datetime</span></a></li><li><a href="#conversions-to_dm"><span id="conversions-to_dm-idx">to_dm</span></a></li><li><a href="#conversions-to_dms"><span id="conversions-to_dms-idx">to_dms</span></a></li><li><a href="#conversions-to_int"><span id="conversions-to_int-idx">to_int</span></a></li><li><a href="#conversions-to_interval"><span id="conversions-to_interval-idx">to_interval</span></a></li><li><a href="#conversions-to_real"><span id="conversions-to_real-idx">to_real</span></a></li><li><a href="#conversions-to_string"><span id="conversions-to_string-idx">to_string</span></a></li><li><a href="#conversions-to_time"><span id="conversions-to_time-idx">to_time</span></a></li></ul><a href="#date-and-time"><h2 id="date-and-time-idx">Date and Time</h2></a><ul><li><a href="#date-and-time-age"><span id="date-and-time-age-idx">age</span></a></li><li><a href="#date-and-time-datetime_from_epoch"><span id="date-and-time-datetime_from_epoch-idx">datetime_from_epoch</span></a></li><li><a href="#date-and-time-day"><span id="date-and-time-day-idx">day</span></a></li><li><a href="#date-and-time-day_of_week"><span id="date-and-time-day_of_week-idx">day_of_week</span></a></li><li><a href="#date-and-time-epoch"><span id="date-and-time-epoch-idx">epoch</span></a></li><li><a href="#date-and-time-format_date"><span id="date-and-time-format_date-idx">format_date</span></a></li><li><a href="#date-and-time-hour"><span id="date-and-time-hour-idx">hour</span></a></li><li><a href="#date-and-time-minute"><span id="date-and-time-minute-idx">minute</span></a></li><li><a href="#date-and-time-month"><span id="date-and-time-month-idx">month</span></a></li><li><a href="#date-and-time-now"><span id="date-and-time-now-idx">now</span></a></li><li><a href="#date-and-time-second"><span id="date-and-time-second-idx">second</span></a></li><li><a href="#date-and-time-to_date"><span id="date-and-time-to_date-idx">to_date</span></a></li><li><a href="#date-and-time-to_datetime"><span id="date-and-time-to_datetime-idx">to_datetime</span></a></li><li><a href="#date-and-time-to_interval"><span id="date-and-time-to_interval-idx">to_interval</span></a></li><li><a href="#date-and-time-to_time"><span id="date-and-time-to_time-idx">to_time</span></a></li><li><a href="#date-and-time-week"><span id="date-and-time-week-idx">week</span></a></li><li><a href="#date-and-time-year"><span id="date-and-time-year-idx">year</span></a></li></ul><a href="#files-and-paths"><h2 id="files-and-paths-idx">Files and Paths</h2></a><ul><li><a href="#files-and-paths-base_file_name"><span id="files-and-paths-base_file_name-idx">base_file_name</span></a></li><li><a href="#files-and-paths-file_exists"><span id="files-and-paths-file_exists-idx">file_exists</span></a></li><li><a href="#files-and-paths-file_name"><span id="files-and-paths-file_name-idx">file_name</span></a></li><li><a href="#files-and-paths-file_path"><span id="files-and-paths-file_path-idx">file_path</span></a></li><li><a href="#files-and-paths-file_size"><span id="files-and-paths-file_size-idx">file_size</span></a></li><li><a href="#files-and-paths-file_suffix"><span id="files-and-paths-file_suffix-idx">file_suffix</span></a></li><li><a href="#files-and-paths-is_directory"><span id="files-and-paths-is_directory-idx">is_directory</span></a></li><li><a href="#files-and-paths-is_file"><span id="files-and-paths-is_file-idx">is_file</span></a></li></ul><a href="#form"><h2 id="form-idx">Form</h2></a><ul><li><a href="#form-current_value"><span id="form-current_value-idx">current_value</span></a></li></ul><a href="#fuzzy-matching"><h2 id="fuzzy-matching-idx">Fuzzy Matching</h2></a><ul><li><a href="#fuzzy-matching-hamming_distance"><span id="fuzzy-matching-hamming_distance-idx">hamming_distance</span></a></li><li><a href="#fuzzy-matching-levenshtein"><span id="fuzzy-matching-levenshtein-idx">levenshtein</span></a></li><li><a href="#fuzzy-matching-longest_common_substring"><span id="fuzzy-matching-longest_common_substring-idx">longest_common_substring</span></a></li><li><a href="#fuzzy-matching-soundex"><span id="fuzzy-matching-soundex-idx">soundex</span></a></li></ul><a href="#general"><h2 id="general-idx">General</h2></a><ul><li><a href="#general-env"><span id="general-env-idx">env</span></a></li><li><a href="#general-eval"><span id="general-eval-idx">eval</span></a></li><li><a href="#general-is_layer_visible"><span id="general-is_layer_visible-idx">is_layer_visible</span></a></li><li><a href="#general-layer_property"><span id="general-layer_property-idx">layer_property</span></a></li><li><a href="#general-var"><span id="general-var-idx">var</span></a></li><li><a href="#general-with_variable"><span id="general-with_variable-idx">with_variable</span></a></li></ul><a href="#geometrygroup"><h2 id="geometrygroup-idx">Geometry</h2></a><ul><li><a href="#geometrygroup-dollar-area"><span id="geometrygroup-dollar-area-idx">$area</span></a></li><li><a href="#geometrygroup-dollar-geometry"><span id="geometrygroup-dollar-geometry-idx">$geometry</span></a></li><li><a href="#geometrygroup-dollar-length"><span id="geometrygroup-dollar-length-idx">$length</span></a></li><li><a href="#geometrygroup-dollar-perimeter"><span id="geometrygroup-dollar-perimeter-idx">$perimeter</span></a></li><li><a href="#geometrygroup-dollar-x"><span id="geometrygroup-dollar-x-idx">$x</span></a></li><li><a href="#geometrygroup-dollar-x_at"><span id="geometrygroup-dollar-x_at-idx">$x_at</span></a></li><li><a href="#geometrygroup-dollar-y"><span id="geometrygroup-dollar-y-idx">$y</span></a></li><li><a href="#geometrygroup-dollar-y_at"><span id="geometrygroup-dollar-y_at-idx">$y_at</span></a></li><li><a href="#geometrygroup-angle_at_vertex"><span id="geometrygroup-angle_at_vertex-idx">angle_at_vertex</span></a></li><li><a href="#geometrygroup-area"><span id="geometrygroup-area-idx">area</span></a></li><li><a href="#geometrygroup-azimuth"><span id="geometrygroup-azimuth-idx">azimuth</span></a></li><li><a href="#geometrygroup-boundary"><span id="geometrygroup-boundary-idx">boundary</span></a></li><li><a href="#geometrygroup-bounds"><span id="geometrygroup-bounds-idx">bounds</span></a></li><li><a href="#geometrygroup-bounds_height"><span id="geometrygroup-bounds_height-idx">bounds_height</span></a></li><li><a href="#geometrygroup-bounds_width"><span id="geometrygroup-bounds_width-idx">bounds_width</span></a></li><li><a href="#geometrygroup-buffer"><span id="geometrygroup-buffer-idx">buffer</span></a></li><li><a href="#geometrygroup-buffer_by_m"><span id="geometrygroup-buffer_by_m-idx">buffer_by_m</span></a></li><li><a href="#geometrygroup-centroid"><span id="geometrygroup-centroid-idx">centroid</span></a></li><li><a href="#geometrygroup-closest_point"><span id="geometrygroup-closest_point-idx">closest_point</span></a></li><li><a href="#geometrygroup-collect_geometries"><span id="geometrygroup-collect_geometries-idx">collect_geometries</span></a></li><li><a href="#geometrygroup-combine"><span id="geometrygroup-combine-idx">combine</span></a></li><li><a href="#geometrygroup-contains"><span id="geometrygroup-contains-idx">contains</span></a></li><li><a href="#geometrygroup-convex_hull"><span id="geometrygroup-convex_hull-idx">convex_hull</span></a></li><li><a href="#geometrygroup-crosses"><span id="geometrygroup-crosses-idx">crosses</span></a></li><li><a href="#geometrygroup-difference"><span id="geometrygroup-difference-idx">difference</span></a></li><li><a href="#geometrygroup-disjoint"><span id="geometrygroup-disjoint-idx">disjoint</span></a></li><li><a href="#geometrygroup-distance"><span id="geometrygroup-distance-idx">distance</span></a></li><li><a href="#geometrygroup-distance_to_vertex"><span id="geometrygroup-distance_to_vertex-idx">distance_to_vertex</span></a></li><li><a href="#geometrygroup-end_point"><span id="geometrygroup-end_point-idx">end_point</span></a></li><li><a href="#geometrygroup-extend"><span id="geometrygroup-extend-idx">extend</span></a></li><li><a href="#geometrygroup-exterior_ring"><span id="geometrygroup-exterior_ring-idx">exterior_ring</span></a></li><li><a href="#geometrygroup-extrude"><span id="geometrygroup-extrude-idx">extrude</span></a></li><li><a href="#geometrygroup-flip_coordinates"><span id="geometrygroup-flip_coordinates-idx">flip_coordinates</span></a></li><li><a href="#geometrygroup-force_rhr"><span id="geometrygroup-force_rhr-idx">force_rhr</span></a></li><li><a href="#geometrygroup-geom_from_gml"><span id="geometrygroup-geom_from_gml-idx">geom_from_gml</span></a></li><li><a href="#geometrygroup-geom_from_wkb"><span id="geometrygroup-geom_from_wkb-idx">geom_from_wkb</span></a></li><li><a href="#geometrygroup-geom_from_wkt"><span id="geometrygroup-geom_from_wkt-idx">geom_from_wkt</span></a></li><li><a href="#geometrygroup-geom_to_wkb"><span id="geometrygroup-geom_to_wkb-idx">geom_to_wkb</span></a></li><li><a href="#geometrygroup-geom_to_wkt"><span id="geometrygroup-geom_to_wkt-idx">geom_to_wkt</span></a></li><li><a href="#geometrygroup-geometry"><span id="geometrygroup-geometry-idx">geometry</span></a></li><li><a href="#geometrygroup-geometry_n"><span id="geometrygroup-geometry_n-idx">geometry_n</span></a></li><li><a href="#geometrygroup-hausdorff_distance"><span id="geometrygroup-hausdorff_distance-idx">hausdorff_distance</span></a></li><li><a href="#geometrygroup-inclination"><span id="geometrygroup-inclination-idx">inclination</span></a></li><li><a href="#geometrygroup-interior_ring_n"><span id="geometrygroup-interior_ring_n-idx">interior_ring_n</span></a></li><li><a href="#geometrygroup-intersection"><span id="geometrygroup-intersection-idx">intersection</span></a></li><li><a href="#geometrygroup-intersects"><span id="geometrygroup-intersects-idx">intersects</span></a></li><li><a href="#geometrygroup-intersects_bbox"><span id="geometrygroup-intersects_bbox-idx">intersects_bbox</span></a></li><li><a href="#geometrygroup-is_closed"><span id="geometrygroup-is_closed-idx">is_closed</span></a></li><li><a href="#geometrygroup-is_empty"><span id="geometrygroup-is_empty-idx">is_empty</span></a></li><li><a href="#geometrygroup-is_empty_or_null"><span id="geometrygroup-is_empty_or_null-idx">is_empty_or_null</span></a></li><li><a href="#geometrygroup-is_valid"><span id="geometrygroup-is_valid-idx">is_valid</span></a></li><li><a href="#geometrygroup-length"><span id="geometrygroup-length-idx">length</span></a></li><li><a href="#geometrygroup-line_interpolate_angle"><span id="geometrygroup-line_interpolate_angle-idx">line_interpolate_angle</span></a></li><li><a href="#geometrygroup-line_interpolate_point"><span id="geometrygroup-line_interpolate_point-idx">line_interpolate_point</span></a></li><li><a href="#geometrygroup-line_locate_point"><span id="geometrygroup-line_locate_point-idx">line_locate_point</span></a></li><li><a href="#geometrygroup-line_merge"><span id="geometrygroup-line_merge-idx">line_merge</span></a></li><li><a href="#geometrygroup-line_substring"><span id="geometrygroup-line_substring-idx">line_substring</span></a></li><li><a href="#geometrygroup-m"><span id="geometrygroup-m-idx">m</span></a></li><li><a href="#geometrygroup-make_circle"><span id="geometrygroup-make_circle-idx">make_circle</span></a></li><li><a href="#geometrygroup-make_ellipse"><span id="geometrygroup-make_ellipse-idx">make_ellipse</span></a></li><li><a href="#geometrygroup-make_line"><span id="geometrygroup-make_line-idx">make_line</span></a></li><li><a href="#geometrygroup-make_point"><span id="geometrygroup-make_point-idx">make_point</span></a></li><li><a href="#geometrygroup-make_point_m"><span id="geometrygroup-make_point_m-idx">make_point_m</span></a></li><li><a href="#geometrygroup-make_polygon"><span id="geometrygroup-make_polygon-idx">make_polygon</span></a></li><li><a href="#geometrygroup-make_rectangle_3points"><span id="geometrygroup-make_rectangle_3points-idx">make_rectangle_3points</span></a></li><li><a href="#geometrygroup-make_regular_polygon"><span id="geometrygroup-make_regular_polygon-idx">make_regular_polygon</span></a></li><li><a href="#geometrygroup-make_square"><span id="geometrygroup-make_square-idx">make_square</span></a></li><li><a href="#geometrygroup-make_triangle"><span id="geometrygroup-make_triangle-idx">make_triangle</span></a></li><li><a href="#geometrygroup-minimal_circle"><span id="geometrygroup-minimal_circle-idx">minimal_circle</span></a></li><li><a href="#geometrygroup-nodes_to_points"><span id="geometrygroup-nodes_to_points-idx">nodes_to_points</span></a></li><li><a href="#geometrygroup-num_geometries"><span id="geometrygroup-num_geometries-idx">num_geometries</span></a></li><li><a href="#geometrygroup-num_interior_rings"><span id="geometrygroup-num_interior_rings-idx">num_interior_rings</span></a></li><li><a href="#geometrygroup-num_points"><span id="geometrygroup-num_points-idx">num_points</span></a></li><li><a href="#geometrygroup-num_rings"><span id="geometrygroup-num_rings-idx">num_rings</span></a></li><li><a href="#geometrygroup-offset_curve"><span id="geometrygroup-offset_curve-idx">offset_curve</span></a></li><li><a href="#geometrygroup-order_parts"><span id="geometrygroup-order_parts-idx">order_parts</span></a></li><li><a href="#geometrygroup-oriented_bbox"><span id="geometrygroup-oriented_bbox-idx">oriented_bbox</span></a></li><li><a href="#geometrygroup-overlaps"><span id="geometrygroup-overlaps-idx">overlaps</span></a></li><li><a href="#geometrygroup-perimeter"><span id="geometrygroup-perimeter-idx">perimeter</span></a></li><li><a href="#geometrygroup-point_n"><span id="geometrygroup-point_n-idx">point_n</span></a></li><li><a href="#geometrygroup-point_on_surface"><span id="geometrygroup-point_on_surface-idx">point_on_surface</span></a></li><li><a href="#geometrygroup-pole_of_inaccessibility"><span id="geometrygroup-pole_of_inaccessibility-idx">pole_of_inaccessibility</span></a></li><li><a href="#geometrygroup-project"><span id="geometrygroup-project-idx">project</span></a></li><li><a href="#geometrygroup-relate"><span id="geometrygroup-relate-idx">relate</span></a></li><li><a href="#geometrygroup-reverse"><span id="geometrygroup-reverse-idx">reverse</span></a></li><li><a href="#geometrygroup-rotate"><span id="geometrygroup-rotate-idx">rotate</span></a></li><li><a href="#geometrygroup-segments_to_lines"><span id="geometrygroup-segments_to_lines-idx">segments_to_lines</span></a></li><li><a href="#geometrygroup-shortest_line"><span id="geometrygroup-shortest_line-idx">shortest_line</span></a></li><li><a href="#geometrygroup-simplify"><span id="geometrygroup-simplify-idx">simplify</span></a></li><li><a href="#geometrygroup-simplify_vw"><span id="geometrygroup-simplify_vw-idx">simplify_vw</span></a></li><li><a href="#geometrygroup-single_sided_buffer"><span id="geometrygroup-single_sided_buffer-idx">single_sided_buffer</span></a></li><li><a href="#geometrygroup-smooth"><span id="geometrygroup-smooth-idx">smooth</span></a></li><li><a href="#geometrygroup-start_point"><span id="geometrygroup-start_point-idx">start_point</span></a></li><li><a href="#geometrygroup-sym_difference"><span id="geometrygroup-sym_difference-idx">sym_difference</span></a></li><li><a href="#geometrygroup-tapered_buffer"><span id="geometrygroup-tapered_buffer-idx">tapered_buffer</span></a></li><li><a href="#geometrygroup-touches"><span id="geometrygroup-touches-idx">touches</span></a></li><li><a href="#geometrygroup-transform"><span id="geometrygroup-transform-idx">transform</span></a></li><li><a href="#geometrygroup-translate"><span id="geometrygroup-translate-idx">translate</span></a></li><li><a href="#geometrygroup-union"><span id="geometrygroup-union-idx">union</span></a></li><li><a href="#geometrygroup-wedge_buffer"><span id="geometrygroup-wedge_buffer-idx">wedge_buffer</span></a></li><li><a href="#geometrygroup-within"><span id="geometrygroup-within-idx">within</span></a></li><li><a href="#geometrygroup-x"><span id="geometrygroup-x-idx">x</span></a></li><li><a href="#geometrygroup-x_max"><span id="geometrygroup-x_max-idx">x_max</span></a></li><li><a href="#geometrygroup-x_min"><span id="geometrygroup-x_min-idx">x_min</span></a></li><li><a href="#geometrygroup-y"><span id="geometrygroup-y-idx">y</span></a></li><li><a href="#geometrygroup-y_max"><span id="geometrygroup-y_max-idx">y_max</span></a></li><li><a href="#geometrygroup-y_min"><span id="geometrygroup-y_min-idx">y_min</span></a></li><li><a href="#geometrygroup-z"><span id="geometrygroup-z-idx">z</span></a></li></ul><a href="#layout"><h2 id="layout-idx">Layout</h2></a><ul><li><a href="#layout-item_variables"><span id="layout-item_variables-idx">item_variables</span></a></li></ul><a href="#map-layers"><h2 id="map-layers-idx">Map Layers</h2></a><ul><li><a href="#map-layers-decode_uri"><span id="map-layers-decode_uri-idx">decode_uri</span></a></li></ul><a href="#maps"><h2 id="maps-idx">Maps</h2></a><ul><li><a href="#maps-from_json"><span id="maps-from_json-idx">from_json</span></a></li><li><a href="#maps-hstore_to_map"><span id="maps-hstore_to_map-idx">hstore_to_map</span></a></li><li><a href="#maps-json_to_map"><span id="maps-json_to_map-idx">json_to_map</span></a></li><li><a href="#maps-map"><span id="maps-map-idx">map</span></a></li><li><a href="#maps-map_akeys"><span id="maps-map_akeys-idx">map_akeys</span></a></li><li><a href="#maps-map_avals"><span id="maps-map_avals-idx">map_avals</span></a></li><li><a href="#maps-map_concat"><span id="maps-map_concat-idx">map_concat</span></a></li><li><a href="#maps-map_delete"><span id="maps-map_delete-idx">map_delete</span></a></li><li><a href="#maps-map_exist"><span id="maps-map_exist-idx">map_exist</span></a></li><li><a href="#maps-map_get"><span id="maps-map_get-idx">map_get</span></a></li><li><a href="#maps-map_insert"><span id="maps-map_insert-idx">map_insert</span></a></li><li><a href="#maps-map_to_hstore"><span id="maps-map_to_hstore-idx">map_to_hstore</span></a></li><li><a href="#maps-map_to_json"><span id="maps-map_to_json-idx">map_to_json</span></a></li><li><a href="#maps-to_json"><span id="maps-to_json-idx">to_json</span></a></li></ul><a href="#math"><h2 id="math-idx">Math</h2></a><ul><li><a href="#math-abs"><span id="math-abs-idx">abs</span></a></li><li><a href="#math-acos"><span id="math-acos-idx">acos</span></a></li><li><a href="#math-asin"><span id="math-asin-idx">asin</span></a></li><li><a href="#math-atan"><span id="math-atan-idx">atan</span></a></li><li><a href="#math-atan2"><span id="math-atan2-idx">atan2</span></a></li><li><a href="#math-azimuth"><span id="math-azimuth-idx">azimuth</span></a></li><li><a href="#math-ceil"><span id="math-ceil-idx">ceil</span></a></li><li><a href="#math-clamp"><span id="math-clamp-idx">clamp</span></a></li><li><a href="#math-cos"><span id="math-cos-idx">cos</span></a></li><li><a href="#math-degrees"><span id="math-degrees-idx">degrees</span></a></li><li><a href="#math-exp"><span id="math-exp-idx">exp</span></a></li><li><a href="#math-floor"><span id="math-floor-idx">floor</span></a></li><li><a href="#math-inclination"><span id="math-inclination-idx">inclination</span></a></li><li><a href="#math-ln"><span id="math-ln-idx">ln</span></a></li><li><a href="#math-log"><span id="math-log-idx">log</span></a></li><li><a href="#math-log10"><span id="math-log10-idx">log10</span></a></li><li><a href="#math-max"><span id="math-max-idx">max</span></a></li><li><a href="#math-min"><span id="math-min-idx">min</span></a></li><li><a href="#math-pi"><span id="math-pi-idx">pi</span></a></li><li><a href="#math-radians"><span id="math-radians-idx">radians</span></a></li><li><a href="#math-rand"><span id="math-rand-idx">rand</span></a></li><li><a href="#math-randf"><span id="math-randf-idx">randf</span></a></li><li><a href="#math-round"><span id="math-round-idx">round</span></a></li><li><a href="#math-scale_exp"><span id="math-scale_exp-idx">scale_exp</span></a></li><li><a href="#math-scale_linear"><span id="math-scale_linear-idx">scale_linear</span></a></li><li><a href="#math-sin"><span id="math-sin-idx">sin</span></a></li><li><a href="#math-sqrt"><span id="math-sqrt-idx">sqrt</span></a></li><li><a href="#math-tan"><span id="math-tan-idx">tan</span></a></li></ul><a href="#processing"><h2 id="processing-idx">Processing</h2></a><ul><li><a href="#processing-parameter"><span id="processing-parameter-idx">parameter</span></a></li></ul><a href="#rasters"><h2 id="rasters-idx">Rasters</h2></a><ul><li><a href="#rasters-raster_statistic"><span id="rasters-raster_statistic-idx">raster_statistic</span></a></li><li><a href="#rasters-raster_value"><span id="rasters-raster_value-idx">raster_value</span></a></li></ul><a href="#record-and-attributes"><h2 id="record-and-attributes-idx">Record and Attributes</h2></a><ul><li><a href="#record-and-attributes-dollar-currentfeature"><span id="record-and-attributes-dollar-currentfeature-idx">$currentfeature</span></a></li><li><a href="#record-and-attributes-dollar-id"><span id="record-and-attributes-dollar-id-idx">$id</span></a></li><li><a href="#record-and-attributes-attribute"><span id="record-and-attributes-attribute-idx">attribute</span></a></li><li><a href="#record-and-attributes-attributes"><span id="record-and-attributes-attributes-idx">attributes</span></a></li><li><a href="#record-and-attributes-get_feature"><span id="record-and-attributes-get_feature-idx">get_feature</span></a></li><li><a href="#record-and-attributes-get_feature_by_id"><span id="record-and-attributes-get_feature_by_id-idx">get_feature_by_id</span></a></li><li><a href="#record-and-attributes-is_selected"><span id="record-and-attributes-is_selected-idx">is_selected</span></a></li><li><a href="#record-and-attributes-num_selected"><span id="record-and-attributes-num_selected-idx">num_selected</span></a></li><li><a href="#record-and-attributes-represent_value"><span id="record-and-attributes-represent_value-idx">represent_value</span></a></li><li><a href="#record-and-attributes-sqlite_fetch_and_increment"><span id="record-and-attributes-sqlite_fetch_and_increment-idx">sqlite_fetch_and_increment</span></a></li><li><a href="#record-and-attributes-uuid"><span id="record-and-attributes-uuid-idx">uuid</span></a></li></ul><a href="#string"><h2 id="string-idx">String</h2></a><ul><li><a href="#string-char"><span id="string-char-idx">char</span></a></li><li><a href="#string-concat"><span id="string-concat-idx">concat</span></a></li><li><a href="#string-format"><span id="string-format-idx">format</span></a></li><li><a href="#string-format_date"><span id="string-format_date-idx">format_date</span></a></li><li><a href="#string-format_number"><span id="string-format_number-idx">format_number</span></a></li><li><a href="#string-left"><span id="string-left-idx">left</span></a></li><li><a href="#string-length"><span id="string-length-idx">length</span></a></li><li><a href="#string-lower"><span id="string-lower-idx">lower</span></a></li><li><a href="#string-lpad"><span id="string-lpad-idx">lpad</span></a></li><li><a href="#string-regexp_match"><span id="string-regexp_match-idx">regexp_match</span></a></li><li><a href="#string-regexp_replace"><span id="string-regexp_replace-idx">regexp_replace</span></a></li><li><a href="#string-regexp_substr"><span id="string-regexp_substr-idx">regexp_substr</span></a></li><li><a href="#string-replace"><span id="string-replace-idx">replace</span></a></li><li><a href="#string-right"><span id="string-right-idx">right</span></a></li><li><a href="#string-rpad"><span id="string-rpad-idx">rpad</span></a></li><li><a href="#string-strpos"><span id="string-strpos-idx">strpos</span></a></li><li><a href="#string-substr"><span id="string-substr-idx">substr</span></a></li><li><a href="#string-title"><span id="string-title-idx">title</span></a></li><li><a href="#string-to_string"><span id="string-to_string-idx">to_string</span></a></li><li><a href="#string-trim"><span id="string-trim-idx">trim</span></a></li><li><a href="#string-upper"><span id="string-upper-idx">upper</span></a></li><li><a href="#string-wordwrap"><span id="string-wordwrap-idx">wordwrap</span></a></li></ul>
<div id="aggregates" class="group"><h2><a href="#aggregates-idx">group aggregates</a></h2>
<div class="description"><p>Contains functions which aggregate values over layers and fields.</p></div></div>
<div class="function"><h3 id="aggregates-aggregate"><a href="#aggregates-aggregate-idx">
function aggregate
</a></h3>
<div class="description">
<p>
Returns an aggregate value calculated using features from another layer.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
aggregate
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
aggregate
</span>
,
<span class="argument">
expression
</span>
[,
<span class="argument">
filter
</span>
][,
<span class="argument">
concatenator
</span>
][,
<span class="argument">
order_by
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
a string, representing either a layer name or layer ID
</td>
</tr>
<tr>
<td class="argument">
aggregate
</td>
<td>
a string corresponding to the aggregate to calculate. Valid options are:
<br/>
<ul>
<li>
count
</li>
<li>
count_distinct
</li>
<li>
count_missing
</li>
<li>
min
</li>
<li>
max
</li>
<li>
sum
</li>
<li>
mean
</li>
<li>
median
</li>
<li>
stdev
</li>
<li>
stdevsample
</li>
<li>
range
</li>
<li>
minority
</li>
<li>
majority
</li>
<li>
q1: first quartile
</li>
<li>
q3: third quartile
</li>
<li>
iqr: inter quartile range
</li>
<li>
min_length: minimum string length
</li>
<li>
max_length: maximum string length
</li>
<li>
concatenate: join strings with a concatenator
</li>
<li>
concatenate_unique: join unique strings with a concatenator
</li>
<li>
collect: create an aggregated multipart geometry
</li>
<li>
array_agg: create an array of aggregated values
</li>
</ul>
</td>
</tr>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression or field name to aggregate
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional filter expression to limit the features used for calculating the aggregate. Fields and geometry are from the features on the joined layer. The source feature can be accessed with the variable @parent.
</td>
</tr>
<tr>
<td class="argument">
concatenator
</td>
<td>
optional string to use to join values for 'concatenate' aggregate
</td>
</tr>
<tr>
<td class="argument">
order_by
</td>
<td>
optional filter expression to order the features used for calculating the aggregate. Fields and geometry are from the features on the joined layer.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
aggregate(layer:='rail_stations',aggregate:='sum',expression:="passengers")
</code>
<code>
sum of all values from the passengers field in the rail_stations layer
</code>
</li>
<li>
<code>
aggregate('rail_stations','sum', "passengers"/7)
</code>
<code>
calculates a daily average of "passengers" by dividing the "passengers" field by 7 before summing the values
</code>
</li>
<li>
<code>
aggregate(layer:='rail_stations',aggregate:='sum',expression:="passengers",filter:="class"&gt;3)
</code>
<code>
sums up all values from the "passengers" field from features where the "class" attribute is greater than 3 only
</code>
</li>
<li>
<code>
aggregate(layer:='rail_stations',aggregate:='concatenate', expression:="name", concatenator:=',')
</code>
<code>
comma separated list of the name field for all features in the rail_stations layer
</code>
</li>
<li>
<code>
aggregate(layer:='countries', aggregate:='max', expression:="code", filter:=intersects( $geometry, geometry(@parent) ) )
</code>
<code>
The country code of an intersecting country on the layer 'countries'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-array_agg"><a href="#aggregates-array_agg-idx">
function array_agg
</a></h3>
<div class="description">
<p>
Returns an array of aggregated values from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_agg
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
][,
<span class="argument">
order_by
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
<tr>
<td class="argument">
order_by
</td>
<td>
optional expression to use to order features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_agg("name",group_by:="state")
</code>
<code>
list of name values, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-collect"><a href="#aggregates-collect-idx">
function collect
</a></h3>
<div class="description">
<p>
Returns the multipart geometry of aggregated geometries from an expression
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
collect
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
geometry expression to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
collect( $geometry )
</code>
<code>
multipart geometry of aggregated geometries
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-concatenate"><a href="#aggregates-concatenate-idx">
function concatenate
</a></h3>
<div class="description">
<p>
Returns all aggregated strings from a field or expression joined by a delimiter.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
concatenate
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
][,
<span class="argument">
concatenator
</span>
][,
<span class="argument">
order_by
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
<tr>
<td class="argument">
concatenator
</td>
<td>
optional string to use to join values
</td>
</tr>
<tr>
<td class="argument">
order_by
</td>
<td>
optional expression to use to order features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
concatenate("town_name",group_by:="state",concatenator:=',')
</code>
<code>
comma separated list of town_names, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-concatenate_unique"><a href="#aggregates-concatenate_unique-idx">
function concatenate_unique
</a></h3>
<div class="description">
<p>
Returns all unique strings from a field or expression joined by a delimiter.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
concatenate_unique
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
][,
<span class="argument">
concatenator
</span>
][,
<span class="argument">
order_by
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
<tr>
<td class="argument">
concatenator
</td>
<td>
optional string to use to join values
</td>
</tr>
<tr>
<td class="argument">
order_by
</td>
<td>
optional expression to use to order features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
concatenate("town_name",group_by:="state",concatenator:=',')
</code>
<code>
comma separated list of unique town_names, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-count"><a href="#aggregates-count-idx">
function count
</a></h3>
<div class="description">
<p>
Returns the count of matching features.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
count
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
count("stations",group_by:="state")
</code>
<code>
count of stations, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-count_distinct"><a href="#aggregates-count_distinct-idx">
function count_distinct
</a></h3>
<div class="description">
<p>
Returns the count of distinct values.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
count_distinct
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
count_distinct("stations",group_by:="state")
</code>
<code>
count of distinct stations values, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-count_missing"><a href="#aggregates-count_missing-idx">
function count_missing
</a></h3>
<div class="description">
<p>
Returns the count of missing (null) values.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
count_missing
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
count_missing("stations",group_by:="state")
</code>
<code>
count of missing (null) station values, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-iqr"><a href="#aggregates-iqr-idx">
function iqr
</a></h3>
<div class="description">
<p>
Returns the calculated inter quartile range from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
iqr
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
iqr("population",group_by:="state")
</code>
<code>
inter quartile range of population value, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-majority"><a href="#aggregates-majority-idx">
function majority
</a></h3>
<div class="description">
<p>
Returns the aggregate majority of values (most commonly occurring value) from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
majority
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
majority("class",group_by:="state")
</code>
<code>
most commonly occurring class value, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-max_length"><a href="#aggregates-max_length-idx">
function max_length
</a></h3>
<div class="description">
<p>
Returns the maximum length of strings from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
max_length
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
max_length("town_name",group_by:="state")
</code>
<code>
maximum length of town_name, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-maximum"><a href="#aggregates-maximum-idx">
function maximum
</a></h3>
<div class="description">
<p>
Returns the aggregate maximum value from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
maximum
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
maximum("population",group_by:="state")
</code>
<code>
maximum population value, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-mean"><a href="#aggregates-mean-idx">
function mean
</a></h3>
<div class="description">
<p>
Returns the aggregate mean value from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
mean
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
mean("population",group_by:="state")
</code>
<code>
mean population value, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-median"><a href="#aggregates-median-idx">
function median
</a></h3>
<div class="description">
<p>
Returns the aggregate median value from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
median
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
median("population",group_by:="state")
</code>
<code>
median population value, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-min_length"><a href="#aggregates-min_length-idx">
function min_length
</a></h3>
<div class="description">
<p>
Returns the minimum length of strings from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
min_length
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
min_length("town_name",group_by:="state")
</code>
<code>
minimum length of town_name, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-minimum"><a href="#aggregates-minimum-idx">
function minimum
</a></h3>
<div class="description">
<p>
Returns the aggregate minimum value from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
minimum
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
minimum("population",group_by:="state")
</code>
<code>
minimum population value, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-minority"><a href="#aggregates-minority-idx">
function minority
</a></h3>
<div class="description">
<p>
Returns the aggregate minority of values (least occurring value) from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
minority
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
minority("class",group_by:="state")
</code>
<code>
least occurring class value, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-q1"><a href="#aggregates-q1-idx">
function q1
</a></h3>
<div class="description">
<p>
Returns the calculated first quartile from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
q1
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
q1("population",group_by:="state")
</code>
<code>
first quartile of population value, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-q3"><a href="#aggregates-q3-idx">
function q3
</a></h3>
<div class="description">
<p>
Returns the calculated third quartile from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
q3
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
q3("population",group_by:="state")
</code>
<code>
third quartile of population value, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-range"><a href="#aggregates-range-idx">
function range
</a></h3>
<div class="description">
<p>
Returns the aggregate range of values (maximum - minimum) from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
range
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
range("population",group_by:="state")
</code>
<code>
range of population values, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-relation_aggregate"><a href="#aggregates-relation_aggregate-idx">
function relation_aggregate
</a></h3>
<div class="description">
<p>
Returns an aggregate value calculated using all matching child features from a layer relation.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
relation_aggregate
</span>
(
<span class="argument">
relation
</span>
,
<span class="argument">
aggregate
</span>
,
<span class="argument">
expression
</span>
[,
<span class="argument">
concatenator
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
relation
</td>
<td>
a string, representing a relation ID
</td>
</tr>
<tr>
<td class="argument">
aggregate
</td>
<td>
a string corresponding to the aggregate to calculate. Valid options are:
<br/>
<ul>
<li>
count
</li>
<li>
count_distinct
</li>
<li>
count_missing
</li>
<li>
min
</li>
<li>
max
</li>
<li>
sum
</li>
<li>
mean
</li>
<li>
median
</li>
<li>
stdev
</li>
<li>
stdevsample
</li>
<li>
range
</li>
<li>
minority
</li>
<li>
majority
</li>
<li>
q1: first quartile
</li>
<li>
q3: third quartile
</li>
<li>
iqr: inter quartile range
</li>
<li>
min_length: minimum string length
</li>
<li>
max_length: maximum string length
</li>
<li>
concatenate: join strings with a concatenator
</li>
<li>
concatenate_unique: join unique strings with a concatenator
</li>
<li>
collect: create an aggregated multipart geometry
</li>
<li>
array_agg: create an array of aggregated values
</li>
</ul>
</td>
</tr>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression or field name to aggregate
</td>
</tr>
<tr>
<td class="argument">
concatenator
</td>
<td>
optional string to use to join values for 'concatenate' aggregate
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional filter expression to order the features used for calculating the aggregate. Fields and geometry are from the features on the joined layer.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
relation_aggregate(relation:='my_relation',aggregate:='mean',expression:="passengers")
</code>
<code>
mean value of all matching child features using the 'my_relation' relation
</code>
</li>
<li>
<code>
relation_aggregate('my_relation','sum', "passengers"/7)
</code>
<code>
sum of the passengers field divided by 7 for all matching child features using the 'my_relation' relation
</code>
</li>
<li>
<code>
relation_aggregate('my_relation','concatenate', "towns", concatenator:=',')
</code>
<code>
comma separated list of the towns field for all matching child features using the 'my_relation' relation
</code>
</li>
<li>
<code>
relation_aggregate('my_relation','array_agg', "id")
</code>
<code>
array of the id field from all matching child features using the 'my_relation' relation
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-stdev"><a href="#aggregates-stdev-idx">
function stdev
</a></h3>
<div class="description">
<p>
Returns the aggregate standard deviation value from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
stdev
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
stdev("population",group_by:="state")
</code>
<code>
standard deviation of population value, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="aggregates-sum"><a href="#aggregates-sum-idx">
function sum
</a></h3>
<div class="description">
<p>
Returns the aggregate summed value from a field or expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
sum
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
sub expression of field to aggregate
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
optional expression to use to group aggregate calculations
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
optional expression to use to filter features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
sum("population",group_by:="state")
</code>
<code>
summed population value, grouped by state field
</code>
</li>
</ul>
</div>
</div></div>
<div id="arrays" class="group"><h2><a href="#arrays-idx">group arrays</a></h2>
<div class="description"><p>This group contains expression functions for the creation and manipulation of arrays (also known as list data structures). The order of values within the array matters, in contrary to the 'map' data structure, where the order of key-value pairs is irrelevant and values are identified by their keys.</p></div></div>
<div class="function"><h3 id="arrays-array"><a href="#arrays-array-idx">
function array
</a></h3>
<div class="description">
<p>
Returns an array containing all the values passed as parameter.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array
</span>
(
<span class="argument">
value1
</span>
,
<span class="argument">
value2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
a value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array(2,10)
</code>
<code>
[ 2, 10 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_all"><a href="#arrays-array_all-idx">
function array_all
</a></h3>
<div class="description">
<p>
Returns true if an array contains all the values of a given array.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_all
</span>
(
<span class="argument">
array_a
</span>
,
<span class="argument">
array_b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array_a
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
array_b
</td>
<td>
the array of values to search
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_all(array(1,2,3),array(2,3))
</code>
<code>
true
</code>
</li>
<li>
<code>
array_all(array(1,2,3),array(1,2,4))
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_append"><a href="#arrays-array_append-idx">
function array_append
</a></h3>
<div class="description">
<p>
Returns an array with the given value added at the end.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_append
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
the value to add
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_append(array(1,2,3),4)
</code>
<code>
[ 1, 2, 3, 4 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_cat"><a href="#arrays-array_cat-idx">
function array_cat
</a></h3>
<div class="description">
<p>
Returns an array containing all the given arrays concatenated.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_cat
</span>
(
<span class="argument">
array1
</span>
,
<span class="argument">
array2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_cat(array(1,2),array(2,3))
</code>
<code>
[ 1, 2, 2, 3 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_contains"><a href="#arrays-array_contains-idx">
function array_contains
</a></h3>
<div class="description">
<p>
Returns true if an array contains the given value.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_contains
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
the value to search
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_contains(array(1,2,3),2)
</code>
<code>
true
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_distinct"><a href="#arrays-array_distinct-idx">
function array_distinct
</a></h3>
<div class="description">
<p>
Returns an array containing distinct values of the given array.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_distinct
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_distinct(array(1,2,3,2,1))
</code>
<code>
[ 1, 2, 3 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_filter"><a href="#arrays-array_filter-idx">
function array_filter
</a></h3>
<div class="description">
<p>
Returns an array with only the items for which the expression evaluates to true.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_filter
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
expression
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
expression
</td>
<td>
an expression to evaluate on each item. The variable `@element` will be replaced by the current value.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_filter(array(1,2,3),@element &lt; 3)
</code>
<code>
[ 1, 2 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_find"><a href="#arrays-array_find-idx">
function array_find
</a></h3>
<div class="description">
<p>
Returns the index (0 for the first one) of a value within an array. Returns -1 if the value is not found.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_find
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
the value to search
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_find(array(1,2,3),2)
</code>
<code>
1
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_first"><a href="#arrays-array_first-idx">
function array_first
</a></h3>
<div class="description">
<p>
Returns the first value of an array.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_first
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_first(array('a','b','c'))
</code>
<code>
'a'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_foreach"><a href="#arrays-array_foreach-idx">
function array_foreach
</a></h3>
<div class="description">
<p>
Returns an array with the given expression evaluated on each item.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_foreach
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
expression
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
expression
</td>
<td>
an expression to evaluate on each item. The variable `@element` will be replaced by the current value.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_foreach(array('a','b','c'),upper(@element))
</code>
<code>
[ 'A', 'B', 'C' ]
</code>
</li>
<li>
<code>
array_foreach(array(1,2,3),@element + 10)
</code>
<code>
[ 11, 12, 13 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_get"><a href="#arrays-array_get-idx">
function array_get
</a></h3>
<div class="description">
<p>
Returns the Nth value (0 for the first one) of an array.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_get
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
index
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
index
</td>
<td>
the index to get (0 based)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_get(array('a','b','c'),1)
</code>
<code>
'b'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_insert"><a href="#arrays-array_insert-idx">
function array_insert
</a></h3>
<div class="description">
<p>
Returns an array with the given value added at the given position.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_insert
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
pos
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
pos
</td>
<td>
the position where to add (0 based)
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
the value to add
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_insert(array(1,2,3),1,100)
</code>
<code>
[ 1, 100, 2, 3 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_intersect"><a href="#arrays-array_intersect-idx">
function array_intersect
</a></h3>
<div class="description">
<p>
Returns true if at least one element of array1 exists in array2.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_intersect
</span>
(
<span class="argument">
array1
</span>
,
<span class="argument">
array2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array1
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
array2
</td>
<td>
another array
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_intersect(array(1,2,3,4),array(4,0,2,5))
</code>
<code>
true
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_last"><a href="#arrays-array_last-idx">
function array_last
</a></h3>
<div class="description">
<p>
Returns the last value of an array.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_last
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_last(array('a','b','c'))
</code>
<code>
'c'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_length"><a href="#arrays-array_length-idx">
function array_length
</a></h3>
<div class="description">
<p>
Returns the number of elements of an array.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_length
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_length(array(1,2,3))
</code>
<code>
3
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_prepend"><a href="#arrays-array_prepend-idx">
function array_prepend
</a></h3>
<div class="description">
<p>
Returns an array with the given value added at the beginning.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_prepend
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
the value to add
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_prepend(array(1,2,3),0)
</code>
<code>
[ 0, 1, 2, 3 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_remove_all"><a href="#arrays-array_remove_all-idx">
function array_remove_all
</a></h3>
<div class="description">
<p>
Returns an array with all the entries of the given value removed.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_remove_all
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
the values to remove
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_remove_all(array('a','b','c','b'),'b')
</code>
<code>
[ 'a', 'c' ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_remove_at"><a href="#arrays-array_remove_at-idx">
function array_remove_at
</a></h3>
<div class="description">
<p>
Returns an array with the given index removed.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_remove_at
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
pos
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
pos
</td>
<td>
the position to remove (0 based)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_remove_at(array(1,2,3),1)
</code>
<code>
[ 1, 3 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_reverse"><a href="#arrays-array_reverse-idx">
function array_reverse
</a></h3>
<div class="description">
<p>
Returns the given array with array values in reversed order.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_reverse
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_reverse(array(2,4,0,10))
</code>
<code>
[ 10, 0, 4, 2 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_slice"><a href="#arrays-array_slice-idx">
function array_slice
</a></h3>
<div class="description">
<p>
Returns a portion of the array. The slice is defined by the start_pos and end_pos arguments.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_slice
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
start_pos
</span>
,
<span class="argument">
end_pos
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
start_pos
</td>
<td>
the index of the start position of the slice (0 based). The start_pos index is included in the slice. If you use a negative start_pos, the index is counted from the end of the list (-1 based).
</td>
</tr>
<tr>
<td class="argument">
end_pos
</td>
<td>
the index of the end position of the slice (0 based). The end_pos index is included in the slice. If you use a negative end_pos, the index is counted from the end of the list (-1 based).
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_slice(array(1,2,3,4,5),0,3)
</code>
<code>
[ 1, 2, 3, 4 ]
</code>
</li>
<li>
<code>
array_slice(array(1,2,3,4,5),0,-1)
</code>
<code>
[ 1, 2, 3, 4, 5 ]
</code>
</li>
<li>
<code>
array_slice(array(1,2,3,4,5),-5,-1)
</code>
<code>
[ 1, 2, 3, 4, 5 ]
</code>
</li>
<li>
<code>
array_slice(array(1,2,3,4,5),0,0)
</code>
<code>
[ 1 ]
</code>
</li>
<li>
<code>
array_slice(array(1,2,3,4,5),-2,-1)
</code>
<code>
[ 4, 5 ]
</code>
</li>
<li>
<code>
array_slice(array(1,2,3,4,5),-1,-1)
</code>
<code>
[ 5 ]
</code>
</li>
<li>
<code>
array_slice(array('Dufour','Valmiera','Chugiak','Brighton'),1,2)
</code>
<code>
[ 'Valmiera', 'Chugiak' ]
</code>
</li>
<li>
<code>
array_slice(array_slice(array('Dufour','Valmiera','Chugiak','Brighton'),-2,-1)
</code>
<code>
[ 'Chugiak', 'Brighton' ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_sort"><a href="#arrays-array_sort-idx">
function array_sort
</a></h3>
<div class="description">
<p>
Returns the provided array with its elements sorted.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_sort
</span>
(
<span class="argument">
array
</span>
[,
<span class="argument">
ascending=true
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
an array
</td>
</tr>
<tr>
<td class="argument">
ascending
</td>
<td>
set this parameter to false to sort the array in descending order
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_sort(array(3,2,1))
</code>
<code>
[ 1, 2, 3 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-array_to_string"><a href="#arrays-array_to_string-idx">
function array_to_string
</a></h3>
<div class="description">
<p>
Concatenates array elements into a string separated by a delimiter and using optional string for empty values.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_to_string
</span>
(
<span class="argument">
array
</span>
[,
<span class="argument">
delimiter=','
</span>
][,
<span class="argument">
empty_value=''
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
the input array
</td>
</tr>
<tr>
<td class="argument">
delimiter
</td>
<td>
the string delimiter used to separate concatenated array elements
</td>
</tr>
<tr>
<td class="argument">
empty_value
</td>
<td>
the optional string to use as replacement for empty (zero length) matches
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
array_to_string(array('1','2','3'))
</code>
<code>
'1,2,3'
</code>
</li>
<li>
<code>
array_to_string(array(1,2,3),'-')
</code>
<code>
'1-2-3'
</code>
</li>
<li>
<code>
array_to_string(array('1','','3'),',','0')
</code>
<code>
'1,0,3'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-generate_series"><a href="#arrays-generate_series-idx">
function generate_series
</a></h3>
<div class="description">
<p>
Creates an array containing a sequence of numbers.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
generate_series
</span>
(
<span class="argument">
start
</span>
,
<span class="argument">
stop
</span>
[,
<span class="argument">
step=1
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
start
</td>
<td>
first value of the sequence
</td>
</tr>
<tr>
<td class="argument">
stop
</td>
<td>
value that ends the sequence once reached
</td>
</tr>
<tr>
<td class="argument">
step
</td>
<td>
value used as the increment between values
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
generate_series(1,5)
</code>
<code>
[ 1, 2, 3, 4, 5 ]
</code>
</li>
<li>
<code>
generate_series(5,1,-1)
</code>
<code>
[ 5, 4, 3, 2, 1 ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-regexp_matches"><a href="#arrays-regexp_matches-idx">
function regexp_matches
</a></h3>
<div class="description">
<p>
Returns an array of all strings captured by capturing groups, in the order the groups themselves appear in the supplied regular expression against a string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
regexp_matches
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
regex
</span>
[,
<span class="argument">
empty_value=''
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to capture groups from against the regular expression
</td>
</tr>
<tr>
<td class="argument">
regex
</td>
<td>
the regular expression used to capture groups
</td>
</tr>
<tr>
<td class="argument">
empty_value
</td>
<td>
the optional string to use as replacement for empty (zero length) matches
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
regexp_matches('QGIS=&gt;rocks','(.*)=&gt;(.*)')
</code>
<code>
[ 'QGIS', 'rocks' ]
</code>
</li>
<li>
<code>
regexp_matches('key=&gt;','(.*)=&gt;(.*)','empty value')
</code>
<code>
[ 'key', 'empty value' ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="arrays-string_to_array"><a href="#arrays-string_to_array-idx">
function string_to_array
</a></h3>
<div class="description">
<p>
Splits string into an array using supplied delimiter and optional string for empty values.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
string_to_array
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
delimiter=','
</span>
][,
<span class="argument">
empty_value=''
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the input string
</td>
</tr>
<tr>
<td class="argument">
delimiter
</td>
<td>
the string delimiter used to split the input string
</td>
</tr>
<tr>
<td class="argument">
empty_value
</td>
<td>
the optional string to use as replacement for empty (zero length) matches
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
string_to_array('1,2,3',',')
</code>
<code>
[ '1', '2', '3' ]
</code>
</li>
<li>
<code>
string_to_array('1,,3',',','0')
</code>
<code>
[ '1', '0', '3' ]
</code>
</li>
</ul>
</div>
</div></div>
<div id="color" class="group"><h2><a href="#color-idx">group color</a></h2>
<div class="description"><p>This group contains functions for manipulating colors</p></div></div>
<div class="function"><h3 id="color-color_cmyk"><a href="#color-color_cmyk-idx">
function color_cmyk
</a></h3>
<div class="description">
<p>
Returns a string representation of a color based on its cyan, magenta, yellow and black components
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_cmyk
</span>
(
<span class="argument">
cyan
</span>
,
<span class="argument">
magenta
</span>
,
<span class="argument">
yellow
</span>
,
<span class="argument">
black
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
cyan
</td>
<td>
cyan component of the color, as a percentage integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
magenta
</td>
<td>
magenta component of the color, as a percentage integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
yellow
</td>
<td>
yellow component of the color, as a percentage integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
black
</td>
<td>
black component of the color, as a percentage integer value from 0 to 100
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
color_cmyk(100,50,0,10)
</code>
<code>
0,115,230
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-color_cmyka"><a href="#color-color_cmyka-idx">
function color_cmyka
</a></h3>
<div class="description">
<p>
Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_cmyka
</span>
(
<span class="argument">
cyan
</span>
,
<span class="argument">
magenta
</span>
,
<span class="argument">
yellow
</span>
,
<span class="argument">
black
</span>
,
<span class="argument">
alpha
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
cyan
</td>
<td>
cyan component of the color, as a percentage integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
magenta
</td>
<td>
magenta component of the color, as a percentage integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
yellow
</td>
<td>
yellow component of the color, as a percentage integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
black
</td>
<td>
black component of the color, as a percentage integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
alpha
</td>
<td>
alpha component as an integer value from 0 (completely transparent) to 255 (opaque).
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
color_cmyk(100,50,0,10,200)
</code>
<code>
0,115,230,200
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-color_grayscale_average"><a href="#color-color_grayscale_average-idx">
function color_grayscale_average
</a></h3>
<div class="description">
<p>
Applies a grayscale filter and returns a string representation from a provided color.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_grayscale_average
</span>
(
<span class="argument">
color
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color
</td>
<td>
a color string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
color_grayscale_average('255,100,50')
</code>
<code>
127,127,127,255
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-color_hsl"><a href="#color-color_hsl-idx">
function color_hsl
</a></h3>
<div class="description">
<p>
Returns a string representation of a color based on its hue, saturation, and lightness attributes.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_hsl
</span>
(
<span class="argument">
hue
</span>
,
<span class="argument">
saturation
</span>
,
<span class="argument">
lightness
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
hue
</td>
<td>
hue of the color, as an integer value from 0 to 360
</td>
</tr>
<tr>
<td class="argument">
saturation
</td>
<td>
saturation percentage of the color as an integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
lightness
</td>
<td>
lightness percentage of the color as an integer value from 0 to 100
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
color_hsl(100,50,70)
</code>
<code>
166,217,140
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-color_hsla"><a href="#color-color_hsla-idx">
function color_hsla
</a></h3>
<div class="description">
<p>
Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_hsla
</span>
(
<span class="argument">
hue
</span>
,
<span class="argument">
saturation
</span>
,
<span class="argument">
lightness
</span>
,
<span class="argument">
alpha
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
hue
</td>
<td>
hue of the color, as an integer value from 0 to 360
</td>
</tr>
<tr>
<td class="argument">
saturation
</td>
<td>
saturation percentage of the color as an integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
lightness
</td>
<td>
lightness percentage of the color as an integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
alpha
</td>
<td>
alpha component as an integer value from 0 (completely transparent) to 255 (opaque).
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
color_hsla(100,50,70,200)
</code>
<code>
166,217,140,200
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-color_hsv"><a href="#color-color_hsv-idx">
function color_hsv
</a></h3>
<div class="description">
<p>
Returns a string representation of a color based on its hue, saturation, and value attributes.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_hsv
</span>
(
<span class="argument">
hue
</span>
,
<span class="argument">
saturation
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
hue
</td>
<td>
hue of the color, as an integer value from 0 to 360
</td>
</tr>
<tr>
<td class="argument">
saturation
</td>
<td>
saturation percentage of the color as an integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
value percentage of the color as an integer from 0 to 100
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
color_hsv(40,100,100)
</code>
<code>
255,170,0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-color_hsva"><a href="#color-color_hsva-idx">
function color_hsva
</a></h3>
<div class="description">
<p>
Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_hsva
</span>
(
<span class="argument">
hue
</span>
,
<span class="argument">
saturation
</span>
,
<span class="argument">
value
</span>
,
<span class="argument">
alpha
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
hue
</td>
<td>
hue of the color, as an integer value from 0 to 360
</td>
</tr>
<tr>
<td class="argument">
saturation
</td>
<td>
saturation percentage of the color as an integer value from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
value percentage of the color as an integer from 0 to 100
</td>
</tr>
<tr>
<td class="argument">
alpha
</td>
<td>
alpha component as an integer value from 0 (completely transparent) to 255 (opaque)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
color_hsva(40,100,100,200)
</code>
<code>
255,170,0,200
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-color_mix_rgb"><a href="#color-color_mix_rgb-idx">
function color_mix_rgb
</a></h3>
<div class="description">
<p>
Returns a string representing a color mixing the red, green, blue, and alpha values of two provided colors based on a given ratio.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_mix_rgb
</span>
(
<span class="argument">
color1
</span>
,
<span class="argument">
color2
</span>
,
<span class="argument">
ratio
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color1
</td>
<td>
a color string
</td>
</tr>
<tr>
<td class="argument">
color2
</td>
<td>
a color string
</td>
</tr>
<tr>
<td class="argument">
ratio
</td>
<td>
a ratio
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
color_mix_rgb('0,0,0','255,255,255',0.5)
</code>
<code>
127,127,127,255
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-color_part"><a href="#color-color_part-idx">
function color_part
</a></h3>
<div class="description">
<p>
Returns a specific component from a color string, e.g., the red component or alpha component.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_part
</span>
(
<span class="argument">
color
</span>
,
<span class="argument">
component
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color
</td>
<td>
a color string
</td>
</tr>
<tr>
<td class="argument">
component
</td>
<td>
a string corresponding to the color component to return. Valid options are:
<br/>
<ul>
<li>
red: RGB red component (0-255)
</li>
<li>
green: RGB green component (0-255)
</li>
<li>
blue: RGB blue component (0-255)
</li>
<li>
alpha: alpha (transparency) value (0-255)
</li>
<li>
hue: HSV hue (0-360)
</li>
<li>
saturation: HSV saturation (0-100)
</li>
<li>
value: HSV value (0-100)
</li>
<li>
hsl_hue: HSL hue (0-360)
</li>
<li>
hsl_saturation: HSL saturation (0-100)
</li>
<li>
lightness: HSL lightness (0-100)
</li>
<li>
cyan: CMYK cyan component (0-100)
</li>
<li>
magenta: CMYK magenta component (0-100)
</li>
<li>
yellow: CMYK yellow component (0-100)
</li>
<li>
black: CMYK black component (0-100)
</li>
</ul>
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
color_part('200,10,30','green')
</code>
<code>
10
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-color_rgb"><a href="#color-color_rgb-idx">
function color_rgb
</a></h3>
<div class="description">
<p>
Returns a string representation of a color based on its red, green, and blue components.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_rgb
</span>
(
<span class="argument">
red
</span>
,
<span class="argument">
green
</span>
,
<span class="argument">
blue
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
red
</td>
<td>
red component as an integer value from 0 to 255
</td>
</tr>
<tr>
<td class="argument">
green
</td>
<td>
green component as an integer value from 0 to 255
</td>
</tr>
<tr>
<td class="argument">
blue
</td>
<td>
blue component as an integer value from 0 to 255
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
color_rgb(255,127,0)
</code>
<code>
255,127,0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-color_rgba"><a href="#color-color_rgba-idx">
function color_rgba
</a></h3>
<div class="description">
<p>
Returns a string representation of a color based on its red, green, blue, and alpha (transparency) components.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_rgba
</span>
(
<span class="argument">
red
</span>
,
<span class="argument">
green
</span>
,
<span class="argument">
blue
</span>
,
<span class="argument">
alpha
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
red
</td>
<td>
red component as an integer value from 0 to 255
</td>
</tr>
<tr>
<td class="argument">
green
</td>
<td>
green component as an integer value from 0 to 255
</td>
</tr>
<tr>
<td class="argument">
blue
</td>
<td>
blue component as an integer value from 0 to 255
</td>
</tr>
<tr>
<td class="argument">
alpha
</td>
<td>
alpha component as an integer value from 0 (completely transparent) to 255 (opaque).
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
color_rgba(255,127,0,200)
</code>
<code>
255,127,0,200
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-create_ramp"><a href="#color-create_ramp-idx">
function create_ramp
</a></h3>
<div class="description">
<p>
Returns a gradient ramp from a map of color strings and steps.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
create_ramp
</span>
(
<span class="argument">
map
</span>
[,
<span class="argument">
discrete
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
a map of color strings and steps
</td>
</tr>
<tr>
<td class="argument">
discrete
</td>
<td>
declare whether the color ramp is discrete
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
ramp_color(create_array(map(0,'0,0,0',1,'255,0,0')),1)
</code>
<code>
'255,0,0,255'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-darker"><a href="#color-darker-idx">
function darker
</a></h3>
<div class="description">
<p>
Returns a darker (or lighter) color string
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
darker
</span>
(
<span class="argument">
color
</span>
,
<span class="argument">
factor
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color
</td>
<td>
a color string
</td>
</tr>
<tr>
<td class="argument">
factor
</td>
<td>
a integer number corresponding to the darkening factor:
<ul>
<li>
if the factor is greater than 100, this functions returns a darker color (for e.g., setting factor to 300 returns a color that has one-third the brightness);
</li>
<li>
if the factor is less than 100, the return color is lighter, but using the lighter() function for this purpose is recommended;
</li>
<li>
if the factor is 0 or negative, the return value is unspecified.
</li>
</ul>
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
darker('200,10,30',300)
</code>
<code>
'66,3,10,255'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-lighter"><a href="#color-lighter-idx">
function lighter
</a></h3>
<div class="description">
<p>
Returns a lighter (or darker) color string
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
lighter
</span>
(
<span class="argument">
color
</span>
,
<span class="argument">
factor
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color
</td>
<td>
a color string
</td>
</tr>
<tr>
<td class="argument">
factor
</td>
<td>
a integer number corresponding to the lightening factor:
<ul>
<li>
if the factor is greater than 100, this functions returns a lighter color (for e.g., setting factor to 150 returns a color that is 50% brighter);
</li>
<li>
if the factor is less than 100, the return color is darker, but using the darker() function for this purpose is recommended;
</li>
<li>
if the factor is 0 or negative, the return value is unspecified.
</li>
</ul>
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
lighter('200,10,30',200)
</code>
<code>
'255,158,168,255'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-project_color"><a href="#color-project_color-idx">
function project_color
</a></h3>
<div class="description">
<p>
Returns a color from the project's color scheme.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
project_color
</span>
(
<span class="argument">
name
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
name
</td>
<td>
a color name
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
project_color('Logo color')
</code>
<code>
20,140,50
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-ramp_color"><a href="#color-ramp_color-idx">
function ramp_color
</a></h3>
<div class="description">
<p>
Returns a string representing a color from a color ramp.
</p>
</div>
<h3 id="color-ramp_color"><a href="#color-ramp_color-idx">
Saved ramp variant
</a></h3>
<div class="description">
Returns a string representing a color from a saved ramp
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
ramp_color
</span>
(
<span class="argument">
ramp_name
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
ramp_name
</td>
<td>
the name of the color ramp as a string, for example 'Spectral'
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
the position on the ramp to select the color from as a real number between 0 and 1
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
ramp_color('Spectral',0.3)
</code>
<code>
'253,190,115,255'
</code>
</li>
</ul>
</div>
<h4>
Notes
</h4>
<div class="notes">
<p>
The color ramps available vary between QGIS installations. This function may not give the expected results if you move your QGIS project between installations.
</p>
</div>
<h3 id="color-ramp_color"><a href="#color-ramp_color-idx">
Expression-created ramp variant
</a></h3>
<div class="description">
Returns a string representing a color from an expression-created ramp
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
ramp_color
</span>
(
<span class="argument">
ramp
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
ramp
</td>
<td>
the color ramp
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
the position on the ramp to select the color from as a real number between 0 and 1
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
ramp_color(create_ramp(map(0,'0,0,0',1,'255,0,0')),1)
</code>
<code>
'255,0,0,255'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="color-set_color_part"><a href="#color-set_color_part-idx">
function set_color_part
</a></h3>
<div class="description">
<p>
Sets a specific color component for a color string, e.g., the red component or alpha component.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
set_color_part
</span>
(
<span class="argument">
color
</span>
,
<span class="argument">
component
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color
</td>
<td>
a color string
</td>
</tr>
<tr>
<td class="argument">
component
</td>
<td>
a string corresponding to the color component to set. Valid options are:
<br/>
<ul>
<li>
red: RGB red component (0-255)
</li>
<li>
green: RGB green component (0-255)
</li>
<li>
blue: RGB blue component (0-255)
</li>
<li>
alpha: alpha (transparency) value (0-255)
</li>
<li>
hue: HSV hue (0-360)
</li>
<li>
saturation: HSV saturation (0-100)
</li>
<li>
value: HSV value (0-100)
</li>
<li>
hsl_hue: HSL hue (0-360)
</li>
<li>
hsl_saturation: HSL saturation (0-100)
</li>
<li>
lightness: HSL lightness (0-100)
</li>
<li>
cyan: CMYK cyan component (0-100)
</li>
<li>
magenta: CMYK magenta component (0-100)
</li>
<li>
yellow: CMYK yellow component (0-100)
</li>
<li>
black: CMYK black component (0-100)
</li>
</ul>
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
new value for color component, respecting the ranges listed above
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
set_color_part('200,10,30','green',50)
</code>
<code>
200,50,30
</code>
</li>
</ul>
</div>
</div></div>
<div id="conditionals" class="group"><h2><a href="#conditionals-idx">group conditionals</a></h2>
<div class="description"><p>This group contains functions to handle conditional checks in expressions.</p></div></div>
<div class="function"><h3 id="conditionals-coalesce"><a href="#conditionals-coalesce-idx">
function coalesce
</a></h3>
<div class="description">
<p>
Returns the first non-NULL value from the expression list.
<br/>
This function can take any number of arguments.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
coalesce
</span>
(
<span class="argument">
expression1
</span>
,
<span class="argument">
expression2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
any valid expression or value, regardless of type.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
coalesce(NULL, 2)
</code>
<code>
2
</code>
</li>
<li>
<code>
coalesce(NULL, 2, 3)
</code>
<code>
2
</code>
</li>
<li>
<code>
coalesce(7, NULL, 3*2)
</code>
<code>
7
</code>
</li>
<li>
<code>
coalesce("fieldA", "fallbackField", 'ERROR')
</code>
<code>
value of fieldA if it is non-NULL else the value of "fallbackField" or the string 'ERROR' if both are NULL
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conditionals-if"><a href="#conditionals-if-idx">
function if
</a></h3>
<div class="description">
<p>
Tests a condition and returns a different result depending on the conditional check.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
if
</span>
(
<span class="argument">
condition
</span>
,
<span class="argument">
result_when_true
</span>
,
<span class="argument">
result_when_false
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
condition
</td>
<td>
the condition which should be checked
</td>
</tr>
<tr>
<td class="argument">
result_when_true
</td>
<td>
the result which will be returned when the condition is true or another value that does not convert to false.
</td>
</tr>
<tr>
<td class="argument">
result_when_false
</td>
<td>
the result which will be returned when the condition is false or another value that converts to false like 0 or ''. NULL will also be converted to false.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
if( 1+1=2, 'Yes', 'No' )
</code>
<code>
'Yes'
</code>
</li>
<li>
<code>
if( 1+1=3, 'Yes', 'No' )
</code>
<code>
'No'
</code>
</li>
<li>
<code>
if( 5 &gt; 3, 1, 0)
</code>
<code>
1
</code>
</li>
<li>
<code>
if( '', 'It is true (not empty)', 'It is false (empty)' )
</code>
<code>
'It is false (empty)'
</code>
</li>
<li>
<code>
if( ' ', 'It is true (not empty)', 'It is false (empty)' )
</code>
<code>
'It is true (not empty)'
</code>
</li>
<li>
<code>
if( 0, 'One', 'Zero' )
</code>
<code>
'Zero'
</code>
</li>
<li>
<code>
if( 10, 'One', 'Zero' )
</code>
<code>
'One'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conditionals-nullif"><a href="#conditionals-nullif-idx">
function nullif
</a></h3>
<div class="description">
<p>
Returns a null value if value1 equals value2; otherwise it returns value1. This can be used to conditionally substitute values with NULL.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
nullif
</span>
(
<span class="argument">
value1
</span>
,
<span class="argument">
value2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value1
</td>
<td>
The value that should either be used or substituted with NULL.
</td>
</tr>
<tr>
<td class="argument">
value2
</td>
<td>
The control value that will trigger the NULL substitution.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
nullif('(none)', '(none)')
</code>
<code>
NULL
</code>
</li>
<li>
<code>
nullif('text', '(none)')
</code>
<code>
'text'
</code>
</li>
<li>
<code>
nullif("name", '')
</code>
<code>
NULL, if name is an empty string (or already NULL), the name in any other case.
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conditionals-regexp_match"><a href="#conditionals-regexp_match-idx">
function regexp_match
</a></h3>
<div class="description">
<p>
Return the first matching position matching a regular expression within a string, or 0 if the substring is not found.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
regexp_match
</span>
(
<span class="argument">
input_string
</span>
,
<span class="argument">
regex
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
input_string
</td>
<td>
the string to test against the regular expression
</td>
</tr>
<tr>
<td class="argument">
regex
</td>
<td>
The regular expression to test against. Backslash characters must be double escaped (e.g., "\\s" to match a white space character).
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
regexp_match('QGIS ROCKS','\\sROCKS')
</code>
<code>
4
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conditionals-try"><a href="#conditionals-try-idx">
function try
</a></h3>
<div class="description">
<p>
Tries an expression and returns its value if error-free. If the expression returns an error, an alternative value will be returned when provided otherwise the function will return null.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
try
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
alternative
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
the expression which should be run
</td>
</tr>
<tr>
<td class="argument">
alternative
</td>
<td>
the result which will be returned if the expression returns an error.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
try( to_int( '1' ), 0 )
</code>
<code>
1
</code>
</li>
<li>
<code>
try( to_int( 'a' ), 0 )
</code>
<code>
0
</code>
</li>
<li>
<code>
try( to_date( 'invalid_date' ) )
</code>
<code>
NULL
</code>
</li>
</ul>
</div>
</div></div>
<div id="conversions" class="group"><h2><a href="#conversions-idx">group conversions</a></h2>
<div class="description"><p>This group contains functions to convert on data type to another e.g string to integer, integer to string.</p></div></div>
<div class="function"><h3 id="conversions-hash"><a href="#conversions-hash-idx">
function hash
</a></h3>
<div class="description">
<p>
Creates a hash from a string with a given method.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
hash
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
method
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to hash
</td>
</tr>
<tr>
<td class="argument">
method
</td>
<td>
The hash method among 'md4', 'md5', 'sha1', 'sha224', 'sha384', 'sha512', 'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512', 'keccak_224', 'keccak_256', 'keccak_384', 'keccak_512'
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
hash('QGIS', md4)
</code>
<code>
'c0fc71c241cdebb6e888cbac0e2b68eb'
</code>
</li>
<li>
<code>
hash('QGIS', md5)
</code>
<code>
'57470aaa9e22adaefac7f5f342f1c6da'
</code>
</li>
<li>
<code>
hash('QGIS', sha1)
</code>
<code>
'f87cfb2b74cdd5867db913237024e7001e62b114'
</code>
</li>
<li>
<code>
hash('QGIS', sha224)
</code>
<code>
'4093a619ada631c770f44bc643ead18fb393b93d6a6af1861fcfece0'
</code>
</li>
<li>
<code>
hash('QGIS', sha256)
</code>
<code>
'eb045cba7a797aaa06ac58830846e40c8e8c780bc0676d3393605fae50c05309'
</code>
</li>
<li>
<code>
hash('QGIS', sha384)
</code>
<code>
'91c1de038cc3d09fdd512e99f9dd9922efadc39ed21d3922e69a4305cc25506033aee388e554b78714c8734f9cd7e610'
</code>
</li>
<li>
<code>
hash('QGIS', sha512)
</code>
<code>
'c2c092f2ab743bf8edbeb6d028a745f30fc720408465ed369421f0a4e20fa5e27f0c90ad72d3f1d836eaa5d25cd39897d4cf77e19984668ef58da6e3159f18ac'
</code>
</li>
<li>
<code>
hash('QGIS', sha3_224)
</code>
<code>
'467f49a5039e7280d5d42fd433e80d203439e338eaabd701f0d6c17d'
</code>
</li>
<li>
<code>
hash('QGIS', sha3_256)
</code>
<code>
'540f7354b6b8a6e735f2845250f15f4f3ba4f666c55574d9e9354575de0e980f'
</code>
</li>
<li>
<code>
hash('QGIS', sha3_384)
</code>
<code>
'96052da1e77679e9a65f60d7ead961b287977823144786386eb43647b0901fd8516fa6f1b9d243fb3f28775e6dde6107'
</code>
</li>
<li>
<code>
hash('QGIS', sha3_512)
</code>
<code>
'900d079dc69761da113980253aa8ac0414a8bd6d09879a916228f8743707c4758051c98445d6b8945ec854ff90655005e02aceb0a2ffc6a0ebf818745d665349'
</code>
</li>
<li>
<code>
hash('QGIS', keccak_224)
</code>
<code>
'5b0ce6acef8b0a121d4ac4f3eaa8503c799ad4e26a3392d1fb201478'
</code>
</li>
<li>
<code>
hash('QGIS', keccak_256)
</code>
<code>
'991c520aa6815392de24087f61b2ae0fd56abbfeee4a8ca019c1011d327c577e'
</code>
</li>
<li>
<code>
hash('QGIS', keccak_384)
</code>
<code>
'c57a3aed9d856fa04e5eeee9b62b6e027cca81ba574116d3cc1f0d48a1ef9e5886ff463ea8d0fac772ee473bf92f810d'
</code>
</li>
<li>
<code>
keccak_512('QGIS')
</code>
<code>
'6f0f751776b505e317de222508fa5d3ed7099d8f07c74fed54ccee6e7cdc6b89b4a085e309f2ee5210c9'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conversions-md5"><a href="#conversions-md5-idx">
function md5
</a></h3>
<div class="description">
<p>
Creates a md5 hash from a string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
md5
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to hash
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
md5('QGIS')
</code>
<code>
'57470aaa9e22adaefac7f5f342f1c6da'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conversions-sha256"><a href="#conversions-sha256-idx">
function sha256
</a></h3>
<div class="description">
<p>
Creates a sha256 hash from a string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
sha256
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to hash
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
sha256('QGIS')
</code>
<code>
'eb045cba7a797aaa06ac58830846e40c8e8c780bc0676d3393605fae50c05309'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conversions-to_date"><a href="#conversions-to_date-idx">
function to_date
</a></h3>
<div class="description">
<p>
Converts a string into a date object. An optional format string can be provided to parse the string; see
<a href="https://doc.qt.io/qt-5/qdate.html#fromString-1">
QDate::fromString
</a>
for additional documentation on the format.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_date
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string representing a date value
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
format used to convert the string into a date
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
language (lowercase, two- or three-letter, ISO 639 language code) used to convert the string into a date
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_date('2012-05-04')
</code>
<code>
2012-05-04
</code>
</li>
<li>
<code>
to_date('June 29, 2019','MMMM d, yyyy')
</code>
<code>
2019-06-29
</code>
</li>
<li>
<code>
to_date('29 juin, 2019','d MMMM, yyyy','fr')
</code>
<code>
2019-06-29
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conversions-to_datetime"><a href="#conversions-to_datetime-idx">
function to_datetime
</a></h3>
<div class="description">
<p>
Converts a string into a datetime object. An optional format string can be provided to parse the string; see
<a href="https://doc.qt.io/qt-5/qdatetime.html#fromString-1">
QDateTime::fromString
</a>
for additional documentation on the format.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_datetime
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string representing a datetime value
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
format used to convert the string into a datetime
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
language (lowercase, two- or three-letter, ISO 639 language code) used to convert the string into a datetime
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_datetime('2012-05-04 12:50:00')
</code>
<code>
2012-05-04T12:50:00
</code>
</li>
<li>
<code>
to_datetime('June 29, 2019 @ 12:34','MMMM d, yyyy @ HH:mm')
</code>
<code>
2019-06-29T12:34
</code>
</li>
<li>
<code>
to_datetime('29 juin, 2019 @ 12:34','d MMMM, yyyy @ HH:mm','fr')
</code>
<code>
2019-06-29T12:34
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conversions-to_dm"><a href="#conversions-to_dm-idx">
function to_dm
</a></h3>
<div class="description">
<p>
Convert a coordinate to degree, minute.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_dm
</span>
(
<span class="argument">
coordinate
</span>
,
<span class="argument">
axis
</span>
,
<span class="argument">
precision
</span>
[,
<span class="argument">
formatting
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
coordinate
</td>
<td>
A latitude or longitude value.
</td>
</tr>
<tr>
<td class="argument">
axis
</td>
<td>
The axis of the coordinate. Either 'x' or 'y'.
</td>
</tr>
<tr>
<td class="argument">
precision
</td>
<td>
Number of decimals.
</td>
</tr>
<tr>
<td class="argument">
formatting
</td>
<td>
Designates the formatting type. Acceptable values are NULL, 'aligned' or 'suffix'.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_dm(6.3545681, 'x', 3)
</code>
<code>
6°21.274′
</code>
</li>
<li>
<code>
to_dm(6.3545681, 'y', 4, 'suffix')
</code>
<code>
6°21.2741′N
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conversions-to_dms"><a href="#conversions-to_dms-idx">
function to_dms
</a></h3>
<div class="description">
<p>
Convert a coordinate to degree, minute, second.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_dms
</span>
(
<span class="argument">
coordinate
</span>
,
<span class="argument">
axis
</span>
,
<span class="argument">
precision
</span>
[,
<span class="argument">
formatting
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
coordinate
</td>
<td>
A latitude or longitude value.
</td>
</tr>
<tr>
<td class="argument">
axis
</td>
<td>
The axis of the coordinate. Either 'x' or 'y'.
</td>
</tr>
<tr>
<td class="argument">
precision
</td>
<td>
Number of decimals.
</td>
</tr>
<tr>
<td class="argument">
formatting
</td>
<td>
Designates the formatting type. Acceptable values are NULL, 'aligned' or 'suffix'.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_dms(6.3545681, 'x', 3)
</code>
<code>
6°21′16.445″
</code>
</li>
<li>
<code>
to_dms(6.3545681, 'y', 4, 'suffix')
</code>
<code>
6°21′16.4452″N
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conversions-to_int"><a href="#conversions-to_int-idx">
function to_int
</a></h3>
<div class="description">
<p>
Converts a string to integer number. Nothing is returned if a value cannot be converted to integer (e.g '123asd' is invalid).
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_int
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string to convert to integer number
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_int('123')
</code>
<code>
123
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conversions-to_interval"><a href="#conversions-to_interval-idx">
function to_interval
</a></h3>
<div class="description">
<p>
Converts a string to a interval type. Can be used to take days, hours, month, etc of a date.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_interval
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
a string representing an interval. Allowable formats include {n} days {n} hours {n} months.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_datetime('2012-05-05 12:00:00') - to_interval('1 day 2 hours')
</code>
<code>
2012-05-04T10:00:00
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conversions-to_real"><a href="#conversions-to_real-idx">
function to_real
</a></h3>
<div class="description">
<p>
Converts a string to a real number. Nothing is returned if a value cannot be converted to real (e.g '123.56asd' is invalid). Numbers are rounded after saving changes if the precision is smaller than the result of the conversion.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_real
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string to convert to real number
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_real('123.45')
</code>
<code>
123.45
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conversions-to_string"><a href="#conversions-to_string-idx">
function to_string
</a></h3>
<div class="description">
<p>
Converts a number to string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_string
</span>
(
<span class="argument">
number
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
number
</td>
<td>
Integer or real value. The number to convert to string.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_string(123)
</code>
<code>
'123'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="conversions-to_time"><a href="#conversions-to_time-idx">
function to_time
</a></h3>
<div class="description">
<p>
Converts a string into a time object. An optional format string can be provided to parse the string; see
<a href="https://doc.qt.io/qt-5/qtime.html#fromString-1">
QTime::fromString
</a>
for additional documentation on the format.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_time
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string representing a time value
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
format used to convert the string into a time
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
language (lowercase, two- or three-letter, ISO 639 language code) used to convert the string into a time
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_time('12:30:01')
</code>
<code>
12:30:01
</code>
</li>
<li>
<code>
to_time('12:34','HH:mm')
</code>
<code>
12:34:00
</code>
</li>
<li>
<code>
to_time('12:34','HH:mm','fr')
</code>
<code>
12:34:00
</code>
</li>
</ul>
</div>
</div></div>
<div id="date-and-time" class="group"><h2><a href="#date-and-time-idx">group date and time</a></h2>
<div class="description"><p>This group contains functions for handling date and time data.</p></div></div>
<div class="function"><h3 id="date-and-time-age"><a href="#date-and-time-age-idx">
function age
</a></h3>
<div class="description">
<p>
Returns the difference between two dates or datetimes.
<br/>
The difference is returned as a
<code>
Interval
</code>
and needs to be used with one of the following functions in order to extract useful information:
<br>
<ul>
<li>
<code>
year
</code>
<li>
<code>
month
</code>
<li>
<code>
week
</code>
<li>
<code>
day
</code>
<li>
<code>
hour
</code>
<li>
<code>
minute
</code>
<li>
<code>
second
</code>
</li>
</li>
</li>
</li>
</li>
</li>
</li>
</ul>
</br>
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
age
</span>
(
<span class="argument">
datetime1
</span>
,
<span class="argument">
datetime2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
datetime1
</td>
<td>
a string, date or datetime representing the later date
</td>
</tr>
<tr>
<td class="argument">
datetime2
</td>
<td>
a string, date or datetime representing the earlier date
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
day(age('2012-05-12','2012-05-02'))
</code>
<code>
10
</code>
</li>
<li>
<code>
hour(age('2012-05-12','2012-05-02'))
</code>
<code>
240
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-datetime_from_epoch"><a href="#date-and-time-datetime_from_epoch-idx">
function datetime_from_epoch
</a></h3>
<div class="description">
<p>
Returns a datetime whose date and time are the number of milliseconds, msecs, that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (Qt.UTC), and converted to Qt.LocalTime.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
datetime_from_epoch
</span>
(
<span class="argument">
int
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
int
</td>
<td>
number (milliseconds)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
datetime_from_epoch(1483225200000)
</code>
<code>
2017-01-01T00:00:00
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-day"><a href="#date-and-time-day-idx">
function day
</a></h3>
<div class="description">
<p>
Extracts the day from a date, or the number of days from an interval.
</p>
</div>
<h3 id="date-and-time-day"><a href="#date-and-time-day-idx">
Date variant
</a></h3>
<div class="description">
Extracts the day from a date or datetime.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
day
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
a date or datetime value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
day('2012-05-12')
</code>
<code>
12
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-day"><a href="#date-and-time-day-idx">
Interval variant
</a></h3>
<div class="description">
Calculates the length in days of an interval.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
day
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
interval value to return number of days from
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
day(to_interval('3 days'))
</code>
<code>
3
</code>
</li>
<li>
<code>
day(to_interval('3 weeks 2 days'))
</code>
<code>
23
</code>
</li>
<li>
<code>
day(age('2012-01-01','2010-01-01'))
</code>
<code>
730
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-day_of_week"><a href="#date-and-time-day_of_week-idx">
function day_of_week
</a></h3>
<div class="description">
<p>
Returns the day of the week for a specified date or datetime. The returned value ranges from 0 to 6, where 0 corresponds to a Sunday and 6 to a Saturday.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
day_of_week
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
date or datetime value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
day_of_week(to_date('2015-09-21'))
</code>
<code>
1
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-epoch"><a href="#date-and-time-epoch-idx">
function epoch
</a></h3>
<div class="description">
<p>
Returns the interval in milliseconds between the unix epoch and a given date value.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
epoch
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
a date or datetime value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
epoch(to_date('2017-01-01'))
</code>
<code>
1483203600000
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-format_date"><a href="#date-and-time-format_date-idx">
function format_date
</a></h3>
<div class="description">
<p>
Formats a date type or string into a custom string format. Uses Qt date/time format strings. See
<a href="https://doc.qt.io/qt-5/qdatetime.html#toString">
QDateTime::toString
</a>
.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
format_date
</span>
(
<span class="argument">
datetime
</span>
,
<span class="argument">
format
</span>
[,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
datetime
</td>
<td>
date, time or datetime value
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
String template used to format the string.
<table>
<thead>
<tr>
<th>
Expression
</th>
<th>
Output
</th>
</tr>
</thead>
<tr valign="top">
<td>
d
</td>
<td>
the day as number without a leading zero (1 to 31)
</td>
</tr>
<tr valign="top">
<td>
dd
</td>
<td>
the day as number with a leading zero (01 to 31)
</td>
</tr>
<tr valign="top">
<td>
ddd
</td>
<td>
the abbreviated localized day name (e.g. 'Mon' to 'Sun')
</td>
</tr>
<tr valign="top">
<td>
dddd
</td>
<td>
the long localized day name (e.g. 'Monday' to 'Sunday')
</td>
</tr>
<tr valign="top">
<td>
M
</td>
<td>
the month as number without a leading zero (1-12)
</td>
</tr>
<tr valign="top">
<td>
MM
</td>
<td>
the month as number with a leading zero (01-12)
</td>
</tr>
<tr valign="top">
<td>
MMM
</td>
<td>
the abbreviated localized month name (e.g. 'Jan' to 'Dec')
</td>
</tr>
<tr valign="top">
<td>
MMMM
</td>
<td>
the long localized month name (e.g. 'January' to 'December')
</td>
</tr>
<tr valign="top">
<td>
yy
</td>
<td>
the year as two digit number (00-99)
</td>
</tr>
<tr valign="top">
<td>
yyyy
</td>
<td>
the year as four digit number
</td>
</tr>
</table>
<p>
These expressions may be used for the time part of the format string:
</p>
<table>
<thead>
<tr>
<th>
Expression
</th>
<th>
Output
</th>
</tr>
</thead>
<tr valign="top">
<td>
h
</td>
<td>
the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
hh
</td>
<td>
the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
H
</td>
<td>
the hour without a leading zero (0 to 23, even with AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
HH
</td>
<td>
the hour with a leading zero (00 to 23, even with AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
m
</td>
<td>
the minute without a leading zero (0 to 59)
</td>
</tr>
<tr valign="top">
<td>
mm
</td>
<td>
the minute with a leading zero (00 to 59)
</td>
</tr>
<tr valign="top">
<td>
s
</td>
<td>
the second without a leading zero (0 to 59)
</td>
</tr>
<tr valign="top">
<td>
ss
</td>
<td>
the second with a leading zero (00 to 59)
</td>
</tr>
<tr valign="top">
<td>
z
</td>
<td>
the milliseconds without trailing zeroes (0 to 999)
</td>
</tr>
<tr valign="top">
<td>
zzz
</td>
<td>
the milliseconds with trailing zeroes (000 to 999)
</td>
</tr>
<tr valign="top">
<td>
AP or A
</td>
<td>
interpret as an AM/PM time.
<i>
AP
</i>
must be either "AM" or "PM".
</td>
</tr>
<tr valign="top">
<td>
ap or a
</td>
<td>
Interpret as an AM/PM time.
<i>
ap
</i>
must be either "am" or "pm".
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
language (lowercase, two- or three-letter, ISO 639 language code) used to format the date into a custom string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
format_date('2012-05-15','dd.MM.yyyy')
</code>
<code>
'15.05.2012'
</code>
</li>
<li>
<code>
format_date('2012-05-15','d MMMM yyyy','fr')
</code>
<code>
'15 juin 2012'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-hour"><a href="#date-and-time-hour-idx">
function hour
</a></h3>
<div class="description">
<p>
Extracts the hour part from a datetime or time, or the number of hours from an interval.
</p>
</div>
<h3 id="date-and-time-hour"><a href="#date-and-time-hour-idx">
Time variant
</a></h3>
<div class="description">
Extracts the hour part from a time or datetime.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
hour
</span>
(
<span class="argument">
datetime
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
datetime
</td>
<td>
a time or datetime value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
hour('2012-07-22T13:24:57')
</code>
<code>
13
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-hour"><a href="#date-and-time-hour-idx">
Interval variant
</a></h3>
<div class="description">
Calculates the length in hours of an interval.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
hour
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
interval value to return number of hours from
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
hour(tointerval('3 hours'))
</code>
<code>
3
</code>
</li>
<li>
<code>
hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00'))
</code>
<code>
3
</code>
</li>
<li>
<code>
hour(age('2012-01-01','2010-01-01'))
</code>
<code>
17520
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-minute"><a href="#date-and-time-minute-idx">
function minute
</a></h3>
<div class="description">
<p>
Extracts the minutes part from a datetime or time, or the number of minutes from an interval.
</p>
</div>
<h3 id="date-and-time-minute"><a href="#date-and-time-minute-idx">
Time variant
</a></h3>
<div class="description">
Extracts the minutes part from a time or datetime.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
minute
</span>
(
<span class="argument">
datetime
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
datetime
</td>
<td>
a time or datetime value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
minute('2012-07-22T13:24:57')
</code>
<code>
24
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-minute"><a href="#date-and-time-minute-idx">
Interval variant
</a></h3>
<div class="description">
Calculates the length in minutes of an interval.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
minute
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
interval value to return number of minutes from
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
minute(tointerval('3 minutes'))
</code>
<code>
3
</code>
</li>
<li>
<code>
minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00'))
</code>
<code>
20
</code>
</li>
<li>
<code>
minute(age('2012-01-01','2010-01-01'))
</code>
<code>
1051200
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-month"><a href="#date-and-time-month-idx">
function month
</a></h3>
<div class="description">
<p>
Extracts the month part from a date, or the number of months from an interval.
</p>
</div>
<h3 id="date-and-time-month"><a href="#date-and-time-month-idx">
Date variant
</a></h3>
<div class="description">
Extracts the month part from a date or datetime.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
month
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
a date or datetime value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
month('2012-05-12')
</code>
<code>
05
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-month"><a href="#date-and-time-month-idx">
Interval variant
</a></h3>
<div class="description">
Calculates the length in months of an interval.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
month
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
interval value to return number of months from
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
month(to_interval('3 months'))
</code>
<code>
3
</code>
</li>
<li>
<code>
month(age('2012-01-01','2010-01-01'))
</code>
<code>
4.03333
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-now"><a href="#date-and-time-now-idx">
function now
</a></h3>
<div class="description">
<p>
Returns the current date and time. The function is static and will return consistent results while evaluating. The time returned is the time when the expression is prepared.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
now
</span>
()
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
now()
</code>
<code>
2012-07-22T13:24:57
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-second"><a href="#date-and-time-second-idx">
function second
</a></h3>
<div class="description">
<p>
Extracts the seconds part from a datetime or time, or the number of seconds from an interval.
</p>
</div>
<h3 id="date-and-time-second"><a href="#date-and-time-second-idx">
Time variant
</a></h3>
<div class="description">
Extracts the seconds part from a time or datetime.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
second
</span>
(
<span class="argument">
datetime
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
datetime
</td>
<td>
a time or datetime value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
second('2012-07-22T13:24:57')
</code>
<code>
57
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-second"><a href="#date-and-time-second-idx">
Interval variant
</a></h3>
<div class="description">
Calculates the length in seconds of an interval.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
second
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
interval value to return number of seconds from
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
second(age('2012-07-22T00:20:00','2012-07-22T00:00:00'))
</code>
<code>
1200
</code>
</li>
<li>
<code>
second(age('2012-01-01','2010-01-01'))
</code>
<code>
63072000
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-to_date"><a href="#date-and-time-to_date-idx">
function to_date
</a></h3>
<div class="description">
<p>
Converts a string into a date object. An optional format string can be provided to parse the string; see
<a href="https://doc.qt.io/qt-5/qdate.html#fromString-1">
QDate::fromString
</a>
for additional documentation on the format.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_date
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string representing a date value
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
format used to convert the string into a date
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
language (lowercase, two- or three-letter, ISO 639 language code) used to convert the string into a date
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_date('2012-05-04')
</code>
<code>
2012-05-04
</code>
</li>
<li>
<code>
to_date('June 29, 2019','MMMM d, yyyy')
</code>
<code>
2019-06-29
</code>
</li>
<li>
<code>
to_date('29 juin, 2019','d MMMM, yyyy','fr')
</code>
<code>
2019-06-29
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-to_datetime"><a href="#date-and-time-to_datetime-idx">
function to_datetime
</a></h3>
<div class="description">
<p>
Converts a string into a datetime object. An optional format string can be provided to parse the string; see
<a href="https://doc.qt.io/qt-5/qdatetime.html#fromString-1">
QDateTime::fromString
</a>
for additional documentation on the format.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_datetime
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string representing a datetime value
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
format used to convert the string into a datetime
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
language (lowercase, two- or three-letter, ISO 639 language code) used to convert the string into a datetime
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_datetime('2012-05-04 12:50:00')
</code>
<code>
2012-05-04T12:50:00
</code>
</li>
<li>
<code>
to_datetime('June 29, 2019 @ 12:34','MMMM d, yyyy @ HH:mm')
</code>
<code>
2019-06-29T12:34
</code>
</li>
<li>
<code>
to_datetime('29 juin, 2019 @ 12:34','d MMMM, yyyy @ HH:mm','fr')
</code>
<code>
2019-06-29T12:34
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-to_interval"><a href="#date-and-time-to_interval-idx">
function to_interval
</a></h3>
<div class="description">
<p>
Converts a string to a interval type. Can be used to take days, hours, month, etc of a date.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_interval
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
a string representing an interval. Allowable formats include {n} days {n} hours {n} months.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_datetime('2012-05-05 12:00:00') - to_interval('1 day 2 hours')
</code>
<code>
2012-05-04T10:00:00
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-to_time"><a href="#date-and-time-to_time-idx">
function to_time
</a></h3>
<div class="description">
<p>
Converts a string into a time object. An optional format string can be provided to parse the string; see
<a href="https://doc.qt.io/qt-5/qtime.html#fromString-1">
QTime::fromString
</a>
for additional documentation on the format.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_time
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string representing a time value
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
format used to convert the string into a time
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
language (lowercase, two- or three-letter, ISO 639 language code) used to convert the string into a time
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_time('12:30:01')
</code>
<code>
12:30:01
</code>
</li>
<li>
<code>
to_time('12:34','HH:mm')
</code>
<code>
12:34:00
</code>
</li>
<li>
<code>
to_time('12:34','HH:mm','fr')
</code>
<code>
12:34:00
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-week"><a href="#date-and-time-week-idx">
function week
</a></h3>
<div class="description">
<p>
Extracts the week number from a date, or the number of weeks from an interval.
</p>
</div>
<h3 id="date-and-time-week"><a href="#date-and-time-week-idx">
Date variant
</a></h3>
<div class="description">
Extracts the week number from a date or datetime.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
week
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
a date or datetime value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
week('2012-05-12')
</code>
<code>
19
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-week"><a href="#date-and-time-week-idx">
Interval variant
</a></h3>
<div class="description">
Calculates the length in weeks of an interval.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
week
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
interval value to return number of months from
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
week(to_interval('3 weeks'))
</code>
<code>
3
</code>
</li>
<li>
<code>
week(age('2012-01-01','2010-01-01'))
</code>
<code>
104.285
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="date-and-time-year"><a href="#date-and-time-year-idx">
function year
</a></h3>
<div class="description">
<p>
Extracts the year part from a date, or the number of years from an interval.
</p>
</div>
<h3 id="date-and-time-year"><a href="#date-and-time-year-idx">
Date variant
</a></h3>
<div class="description">
Extracts the year part from a date or datetime.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
year
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
a date or datetime value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
year('2012-05-12')
</code>
<code>
2012
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-year"><a href="#date-and-time-year-idx">
Interval variant
</a></h3>
<div class="description">
Calculates the length in years of an interval.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
year
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
interval value to return number of years from
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
year(to_interval('3 years'))
</code>
<code>
3
</code>
</li>
<li>
<code>
year(age('2012-01-01','2010-01-01'))
</code>
<code>
1.9986
</code>
</li>
</ul>
</div>
</div></div>
<div id="files-and-paths" class="group"><h2><a href="#files-and-paths-idx">group files and paths</a></h2>
<div class="description"><p>Contains functions which manipulate file and path names.</p></div></div>
<div class="function"><h3 id="files-and-paths-base_file_name"><a href="#files-and-paths-base_file_name-idx">
function base_file_name
</a></h3>
<div class="description">
<p>
Returns the base name of the file without the directory or file suffix.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
base_file_name
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
base_file_name('/home/qgis/data/country_boundaries.shp')
</code>
<code>
'country_boundaries'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="files-and-paths-file_exists"><a href="#files-and-paths-file_exists-idx">
function file_exists
</a></h3>
<div class="description">
<p>
Returns true if a file path exists.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
file_exists
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
file_exists('/home/qgis/data/country_boundaries.shp')
</code>
<code>
true
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="files-and-paths-file_name"><a href="#files-and-paths-file_name-idx">
function file_name
</a></h3>
<div class="description">
<p>
Returns the name of a file (including the file extension), excluding the directory.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
file_name
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
file_name('/home/qgis/data/country_boundaries.shp')
</code>
<code>
'country_boundaries.shp'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="files-and-paths-file_path"><a href="#files-and-paths-file_path-idx">
function file_path
</a></h3>
<div class="description">
<p>
Returns the directory component of a file path. This does not include the file name.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
file_path
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
file_path('/home/qgis/data/country_boundaries.shp')
</code>
<code>
'/home/qgis/data'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="files-and-paths-file_size"><a href="#files-and-paths-file_size-idx">
function file_size
</a></h3>
<div class="description">
<p>
Returns the size (in bytes) of a file.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
file_size
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
file_size('/home/qgis/data/country_boundaries.geojson')
</code>
<code>
5674
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="files-and-paths-file_suffix"><a href="#files-and-paths-file_suffix-idx">
function file_suffix
</a></h3>
<div class="description">
<p>
Returns the file suffix (extension) from a file path.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
file_suffix
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
file_suffix('/home/qgis/data/country_boundaries.shp')
</code>
<code>
'shp'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="files-and-paths-is_directory"><a href="#files-and-paths-is_directory-idx">
function is_directory
</a></h3>
<div class="description">
<p>
Returns true if a path corresponds to a directory.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_directory
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
is_directory('/home/qgis/data/country_boundaries.shp')
</code>
<code>
false
</code>
</li>
<li>
<code>
is_directory('/home/qgis/data/')
</code>
<code>
true
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="files-and-paths-is_file"><a href="#files-and-paths-is_file-idx">
function is_file
</a></h3>
<div class="description">
<p>
Returns true if a path corresponds to a file.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_file
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
is_file('/home/qgis/data/country_boundaries.shp')
</code>
<code>
true
</code>
</li>
<li>
<code>
is_file('/home/qgis/data/')
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div id="form" class="group">function help for Form missing</div>
<div class="function"><h3 id="form-current_value"><a href="#form-current_value-idx">
function current_value
</a></h3>
<div class="description">
<p>
Returns the current, unsaved value of a field in the form or table row currently being edited. This will differ from the feature's actual attribute values for features which are currently being edited or have not yet been added to a layer.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
current_value
</span>
(
<span class="argument">
field_name
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
field_name
</td>
<td>
a field name in the current form or table row
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
current_value( 'FIELD_NAME' )
</code>
<code>
The current value of field 'FIELD_NAME'.
</code>
</li>
</ul>
</div>
</div></div>
<div id="fuzzy-matching" class="group"><h2><a href="#fuzzy-matching-idx">group fuzzy matching</a></h2>
<div class="description"><p>This group contains functions for fuzzy comparisons between values.</p></div></div>
<div class="function"><h3 id="fuzzy-matching-hamming_distance"><a href="#fuzzy-matching-hamming_distance-idx">
function hamming_distance
</a></h3>
<div class="description">
<p>
Returns the Hamming distance between two strings. This equates to the number of characters at corresponding positions within the input strings where the characters are different. The input strings must be the same length, and the comparison is case-sensitive.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
hamming_distance
</span>
(
<span class="argument">
string1
</span>
,
<span class="argument">
string2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string1
</td>
<td>
a string
</td>
</tr>
<tr>
<td class="argument">
string2
</td>
<td>
a string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
hamming_distance('abc','xec')
</code>
<code>
2
</code>
</li>
<li>
<code>
hamming_distance('abc','ABc')
</code>
<code>
2
</code>
</li>
<li>
<code>
hamming_distance(upper('abc'),upper('ABC'))
</code>
<code>
0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="fuzzy-matching-levenshtein"><a href="#fuzzy-matching-levenshtein-idx">
function levenshtein
</a></h3>
<div class="description">
<p>
Returns the Levenshtein edit distance between two strings. This equates to the minimum number of character edits (insertions, deletions or substitutions) required to change one string to another.
<br/>
The Levenshtein distance is a measure of the similarity between two strings. Smaller distances mean the strings are more similar, and larger distances indicate more different strings. The distance is case sensitive.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
levenshtein
</span>
(
<span class="argument">
string1
</span>
,
<span class="argument">
string2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string1
</td>
<td>
a string
</td>
</tr>
<tr>
<td class="argument">
string2
</td>
<td>
a string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
levenshtein('kittens','mitten')
</code>
<code>
2
</code>
</li>
<li>
<code>
levenshtein('Kitten','kitten')
</code>
<code>
1
</code>
</li>
<li>
<code>
levenshtein(upper('Kitten'),upper('kitten'))
</code>
<code>
0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="fuzzy-matching-longest_common_substring"><a href="#fuzzy-matching-longest_common_substring-idx">
function longest_common_substring
</a></h3>
<div class="description">
<p>
Returns the longest common substring between two strings. This substring is the longest string that is a substring of the two input strings. For example, the longest common substring of "ABABC" and "BABCA" is "ABC". The substring is case sensitive.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
longest_common_substring
</span>
(
<span class="argument">
string1
</span>
,
<span class="argument">
string2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string1
</td>
<td>
a string
</td>
</tr>
<tr>
<td class="argument">
string2
</td>
<td>
a string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
longest_common_substring('ABABC','BABCA')
</code>
<code>
'ABC'
</code>
</li>
<li>
<code>
longest_common_substring('abcDeF','abcdef')
</code>
<code>
'abc'
</code>
</li>
<li>
<code>
longest_common_substring(upper('abcDeF'),upper('abcdex'))
</code>
<code>
'ABCDE'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="fuzzy-matching-soundex"><a href="#fuzzy-matching-soundex-idx">
function soundex
</a></h3>
<div class="description">
<p>
Returns the Soundex representation of a string. Soundex is a phonetic matching algorithm, so strings with similar sounds should be represented by the same Soundex code.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
soundex
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
a string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
soundex('robert')
</code>
<code>
'R163'
</code>
</li>
<li>
<code>
soundex('rupert')
</code>
<code>
'R163'
</code>
</li>
<li>
<code>
soundex('rubin')
</code>
<code>
'R150'
</code>
</li>
</ul>
</div>
</div></div>
<div id="general" class="group"><h2><a href="#general-idx">group general</a></h2>
<div class="description"><p>This group contains general assorted functions.</p></div></div>
<div class="function"><h3 id="general-env"><a href="#general-env-idx">
function env
</a></h3>
<div class="description">
<p>
Gets an environment variable and returns its content as a string. If the variable is not found, `NULL` will be returned. This is handy to inject system specific configuration like drive letters or path prefixes. Definition of environment variables depends on the operating system, please check with your system administrator or the operating system documentation how this can be set.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
env
</span>
(
<span class="argument">
name
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
name
</td>
<td>
The name of the environment variable which should be retrieved.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
env( 'LANG' )
</code>
<code>
'en_US.UTF-8'
</code>
</li>
<li>
<code>
env( 'MY_OWN_PREFIX_VAR' )
</code>
<code>
'Z:'
</code>
</li>
<li>
<code>
env( 'I_DO_NOT_EXIST' )
</code>
<code>
NULL
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="general-eval"><a href="#general-eval-idx">
function eval
</a></h3>
<div class="description">
<p>
Evaluates an expression which is passed in a string. Useful to expand dynamic parameters passed as context variables or fields.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
eval
</span>
(
<span class="argument">
expression
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
an expression string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
eval(''nice'')
</code>
<code>
'nice'
</code>
</li>
<li>
<code>
eval(@expression_var)
</code>
<code>
[whatever the result of evaluating @expression_var might be…]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="general-is_layer_visible"><a href="#general-is_layer_visible-idx">
function is_layer_visible
</a></h3>
<div class="description">
<p>
Returns true if a specified layer is visible.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_layer_visible
</span>
(
<span class="argument">
layer
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
a string, representing either a layer name or layer ID
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
is_layer_visible('baseraster')
</code>
<code>
True
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="general-layer_property"><a href="#general-layer_property-idx">
function layer_property
</a></h3>
<div class="description">
<p>
Returns a matching layer property or metadata value.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
layer_property
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
property
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
a string, representing either a layer name or layer ID
</td>
</tr>
<tr>
<td class="argument">
property
</td>
<td>
a string corresponding to the property to return. Valid options are:
<br/>
<ul>
<li>
name: layer name
</li>
<li>
id: layer ID
</li>
<li>
title: metadata title string
</li>
<li>
abstract: metadata abstract string
</li>
<li>
keywords: metadata keywords
</li>
<li>
data_url: metadata URL
</li>
<li>
attribution: metadata attribution string
</li>
<li>
attribution_url: metadata attribution URL
</li>
<li>
source: layer source
</li>
<li>
min_scale: minimum display scale for layer
</li>
<li>
max_scale: maximum display scale for layer
</li>
<li>
crs: layer CRS
</li>
<li>
crs_definition: layer CRS full definition
</li>
<li>
crs_description: layer CRS description
</li>
<li>
extent: layer extent (as a geometry object)
</li>
<li>
type: layer type, e.g., Vector or Raster
</li>
<li>
storage_type: storage format (vector layers only)
</li>
<li>
geometry_type: geometry type, e.g., Point (vector layers only)
</li>
<li>
feature_count: approximate feature count for layer (vector layers only)
</li>
<li>
path: File path to the layer data source. Only available for file based layers.
</li>
</ul>
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
layer_property('streets','title')
</code>
<code>
'Basemap Streets'
</code>
</li>
<li>
<code>
layer_property('airports','feature_count')
</code>
<code>
120
</code>
</li>
<li>
<code>
layer_property('landsat','crs')
</code>
<code>
'EPSG:4326'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="general-var"><a href="#general-var-idx">
function var
</a></h3>
<div class="description">
<p>
Returns the value stored within a specified variable.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
var
</span>
(
<span class="argument">
name
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
name
</td>
<td>
a variable name
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
var('qgis_version')
</code>
<code>
'2.12'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="general-with_variable"><a href="#general-with_variable-idx">
function with_variable
</a></h3>
<div class="description">
<p>
This function sets a variable for any expression code that will be provided as 3rd argument. This is only useful for complicated expressions, where the same calculated value needs to be used in different places.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
with_variable
</span>
(
<span class="argument">
name
</span>
,
<span class="argument">
value
</span>
,
<span class="argument">
expression
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
name
</td>
<td>
the name of the variable to set
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
the value to set
</td>
</tr>
<tr>
<td class="argument">
expression
</td>
<td>
the expression for which the variable will be available
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
with_variable('my_sum', 1 + 2 + 3, @my_sum * 2 + @my_sum * 5)
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div></div>
<div id="geometrygroup" class="group"><h2><a href="#geometrygroup-idx">group geometry</a></h2>
<div class="description"><p>This group contains functions that operate on geometry objects e.g length, area.</p></div></div>
<div class="function"><h3 id="geometrygroup-dollar-area"><a href="#geometrygroup-dollar-area-idx">
function $area
</a></h3>
<div class="description">
<p>
Returns the area of the current feature. The area calculated by this function respects both the current project's ellipsoid setting and area unit settings. For example, if an ellipsoid has been set for the project then the calculated area will be ellipsoidal, and if no ellipsoid is set then the calculated area will be planimetric.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
$area
</span>
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
$area
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-dollar-geometry"><a href="#geometrygroup-dollar-geometry-idx">
function $geometry
</a></h3>
<div class="description">
<p>
Returns the geometry of the current feature. Can be used for processing with other functions.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
$geometry
</span>
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geomToWKT( $geometry )
</code>
<code>
POINT(6 50)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-dollar-length"><a href="#geometrygroup-dollar-length-idx">
function $length
</a></h3>
<div class="description">
<p>
Returns the length of a linestring. If you need the length of a border of a polygon, use $perimeter instead. The length calculated by this function respects both the current project's ellipsoid setting and distance unit settings. For example, if an ellipsoid has been set for the project then the calculated length will be ellipsoidal, and if no ellipsoid is set then the calculated length will be planimetric.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
$length
</span>
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
$length
</code>
<code>
42.4711
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-dollar-perimeter"><a href="#geometrygroup-dollar-perimeter-idx">
function $perimeter
</a></h3>
<div class="description">
<p>
Returns the perimeter length of the current feature. The perimeter calculated by this function respects both the current project's ellipsoid setting and distance unit settings. For example, if an ellipsoid has been set for the project then the calculated perimeter will be ellipsoidal, and if no ellipsoid is set then the calculated perimeter will be planimetric.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
$perimeter
</span>
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
$perimeter
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-dollar-x"><a href="#geometrygroup-dollar-x-idx">
function $x
</a></h3>
<div class="description">
<p>
Returns the x coordinate of the current feature.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
$x
</span>
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
$x
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-dollar-x_at"><a href="#geometrygroup-dollar-x_at-idx">
function $x_at
</a></h3>
<div class="description">
<p>
Retrieves a x coordinate of the current feature's geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
$x_at
</span>
(
<span class="argument">
i
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
i
</td>
<td>
index of point of a line (indices start at 0; negative values apply from the last index, starting at -1)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
$x_at(1)
</code>
<code>
5
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-dollar-y"><a href="#geometrygroup-dollar-y-idx">
function $y
</a></h3>
<div class="description">
<p>
Returns the y coordinate of the current feature.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
$y
</span>
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
$y
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-dollar-y_at"><a href="#geometrygroup-dollar-y_at-idx">
function $y_at
</a></h3>
<div class="description">
<p>
Retrieves a y coordinate of the current feature's geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
$y_at
</span>
(
<span class="argument">
i
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
i
</td>
<td>
index of point of a line (indices start at 0; negative values apply from the last index, starting at -1)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
$y_at(1)
</code>
<code>
2
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-angle_at_vertex"><a href="#geometrygroup-angle_at_vertex-idx">
function angle_at_vertex
</a></h3>
<div class="description">
<p>
Returns the bisector angle (average angle) to the geometry for a specified vertex on a linestring geometry. Angles are in degrees clockwise from north.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
angle_at_vertex
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
vertex
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a linestring geometry
</td>
</tr>
<tr>
<td class="argument">
vertex
</td>
<td>
vertex index, starting from 0; if the value is negative, the selected vertex index will be its total count minus the absolute value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
angle_at_vertex(geometry:=geom_from_wkt('LineString(0 0, 10 0, 10 10)'),vertex:=1)
</code>
<code>
45.0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-area"><a href="#geometrygroup-area-idx">
function area
</a></h3>
<div class="description">
<p>
Returns the area of a geometry polygon object. Calculations are always planimetric in the Spatial Reference System (SRS) of this geometry, and the units of the returned area will match the units for the SRS. This differs from the calculations performed by the $area function, which will perform ellipsoidal calculations based on the project's ellipsoid and area unit settings.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
area
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
polygon geometry object
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
area(geom_from_wkt('POLYGON((0 0, 4 0, 4 2, 0 2, 0 0))'))
</code>
<code>
8.0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-azimuth"><a href="#geometrygroup-azimuth-idx">
function azimuth
</a></h3>
<div class="description">
<p>
Returns the north-based azimuth as the angle in radians measured clockwise from the vertical on point_a to point_b.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
azimuth
</span>
(
<span class="argument">
point_a
</span>
,
<span class="argument">
point_b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point_a
</td>
<td>
point geometry
</td>
</tr>
<tr>
<td class="argument">
point_b
</td>
<td>
point geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
degrees( azimuth( make_point(25, 45), make_point(75, 100) ) )
</code>
<code>
42.273689
</code>
</li>
<li>
<code>
degrees( azimuth( make_point(75, 100), make_point(25,45) ) )
</code>
<code>
222.273689
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-boundary"><a href="#geometrygroup-boundary-idx">
function boundary
</a></h3>
<div class="description">
<p>
Returns the closure of the combinatorial boundary of the geometry (ie the topological boundary of the geometry). For instance, a polygon geometry will have a boundary consisting of the linestrings for each ring in the polygon. Some geometry types do not have a defined boundary, e.g., points or geometry collections, and will return null.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
boundary
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(boundary(geom_from_wkt('Polygon((1 1, 0 0, -1 1, 1 1))')))
</code>
<code>
'LineString(1 1,0 0,-1 1,1 1)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-bounds"><a href="#geometrygroup-bounds-idx">
function bounds
</a></h3>
<div class="description">
<p>
Returns a geometry which represents the bounding box of an input geometry. Calculations are in the Spatial Reference System of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
bounds
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
bounds($geometry)
</code>
<code>
bounding box of $geometry
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-bounds_height"><a href="#geometrygroup-bounds_height-idx">
function bounds_height
</a></h3>
<div class="description">
<p>
Returns the height of the bounding box of a geometry. Calculations are in the Spatial Reference System of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
bounds_height
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
bounds_height($geometry)
</code>
<code>
height of bounding box of $geometry
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-bounds_width"><a href="#geometrygroup-bounds_width-idx">
function bounds_width
</a></h3>
<div class="description">
<p>
Returns the width of the bounding box of a geometry. Calculations are in the Spatial Reference System of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
bounds_width
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
bounds_width($geometry)
</code>
<code>
width of bounding box of $geometry
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-buffer"><a href="#geometrygroup-buffer-idx">
function buffer
</a></h3>
<div class="description">
<p>
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.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
buffer
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
distance
</span>
[,
<span class="argument">
segments=8
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
buffer distance in layer units
</td>
</tr>
<tr>
<td class="argument">
segments
</td>
<td>
number of segments to use to represent a quarter circle when a round join style is used. A larger number results in a smoother buffer with more nodes.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
buffer($geometry, 10.5)
</code>
<code>
polygon of $geometry buffered by 10.5 units
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-buffer_by_m"><a href="#geometrygroup-buffer_by_m-idx">
function buffer_by_m
</a></h3>
<div class="description">
<p>
Creates a buffer along a line geometry where the buffer diameter varies according to the m-values at the line vertices.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
buffer_by_m
</span>
(
<span class="argument">
geometry
</span>
[,
<span class="argument">
segments=8
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
input geometry. Must be a (multi)line geometry with m values.
</td>
</tr>
<tr>
<td class="argument">
segments
</td>
<td>
number of segments to approximate quarter-circle curves in the buffer.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
buffer_by_m(geometry:=geom_from_wkt('LINESTRINGM(1 2 0.5, 4 2 0.2)'),segments:=8)
</code>
<code>
A variable width buffer starting with a diameter of 0.5 and ending with a diameter of 0.2 along the linestring geometry.
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-centroid"><a href="#geometrygroup-centroid-idx">
function centroid
</a></h3>
<div class="description">
<p>
Returns the geometric center of a geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
centroid
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
centroid($geometry)
</code>
<code>
a point geometry
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-closest_point"><a href="#geometrygroup-closest_point-idx">
function closest_point
</a></h3>
<div class="description">
<p>
Returns the point on geometry1 that is closest to geometry2.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
closest_point
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
geometry to find closest point on
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
geometry to find closest point to
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(closest_point(geom_from_wkt('LINESTRING (20 80, 98 190, 110 180, 50 75 )'),geom_from_wkt('POINT(100 100)')))
</code>
<code>
Point(73.0769 115.384)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-collect_geometries"><a href="#geometrygroup-collect_geometries-idx">
function collect_geometries
</a></h3>
<div class="description">
<p>
Collects a set of geometries into a multi-part geometry object.
</p>
</div>
<h3 id="geometrygroup-collect_geometries"><a href="#geometrygroup-collect_geometries-idx">
List of arguments variant
</a></h3>
<div class="description">
Geometry parts are specified as separate arguments to the function.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
collect_geometries
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(collect_geometries(make_point(1,2), make_point(3,4), make_point(5,6)))
</code>
<code>
'MultiPoint ((1 2),(3 4),(5 6))'
</code>
</li>
</ul>
</div>
<h3 id="geometrygroup-collect_geometries"><a href="#geometrygroup-collect_geometries-idx">
Array variant
</a></h3>
<div class="description">
Geometry parts are specified as an array of geometry parts.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
collect_geometries
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
array of geometry objects
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(collect_geometries(array(make_point(1,2), make_point(3,4), make_point(5,6))))
</code>
<code>
'MultiPoint ((1 2),(3 4),(5 6))'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-combine"><a href="#geometrygroup-combine-idx">
function combine
</a></h3>
<div class="description">
<p>
Returns the combination of two geometries.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
combine
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 2 1)' ) ) )
</code>
<code>
MULTILINESTRING((4 4, 2 1), (3 3, 4 4), (4 4, 5 5))
</code>
</li>
<li>
<code>
geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 6 6, 2 1)' ) ) )
</code>
<code>
LINESTRING(3 3, 4 4, 6 6, 2 1)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-contains"><a href="#geometrygroup-contains-idx">
function contains
</a></h3>
<div class="description">
<p>
Tests whether a geometry contains another. Returns true if and only if no points of geometry b lie in the exterior of geometry a, and at least one point of the interior of b lies in the interior of a.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
contains
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
contains( geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))' ), geom_from_wkt( 'POINT(0.5 0.5 )' ) )
</code>
<code>
true
</code>
</li>
<li>
<code>
contains( geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-convex_hull"><a href="#geometrygroup-convex_hull-idx">
function convex_hull
</a></h3>
<div class="description">
<p>
Returns the convex hull of a geometry. It represents the minimum convex geometry that encloses all geometries within the set.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
convex_hull
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( convex_hull( geom_from_wkt( 'LINESTRING(3 3, 4 4, 4 10)' ) ) )
</code>
<code>
POLYGON((3 3,4 10,4 4,3 3))
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-crosses"><a href="#geometrygroup-crosses-idx">
function crosses
</a></h3>
<div class="description">
<p>
Tests whether a geometry crosses another. Returns true if the supplied geometries have some, but not all, interior points in common.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
crosses
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
crosses( geom_from_wkt( 'LINESTRING(3 5, 4 4, 5 3)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
true
</code>
</li>
<li>
<code>
crosses( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-difference"><a href="#geometrygroup-difference-idx">
function difference
</a></h3>
<div class="description">
<p>
Returns a geometry that represents that part of geometry_a that does not intersect with geometry_b.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
difference
</span>
(
<span class="argument">
geometry_a
</span>
,
<span class="argument">
geometry_b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry_a
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry_b
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( difference( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4)' ) ) )
</code>
<code>
LINESTRING(4 4, 5 5)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-disjoint"><a href="#geometrygroup-disjoint-idx">
function disjoint
</a></h3>
<div class="description">
<p>
Tests whether geometries do not spatially intersect. Returns true if the geometries do not share any space together.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
disjoint
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
disjoint( geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0 ))' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
true
</code>
</li>
<li>
<code>
disjoint( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'POINT(4 4)' ))
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-distance"><a href="#geometrygroup-distance-idx">
function distance
</a></h3>
<div class="description">
<p>
Returns the minimum distance (based on spatial ref) between two geometries in projected units.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
distance
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
distance( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(4 8)' ) )
</code>
<code>
4
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-distance_to_vertex"><a href="#geometrygroup-distance_to_vertex-idx">
function distance_to_vertex
</a></h3>
<div class="description">
<p>
Returns the distance along the geometry to a specified vertex.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
distance_to_vertex
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
vertex
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a linestring geometry
</td>
</tr>
<tr>
<td class="argument">
vertex
</td>
<td>
vertex index, starting from 0; if the value is negative, the selected vertex index will be its total count minus the absolute value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
distance_to_vertex(geometry:=geom_from_wkt('LineString(0 0, 10 0, 10 10)'),vertex:=1)
</code>
<code>
10.0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-end_point"><a href="#geometrygroup-end_point-idx">
function end_point
</a></h3>
<div class="description">
<p>
Returns the last node from a geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
end_point
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometry object
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(end_point(geom_from_wkt('LINESTRING(4 0, 4 2, 0 2)')))
</code>
<code>
'Point (0 2)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-extend"><a href="#geometrygroup-extend-idx">
function extend
</a></h3>
<div class="description">
<p>
Extends the start and end of a linestring geometry by a specified amount. Lines are extended using the bearing of the first and last segment in the line. Distances are in the Spatial Reference System of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
extend
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
start_distance
</span>
,
<span class="argument">
end_distance
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a (multi)linestring geometry
</td>
</tr>
<tr>
<td class="argument">
start_distance
</td>
<td>
distance to extend the start of the line
</td>
</tr>
<tr>
<td class="argument">
end_distance
</td>
<td>
distance to extend the end of the line.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(extend(geom_from_wkt('LineString(0 0, 1 0, 1 1)'),1,2))
</code>
<code>
LineString (-1 0, 1 0, 1 3)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-exterior_ring"><a href="#geometrygroup-exterior_ring-idx">
function exterior_ring
</a></h3>
<div class="description">
<p>
Returns a line string representing the exterior ring of a polygon geometry. If the geometry is not a polygon then the result will be null.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
exterior_ring
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a polygon geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(exterior_ring(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),( 0.1 0.1, 0.1 0.2, 0.2 0.2, 0.2, 0.1, 0.1 0.1))')))
</code>
<code>
'LineString (-1 -1, 4 0, 4 2, 0 2, -1 -1)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-extrude"><a href="#geometrygroup-extrude-idx">
function extrude
</a></h3>
<div class="description">
<p>
Returns an extruded version of the input (Multi-)Curve or (Multi-)Linestring geometry with an extension specified by x and y.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
extrude
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
x
</span>
,
<span class="argument">
y
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a polygon geometry
</td>
</tr>
<tr>
<td class="argument">
x
</td>
<td>
x extension, numeric value
</td>
</tr>
<tr>
<td class="argument">
y
</td>
<td>
y extension, numeric value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
extrude(geom_from_wkt('LineString(1 2, 3 2, 4 3)'), 1, 2)
</code>
<code>
Polygon ((1 2, 3 2, 4 3, 5 5, 4 4, 2 4, 1 2))
</code>
</li>
<li>
<code>
extrude(geom_from_wkt('MultiLineString((1 2, 3 2), (4 3, 8 3)'), 1, 2)
</code>
<code>
MultiPolygon (((1 2, 3 2, 4 4, 2 4, 1 2)),((4 3, 8 3, 9 5, 5 5, 4 3)))
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-flip_coordinates"><a href="#geometrygroup-flip_coordinates-idx">
function flip_coordinates
</a></h3>
<div class="description">
<p>
Returns a copy of the geometry with the x and y coordinates swapped. Useful for repairing geometries which have had their latitude and longitude values reversed.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
flip_coordinates
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(flip_coordinates(make_point(1, 2)))
</code>
<code>
Point (2 1)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-force_rhr"><a href="#geometrygroup-force_rhr-idx">
function force_rhr
</a></h3>
<div class="description">
<p>
Forces a geometry to respect the Right-Hand-Rule, in which the area that is bounded by a polygon is to the right of the boundary. In particular, the exterior ring is oriented in a clockwise direction and the interior rings in a counter-clockwise direction.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
force_rhr
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry. Any non-polygon geometries are returned unchanged.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(force_rhr(geometry:=geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1))')))
</code>
<code>
Polygon ((-1 -1, 0 2, 4 2, 4 0, -1 -1))
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-geom_from_gml"><a href="#geometrygroup-geom_from_gml-idx">
function geom_from_gml
</a></h3>
<div class="description">
<p>
Returns a geometry from a GML representation of geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
geom_from_gml
</span>
(
<span class="argument">
gml
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
gml
</td>
<td>
GML representation of a geometry as a string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_from_gml('&lt;gml:LineString srsName="EPSG:4326"&gt;&lt;gml:coordinates&gt;4,4 5,5 6,6&lt;/gml:coordinates&gt;&lt;/gml:LineString&gt;')
</code>
<code>
a line geometry object
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-geom_from_wkb"><a href="#geometrygroup-geom_from_wkb-idx">
function geom_from_wkb
</a></h3>
<div class="description">
<p>
Returns a geometry created from a Well-Known Binary (WKB) representation.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
geom_from_wkb
</span>
(
<span class="argument">
binary
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
binary
</td>
<td>
Well-Known Binary (WKB) representation of a geometry (as a binary blob)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_from_wkb( geom_to_wkb( make_point(4,5) ) )
</code>
<code>
a point geometry object
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-geom_from_wkt"><a href="#geometrygroup-geom_from_wkt-idx">
function geom_from_wkt
</a></h3>
<div class="description">
<p>
Returns a geometry created from a Well-Known Text (WKT) representation.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
geom_from_wkt
</span>
(
<span class="argument">
text
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
text
</td>
<td>
Well-Known Text (WKT) representation of a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_from_wkt( 'POINT(4 5)' )
</code>
<code>
a geometry object
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-geom_to_wkb"><a href="#geometrygroup-geom_to_wkb-idx">
function geom_to_wkb
</a></h3>
<div class="description">
<p>
Returns the Well-Known Binary (WKB) representation of a geometry as a binary blob.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
geom_to_wkb
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkb( $geometry )
</code>
<code>
binary blob containing a geometry object
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-geom_to_wkt"><a href="#geometrygroup-geom_to_wkt-idx">
function geom_to_wkt
</a></h3>
<div class="description">
<p>
Returns the Well-Known Text (WKT) representation of the geometry without SRID metadata.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
geom_to_wkt
</span>
(
<span class="argument">
geometry
</span>
[,
<span class="argument">
precision
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
precision
</td>
<td>
numeric precision
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( $geometry )
</code>
<code>
POINT(6 50)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-geometry"><a href="#geometrygroup-geometry-idx">
function geometry
</a></h3>
<div class="description">
<p>
Returns a feature's geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
geometry
</span>
(
<span class="argument">
feature
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
feature
</td>
<td>
a feature object
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( geometry( get_feature( layer, attributeField, value ) ) )
</code>
<code>
'POINT(6 50)'
</code>
</li>
<li>
<code>
intersects( $geometry, geometry( get_feature( layer, attributeField, value ) ) )
</code>
<code>
true
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-geometry_n"><a href="#geometrygroup-geometry_n-idx">
function geometry_n
</a></h3>
<div class="description">
<p>
Returns a specific geometry from a geometry collection, or null if the input geometry is not a collection.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
geometry_n
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
index
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometry collection
</td>
</tr>
<tr>
<td class="argument">
index
</td>
<td>
index of geometry to return, where 1 is the first geometry in the collection
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(geometry_n(geom_from_wkt('GEOMETRYCOLLECTION(POINT(0 1), POINT(0 0), POINT(1 0), POINT(1 1))'),3))
</code>
<code>
'Point (1 0)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-hausdorff_distance"><a href="#geometrygroup-hausdorff_distance-idx">
function hausdorff_distance
</a></h3>
<div class="description">
<p>
Returns the Hausdorff distance between two geometries. This is basically a measure of how similar or dissimilar 2 geometries are, with a lower distance indicating more similar geometries.
<br/>
The function can be executed with an optional densify fraction argument. If not specified, an approximation to the standard Hausdorff distance is used. This approximation is exact or close enough for a large subset of useful cases. Examples of these are:
<br/>
<br/>
<li>
computing distance between Linestrings that are roughly parallel to each other, and roughly equal in length. This occurs in matching linear networks.
</li>
<li>
Testing similarity of geometries.
</li>
<br/>
<br/>
If the default approximate provided by this method is insufficient, specify the optional densify fraction argument. Specifying this argument performs a segment densification before computing the discrete Hausdorff distance. The parameter sets the fraction by which to densify each segment. Each segment will be split into a number of equal-length subsegments, whose fraction of the total length is closest to the given fraction. Decreasing the densify fraction parameter will make the distance returned approach the true Hausdorff distance for the geometries.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
hausdorff_distance
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
[,
<span class="argument">
densify_fraction
</span>
])
</code>
<br>
<br>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
densify_fraction
</td>
<td>
densify fraction amount
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
hausdorff_distance( geometry1:= geom_from_wkt('LINESTRING (0 0, 2 1)'),geometry2:=geom_from_wkt('LINESTRING (0 0, 2 0)'))
</code>
<code>
2
</code>
</li>
<li>
<code>
hausdorff_distance( geom_from_wkt('LINESTRING (130 0, 0 0, 0 150)'),geom_from_wkt('LINESTRING (10 10, 10 150, 130 10)'))
</code>
<code>
14.142135623
</code>
</li>
<li>
<code>
hausdorff_distance( geom_from_wkt('LINESTRING (130 0, 0 0, 0 150)'),geom_from_wkt('LINESTRING (10 10, 10 150, 130 10)'),0.5)
</code>
<code>
70.0
</code>
</li>
</ul>
</div>
</br>
</br>
</div></div>
<div class="function"><h3 id="geometrygroup-inclination"><a href="#geometrygroup-inclination-idx">
function inclination
</a></h3>
<div class="description">
<p>
Returns the inclination measured from the zenith (0) to the nadir (180) on point_a to point_b.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
inclination
</span>
(
<span class="argument">
point_a
</span>
,
<span class="argument">
point_b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point_a
</td>
<td>
point geometry
</td>
</tr>
<tr>
<td class="argument">
point_b
</td>
<td>
point geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, 5 ) )
</code>
<code>
0.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, 0 ) )
</code>
<code>
90.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 50, 100, 0 ) )
</code>
<code>
90.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, -5 ) )
</code>
<code>
180.0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-interior_ring_n"><a href="#geometrygroup-interior_ring_n-idx">
function interior_ring_n
</a></h3>
<div class="description">
<p>
Returns a specific interior ring from a polygon geometry, or null if the geometry is not a polygon.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
interior_ring_n
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
index
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
polygon geometry
</td>
</tr>
<tr>
<td class="argument">
index
</td>
<td>
index of interior to return, where 1 is the first interior ring
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(interior_ring_n(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),(-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1),(-1 -1, 4 0, 4 2, 0 2, -1 -1))'),1))
</code>
<code>
'LineString (-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1))'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-intersection"><a href="#geometrygroup-intersection-idx">
function intersection
</a></h3>
<div class="description">
<p>
Returns a geometry that represents the shared portion of two geometries.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
intersection
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( intersection( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4)' ) ) )
</code>
<code>
LINESTRING(3 3, 4 4)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-intersects"><a href="#geometrygroup-intersects-idx">
function intersects
</a></h3>
<div class="description">
<p>
Tests whether a geometry intersects another. Returns true if the geometries spatially intersect (share any portion of space) and false if they do not.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
intersects
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
intersects( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
true
</code>
</li>
<li>
<code>
intersects( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'POINT(5 5)' ) )
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-intersects_bbox"><a href="#geometrygroup-intersects_bbox-idx">
function intersects_bbox
</a></h3>
<div class="description">
<p>
Tests whether a geometry's bounding box overlaps another geometry's bounding box. Returns true if the geometries spatially intersect the bounding box defined and false if they do not.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
intersects_bbox
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
intersects_bbox( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
true
</code>
</li>
<li>
<code>
intersects_bbox( geom_from_wkt( 'POINT(6 5)' ), geom_from_wkt( 'POLYGON((3 3, 4 4, 5 5, 3 3))' ) )
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-is_closed"><a href="#geometrygroup-is_closed-idx">
function is_closed
</a></h3>
<div class="description">
<p>
Returns true if a line string is closed (start and end points are coincident), or false if a line string is not closed. If the geometry is not a line string then the result will be null.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_closed
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a line string geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
is_closed(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)'))
</code>
<code>
false
</code>
</li>
<li>
<code>
is_closed(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2, 0 0)'))
</code>
<code>
true
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-is_empty"><a href="#geometrygroup-is_empty-idx">
function is_empty
</a></h3>
<div class="description">
<p>
Returns true if a geometry is empty (without coordinates), false if the geometry is not empty and NULL if there is no geometry. See also `is_empty_or_null`.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_empty
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
is_empty(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)'))
</code>
<code>
false
</code>
</li>
<li>
<code>
is_empty(geom_from_wkt('LINESTRING EMPTY'))
</code>
<code>
true
</code>
</li>
<li>
<code>
is_empty(geom_from_wkt('POINT(7 4)'))
</code>
<code>
false
</code>
</li>
<li>
<code>
is_empty(geom_from_wkt('POINT EMPTY'))
</code>
<code>
true
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-is_empty_or_null"><a href="#geometrygroup-is_empty_or_null-idx">
function is_empty_or_null
</a></h3>
<div class="description">
<p>
Returns true if a geometry is NULL or empty (without coordinates) or false otherwise. This function is like the expression '$geometry IS NULL or is_empty($geometry)'
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_empty_or_null
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
is_empty_or_null(NULL)
</code>
<code>
true
</code>
</li>
<li>
<code>
is_empty_or_null(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)'))
</code>
<code>
false
</code>
</li>
<li>
<code>
is_empty_or_null(geom_from_wkt('LINESTRING EMPTY'))
</code>
<code>
true
</code>
</li>
<li>
<code>
is_empty_or_null(geom_from_wkt('POINT(7 4)'))
</code>
<code>
false
</code>
</li>
<li>
<code>
is_empty_or_null(geom_from_wkt('POINT EMPTY'))
</code>
<code>
true
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-is_valid"><a href="#geometrygroup-is_valid-idx">
function is_valid
</a></h3>
<div class="description">
<p>
Returns true if a geometry is valid; if it is well-formed in 2D according to the OGC rules.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_valid
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
is_valid(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2, 0 0)'))
</code>
<code>
true
</code>
</li>
<li>
<code>
is_valid(geom_from_wkt('LINESTRING(0 0)'))
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-length"><a href="#geometrygroup-length-idx">
function length
</a></h3>
<div class="description">
<p>
Returns the number of characters in a string or the length of a geometry linestring.
</p>
</div>
<h3 id="geometrygroup-length"><a href="#geometrygroup-length-idx">
String variant
</a></h3>
<div class="description">
Returns the number of characters in a string.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
length
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string to count length of
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
length('hello')
</code>
<code>
5
</code>
</li>
</ul>
</div>
<h3 id="geometrygroup-length"><a href="#geometrygroup-length-idx">
Geometry variant
</a></h3>
<div class="description">
Calculate the length of a geometry line object. Calculations are always planimetric in the Spatial Reference System (SRS) of this geometry, and the units of the returned length will match the units for the SRS. This differs from the calculations performed by the $length function, which will perform ellipsoidal calculations based on the project's ellipsoid and distance unit settings.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
length
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
line geometry object
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
length(geom_from_wkt('LINESTRING(0 0, 4 0)'))
</code>
<code>
4.0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-line_interpolate_angle"><a href="#geometrygroup-line_interpolate_angle-idx">
function line_interpolate_angle
</a></h3>
<div class="description">
<p>
Returns the angle parallel to the geometry at a specified distance along a linestring geometry. Angles are in degrees clockwise from north.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
line_interpolate_angle
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
distance
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a linestring geometry
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
distance along line to interpolate angle at
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
line_interpolate_angle(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),distance:=5)
</code>
<code>
90.0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-line_interpolate_point"><a href="#geometrygroup-line_interpolate_point-idx">
function line_interpolate_point
</a></h3>
<div class="description">
<p>
Returns the point interpolated by a specified distance along a linestring geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
line_interpolate_point
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
distance
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a linestring geometry
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
distance along line to interpolate
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(line_interpolate_point(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),distance:=5))
</code>
<code>
'Point (5 0)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-line_locate_point"><a href="#geometrygroup-line_locate_point-idx">
function line_locate_point
</a></h3>
<div class="description">
<p>
Returns the distance along a linestring corresponding to the closest position the linestring comes to a specified point geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
line_locate_point
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
point
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a linestring geometry
</td>
</tr>
<tr>
<td class="argument">
point
</td>
<td>
point geometry to locate closest position on linestring to
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
line_locate_point(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),point:=geom_from_wkt('Point(5 0)'))
</code>
<code>
5.0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-line_merge"><a href="#geometrygroup-line_merge-idx">
function line_merge
</a></h3>
<div class="description">
<p>
Returns a LineString or MultiLineString geometry, where any connected LineStrings from the input geometry have been merged into a single linestring. This function will return null if passed a geometry which is not a LineString/MultiLineString.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
line_merge
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a LineString/MultiLineString geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(line_merge(geom_from_wkt('MULTILINESTRING((0 0, 1 1),(1 1, 2 2))')))
</code>
<code>
'LineString(0 0,1 1,2 2)'
</code>
</li>
<li>
<code>
geom_to_wkt(line_merge(geom_from_wkt('MULTILINESTRING((0 0, 1 1),(11 1, 21 2))')))
</code>
<code>
'MultiLineString((0 0, 1 1),(11 1, 21 2)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-line_substring"><a href="#geometrygroup-line_substring-idx">
function line_substring
</a></h3>
<div class="description">
<p>
Returns the portion of a line (or curve) geometry which falls between the specified start and end distances (measured from the beginning of the line). Z and M values are linearly interpolated from existing values.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
line_substring
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
start_distance
</span>
,
<span class="argument">
end_distance
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a linestring or curve geometry
</td>
</tr>
<tr>
<td class="argument">
start_distance
</td>
<td>
distance to start of substring
</td>
</tr>
<tr>
<td class="argument">
end_distance
</td>
<td>
distance to end of substring
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(line_substring(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),start_distance:=2,end_distance=6))
</code>
<code>
'LineString (2 0,6 0)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-m"><a href="#geometrygroup-m-idx">
function m
</a></h3>
<div class="description">
<p>
Returns the m value of a point geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
m
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a point geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
m( geom_from_wkt( 'POINTM(2 5 4)' ) )
</code>
<code>
4
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-make_circle"><a href="#geometrygroup-make_circle-idx">
function make_circle
</a></h3>
<div class="description">
<p>
Creates a circular polygon.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_circle
</span>
(
<span class="argument">
center
</span>
,
<span class="argument">
radius
</span>
[,
<span class="argument">
segment=36
</span>
]…)
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
center
</td>
<td>
center point of the circle
</td>
</tr>
<tr>
<td class="argument">
radius
</td>
<td>
radius of the circle
</td>
</tr>
<tr>
<td class="argument">
segment
</td>
<td>
optional argument for polygon segmentation. By default this value is 36
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_circle(make_point(10,10), 5, 4))
</code>
<code>
'Polygon ((10 15, 15 10, 10 5, 5 10, 10 15))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_circle(make_point(10,10,5), 5, 4))
</code>
<code>
'PolygonZ ((10 15 5, 15 10 5, 10 5 5, 5 10 5, 10 15 5))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_circle(make_point(10,10,5,30), 5, 4))
</code>
<code>
'PolygonZM ((10 15 5 30, 15 10 5 30, 10 5 5 30, 5 10 5 30, 10 15 5 30))'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-make_ellipse"><a href="#geometrygroup-make_ellipse-idx">
function make_ellipse
</a></h3>
<div class="description">
<p>
Creates an elliptical polygon.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_ellipse
</span>
(
<span class="argument">
center
</span>
,
<span class="argument">
semi_major_axis
</span>
,
<span class="argument">
semi_minor_axis
</span>
,
<span class="argument">
azimuth
</span>
[,
<span class="argument">
segment=36
</span>
]…)
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
center
</td>
<td>
center point of the ellipse
</td>
</tr>
<tr>
<td class="argument">
semi_major_axis
</td>
<td>
semi-major axis of the ellipse
</td>
</tr>
<tr>
<td class="argument">
semi_minor_axis
</td>
<td>
semi-minor axis of the ellipse
</td>
</tr>
<tr>
<td class="argument">
azimuth
</td>
<td>
orientation of the ellipse
</td>
</tr>
<tr>
<td class="argument">
segment
</td>
<td>
optional argument for polygon segmentation. By default this value is 36
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_ellipse(make_point(10,10), 5, 2, 90, 4))
</code>
<code>
'Polygon ((15 10, 10 8, 5 10, 10 12, 15 10))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_ellipse(make_point(10,10,5), 5, 2, 90, 4))
</code>
<code>
'PolygonZ ((15 10 5, 10 8 5, 5 10 5, 10 12 5, 15 10 5))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_ellipse(make_point(10,10,5,30), 5, 2, 90, 4))
</code>
<code>
'PolygonZM ((15 10 5 30, 10 8 5 30, 5 10 5 30, 10 12 5 30, 15 10 5 30))'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-make_line"><a href="#geometrygroup-make_line-idx">
function make_line
</a></h3>
<div class="description">
<p>
Creates a line geometry from a series of point geometries.
</p>
</div>
<h3 id="geometrygroup-make_line"><a href="#geometrygroup-make_line-idx">
List of arguments variant
</a></h3>
<div class="description">
Line vertices are specified as separate arguments to the function.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_line
</span>
(
<span class="argument">
point1
</span>
,
<span class="argument">
point2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point
</td>
<td>
a point geometry (or array of points)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_line(make_point(2,4),make_point(3,5)))
</code>
<code>
'LineString (2 4, 3 5)'
</code>
</li>
<li>
<code>
geom_to_wkt(make_line(make_point(2,4),make_point(3,5),make_point(9,7)))
</code>
<code>
'LineString (2 4, 3 5, 9 7)'
</code>
</li>
</ul>
</div>
<h3 id="geometrygroup-make_line"><a href="#geometrygroup-make_line-idx">
Array variant
</a></h3>
<div class="description">
Line vertices are specified as an array of points.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_line
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
array of points
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_line(array(make_point(2,4),make_point(3,5),make_point(9,7))))
</code>
<code>
'LineString (2 4, 3 5, 9 7)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-make_point"><a href="#geometrygroup-make_point-idx">
function make_point
</a></h3>
<div class="description">
<p>
Creates a point geometry from an x and y (and optional z and m) value.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_point
</span>
(
<span class="argument">
x
</span>
,
<span class="argument">
y
</span>
[,
<span class="argument">
z
</span>
][,
<span class="argument">
m
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
x
</td>
<td>
x coordinate of point
</td>
</tr>
<tr>
<td class="argument">
y
</td>
<td>
y coordinate of point
</td>
</tr>
<tr>
<td class="argument">
z
</td>
<td>
optional z coordinate of point
</td>
</tr>
<tr>
<td class="argument">
m
</td>
<td>
optional m value of point
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_point(2,4))
</code>
<code>
'Point (2 4)'
</code>
</li>
<li>
<code>
geom_to_wkt(make_point(2,4,6))
</code>
<code>
'PointZ (2 4 6)'
</code>
</li>
<li>
<code>
geom_to_wkt(make_point(2,4,6,8))
</code>
<code>
'PointZM (2 4 6 8)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-make_point_m"><a href="#geometrygroup-make_point_m-idx">
function make_point_m
</a></h3>
<div class="description">
<p>
Creates a point geometry from an x, y coordinate and m value.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_point_m
</span>
(
<span class="argument">
x
</span>
,
<span class="argument">
y
</span>
,
<span class="argument">
m
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
x
</td>
<td>
x coordinate of point
</td>
</tr>
<tr>
<td class="argument">
y
</td>
<td>
y coordinate of point
</td>
</tr>
<tr>
<td class="argument">
m
</td>
<td>
m value of point
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_point_m(2,4,6))
</code>
<code>
'PointM (2 4 6)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-make_polygon"><a href="#geometrygroup-make_polygon-idx">
function make_polygon
</a></h3>
<div class="description">
<p>
Creates a polygon geometry from an outer ring and optional series of inner ring geometries.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_polygon
</span>
(
<span class="argument">
outerRing
</span>
[,
<span class="argument">
innerRing1
</span>
][,
<span class="argument">
innerRing2
</span>
]…)
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
outerRing
</td>
<td>
closed line geometry for polygon's outer ring
</td>
</tr>
<tr>
<td class="argument">
innerRing
</td>
<td>
optional closed line geometry for inner ring
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_polygon(geom_from_wkt('LINESTRING( 0 0, 0 1, 1 1, 1 0, 0 0 )')))
</code>
<code>
'Polygon ((0 0, 0 1, 1 1, 1 0, 0 0))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_polygon(geom_from_wkt('LINESTRING( 0 0, 0 1, 1 1, 1 0, 0 0 )'),geom_from_wkt('LINESTRING( 0.1 0.1, 0.1 0.2, 0.2 0.2, 0.2 0.1, 0.1 0.1 )'),geom_from_wkt('LINESTRING( 0.8 0.8, 0.8 0.9, 0.9 0.9, 0.9 0.8, 0.8 0.8 )')))
</code>
<code>
'Polygon ((0 0, 0 1, 1 1, 1 0, 0 0),(0.1 0.1, 0.1 0.2, 0.2 0.2, 0.2 0.1, 0.1 0.1),(0.8 0.8, 0.8 0.9, 0.9 0.9, 0.9 0.8, 0.8 0.8))'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-make_rectangle_3points"><a href="#geometrygroup-make_rectangle_3points-idx">
function make_rectangle_3points
</a></h3>
<div class="description">
<p>
Creates a rectangle from 3 points.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_rectangle_3points
</span>
(
<span class="argument">
point1
</span>
,
<span class="argument">
point2
</span>
,
<span class="argument">
point3
</span>
[,
<span class="argument">
option=0
</span>
]…)
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point1
</td>
<td>
First point.
</td>
</tr>
<tr>
<td class="argument">
point2
</td>
<td>
Second point.
</td>
</tr>
<tr>
<td class="argument">
point3
</td>
<td>
Third point.
</td>
</tr>
<tr>
<td class="argument">
option
</td>
<td>
An optional argument to construct the rectangle. By default this value is 0. Value can be 0 (distance) or 1 (projected). Option distance: Second distance is equal to the distance between 2nd and 3rd point. Option projected: Second distance is equal to the distance of the perpendicular projection of the 3rd point on the segment or its extension.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_rectangle(make_point(0, 0), make_point(0,5), make_point(5, 5), 0)))
</code>
<code>
'Polygon ((0 0, 0 5, 5 5, 5 0, 0 0))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_rectangle(make_point(0, 0), make_point(0,5), make_point(5, 3), 1)))
</code>
<code>
'Polygon ((0 0, 0 5, 5 5, 5 0, 0 0))'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-make_regular_polygon"><a href="#geometrygroup-make_regular_polygon-idx">
function make_regular_polygon
</a></h3>
<div class="description">
<p>
Creates a regular polygon.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_regular_polygon
</span>
(
<span class="argument">
center
</span>
,
<span class="argument">
radius
</span>
,
<span class="argument">
number_sides
</span>
[,
<span class="argument">
circle=0
</span>
]…)
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
center
</td>
<td>
center of the regular polygon
</td>
</tr>
<tr>
<td class="argument">
radius
</td>
<td>
second point. The first if the regular polygon is inscribed. The midpoint of the first side if the regular polygon is circumscribed.
</td>
</tr>
<tr>
<td class="argument">
number_sides
</td>
<td>
Number of sides/edges of the regular polygon
</td>
</tr>
<tr>
<td class="argument">
circle
</td>
<td>
Optional argument to construct the regular polygon. By default this value is 0. Value can be 0 (inscribed) or 1 (circumscribed)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_regular_polygon(make_point(0,0), make_point(0,5), 5))
</code>
<code>
'Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_regular_polygon(make_point(0,0), project(make_point(0,0), 4.0451, radians(36)), 5))
</code>
<code>
'Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-make_square"><a href="#geometrygroup-make_square-idx">
function make_square
</a></h3>
<div class="description">
<p>
Creates a square from a diagonal.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_square
</span>
(
<span class="argument">
point1
</span>
,
<span class="argument">
point2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point1
</td>
<td>
First point of the regular polygon
</td>
</tr>
<tr>
<td class="argument">
point2
</td>
<td>
Second point
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_square( make_point(0,0), make_point(5,5)))
</code>
<code>
'Polygon ((0 0, -0 5, 5 5, 5 0, 0 0))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_square( make_point(5,0), make_point(5,5)))
</code>
<code>
'Polygon ((5 0, 2.5 2.5, 5 5, 7.5 2.5, 5 0))'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-make_triangle"><a href="#geometrygroup-make_triangle-idx">
function make_triangle
</a></h3>
<div class="description">
<p>
Creates a triangle polygon.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_triangle
</span>
(
<span class="argument">
point 1
</span>
,
<span class="argument">
point 2
</span>
,
<span class="argument">
point 3
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point 1
</td>
<td>
first point of the triangle
</td>
</tr>
<tr>
<td class="argument">
point 2
</td>
<td>
second point of the triangle
</td>
</tr>
<tr>
<td class="argument">
point 3
</td>
<td>
third point of the triangle
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_triangle(make_point(0,0), make_point(5,5), make_point(0,10)))
</code>
<code>
'Triangle ((0 0, 5 5, 0 10, 0 0))'
</code>
</li>
<li>
<code>
geom_to_wkt(boundary(make_triangle(make_point(0,0), make_point(5,5), make_point(0,10))))
</code>
<code>
'LineString (0 0, 5 5, 0 10, 0 0)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-minimal_circle"><a href="#geometrygroup-minimal_circle-idx">
function minimal_circle
</a></h3>
<div class="description">
<p>
Returns the minimal enclosing circle of a geometry. It represents the minimum circle that encloses all geometries within the set.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
minimal_circle
</span>
(
<span class="argument">
geometry
</span>
[,
<span class="argument">
segment=36
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
segment
</td>
<td>
optional argument for polygon segmentation. By default this value is 36
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( minimal_circle( geom_from_wkt( 'LINESTRING(0 5, 0 -5, 2 1)' ), 4 ) )
</code>
<code>
Polygon ((0 5, 5 -0, -0 -5, -5 0, 0 5))
</code>
</li>
<li>
<code>
geom_to_wkt( minimal_circle( geom_from_wkt( 'MULTIPOINT(1 2, 3 4, 3 2)' ), 4 ) )
</code>
<code>
Polygon ((3 4, 3 2, 1 2, 1 4, 3 4))
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-nodes_to_points"><a href="#geometrygroup-nodes_to_points-idx">
function nodes_to_points
</a></h3>
<div class="description">
<p>
Returns a multipoint geometry consisting of every node in the input geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
nodes_to_points
</span>
(
<span class="argument">
geometry
</span>
[,
<span class="argument">
ignore_closing_nodes=false
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometry object
</td>
</tr>
<tr>
<td class="argument">
ignore_closing_nodes
</td>
<td>
optional argument specifying whether to include duplicate nodes which close lines or polygons rings. Defaults to false, set to true to avoid including these duplicate nodes in the output collection.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(nodes_to_points(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))
</code>
<code>
'MultiPoint ((0 0),(1 1),(2 2))'
</code>
</li>
<li>
<code>
geom_to_wkt(nodes_to_points(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1))'),true))
</code>
<code>
'MultiPoint ((-1 -1),(4 0),(4 2),(0 2))'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-num_geometries"><a href="#geometrygroup-num_geometries-idx">
function num_geometries
</a></h3>
<div class="description">
<p>
Returns the number of geometries in a geometry collection, or null if the input geometry is not a collection.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
num_geometries
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometry collection
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
num_geometries(geom_from_wkt('GEOMETRYCOLLECTION(POINT(0 1), POINT(0 0), POINT(1 0), POINT(1 1))'))
</code>
<code>
4
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-num_interior_rings"><a href="#geometrygroup-num_interior_rings-idx">
function num_interior_rings
</a></h3>
<div class="description">
<p>
Returns the number of interior rings in a polygon or geometry collection, or null if the input geometry is not a polygon or collection.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
num_interior_rings
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
input geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
num_interior_rings(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),(-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1))'))
</code>
<code>
1
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-num_points"><a href="#geometrygroup-num_points-idx">
function num_points
</a></h3>
<div class="description">
<p>
Returns the number of vertices in a geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
num_points
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
num_points($geometry)
</code>
<code>
number of vertices in $geometry
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-num_rings"><a href="#geometrygroup-num_rings-idx">
function num_rings
</a></h3>
<div class="description">
<p>
Returns the number of rings (including exterior rings) in a polygon or geometry collection, or null if the input geometry is not a polygon or collection.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
num_rings
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
input geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
num_rings(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),(-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1))'))
</code>
<code>
2
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-offset_curve"><a href="#geometrygroup-offset_curve-idx">
function offset_curve
</a></h3>
<div class="description">
<p>
Returns a geometry formed by offsetting a linestring geometry to the side. Distances are in the Spatial Reference System of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
offset_curve
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
distance
</span>
[,
<span class="argument">
segments=8
</span>
][,
<span class="argument">
join=1
</span>
][,
<span class="argument">
miter_limit=2.0
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a (multi)linestring geometry
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
offset distance. Positive values will be buffered to the left of lines, negative values to the right
</td>
</tr>
<tr>
<td class="argument">
segments
</td>
<td>
number of segments to use to represent a quarter circle when a round join style is used. A larger number results in a smoother line with more nodes.
</td>
</tr>
<tr>
<td class="argument">
join
</td>
<td>
join style for corners, where 1 = round, 2 = miter and 3 = bevel
</td>
</tr>
<tr>
<td class="argument">
miter_limit
</td>
<td>
limit on the miter ratio used for very sharp corners (when using miter joins only)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
offset_curve($geometry, 10.5)
</code>
<code>
line offset to the left by 10.5 units
</code>
</li>
<li>
<code>
offset_curve($geometry, -10.5)
</code>
<code>
line offset to the right by 10.5 units
</code>
</li>
<li>
<code>
offset_curve($geometry, 10.5, segments=16, join=1)
</code>
<code>
line offset to the left by 10.5 units, using more segments to result in a smoother curve
</code>
</li>
<li>
<code>
offset_curve($geometry, 10.5, join=3)
</code>
<code>
line offset to the left by 10.5 units, using a beveled join
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-order_parts"><a href="#geometrygroup-order_parts-idx">
function order_parts
</a></h3>
<div class="description">
<p>
Orders the parts of a MultiGeometry by a given criteria
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
order_parts
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
orderby
</span>
,
<span class="argument">
ascending
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a multi-type geometry
</td>
</tr>
<tr>
<td class="argument">
orderby
</td>
<td>
an expression string defining the order criteria
</td>
</tr>
<tr>
<td class="argument">
ascending
</td>
<td>
boolean, True for ascending, False for descending
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
order_parts(geom_from_wkt('MultiPolygon (((1 1, 5 1, 5 5, 1 5, 1 1)),((1 1, 9 1, 9 9, 1 9, 1 1)))'), 'area($geometry)', False)
</code>
<code>
MultiPolygon (((1 1, 9 1, 9 9, 1 9, 1 1)),((1 1, 5 1, 5 5, 1 5, 1 1)))
</code>
</li>
<li>
<code>
order_parts(geom_from_wkt('LineString(1 2, 3 2, 4 3)'), '1', True)
</code>
<code>
LineString(1 2, 3 2, 4 3)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-oriented_bbox"><a href="#geometrygroup-oriented_bbox-idx">
function oriented_bbox
</a></h3>
<div class="description">
<p>
Returns a geometry which represents the minimal oriented bounding box of an input geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
oriented_bbox
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( oriented_bbox( geom_from_wkt( 'MULTIPOINT(1 2, 3 4, 3 2)' ) ) )
</code>
<code>
Polygon ((1 4, 1 2, 3 2, 3 4, 1 4))
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-overlaps"><a href="#geometrygroup-overlaps-idx">
function overlaps
</a></h3>
<div class="description">
<p>
Tests whether a geometry overlaps another. Returns true if the geometries share space, are of the same dimension, but are not completely contained by each other.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
overlaps
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
overlaps( geom_from_wkt( 'LINESTRING(3 5, 4 4, 5 5, 5 3)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
true
</code>
</li>
<li>
<code>
overlaps( geom_from_wkt( 'LINESTRING(0 0, 1 1)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-perimeter"><a href="#geometrygroup-perimeter-idx">
function perimeter
</a></h3>
<div class="description">
<p>
Returns the perimeter of a geometry polygon object. Calculations are always planimetric in the Spatial Reference System (SRS) of this geometry, and the units of the returned perimeter will match the units for the SRS. This differs from the calculations performed by the $perimeter function, which will perform ellipsoidal calculations based on the project's ellipsoid and distance unit settings.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
perimeter
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
polygon geometry object
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
perimeter(geom_from_wkt('POLYGON((0 0, 4 0, 4 2, 0 2, 0 0))'))
</code>
<code>
12.0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-point_n"><a href="#geometrygroup-point_n-idx">
function point_n
</a></h3>
<div class="description">
<p>
Returns a specific node from a geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
point_n
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
index
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometry object
</td>
</tr>
<tr>
<td class="argument">
index
</td>
<td>
index of node to return, where 1 is the first node; if the value is negative, the selected vertex index will be its total count minus the absolute value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(point_n(geom_from_wkt('POLYGON((0 0, 4 0, 4 2, 0 2, 0 0))'),2))
</code>
<code>
'Point (4 0)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-point_on_surface"><a href="#geometrygroup-point_on_surface-idx">
function point_on_surface
</a></h3>
<div class="description">
<p>
Returns a point guaranteed to lie on the surface of a geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
point_on_surface
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
point_on_surface($geometry)
</code>
<code>
a point geometry
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-pole_of_inaccessibility"><a href="#geometrygroup-pole_of_inaccessibility-idx">
function pole_of_inaccessibility
</a></h3>
<div class="description">
<p>
Calculates the approximate pole of inaccessibility for a surface, which is the most distant internal point from the boundary of the surface. This function uses the 'polylabel' algorithm (Vladimir Agafonkin, 2016), which is an iterative approach guaranteed to find the true pole of inaccessibility within a specified tolerance. More precise tolerances require more iterations and will take longer to calculate.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
pole_of_inaccessibility
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
tolerance
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
tolerance
</td>
<td>
maximum distance between the returned point and the true pole location
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(pole_of_inaccessibility( geom_from_wkt('POLYGON((0 1,0 9,3 10,3 3, 10 3, 10 1, 0 1))'), 0.1))
</code>
<code>
Point(1.55, 1.55)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-project"><a href="#geometrygroup-project-idx">
function project
</a></h3>
<div class="description">
<p>
Returns a point projected from a start point using a distance, a bearing (azimuth) and an elevation in radians.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
project
</span>
(
<span class="argument">
point
</span>
,
<span class="argument">
distance
</span>
,
<span class="argument">
azimuth
</span>
[,
<span class="argument">
elevation
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point
</td>
<td>
start point
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
distance to project
</td>
</tr>
<tr>
<td class="argument">
azimuth
</td>
<td>
azimuth in radians clockwise, where 0 corresponds to north
</td>
</tr>
<tr>
<td class="argument">
elevation
</td>
<td>
angle of inclination in radians
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(project(make_point(1, 2), 3, radians(270)))
</code>
<code>
Point(-2, 2)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-relate"><a href="#geometrygroup-relate-idx">
function relate
</a></h3>
<div class="description">
<p>
Tests the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the relationship between two geometries.
</p>
</div>
<h3 id="geometrygroup-relate"><a href="#geometrygroup-relate-idx">
Relationship variant
</a></h3>
<div class="description">
Returns the Dimensional Extended 9 Intersection Model (DE-9IM) representation of the relationship between two geometries.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
relate
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
relate( geom_from_wkt( 'LINESTRING(40 40,120 120)' ), geom_from_wkt( 'LINESTRING(40 40,60 120)' ) )
</code>
<code>
'FF1F00102'
</code>
</li>
</ul>
</div>
<h3 id="geometrygroup-relate"><a href="#geometrygroup-relate-idx">
Pattern match variant
</a></h3>
<div class="description">
Tests whether the DE-9IM relationship between two geometries matches a specified pattern.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
relate
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
geometry
</span>
,
<span class="argument">
pattern
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
pattern
</td>
<td>
DE-9IM pattern to match
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
relate( geom_from_wkt( 'LINESTRING(40 40,120 120)' ), geom_from_wkt( 'LINESTRING(40 40,60 120)' ), '**1F001**' )
</code>
<code>
True
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-reverse"><a href="#geometrygroup-reverse-idx">
function reverse
</a></h3>
<div class="description">
<p>
Reverses the direction of a line string by reversing the order of its vertices.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
reverse
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(reverse(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))
</code>
<code>
'LINESTRING(2 2, 1 1, 0 0)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-rotate"><a href="#geometrygroup-rotate-idx">
function rotate
</a></h3>
<div class="description">
<p>
Returns a rotated version of a geometry. Calculations are in the Spatial Reference System of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
rotate
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
rotation
</span>
[,
<span class="argument">
point
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
rotation
</td>
<td>
clockwise rotation in degrees
</td>
</tr>
<tr>
<td class="argument">
point
</td>
<td>
rotation center point. If not specified, the center of the geometry's bounding box is used.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
rotate($geometry, 45, make_point(4, 5))
</code>
<code>
geometry rotated 45 degrees clockwise around the (4, 5) point
</code>
</li>
<li>
<code>
rotate($geometry, 45)
</code>
<code>
geometry rotated 45 degrees clockwise around the center of its bounding box
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-segments_to_lines"><a href="#geometrygroup-segments_to_lines-idx">
function segments_to_lines
</a></h3>
<div class="description">
<p>
Returns a multi line geometry consisting of a line for every segment in the input geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
segments_to_lines
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometry object
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(segments_to_lines(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))
</code>
<code>
'MultiLineString ((0 0, 1 1),(1 1, 2 2))'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-shortest_line"><a href="#geometrygroup-shortest_line-idx">
function shortest_line
</a></h3>
<div class="description">
<p>
Returns the shortest line joining geometry1 to geometry2. The resultant line will start at geometry1 and end at geometry2.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
shortest_line
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
geometry to find shortest line from
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
geometry to find shortest line to
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(shortest_line(geom_from_wkt('LINESTRING (20 80, 98 190, 110 180, 50 75 )'),geom_from_wkt('POINT(100 100)')))
</code>
<code>
LineString(73.0769 115.384, 100 100)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-simplify"><a href="#geometrygroup-simplify-idx">
function simplify
</a></h3>
<div class="description">
<p>
Simplifies a geometry by removing nodes using a distance based threshold (ie, the Douglas Peucker algorithm). The algorithm preserves large deviations in geometries and reduces the number of vertices in nearly straight segments.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
simplify
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
tolerance
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
tolerance
</td>
<td>
maximum deviation from straight segments for points to be removed
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(simplify(geometry:=geom_from_wkt('LineString(0 0, 5 0.1, 10 0)'),tolerance:=5))
</code>
<code>
'LineString(0 0, 10 0)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-simplify_vw"><a href="#geometrygroup-simplify_vw-idx">
function simplify_vw
</a></h3>
<div class="description">
<p>
Simplifies a geometry by removing nodes using an area based threshold (ie, the Visvalingam-Whyatt algorithm). The algorithm removes vertices which create small areas in geometries, e.g., narrow spikes or nearly straight segments.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
simplify_vw
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
tolerance
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
tolerance
</td>
<td>
a measure of the maximum area created by a node for the node to be removed
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(simplify_vw(geometry:=geom_from_wkt('LineString(0 0, 5 0, 5.01 10, 5.02 0, 10 0)'),tolerance:=5))
</code>
<code>
'LineString(0 0, 10 0)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-single_sided_buffer"><a href="#geometrygroup-single_sided_buffer-idx">
function single_sided_buffer
</a></h3>
<div class="description">
<p>
Returns a geometry formed by buffering out just one side of a linestring geometry. Distances are in the Spatial Reference System of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
single_sided_buffer
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
distance
</span>
[,
<span class="argument">
segments=8
</span>
][,
<span class="argument">
join=1
</span>
][,
<span class="argument">
miter_limit=2.0
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a (multi)linestring geometry
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
buffer distance. Positive values will be buffered to the left of lines, negative values to the right
</td>
</tr>
<tr>
<td class="argument">
segments
</td>
<td>
number of segments to use to represent a quarter circle when a round join style is used. A larger number results in a smoother buffer with more nodes.
</td>
</tr>
<tr>
<td class="argument">
join
</td>
<td>
join style for corners, where 1 = round, 2 = miter and 3 = bevel
</td>
</tr>
<tr>
<td class="argument">
miter_limit
</td>
<td>
limit on the miter ratio used for very sharp corners (when using miter joins only)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
single_sided_buffer($geometry, 10.5)
</code>
<code>
line buffered to the left by 10.5 units
</code>
</li>
<li>
<code>
single_sided_buffer($geometry, -10.5)
</code>
<code>
line buffered to the right by 10.5 units
</code>
</li>
<li>
<code>
single_sided_buffer($geometry, 10.5, segments=16, join=1)
</code>
<code>
line buffered to the left by 10.5 units, using more segments to result in a smoother buffer
</code>
</li>
<li>
<code>
single_sided_buffer($geometry, 10.5, join=3)
</code>
<code>
line buffered to the left by 10.5 units, using a beveled join
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-smooth"><a href="#geometrygroup-smooth-idx">
function smooth
</a></h3>
<div class="description">
<p>
Smooths a geometry by adding extra nodes which round off corners in the geometry. If input geometries contain Z or M values, these will also be smoothed and the output geometry will retain the same dimensionality as the input geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
smooth
</span>
(
<span class="argument">
geometry
</span>
[,
<span class="argument">
iterations
</span>
][,
<span class="argument">
offset
</span>
][,
<span class="argument">
min_length
</span>
][,
<span class="argument">
max_angle
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
iterations
</td>
<td>
number of smoothing iterations to apply. Larger numbers result in smoother but more complex geometries.
</td>
</tr>
<tr>
<td class="argument">
offset
</td>
<td>
value between 0 and 0.5 which controls how tightly the smoothed geometry follow the original geometry. Smaller values result in a tighter smoothing, larger values result in looser smoothing.
</td>
</tr>
<tr>
<td class="argument">
min_length
</td>
<td>
minimum length of segments to apply smoothing to. This parameter can be used to avoid placing excessive additional nodes in shorter segments of the geometry.
</td>
</tr>
<tr>
<td class="argument">
max_angle
</td>
<td>
maximum angle at node for smoothing to be applied (0-180). By lowering the maximum angle intentionally sharp corners in the geometry can be preserved. For instance, a value of 80 degrees will retain right angles in the geometry.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(smooth(geometry:=geom_from_wkt('LineString(0 0, 5 0, 5 5)'),iterations:=1,offset:=0.2,min_length:=-1,max_angle:=180))
</code>
<code>
'LineString (0 0, 4 0, 5 1, 5 5)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-start_point"><a href="#geometrygroup-start_point-idx">
function start_point
</a></h3>
<div class="description">
<p>
Returns the first node from a geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
start_point
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometry object
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(start_point(geom_from_wkt('LINESTRING(4 0, 4 2, 0 2)')))
</code>
<code>
'Point (4 0)'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-sym_difference"><a href="#geometrygroup-sym_difference-idx">
function sym_difference
</a></h3>
<div class="description">
<p>
Returns a geometry that represents the portions of two geometries that do not intersect.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
sym_difference
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( sym_difference( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 8 8)' ) ) )
</code>
<code>
LINESTRING(5 5, 8 8)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-tapered_buffer"><a href="#geometrygroup-tapered_buffer-idx">
function tapered_buffer
</a></h3>
<div class="description">
<p>
Creates a buffer along a line geometry where the buffer diameter varies evenly over the length of the line.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
tapered_buffer
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
start_width
</span>
,
<span class="argument">
end_width
</span>
[,
<span class="argument">
segments=8
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
input geometry. Must be a (multi)line geometry.
</td>
</tr>
<tr>
<td class="argument">
start_width
</td>
<td>
width of buffer at start of line,
</td>
</tr>
<tr>
<td class="argument">
end_width
</td>
<td>
width of buffer at end of line.
</td>
</tr>
<tr>
<td class="argument">
segments
</td>
<td>
number of segments to approximate quarter-circle curves in the buffer.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
tapered_buffer(geometry:=geom_from_wkt('LINESTRING(1 2, 4 2)'),start_width:=1,end_width:=2,segments:=8)
</code>
<code>
A tapered buffer starting with a diameter of 1 and ending with a diameter of 2 along the linestring geometry.
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-touches"><a href="#geometrygroup-touches-idx">
function touches
</a></h3>
<div class="description">
<p>
Tests whether a geometry touches another. Returns true if the geometries have at least one point in common, but their interiors do not intersect.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
touches
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
touches( geom_from_wkt( 'LINESTRING(5 3, 4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
true
</code>
</li>
<li>
<code>
touches( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(5 5)' ) )
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-transform"><a href="#geometrygroup-transform-idx">
function transform
</a></h3>
<div class="description">
<p>
Returns the geometry transformed from a source CRS to a destination CRS.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
transform
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
source_auth_id
</span>
,
<span class="argument">
dest_auth_id
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
source_auth_id
</td>
<td>
the source auth CRS ID
</td>
</tr>
<tr>
<td class="argument">
dest_auth_id
</td>
<td>
the destination auth CRS ID
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( transform( $geometry, 'EPSG:2154', 'EPSG:4326' ) )
</code>
<code>
POINT(0 51)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-translate"><a href="#geometrygroup-translate-idx">
function translate
</a></h3>
<div class="description">
<p>
Returns a translated version of a geometry. Calculations are in the Spatial Reference System of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
translate
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
dx
</span>
,
<span class="argument">
dy
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
dx
</td>
<td>
delta x
</td>
</tr>
<tr>
<td class="argument">
dy
</td>
<td>
delta y
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
translate($geometry, 5, 10)
</code>
<code>
a geometry of the same type like the original one
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-union"><a href="#geometrygroup-union-idx">
function union
</a></h3>
<div class="description">
<p>
Returns a geometry that represents the point set union of the geometries.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
union
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( union( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(5 5)' ) ) )
</code>
<code>
MULTIPOINT(4 4, 5 5)
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-wedge_buffer"><a href="#geometrygroup-wedge_buffer-idx">
function wedge_buffer
</a></h3>
<div class="description">
<p>
Returns a wedge shaped buffer originating from a point geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
wedge_buffer
</span>
(
<span class="argument">
center
</span>
,
<span class="argument">
azimuth
</span>
,
<span class="argument">
width
</span>
,
<span class="argument">
outer_radius
</span>
[,
<span class="argument">
inner_radius=0.0
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
center
</td>
<td>
center point (origin) of buffer. Must be a point geometry.
</td>
</tr>
<tr>
<td class="argument">
azimuth
</td>
<td>
angle (in degrees) for the middle of the wedge to point.
</td>
</tr>
<tr>
<td class="argument">
width
</td>
<td>
buffer width (in degrees). Note that the wedge will extend to half of the angular width either side of the azimuth direction.
</td>
</tr>
<tr>
<td class="argument">
outer_radius
</td>
<td>
outer radius for buffers
</td>
</tr>
<tr>
<td class="argument">
inner_radius
</td>
<td>
optional inner radius for buffers
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
wedge_buffer(center:=geom_from_wkt('POINT(1 2)'),azimuth:=90,width:=180,outer_radius:=1)
</code>
<code>
A wedge shaped buffer centered on the point (1,2), facing to the East, with a width of 180 degrees and outer radius of 1.
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-within"><a href="#geometrygroup-within-idx">
function within
</a></h3>
<div class="description">
<p>
Tests whether a geometry is within another. Returns true if the geometry a is completely within geometry b.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
within
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
a geometry
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
within( geom_from_wkt( 'POINT( 0.5 0.5)' ), geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))' ) )
</code>
<code>
true
</code>
</li>
<li>
<code>
within( geom_from_wkt( 'POINT( 5 5 )' ), geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0 ))' ) )
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-x"><a href="#geometrygroup-x-idx">
function x
</a></h3>
<div class="description">
<p>
Returns the x coordinate of a point geometry, or the x-coordinate of the centroid for a non-point geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
x
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
x( geom_from_wkt( 'POINT(2 5)' ) )
</code>
<code>
2
</code>
</li>
<li>
<code>
x( $geometry )
</code>
<code>
x coordinate of the current feature's centroid
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-x_max"><a href="#geometrygroup-x_max-idx">
function x_max
</a></h3>
<div class="description">
<p>
Returns the maximum x coordinate of a geometry. Calculations are in the spatial reference system of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
x_max
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
x_max( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )
</code>
<code>
4
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-x_min"><a href="#geometrygroup-x_min-idx">
function x_min
</a></h3>
<div class="description">
<p>
Returns the minimum x coordinate of a geometry. Calculations are in the spatial reference system of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
x_min
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
x_min( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )
</code>
<code>
2
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-y"><a href="#geometrygroup-y-idx">
function y
</a></h3>
<div class="description">
<p>
Returns the y coordinate of a point geometry, or the y-coordinate of the centroid for a non-point geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
y
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
y( geom_from_wkt( 'POINT(2 5)' ) )
</code>
<code>
5
</code>
</li>
<li>
<code>
y( $geometry )
</code>
<code>
y coordinate of the current feature's centroid
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-y_max"><a href="#geometrygroup-y_max-idx">
function y_max
</a></h3>
<div class="description">
<p>
Returns the maximum y coordinate of a geometry. Calculations are in the spatial reference system of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
y_max
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
y_max( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )
</code>
<code>
8
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-y_min"><a href="#geometrygroup-y_min-idx">
function y_min
</a></h3>
<div class="description">
<p>
Returns the minimum y coordinate of a geometry. Calculations are in the spatial reference system of this geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
y_min
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
y_min( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )
</code>
<code>
5
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="geometrygroup-z"><a href="#geometrygroup-z-idx">
function z
</a></h3>
<div class="description">
<p>
Returns the z coordinate of a point geometry.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
z
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a point geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
z( geom_from_wkt( 'POINTZ(2 5 7)' ) )
</code>
<code>
7
</code>
</li>
</ul>
</div>
</div></div>
<div id="layout" class="group">function help for Layout missing</div>
<div class="function"><h3 id="layout-item_variables"><a href="#layout-item_variables-idx">
function item_variables
</a></h3>
<div class="description">
<p>
Returns a map of variables from a composer item inside this composition.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
item_variables
</span>
(
<span class="argument">
id
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
id
</td>
<td>
composer item ID
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
map_get(item_variables('main_map'), 'map_scale')
</code>
<code>
2000
</code>
</li>
</ul>
</div>
</div></div>
<div id="map-layers" class="group"><h2><a href="#map-layers-idx">group map layers</a></h2>
<div class="description"><p>Contains a list of map layers available in the current project.</p></div></div>
<div class="function"><h3 id="map-layers-decode_uri"><a href="#map-layers-decode_uri-idx">
function decode_uri
</a></h3>
<div class="description">
<p>
Takes a layer and decodes the uri of the underlying data provider. It depends on the dataprovider, which data is available.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
decode_uri
</span>
(
<span class="argument">
layer
</span>
[,
<span class="argument">
part
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
The layer for which the uri should be decoded.
</td>
</tr>
<tr>
<td class="argument">
part
</td>
<td>
The part of the uri to return. If unspecified, a map with all uri parts will be returned.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
decode_uri(@layer)
</code>
<code>
{'layerId': '0', 'layerName': '', 'path': '/home/qgis/shapefile.shp'}
</code>
</li>
<li>
<code>
decode_uri(@layer)
</code>
<code>
{'layerId': NULL, 'layerName': 'layer', 'path': '/home/qgis/geopackage.gpkg'}
</code>
</li>
<li>
<code>
decode_uri(@layer, 'path')
</code>
<code>
'C:\my_data\qgis\shape.shp'
</code>
</li>
</ul>
</div>
</div></div>
<div id="maps" class="group"><h2><a href="#maps-idx">group maps</a></h2>
<div class="description"><p>This group contains expression functions for the creation and manipulation of 'map' data structures (also known as dictionary objects, key-value pairs, or associative arrays). One can assign values to given keys. The order of the key-value pairs in the map object is not relevant.</p></div></div>
<div class="function"><h3 id="maps-from_json"><a href="#maps-from_json-idx">
function from_json
</a></h3>
<div class="description">
<p>
Loads a JSON formatted string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
from_json
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
JSON string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
from_json('{"qgis":"rocks"}')
</code>
<code>
{ "qgis" : "rocks" }
</code>
</li>
<li>
<code>
from_json('[1,2,3]')
</code>
<code>
[1,2,3]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-hstore_to_map"><a href="#maps-hstore_to_map-idx">
function hstore_to_map
</a></h3>
<div class="description">
<p>
Creates a map from a hstore-formatted string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
hstore_to_map
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the input string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
hstore_to_map('qgis=&gt;rocks')
</code>
<code>
{ "qgis" : "rocks" }
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-json_to_map"><a href="#maps-json_to_map-idx">
function json_to_map
</a></h3>
<div class="description">
<p>
Creates a map from a json-formatted string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
json_to_map
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the input string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
json_to_map('{"qgis":"rocks"}')
</code>
<code>
{ "qgis" : "rocks" }
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-map"><a href="#maps-map-idx">
function map
</a></h3>
<div class="description">
<p>
Returns a map containing all the keys and values passed as pair of parameters.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
map
</span>
(
<span class="argument">
key1
</span>
,
<span class="argument">
value1
</span>
,
<span class="argument">
key2
</span>
,
<span class="argument">
value2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
key
</td>
<td>
a key (string)
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
a value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
map('1','one','2', 'two')
</code>
<code>
{ '1': 'one', '2': 'two' }
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-map_akeys"><a href="#maps-map_akeys-idx">
function map_akeys
</a></h3>
<div class="description">
<p>
Returns all the keys of a map as an array.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_akeys
</span>
(
<span class="argument">
map
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
a map
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
map_akeys(map('1','one','2','two'))
</code>
<code>
[ '1', '2' ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-map_avals"><a href="#maps-map_avals-idx">
function map_avals
</a></h3>
<div class="description">
<p>
Returns all the values of a map as an array.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_avals
</span>
(
<span class="argument">
map
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
a map
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
map_avals(map('1','one','2','two'))
</code>
<code>
[ 'one', 'two' ]
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-map_concat"><a href="#maps-map_concat-idx">
function map_concat
</a></h3>
<div class="description">
<p>
Returns a map containing all the entries of the given maps. If two maps contain the same key, the value of the second map is taken.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_concat
</span>
(
<span class="argument">
map1
</span>
,
<span class="argument">
map2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
a map
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
map_concat(map('1','one', '2','overridden'),map('2','two', '3','three'))
</code>
<code>
{ '1': 'one, '2': 'two', '3': 'three' }
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-map_delete"><a href="#maps-map_delete-idx">
function map_delete
</a></h3>
<div class="description">
<p>
Returns a map with the given key and its corresponding value deleted.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_delete
</span>
(
<span class="argument">
map
</span>
,
<span class="argument">
key
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
a map
</td>
</tr>
<tr>
<td class="argument">
key
</td>
<td>
the key to delete
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
map_delete(map('1','one','2','two'),'2')
</code>
<code>
{ '1': 'one' }
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-map_exist"><a href="#maps-map_exist-idx">
function map_exist
</a></h3>
<div class="description">
<p>
Returns true if the given key exists in the map.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_exist
</span>
(
<span class="argument">
map
</span>
,
<span class="argument">
key
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
a map
</td>
</tr>
<tr>
<td class="argument">
key
</td>
<td>
the key to lookup
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
map_exist(map('1','one','2','two'),'3')
</code>
<code>
false
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-map_get"><a href="#maps-map_get-idx">
function map_get
</a></h3>
<div class="description">
<p>
Returns the value of a map, given it's key.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_get
</span>
(
<span class="argument">
map
</span>
,
<span class="argument">
key
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
a map
</td>
</tr>
<tr>
<td class="argument">
key
</td>
<td>
the key to lookup
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
map_get(map('1','one','2','two'),'2')
</code>
<code>
'two'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-map_insert"><a href="#maps-map_insert-idx">
function map_insert
</a></h3>
<div class="description">
<p>
Returns a map with an added key/value.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_insert
</span>
(
<span class="argument">
map
</span>
,
<span class="argument">
key
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
a map
</td>
</tr>
<tr>
<td class="argument">
key
</td>
<td>
the key to add
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
the value to add
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
map_insert(map('1','one'),'3','three')
</code>
<code>
{ '1': 'one', '3': 'three' }
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-map_to_hstore"><a href="#maps-map_to_hstore-idx">
function map_to_hstore
</a></h3>
<div class="description">
<p>
Merge map elements into a hstore-formatted string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_to_hstore
</span>
(
<span class="argument">
map
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
the input map
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
map_to_hstore(map('qgis','rocks'))
</code>
<code>
"qgis"=&gt;"rocks"}
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-map_to_json"><a href="#maps-map_to_json-idx">
function map_to_json
</a></h3>
<div class="description">
<p>
Merge map elements into a json-formatted string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_to_json
</span>
(
<span class="argument">
map
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
the input map
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
map_to_json(map('qgis','rocks'))
</code>
<code>
{"qgis":"rocks"}
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="maps-to_json"><a href="#maps-to_json-idx">
function to_json
</a></h3>
<div class="description">
<p>
Create a JSON formatted string from a map, array or other value.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_json
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
The input value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_json(map('qgis','rocks'))
</code>
<code>
{"qgis":"rocks"}
</code>
</li>
<li>
<code>
to_json(array(1,2,3))
</code>
<code>
[1,2,3]
</code>
</li>
</ul>
</div>
</div></div>
<div id="math" class="group"><h2><a href="#math-idx">group math</a></h2>
<div class="description"><p>This group contains math functions e.g square root, sin and cos</p></div></div>
<div class="function"><h3 id="math-abs"><a href="#math-abs-idx">
function abs
</a></h3>
<div class="description">
<p>
Returns the absolute value of a number.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
abs
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
a number
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
abs(-2)
</code>
<code>
2
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-acos"><a href="#math-acos-idx">
function acos
</a></h3>
<div class="description">
<p>
Returns the inverse cosine of a value in radians.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
acos
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
cosine of an angle in radians
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
acos(0.5)
</code>
<code>
1.0471975511966
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-asin"><a href="#math-asin-idx">
function asin
</a></h3>
<div class="description">
<p>
Returns the inverse sine of a value in radians.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
asin
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
sine of an angle in radians
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
asin(1.0)
</code>
<code>
1.5707963267949
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-atan"><a href="#math-atan-idx">
function atan
</a></h3>
<div class="description">
<p>
Returns the inverse tangent of a value in radians.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
atan
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
tan of an angle in radians
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
atan(0.5)
</code>
<code>
0.463647609000806
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-atan2"><a href="#math-atan2-idx">
function atan2
</a></h3>
<div class="description">
<p>
Returns the inverse tangent of dy/dx by using the signs of the two arguments to determine the quadrant of the result.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
atan2
</span>
(
<span class="argument">
dy
</span>
,
<span class="argument">
dx
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
dy
</td>
<td>
y coordinate difference
</td>
</tr>
<tr>
<td class="argument">
dx
</td>
<td>
x coordinate difference
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
atan2(1.0, 1.732)
</code>
<code>
0.523611477769969
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-azimuth"><a href="#math-azimuth-idx">
function azimuth
</a></h3>
<div class="description">
<p>
Returns the north-based azimuth as the angle in radians measured clockwise from the vertical on point_a to point_b.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
azimuth
</span>
(
<span class="argument">
point_a
</span>
,
<span class="argument">
point_b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point_a
</td>
<td>
point geometry
</td>
</tr>
<tr>
<td class="argument">
point_b
</td>
<td>
point geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
degrees( azimuth( make_point(25, 45), make_point(75, 100) ) )
</code>
<code>
42.273689
</code>
</li>
<li>
<code>
degrees( azimuth( make_point(75, 100), make_point(25,45) ) )
</code>
<code>
222.273689
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-ceil"><a href="#math-ceil-idx">
function ceil
</a></h3>
<div class="description">
<p>
Rounds a number upwards.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
ceil
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
a number
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
ceil(4.9)
</code>
<code>
5
</code>
</li>
<li>
<code>
ceil(-4.9)
</code>
<code>
-4
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-clamp"><a href="#math-clamp-idx">
function clamp
</a></h3>
<div class="description">
<p>
Restricts an input value to a specified range.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
clamp
</span>
(
<span class="argument">
minimum
</span>
,
<span class="argument">
input
</span>
,
<span class="argument">
maximum
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
minimum
</td>
<td>
the smallest value
<i>
input
</i>
is allowed to take.
</td>
</tr>
<tr>
<td class="argument">
input
</td>
<td>
a value which will be restricted to the range specified by
<i>
minimum
</i>
and
<i>
maximum
</i>
</td>
</tr>
<tr>
<td class="argument">
maximum
</td>
<td>
the largest value
<i>
input
</i>
is allowed to take
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
clamp(1,5,10)
</code>
<code>
5
</code>
(
<i>
input
</i>
is between 1 and 10 so is returned unchanged)
</li>
<li>
<code>
clamp(1,0,10)
</code>
<code>
1
</code>
(
<i>
input
</i>
is less than minimum value of 1, so function returns 1)
</li>
<li>
<code>
clamp(1,11,10)
</code>
<code>
10
</code>
(
<i>
input
</i>
is greater than maximum value of 10, so function returns 10)
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-cos"><a href="#math-cos-idx">
function cos
</a></h3>
<div class="description">
<p>
Returns cosine of an angle.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
cos
</span>
(
<span class="argument">
angle
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
angle
</td>
<td>
angle in radians
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
cos(1.571)
</code>
<code>
0.000796326710733263
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-degrees"><a href="#math-degrees-idx">
function degrees
</a></h3>
<div class="description">
<p>
Converts from radians to degrees.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
degrees
</span>
(
<span class="argument">
radians
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
radians
</td>
<td>
numeric value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
degrees(3.14159)
</code>
<code>
180
</code>
</li>
<li>
<code>
degrees(1)
</code>
<code>
57.2958
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-exp"><a href="#math-exp-idx">
function exp
</a></h3>
<div class="description">
<p>
Returns exponential of an value.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
exp
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
number to return exponent of
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
exp(1.0)
</code>
<code>
2.71828182845905
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-floor"><a href="#math-floor-idx">
function floor
</a></h3>
<div class="description">
<p>
Rounds a number downwards.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
floor
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
a number
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
floor(4.9)
</code>
<code>
4
</code>
</li>
<li>
<code>
floor(-4.9)
</code>
<code>
-5
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-inclination"><a href="#math-inclination-idx">
function inclination
</a></h3>
<div class="description">
<p>
Returns the inclination measured from the zenith (0) to the nadir (180) on point_a to point_b.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
inclination
</span>
(
<span class="argument">
point_a
</span>
,
<span class="argument">
point_b
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point_a
</td>
<td>
point geometry
</td>
</tr>
<tr>
<td class="argument">
point_b
</td>
<td>
point geometry
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, 5 ) )
</code>
<code>
0.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, 0 ) )
</code>
<code>
90.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 50, 100, 0 ) )
</code>
<code>
90.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, -5 ) )
</code>
<code>
180.0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-ln"><a href="#math-ln-idx">
function ln
</a></h3>
<div class="description">
<p>
Returns the natural logarithm of a value.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
ln
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
numeric value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
ln(1)
</code>
<code>
0
</code>
</li>
<li>
<code>
ln(2.7182818284590452354)
</code>
<code>
1
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-log"><a href="#math-log-idx">
function log
</a></h3>
<div class="description">
<p>
Returns the value of the logarithm of the passed value and base.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
log
</span>
(
<span class="argument">
base
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
base
</td>
<td>
any positive number
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
any positive number
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
log(2, 32)
</code>
<code>
5
</code>
</li>
<li>
<code>
log(0.5, 32)
</code>
<code>
-5
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-log10"><a href="#math-log10-idx">
function log10
</a></h3>
<div class="description">
<p>
Returns the value of the base 10 logarithm of the passed expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
log10
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
any positive number
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
log10(1)
</code>
<code>
0
</code>
</li>
<li>
<code>
log10(100)
</code>
<code>
2
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-max"><a href="#math-max-idx">
function max
</a></h3>
<div class="description">
<p>
Returns the largest value in a set of values.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
max
</span>
(
<span class="argument">
value1
</span>
,
<span class="argument">
value2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
a number
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
max(2,10.2,5.5)
</code>
<code>
10.2
</code>
</li>
<li>
<code>
max(20.5,NULL,6.2)
</code>
<code>
20.5
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-min"><a href="#math-min-idx">
function min
</a></h3>
<div class="description">
<p>
Returns the smallest value in a set of values.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
min
</span>
(
<span class="argument">
value1
</span>
,
<span class="argument">
value2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
a number
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
min(20.5,10,6.2)
</code>
<code>
6.2
</code>
</li>
<li>
<code>
min(2,-10.3,NULL)
</code>
<code>
-10.3
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-pi"><a href="#math-pi-idx">
function pi
</a></h3>
<div class="description">
<p>
Returns value of pi for calculations.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
pi
</span>
()
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
pi()
</code>
<code>
3.14159265358979
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-radians"><a href="#math-radians-idx">
function radians
</a></h3>
<div class="description">
<p>
Converts from degrees to radians.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
radians
</span>
(
<span class="argument">
degrees
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
degrees
</td>
<td>
numeric value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
radians(180)
</code>
<code>
3.14159
</code>
</li>
<li>
<code>
radians(57.2958)
</code>
<code>
1
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-rand"><a href="#math-rand-idx">
function rand
</a></h3>
<div class="description">
<p>
Returns a random integer within the range specified by the minimum and maximum argument (inclusive). If a seed is provided, the returned will always be the same, depending on the seed.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
rand
</span>
(
<span class="argument">
min
</span>
,
<span class="argument">
max
</span>
[,
<span class="argument">
seed=null
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
min
</td>
<td>
an integer representing the smallest possible random number desired
</td>
</tr>
<tr>
<td class="argument">
max
</td>
<td>
an integer representing the largest possible random number desired
</td>
</tr>
<tr>
<td class="argument">
seed
</td>
<td>
any value to use as seed
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
rand(1, 10)
</code>
<code>
8
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-randf"><a href="#math-randf-idx">
function randf
</a></h3>
<div class="description">
<p>
Returns a random float within the range specified by the minimum and maximum argument (inclusive). If a seed is provided, the returned will always be the same, depending on the seed.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
randf
</span>
([
<span class="argument">
min=0.0
</span>
][,
<span class="argument">
max=1.0
</span>
][,
<span class="argument">
seed=null
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
min
</td>
<td>
an float representing the smallest possible random number desired
</td>
</tr>
<tr>
<td class="argument">
max
</td>
<td>
an float representing the largest possible random number desired
</td>
</tr>
<tr>
<td class="argument">
seed
</td>
<td>
any value to use as seed
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
randf(1, 10)
</code>
<code>
4.59258286403147
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-round"><a href="#math-round-idx">
function round
</a></h3>
<div class="description">
<p>
Rounds a number to number of decimal places.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
round
</span>
(
<span class="argument">
value
</span>
[,
<span class="argument">
places=0
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
decimal number to be rounded
</td>
</tr>
<tr>
<td class="argument">
places
</td>
<td>
Optional integer representing number of places to round decimals to. Can be negative.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
round(1234.567, 2)
</code>
<code>
1234.57
</code>
</li>
<li>
<code>
round(1234.567)
</code>
<code>
1235
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-scale_exp"><a href="#math-scale_exp-idx">
function scale_exp
</a></h3>
<div class="description">
<p>
Transforms a given value from an input domain to an output range using an exponential curve. This function can be used to ease values in or out of the specified output range.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
scale_exp
</span>
(
<span class="argument">
val
</span>
,
<span class="argument">
domain_min
</span>
,
<span class="argument">
domain_max
</span>
,
<span class="argument">
range_min
</span>
,
<span class="argument">
range_max
</span>
,
<span class="argument">
exponent
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
val
</td>
<td>
A value in the input domain. The function will return a corresponding scaled value in the output range.
</td>
</tr>
<tr>
<td class="argument">
domain_min
</td>
<td>
Specifies the minimum value in the input domain, the smallest value the input value should take.
</td>
</tr>
<tr>
<td class="argument">
domain_max
</td>
<td>
Specifies the maximum value in the input domain, the largest value the input value should take.
</td>
</tr>
<tr>
<td class="argument">
range_min
</td>
<td>
Specifies the minimum value in the output range, the smallest value which should be output by the function.
</td>
</tr>
<tr>
<td class="argument">
range_max
</td>
<td>
Specifies the maximum value in the output range, the largest value which should be output by the function.
</td>
</tr>
<tr>
<td class="argument">
exponent
</td>
<td>
A positive value (greater than 0), which dictates the way input values are mapped to the output range. Large exponents will cause the output values to 'ease in', starting slowly before accelerating as the input values approach the domain maximum. Smaller exponents (less than 1) will cause output values to 'ease out', where the mapping starts quickly but slows as it approaches the domain maximum.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
scale_exp(5,0,10,0,100,2)
</code>
<code>
25
</code>
(easing in, using an exponent of 2)
</li>
<li>
<code>
scale_exp(3,0,10,0,100,0.5)
</code>
<code>
54.772
</code>
(easing out, using an exponent of 0.5)
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-scale_linear"><a href="#math-scale_linear-idx">
function scale_linear
</a></h3>
<div class="description">
<p>
Transforms a given value from an input domain to an output range using linear interpolation.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
scale_linear
</span>
(
<span class="argument">
val
</span>
,
<span class="argument">
domain_min
</span>
,
<span class="argument">
domain_max
</span>
,
<span class="argument">
range_min
</span>
,
<span class="argument">
range_max
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
val
</td>
<td>
A value in the input domain. The function will return a corresponding scaled value in the output range.
</td>
</tr>
<tr>
<td class="argument">
domain_min
</td>
<td>
Specifies the minimum value in the input domain, the smallest value the input value should take.
</td>
</tr>
<tr>
<td class="argument">
domain_max
</td>
<td>
Specifies the maximum value in the input domain, the largest value the input value should take.
</td>
</tr>
<tr>
<td class="argument">
range_min
</td>
<td>
Specifies the minimum value in the output range, the smallest value which should be output by the function.
</td>
</tr>
<tr>
<td class="argument">
range_max
</td>
<td>
Specifies the maximum value in the output range, the largest value which should be output by the function.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
scale_linear(5,0,10,0,100)
</code>
<code>
50
</code>
</li>
<li>
<code>
scale_linear(0.2,0,1,0,360)
</code>
<code>
72
</code>
(scaling a value between 0 and 1 to an angle between 0 and 360)
</li>
<li>
<code>
scale_linear(1500,1000,10000,9,20)
</code>
<code>
9.6111111
</code>
(scaling a population which varies between 1000 and 10000 to a font size between 9 and 20)
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-sin"><a href="#math-sin-idx">
function sin
</a></h3>
<div class="description">
<p>
Returns the sine of an angle.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
sin
</span>
(
<span class="argument">
angle
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
angle
</td>
<td>
angle in radians
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
sin(1.571)
</code>
<code>
0.999999682931835
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-sqrt"><a href="#math-sqrt-idx">
function sqrt
</a></h3>
<div class="description">
<p>
Returns square root of a value.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
sqrt
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
a number
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
sqrt(9)
</code>
<code>
3
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="math-tan"><a href="#math-tan-idx">
function tan
</a></h3>
<div class="description">
<p>
Returns the tangent of an angle.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
tan
</span>
(
<span class="argument">
angle
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
angle
</td>
<td>
angle in radians
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
tan(1.0)
</code>
<code>
1.5574077246549
</code>
</li>
</ul>
</div>
</div></div>
<div id="processing" class="group">function help for Processing missing</div>
<div class="function"><h3 id="processing-parameter"><a href="#processing-parameter-idx">
function parameter
</a></h3>
<div class="description">
<p>
Returns the value of a processing algorithm input parameter.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
parameter
</span>
(
<span class="argument">
name
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
name
</td>
<td>
name of the corresponding input parameter
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
parameter('BUFFER_SIZE')
</code>
<code>
5.6
</code>
</li>
</ul>
</div>
</div></div>
<div id="rasters" class="group"><h2><a href="#rasters-idx">group rasters</a></h2>
<div class="description"><p>Contains functions which calculate raster statistics and values.</p></div></div>
<div class="function"><h3 id="rasters-raster_statistic"><a href="#rasters-raster_statistic-idx">
function raster_statistic
</a></h3>
<div class="description">
<p>
Returns statistics from a raster layer.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
raster_statistic
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
band
</span>
,
<span class="argument">
property
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
a string, representing either a raster layer name or layer ID
</td>
</tr>
<tr>
<td class="argument">
band
</td>
<td>
integer representing the band number from the raster layer, starting at 1
</td>
</tr>
<tr>
<td class="argument">
property
</td>
<td>
a string corresponding to the property to return. Valid options are:
<br/>
<ul>
<li>
min: minimum value
</li>
<li>
max: maximum value
</li>
<li>
avg: average (mean) value
</li>
<li>
stdev: standard deviation of values
</li>
<li>
range: range of values (max - min)
</li>
<li>
sum: sum of all values from raster
</li>
</ul>
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
raster_statistic('lc',1,'avg')
</code>
<code>
Average value from band 1 from 'lc' raster layer
</code>
</li>
<li>
<code>
raster_statistic('ac2010',3,'min')
</code>
<code>
Minimum value from band 3 from 'ac2010' raster layer
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="rasters-raster_value"><a href="#rasters-raster_value-idx">
function raster_value
</a></h3>
<div class="description">
<p>
Returns the raster value found at the provided point.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
raster_value
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
band
</span>
,
<span class="argument">
point
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
the name or id of a raster layer
</td>
</tr>
<tr>
<td class="argument">
band
</td>
<td>
the band number to sample the value from.
</td>
</tr>
<tr>
<td class="argument">
point
</td>
<td>
point geometry (for multipart geometries having more than one part, a null value will be returned)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
raster_value('dem', 1, make_point(1,1))
</code>
<code>
25
</code>
</li>
</ul>
</div>
</div></div>
<div id="record-and-attributes" class="group"><h2><a href="#record-and-attributes-idx">group record and attributes</a></h2>
<div class="description"><p>This group contains functions that operate on record identifiers.</p></div></div>
<div class="function"><h3 id="record-and-attributes-dollar-currentfeature"><a href="#record-and-attributes-dollar-currentfeature-idx">
function $currentfeature
</a></h3>
<div class="description">
<p>
Returns the current feature being evaluated. This can be used with the 'attribute' function to evaluate attribute values from the current feature.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
$currentfeature
</span>
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
attribute( $currentfeature, 'name' )
</code>
<code>
value stored in 'name' attribute for the current feature
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="record-and-attributes-dollar-id"><a href="#record-and-attributes-dollar-id-idx">
function $id
</a></h3>
<div class="description">
<p>
Returns the feature id of the current row.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
$id
</span>
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
$id
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="record-and-attributes-attribute"><a href="#record-and-attributes-attribute-idx">
function attribute
</a></h3>
<div class="description">
<p>
Returns an attribute from a feature.
</p>
</div>
<h3 id="record-and-attributes-attribute"><a href="#record-and-attributes-attribute-idx">
Variant 1
</a></h3>
<div class="description">
Returns the value of an attribute from the current feature.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
attribute
</span>
(
<span class="argument">
attribute_name
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
attribute_name
</td>
<td>
name of attribute to be returned
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
attribute( 'name' )
</code>
<code>
value stored in 'name' attribute for the current feature
</code>
</li>
</ul>
</div>
<h3 id="record-and-attributes-attribute"><a href="#record-and-attributes-attribute-idx">
Variant 2
</a></h3>
<div class="description">
Allows the target feature and attribute name to be specified.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
attribute
</span>
(
<span class="argument">
feature
</span>
,
<span class="argument">
attribute_name
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
feature
</td>
<td>
a feature
</td>
</tr>
<tr>
<td class="argument">
attribute_name
</td>
<td>
name of attribute to be returned
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
attribute( @atlas_feature, 'name' )
</code>
<code>
value stored in 'name' attribute for the current atlas feature
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="record-and-attributes-attributes"><a href="#record-and-attributes-attributes-idx">
function attributes
</a></h3>
<div class="description">
<p>
Returns a map containing all attributes from a feature, with field names as map keys.
</p>
</div>
<h3 id="record-and-attributes-attributes"><a href="#record-and-attributes-attributes-idx">
Variant 1
</a></h3>
<div class="description">
Returns a map of all attributes from the current feature.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
attributes
</span>
()
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
attributes()['name']
</code>
<code>
value stored in 'name' attribute for the current feature
</code>
</li>
</ul>
</div>
<h3 id="record-and-attributes-attributes"><a href="#record-and-attributes-attributes-idx">
Variant 2
</a></h3>
<div class="description">
Allows the target feature to be specified.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
attributes
</span>
(
<span class="argument">
feature
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
feature
</td>
<td>
a feature
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
attributes( @atlas_feature )['name']
</code>
<code>
value stored in 'name' attribute for the current atlas feature
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="record-and-attributes-get_feature"><a href="#record-and-attributes-get_feature-idx">
function get_feature
</a></h3>
<div class="description">
<p>
Returns the first feature of a layer matching a given attribute value.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
get_feature
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
attribute
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
layer name or ID
</td>
</tr>
<tr>
<td class="argument">
attribute
</td>
<td>
attribute name
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
attribute value to match
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
get_feature('streets','name','main st')
</code>
<code>
first feature found in "streets" layer with "main st" value in the "name" field
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="record-and-attributes-get_feature_by_id"><a href="#record-and-attributes-get_feature_by_id-idx">
function get_feature_by_id
</a></h3>
<div class="description">
<p>
Returns the feature with an id on a layer.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
get_feature_by_id
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
feature_id
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
layer, layer name or layer id
</td>
</tr>
<tr>
<td class="argument">
feature_id
</td>
<td>
the id of the feature which should be returned
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
get_feature('streets', 1)
</code>
<code>
the feature with the id 1 on the layer "streets"
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="record-and-attributes-is_selected"><a href="#record-and-attributes-is_selected-idx">
function is_selected
</a></h3>
<div class="description">
<p>
Returns if a feature is selected. If called with no parameters checks the current feature.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_selected
</span>
([
<span class="argument">
feature=current feature
</span>
][,
<span class="argument">
layer=current layer
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
feature
</td>
<td>
The feature which should be checked for selection.
</td>
</tr>
<tr>
<td class="argument">
layer
</td>
<td>
The layer (or its id or name) on which the selection will be checked.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
is_selected()
</code>
<code>
True if the current feature is selected.
</code>
</li>
<li>
<code>
is_selected(get_feature('streets', 'name', "street_name"), 'streets')
</code>
<code>
True if the current building's street is selected.
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="record-and-attributes-num_selected"><a href="#record-and-attributes-num_selected-idx">
function num_selected
</a></h3>
<div class="description">
<p>
Returns the number of selected features on a given layer. By default works on the layer on which the expression is evaluated.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
num_selected
</span>
([
<span class="argument">
layer=current layer
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
The layer (or its id or name) on which the selection will be checked.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
num_selected()
</code>
<code>
The number of selected features on the current layer.
</code>
</li>
<li>
<code>
num_selected('streets')
</code>
<code>
The number of selected features on the layer streets
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="record-and-attributes-represent_value"><a href="#record-and-attributes-represent_value-idx">
function represent_value
</a></h3>
<div class="description">
<p>
Returns the configured representation value for a field value. It depends on the configured widget type. Often, this is useful for 'Value Map' widgets.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
represent_value
</span>
(
<span class="argument">
value
</span>
,
<span class="argument">
fieldName
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
The value which should be resolved. Most likely a field.
</td>
</tr>
<tr>
<td class="argument">
fieldName
</td>
<td>
The field name for which the widget configuration should be loaded. (Optional)
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
represent_value("field_with_value_map")
</code>
<code>
Description for value
</code>
</li>
<li>
<code>
represent_value('static value', 'field_name')
</code>
<code>
Description for static value
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="record-and-attributes-sqlite_fetch_and_increment"><a href="#record-and-attributes-sqlite_fetch_and_increment-idx">
function sqlite_fetch_and_increment
</a></h3>
<div class="description">
<p>
Manage autoincrementing values in sqlite databases.
<p>
SQlite default values can only be applied on insert and not prefetched.
</p>
<p>
This makes it impossible to acquire an incremented primary key via AUTO_INCREMENT before creating the row in the database. Sidenote: with postgres, this works via the option
<i>
evaluate default values
</i>
.
</p>
<p>
When adding new features with relations, it is really nice to be able to already add children for a parent, while the parents form is still open and hence the parent feature uncommitted.
</p>
<p>
To get around this limitation, this function can be used to manage sequence values in a separate table on sqlite based formats like gpkg.
</p>
<p>
The sequence table will be filtered for a sequence id (filter_attribute and filter_value) and the current value of the id_field will be incremented by 1 and the incremented value returned.
</p>
<p>
If additional columns require values to be specified, the default_value map can be used for this purpose.
</p>
<p>
<b>
Note
</b>
<br/>
This function modifies the target sqlite table. It is intended for usage with default value configurations for attributes.
</p>
<p>
When the database parameter is a layer and the layer is in transaction mode, the value will only be retrieved once during the lifetime of a transaction and cached and incremented. This makes it unsafe to work on the same database from several processes in parallel.
</p>
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
sqlite_fetch_and_increment
</span>
(
<span class="argument">
database
</span>
,
<span class="argument">
table
</span>
,
<span class="argument">
id_field
</span>
,
<span class="argument">
filter_attribute
</span>
,
<span class="argument">
filter_value
</span>
[,
<span class="argument">
default_values
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
database
</td>
<td>
Path to the sqlite file or geopackage layer
</td>
</tr>
<tr>
<td class="argument">
table
</td>
<td>
Name of the table that manages the sequences
</td>
</tr>
<tr>
<td class="argument">
id_field
</td>
<td>
Name of the field that contains the current value
</td>
</tr>
<tr>
<td class="argument">
filter_attribute
</td>
<td>
Name the field that contains a unique identifier for this sequence. Must have a UNIQUE index.
</td>
</tr>
<tr>
<td class="argument">
filter_value
</td>
<td>
Name of the sequence to use.
</td>
</tr>
<tr>
<td class="argument">
default_values
</td>
<td>
Map with default values for additional columns on the table. The values need to be fully quoted. Functions are allowed.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
sqlite_fetch_and_increment(@layer, 'sequence_table', 'last_unique_id', 'sequence_id', 'global', map('last_change','date(''now'')','user','''' || @user_account_name || ''''))
</code>
<code>
0
</code>
</li>
<li>
<code>
sqlite_fetch_and_increment(layer_property(@layer, 'path'), 'sequence_table', 'last_unique_id', 'sequence_id', 'global', map('last_change','date(''now'')','user','''' || @user_account_name || ''''))
</code>
<code>
0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="record-and-attributes-uuid"><a href="#record-and-attributes-uuid-idx">
function uuid
</a></h3>
<div class="description">
<p>
Generates a Universally Unique Identifier (UUID) for each row using the Qt
<a href="http://qt-project.org/doc/qt-4.8/quuid.html#createUuid">
QUuid::createUuid
</a>
method. Each UUID is 38 characters long.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
uuid
</span>
()
</code>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
uuid()
</code>
<code>
'{0bd2f60f-f157-4a6d-96af-d4ba4cb366a1}'
</code>
</li>
</ul>
</div>
</div></div>
<div id="string" class="group"><h2><a href="#string-idx">group string</a></h2>
<div class="description"><p>This group contains functions that operate on strings e.g replace, convert to upper case.</p></div></div>
<div class="function"><h3 id="string-char"><a href="#string-char-idx">
function char
</a></h3>
<div class="description">
<p>
Returns the character associated with a unicode code.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
char
</span>
(
<span class="argument">
code
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
code
</td>
<td>
a unicode code number
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
char(81)
</code>
<code>
'Q'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-concat"><a href="#string-concat-idx">
function concat
</a></h3>
<div class="description">
<p>
Concatenates several strings to one. NULL values are converted to empty strings. Other values (like numbers) are converted to strings.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
concat
</span>
(
<span class="argument">
string1
</span>
,
<span class="argument">
string2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
a string value
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
concat('sun', 'set')
</code>
<code>
'sunset'
</code>
</li>
<li>
<code>
concat('a','b','c','d','e')
</code>
<code>
'abcde'
</code>
</li>
<li>
<code>
concat('Anno ', 1984)
</code>
<code>
'Anno 1984'
</code>
</li>
<li>
<code>
concat('The Wall', NULL)
</code>
<code>
'The Wall'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-format"><a href="#string-format-idx">
function format
</a></h3>
<div class="description">
<p>
Format a string using supplied arguments.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
format
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
arg1
</span>
,
<span class="argument">
arg2
</span>
…)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
A string with place holders for the arguments. Use %1, %2, etc for placeholders. Placeholders can be repeated.
</td>
</tr>
<tr>
<td class="argument">
arg
</td>
<td>
any type. Any number of arguments.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
format('This %1 a %2','is', 'test')
</code>
<code>
'This is a test''
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-format_date"><a href="#string-format_date-idx">
function format_date
</a></h3>
<div class="description">
<p>
Formats a date type or string into a custom string format. Uses Qt date/time format strings. See
<a href="https://doc.qt.io/qt-5/qdatetime.html#toString">
QDateTime::toString
</a>
.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
format_date
</span>
(
<span class="argument">
datetime
</span>
,
<span class="argument">
format
</span>
[,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
datetime
</td>
<td>
date, time or datetime value
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
String template used to format the string.
<table>
<thead>
<tr>
<th>
Expression
</th>
<th>
Output
</th>
</tr>
</thead>
<tr valign="top">
<td>
d
</td>
<td>
the day as number without a leading zero (1 to 31)
</td>
</tr>
<tr valign="top">
<td>
dd
</td>
<td>
the day as number with a leading zero (01 to 31)
</td>
</tr>
<tr valign="top">
<td>
ddd
</td>
<td>
the abbreviated localized day name (e.g. 'Mon' to 'Sun')
</td>
</tr>
<tr valign="top">
<td>
dddd
</td>
<td>
the long localized day name (e.g. 'Monday' to 'Sunday')
</td>
</tr>
<tr valign="top">
<td>
M
</td>
<td>
the month as number without a leading zero (1-12)
</td>
</tr>
<tr valign="top">
<td>
MM
</td>
<td>
the month as number with a leading zero (01-12)
</td>
</tr>
<tr valign="top">
<td>
MMM
</td>
<td>
the abbreviated localized month name (e.g. 'Jan' to 'Dec')
</td>
</tr>
<tr valign="top">
<td>
MMMM
</td>
<td>
the long localized month name (e.g. 'January' to 'December')
</td>
</tr>
<tr valign="top">
<td>
yy
</td>
<td>
the year as two digit number (00-99)
</td>
</tr>
<tr valign="top">
<td>
yyyy
</td>
<td>
the year as four digit number
</td>
</tr>
</table>
<p>
These expressions may be used for the time part of the format string:
</p>
<table>
<thead>
<tr>
<th>
Expression
</th>
<th>
Output
</th>
</tr>
</thead>
<tr valign="top">
<td>
h
</td>
<td>
the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
hh
</td>
<td>
the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
H
</td>
<td>
the hour without a leading zero (0 to 23, even with AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
HH
</td>
<td>
the hour with a leading zero (00 to 23, even with AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
m
</td>
<td>
the minute without a leading zero (0 to 59)
</td>
</tr>
<tr valign="top">
<td>
mm
</td>
<td>
the minute with a leading zero (00 to 59)
</td>
</tr>
<tr valign="top">
<td>
s
</td>
<td>
the second without a leading zero (0 to 59)
</td>
</tr>
<tr valign="top">
<td>
ss
</td>
<td>
the second with a leading zero (00 to 59)
</td>
</tr>
<tr valign="top">
<td>
z
</td>
<td>
the milliseconds without trailing zeroes (0 to 999)
</td>
</tr>
<tr valign="top">
<td>
zzz
</td>
<td>
the milliseconds with trailing zeroes (000 to 999)
</td>
</tr>
<tr valign="top">
<td>
AP or A
</td>
<td>
interpret as an AM/PM time.
<i>
AP
</i>
must be either "AM" or "PM".
</td>
</tr>
<tr valign="top">
<td>
ap or a
</td>
<td>
Interpret as an AM/PM time.
<i>
ap
</i>
must be either "am" or "pm".
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
language (lowercase, two- or three-letter, ISO 639 language code) used to format the date into a custom string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
format_date('2012-05-15','dd.MM.yyyy')
</code>
<code>
'15.05.2012'
</code>
</li>
<li>
<code>
format_date('2012-05-15','d MMMM yyyy','fr')
</code>
<code>
'15 juin 2012'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-format_number"><a href="#string-format_number-idx">
function format_number
</a></h3>
<div class="description">
<p>
Returns a number formatted with the locale separator for thousands. Also truncates the number to the number of supplied places.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
format_number
</span>
(
<span class="argument">
number
</span>
,
<span class="argument">
places
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
number
</td>
<td>
number to be formatted
</td>
</tr>
<tr>
<td class="argument">
places
</td>
<td>
integer representing the number of decimal places to truncate the string to.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
format_number(10000000.332,2)
</code>
<code>
'10,000,000.33'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-left"><a href="#string-left-idx">
function left
</a></h3>
<div class="description">
<p>
Returns a substring that contains the
<i>
n
</i>
leftmost characters of the string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
left
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
length
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
a string
</td>
</tr>
<tr>
<td class="argument">
length
</td>
<td>
integer. The number of characters from the left of the string to return.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
left('Hello World',5)
</code>
<code>
'Hello'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-length"><a href="#string-length-idx">
function length
</a></h3>
<div class="description">
<p>
Returns the number of characters in a string or the length of a geometry linestring.
</p>
</div>
<h3 id="string-length"><a href="#string-length-idx">
String variant
</a></h3>
<div class="description">
Returns the number of characters in a string.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
length
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string to count length of
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
length('hello')
</code>
<code>
5
</code>
</li>
</ul>
</div>
<h3 id="string-length"><a href="#string-length-idx">
Geometry variant
</a></h3>
<div class="description">
Calculate the length of a geometry line object. Calculations are always planimetric in the Spatial Reference System (SRS) of this geometry, and the units of the returned length will match the units for the SRS. This differs from the calculations performed by the $length function, which will perform ellipsoidal calculations based on the project's ellipsoid and distance unit settings.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
length
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
line geometry object
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
length(geom_from_wkt('LINESTRING(0 0, 4 0)'))
</code>
<code>
4.0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-lower"><a href="#string-lower-idx">
function lower
</a></h3>
<div class="description">
<p>
Converts a string to lower case letters.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
lower
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to convert to lower case
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
lower('HELLO World')
</code>
<code>
'hello world'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-lpad"><a href="#string-lpad-idx">
function lpad
</a></h3>
<div class="description">
<p>
Returns a string padded on the left to the specified width, using a fill character. If the target width is smaller than the string's length, the string is truncated.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
lpad
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
width
</span>
,
<span class="argument">
fill
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string to pad
</td>
</tr>
<tr>
<td class="argument">
width
</td>
<td>
length of new string
</td>
</tr>
<tr>
<td class="argument">
fill
</td>
<td>
character to pad the remaining space with
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
lpad('Hello', 10, 'x')
</code>
<code>
'xxxxxHello'
</code>
</li>
<li>
<code>
lpad('Hello', 3, 'x')
</code>
<code>
'Hel'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-regexp_match"><a href="#string-regexp_match-idx">
function regexp_match
</a></h3>
<div class="description">
<p>
Return the first matching position matching a regular expression within a string, or 0 if the substring is not found.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
regexp_match
</span>
(
<span class="argument">
input_string
</span>
,
<span class="argument">
regex
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
input_string
</td>
<td>
the string to test against the regular expression
</td>
</tr>
<tr>
<td class="argument">
regex
</td>
<td>
The regular expression to test against. Backslash characters must be double escaped (e.g., "\\s" to match a white space character).
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
regexp_match('QGIS ROCKS','\\sROCKS')
</code>
<code>
4
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-regexp_replace"><a href="#string-regexp_replace-idx">
function regexp_replace
</a></h3>
<div class="description">
<p>
Returns a string with the supplied regular expression replaced.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
regexp_replace
</span>
(
<span class="argument">
input_string
</span>
,
<span class="argument">
regex
</span>
,
<span class="argument">
replacement
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
input_string
</td>
<td>
the string to replace matches in
</td>
</tr>
<tr>
<td class="argument">
regex
</td>
<td>
The regular expression to replace. Backslash characters must be double escaped (e.g., "\\s" to match a white space character).
</td>
</tr>
<tr>
<td class="argument">
replacement
</td>
<td>
The string that will replace any matching occurrences of the supplied regular expression. Captured groups can be inserted into the replacement string using \\1, \\2, etc.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
regexp_replace('QGIS SHOULD ROCK','\\sSHOULD\\s',' DOES ')
</code>
<code>
'QGIS DOES ROCK'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-regexp_substr"><a href="#string-regexp_substr-idx">
function regexp_substr
</a></h3>
<div class="description">
<p>
Returns the portion of a string which matches a supplied regular expression.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
regexp_substr
</span>
(
<span class="argument">
input_string
</span>
,
<span class="argument">
regex
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
input_string
</td>
<td>
the string to find matches in
</td>
</tr>
<tr>
<td class="argument">
regex
</td>
<td>
The regular expression to match against. Backslash characters must be double escaped (e.g., "\\s" to match a white space character).
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
regexp_substr('abc123','(\\d+)')
</code>
<code>
'123'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-replace"><a href="#string-replace-idx">
function replace
</a></h3>
<div class="description">
<p>
Returns a string with the supplied string, array, or map of strings replaced.
</p>
</div>
<h3 id="string-replace"><a href="#string-replace-idx">
String &amp; array variant
</a></h3>
<div class="description">
Returns a string with the supplied string or array of strings replaced by a string or an array of strings.
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
replace
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
before
</span>
,
<span class="argument">
after
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the input string
</td>
</tr>
<tr>
<td class="argument">
before
</td>
<td>
the string or array of strings to replace
</td>
</tr>
<tr>
<td class="argument">
after
</td>
<td>
the string or array of strings to use as a replacement
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
replace('QGIS SHOULD ROCK','SHOULD','DOES')
</code>
<code>
'QGIS DOES ROCK'
</code>
</li>
<li>
<code>
replace('QGIS ABC',array('A','B','C'),array('X','Y','Z'))
</code>
<code>
'QGIS XYZ'
</code>
</li>
<li>
<code>
replace('QGIS',array('Q','S'),'')
</code>
<code>
'GI'
</code>
</li>
</ul>
</div>
<h3 id="string-replace"><a href="#string-replace-idx">
Map variant
</a></h3>
<div class="description">
Returns a string with the supplied map keys replaced by paired values.
</div>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
replace
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
map
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the input string
</td>
</tr>
<tr>
<td class="argument">
map
</td>
<td>
the map containing keys and values
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
replace('APP SHOULD ROCK',map('APP','QGIS','SHOULD','DOES'))
</code>
<code>
'QGIS DOES ROCK'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-right"><a href="#string-right-idx">
function right
</a></h3>
<div class="description">
<p>
Returns a substring that contains the
<i>
n
</i>
rightmost characters of the string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
right
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
length
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
a string
</td>
</tr>
<tr>
<td class="argument">
length
</td>
<td>
integer. The number of characters from the right of the string to return.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
right('Hello World',5)
</code>
<code>
'World'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-rpad"><a href="#string-rpad-idx">
function rpad
</a></h3>
<div class="description">
<p>
Returns a string padded on the right to the specified width, using a fill character. If the target width is smaller than the string's length, the string is truncated.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
rpad
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
width
</span>
,
<span class="argument">
fill
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string to pad
</td>
</tr>
<tr>
<td class="argument">
width
</td>
<td>
length of new string
</td>
</tr>
<tr>
<td class="argument">
fill
</td>
<td>
character to pad the remaining space with
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
rpad('Hello', 10, 'x')
</code>
<code>
'Helloxxxxx'
</code>
</li>
<li>
<code>
rpad('Hello', 3, 'x')
</code>
<code>
'Hel'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-strpos"><a href="#string-strpos-idx">
function strpos
</a></h3>
<div class="description">
<p>
Return the first matching position of a substring within another string, or 0 if the substring is not found.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
strpos
</span>
(
<span class="argument">
haystack
</span>
,
<span class="argument">
needle
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
haystack
</td>
<td>
string that is to be searched
</td>
</tr>
<tr>
<td class="argument">
needle
</td>
<td>
string to search for
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
strpos('HELLO WORLD','WORLD')
</code>
<code>
7
</code>
</li>
<li>
<code>
strpos('HELLO WORLD','GOODBYE')
</code>
<code>
0
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-substr"><a href="#string-substr-idx">
function substr
</a></h3>
<div class="description">
<p>
Returns a part of a string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
substr
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
start
</span>
[,
<span class="argument">
length
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the full input string
</td>
</tr>
<tr>
<td class="argument">
start
</td>
<td>
integer representing start position to extract beginning with 1; if start is negative, the return string will begin at the end of the string minus the start value
</td>
</tr>
<tr>
<td class="argument">
length
</td>
<td>
integer representing length of string to extract; if length is negative, the return string will omit the given length of characters from the end of the string
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
substr('HELLO WORLD',3,5)
</code>
<code>
'LLO W'
</code>
</li>
<li>
<code>
substr('HELLO WORLD',6)
</code>
<code>
' WORLD'
</code>
</li>
<li>
<code>
substr('HELLO WORLD',-5)
</code>
<code>
'WORLD'
</code>
</li>
<li>
<code>
substr('HELLO',3,-1)
</code>
<code>
'LL'
</code>
</li>
<li>
<code>
substr('HELLO WORLD',-5,2)
</code>
<code>
'WO'
</code>
</li>
<li>
<code>
substr('HELLO WORLD',-5,-1)
</code>
<code>
'WORL'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-title"><a href="#string-title-idx">
function title
</a></h3>
<div class="description">
<p>
Converts all words of a string to title case (all words lower case with leading capital letter).
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
title
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to convert to title case
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
title('hello WOrld')
</code>
<code>
'Hello World'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-to_string"><a href="#string-to_string-idx">
function to_string
</a></h3>
<div class="description">
<p>
Converts a number to string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_string
</span>
(
<span class="argument">
number
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
number
</td>
<td>
Integer or real value. The number to convert to string.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
to_string(123)
</code>
<code>
'123'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-trim"><a href="#string-trim-idx">
function trim
</a></h3>
<div class="description">
<p>
Removes all leading and trailing whitespace (spaces, tabs, etc) from a string.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
trim
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
string to trim
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
trim(' hello world ')
</code>
<code>
'hello world'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-upper"><a href="#string-upper-idx">
function upper
</a></h3>
<div class="description">
<p>
Converts a string to upper case letters.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
upper
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to convert to upper case
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
upper('hello WOrld')
</code>
<code>
'HELLO WORLD'
</code>
</li>
</ul>
</div>
</div></div>
<div class="function"><h3 id="string-wordwrap"><a href="#string-wordwrap-idx">
function wordwrap
</a></h3>
<div class="description">
<p>
Returns a string wrapped to a maximum/minimum number of characters.
</p>
</div>
<h4>
Syntax
</h4>
<div class="syntax">
<code>
<span class="functionname">
wordwrap
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
wrap_length
</span>
[,
<span class="argument">
delimiter_string
</span>
])
</code>
<br/>
<br/>
[ ] marks optional components
<h4>
Arguments
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to be wrapped
</td>
</tr>
<tr>
<td class="argument">
wrap_length
</td>
<td>
an integer. If wrap_length is positive the number represents the ideal maximum number of characters to wrap; if negative, the number represents the minimum number of characters to wrap.
</td>
</tr>
<tr>
<td class="argument">
delimiter_string
</td>
<td>
Optional delimiter string to wrap to a new line.
</td>
</tr>
</table>
</div>
<h4>
Examples
</h4>
<div class="examples">
<ul>
<li>
<code>
wordwrap('UNIVERSITY OF QGIS',13)
</code>
<code>
'UNIVERSITY OF
<br/>
QGIS'
</code>
</li>
<li>
<code>
wordwrap('UNIVERSITY OF QGIS',-3)
</code>
<code>
'UNIVERSITY
<br/>
OF QGIS'
</code>
</li>
</ul>
</div>
</div></div>
This file has been truncated, but you can view the full file.
<style>
.overview{
font: 1.82em;
font-weight: bold;
}
body{
background: white;
color: black;
font-family: 'Lato', 'Ubuntu', 'Lucida Grande', 'Segoe UI', 'Arial', sans-serif;
width: 100%;
}
h1{
background-color: #F6F6F6;
color: #589632;
font-size: x-large;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 3em;
}
h2{
background-color: #F6F6F6;
color: #589632;
font-size: medium;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 1.1em;
}
h3{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: large;
text-align: left;
border-bottom: 5px solid #DCEB5C;
}
h4{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: medium;
text-align: left;
}
h5{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: small;
text-align: left;
}
a{
color: #729FCF;
font-family: arial,sans-serif;
}
label{
background-color: #FFFFCC;
border: 1px solid black;
margin: 1px;
padding: 0px 3px;
font-size: small;
}
th .strong {
font-weight: bold;
}
hr {
border: 0;
height: 0;
border-top: 1px solid black;
}
.list-view .highlight {
text-align: left;
border: 0px;
width: 20%;
padding-right: 15px;
padding-left: 20px;
font-weight: bold;
}
.tabular-view .odd-row {
background-color: #f9f9f9;
}
.section {
font-weight: bold;
padding-top:25px;
}
.tabular-view{
border-collapse: collapse;
width: 95%;
}
.tabular-view th, .tabular-view td {
border:10px solid black;
}
.overview{
font: 1.82em;
font-weight: bold;
}
body{
background: white;
color: black;
font-family: 'Lato', 'Ubuntu', 'Lucida Grande', 'Segoe UI', 'Arial', sans-serif;
width: 100%;
}
h1{
background-color: #F6F6F6;
color: #589632;
font-size: x-large;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 3em;
}
h2{
background-color: #F6F6F6;
color: #589632;
font-size: medium;
font-weight: normal;
background: none;
padding: 0.75em 0 0;
margin: 0;
line-height: 1.1em;
}
h3{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: large;
text-align: left;
border-bottom: 5px solid #DCEB5C;
}
h4{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: medium;
text-align: left;
}
h5{
background-color: #F6F6F6;
color: #93b023;
font-weight: bold;
font-size: small;
text-align: left;
}
a{
color: #729FCF;
font-family: arial,sans-serif;
}
label{
background-color: #FFFFCC;
border: 1px solid black;
margin: 1px;
padding: 0px 3px;
font-size: small;
}
th .strong {
font-weight: bold;
}
hr {
border: 0;
height: 0;
border-top: 1px solid black;
}
.list-view .highlight {
text-align: left;
border: 0px;
width: 20%;
padding-right: 15px;
padding-left: 20px;
font-weight: bold;
}
.tabular-view .odd-row {
background-color: #f9f9f9;
}
.section {
font-weight: bold;
padding-top:25px;
}
body {
margin-left: 50px;
}
.group {
margin-bottom: 30px;
}
.function {
margin-left: 20px;
}
</style>
<h1>Expressions documentation single page (locale es)</h1>
<a href="#aggregates"><h2 id="aggregates-idx">Agregados</h2></a><ul><li><a href="#aggregates-aggregate"><span id="aggregates-aggregate-idx">aggregate</span></a></li><li><a href="#aggregates-array_agg"><span id="aggregates-array_agg-idx">array_agg</span></a></li><li><a href="#aggregates-collect"><span id="aggregates-collect-idx">collect</span></a></li><li><a href="#aggregates-concatenate"><span id="aggregates-concatenate-idx">concatenate</span></a></li><li><a href="#aggregates-concatenate_unique"><span id="aggregates-concatenate_unique-idx">concatenate_unique</span></a></li><li><a href="#aggregates-count"><span id="aggregates-count-idx">count</span></a></li><li><a href="#aggregates-count_distinct"><span id="aggregates-count_distinct-idx">count_distinct</span></a></li><li><a href="#aggregates-count_missing"><span id="aggregates-count_missing-idx">count_missing</span></a></li><li><a href="#aggregates-iqr"><span id="aggregates-iqr-idx">iqr</span></a></li><li><a href="#aggregates-majority"><span id="aggregates-majority-idx">majority</span></a></li><li><a href="#aggregates-max_length"><span id="aggregates-max_length-idx">max_length</span></a></li><li><a href="#aggregates-maximum"><span id="aggregates-maximum-idx">maximum</span></a></li><li><a href="#aggregates-mean"><span id="aggregates-mean-idx">mean</span></a></li><li><a href="#aggregates-median"><span id="aggregates-median-idx">median</span></a></li><li><a href="#aggregates-min_length"><span id="aggregates-min_length-idx">min_length</span></a></li><li><a href="#aggregates-minimum"><span id="aggregates-minimum-idx">minimum</span></a></li><li><a href="#aggregates-minority"><span id="aggregates-minority-idx">minority</span></a></li><li><a href="#aggregates-q1"><span id="aggregates-q1-idx">q1</span></a></li><li><a href="#aggregates-q3"><span id="aggregates-q3-idx">q3</span></a></li><li><a href="#aggregates-range"><span id="aggregates-range-idx">range</span></a></li><li><a href="#aggregates-relation_aggregate"><span id="aggregates-relation_aggregate-idx">relation_aggregate</span></a></li><li><a href="#aggregates-stdev"><span id="aggregates-stdev-idx">stdev</span></a></li><li><a href="#aggregates-sum"><span id="aggregates-sum-idx">sum</span></a></li></ul><a href="#arrays"><h2 id="arrays-idx">Matrices</h2></a><ul><li><a href="#arrays-array"><span id="arrays-array-idx">array</span></a></li><li><a href="#arrays-array_all"><span id="arrays-array_all-idx">array_all</span></a></li><li><a href="#arrays-array_append"><span id="arrays-array_append-idx">array_append</span></a></li><li><a href="#arrays-array_cat"><span id="arrays-array_cat-idx">array_cat</span></a></li><li><a href="#arrays-array_contains"><span id="arrays-array_contains-idx">array_contains</span></a></li><li><a href="#arrays-array_distinct"><span id="arrays-array_distinct-idx">array_distinct</span></a></li><li><a href="#arrays-array_filter"><span id="arrays-array_filter-idx">array_filter</span></a></li><li><a href="#arrays-array_find"><span id="arrays-array_find-idx">array_find</span></a></li><li><a href="#arrays-array_first"><span id="arrays-array_first-idx">array_first</span></a></li><li><a href="#arrays-array_foreach"><span id="arrays-array_foreach-idx">array_foreach</span></a></li><li><a href="#arrays-array_get"><span id="arrays-array_get-idx">array_get</span></a></li><li><a href="#arrays-array_insert"><span id="arrays-array_insert-idx">array_insert</span></a></li><li><a href="#arrays-array_intersect"><span id="arrays-array_intersect-idx">array_intersect</span></a></li><li><a href="#arrays-array_last"><span id="arrays-array_last-idx">array_last</span></a></li><li><a href="#arrays-array_length"><span id="arrays-array_length-idx">array_length</span></a></li><li><a href="#arrays-array_prepend"><span id="arrays-array_prepend-idx">array_prepend</span></a></li><li><a href="#arrays-array_remove_all"><span id="arrays-array_remove_all-idx">array_remove_all</span></a></li><li><a href="#arrays-array_remove_at"><span id="arrays-array_remove_at-idx">array_remove_at</span></a></li><li><a href="#arrays-array_reverse"><span id="arrays-array_reverse-idx">array_reverse</span></a></li><li><a href="#arrays-array_slice"><span id="arrays-array_slice-idx">array_slice</span></a></li><li><a href="#arrays-array_sort"><span id="arrays-array_sort-idx">array_sort</span></a></li><li><a href="#arrays-array_to_string"><span id="arrays-array_to_string-idx">array_to_string</span></a></li><li><a href="#arrays-generate_series"><span id="arrays-generate_series-idx">generate_series</span></a></li><li><a href="#arrays-regexp_matches"><span id="arrays-regexp_matches-idx">regexp_matches</span></a></li><li><a href="#arrays-string_to_array"><span id="arrays-string_to_array-idx">string_to_array</span></a></li></ul><a href="#color"><h2 id="color-idx">Color</h2></a><ul><li><a href="#color-color_cmyk"><span id="color-color_cmyk-idx">color_cmyk</span></a></li><li><a href="#color-color_cmyka"><span id="color-color_cmyka-idx">color_cmyka</span></a></li><li><a href="#color-color_grayscale_average"><span id="color-color_grayscale_average-idx">color_grayscale_average</span></a></li><li><a href="#color-color_hsl"><span id="color-color_hsl-idx">color_hsl</span></a></li><li><a href="#color-color_hsla"><span id="color-color_hsla-idx">color_hsla</span></a></li><li><a href="#color-color_hsv"><span id="color-color_hsv-idx">color_hsv</span></a></li><li><a href="#color-color_hsva"><span id="color-color_hsva-idx">color_hsva</span></a></li><li><a href="#color-color_mix_rgb"><span id="color-color_mix_rgb-idx">color_mix_rgb</span></a></li><li><a href="#color-color_part"><span id="color-color_part-idx">color_part</span></a></li><li><a href="#color-color_rgb"><span id="color-color_rgb-idx">color_rgb</span></a></li><li><a href="#color-color_rgba"><span id="color-color_rgba-idx">color_rgba</span></a></li><li><a href="#color-create_ramp"><span id="color-create_ramp-idx">create_ramp</span></a></li><li><a href="#color-darker"><span id="color-darker-idx">darker</span></a></li><li><a href="#color-lighter"><span id="color-lighter-idx">lighter</span></a></li><li><a href="#color-project_color"><span id="color-project_color-idx">project_color</span></a></li><li><a href="#color-ramp_color"><span id="color-ramp_color-idx">ramp_color</span></a></li><li><a href="#color-set_color_part"><span id="color-set_color_part-idx">set_color_part</span></a></li></ul><a href="#conditionals"><h2 id="conditionals-idx">Condicionales</h2></a><ul><li><a href="#conditionals-coalesce"><span id="conditionals-coalesce-idx">coalesce</span></a></li><li><a href="#conditionals-if"><span id="conditionals-if-idx">if</span></a></li><li><a href="#conditionals-nullif"><span id="conditionals-nullif-idx">nullif</span></a></li><li><a href="#conditionals-regexp_match"><span id="conditionals-regexp_match-idx">regexp_match</span></a></li><li><a href="#conditionals-try"><span id="conditionals-try-idx">try</span></a></li></ul><a href="#conversions"><h2 id="conversions-idx">Conversiones</h2></a><ul><li><a href="#conversions-from_base64"><span id="conversions-from_base64-idx">from_base64</span></a></li><li><a href="#conversions-hash"><span id="conversions-hash-idx">hash</span></a></li><li><a href="#conversions-md5"><span id="conversions-md5-idx">md5</span></a></li><li><a href="#conversions-sha256"><span id="conversions-sha256-idx">sha256</span></a></li><li><a href="#conversions-to_base64"><span id="conversions-to_base64-idx">to_base64</span></a></li><li><a href="#conversions-to_date"><span id="conversions-to_date-idx">to_date</span></a></li><li><a href="#conversions-to_datetime"><span id="conversions-to_datetime-idx">to_datetime</span></a></li><li><a href="#conversions-to_dm"><span id="conversions-to_dm-idx">to_dm</span></a></li><li><a href="#conversions-to_dms"><span id="conversions-to_dms-idx">to_dms</span></a></li><li><a href="#conversions-to_int"><span id="conversions-to_int-idx">to_int</span></a></li><li><a href="#conversions-to_interval"><span id="conversions-to_interval-idx">to_interval</span></a></li><li><a href="#conversions-to_real"><span id="conversions-to_real-idx">to_real</span></a></li><li><a href="#conversions-to_string"><span id="conversions-to_string-idx">to_string</span></a></li><li><a href="#conversions-to_time"><span id="conversions-to_time-idx">to_time</span></a></li></ul><a href="#date-and-time"><h2 id="date-and-time-idx">Fecha y Hora</h2></a><ul><li><a href="#date-and-time-age"><span id="date-and-time-age-idx">age</span></a></li><li><a href="#date-and-time-datetime_from_epoch"><span id="date-and-time-datetime_from_epoch-idx">datetime_from_epoch</span></a></li><li><a href="#date-and-time-day"><span id="date-and-time-day-idx">day</span></a></li><li><a href="#date-and-time-day_of_week"><span id="date-and-time-day_of_week-idx">day_of_week</span></a></li><li><a href="#date-and-time-epoch"><span id="date-and-time-epoch-idx">epoch</span></a></li><li><a href="#date-and-time-format_date"><span id="date-and-time-format_date-idx">format_date</span></a></li><li><a href="#date-and-time-hour"><span id="date-and-time-hour-idx">hour</span></a></li><li><a href="#date-and-time-make_date"><span id="date-and-time-make_date-idx">make_date</span></a></li><li><a href="#date-and-time-make_datetime"><span id="date-and-time-make_datetime-idx">make_datetime</span></a></li><li><a href="#date-and-time-make_interval"><span id="date-and-time-make_interval-idx">make_interval</span></a></li><li><a href="#date-and-time-make_time"><span id="date-and-time-make_time-idx">make_time</span></a></li><li><a href="#date-and-time-minute"><span id="date-and-time-minute-idx">minute</span></a></li><li><a href="#date-and-time-month"><span id="date-and-time-month-idx">month</span></a></li><li><a href="#date-and-time-now"><span id="date-and-time-now-idx">now</span></a></li><li><a href="#date-and-time-second"><span id="date-and-time-second-idx">second</span></a></li><li><a href="#date-and-time-to_date"><span id="date-and-time-to_date-idx">to_date</span></a></li><li><a href="#date-and-time-to_datetime"><span id="date-and-time-to_datetime-idx">to_datetime</span></a></li><li><a href="#date-and-time-to_interval"><span id="date-and-time-to_interval-idx">to_interval</span></a></li><li><a href="#date-and-time-to_time"><span id="date-and-time-to_time-idx">to_time</span></a></li><li><a href="#date-and-time-week"><span id="date-and-time-week-idx">week</span></a></li><li><a href="#date-and-time-year"><span id="date-and-time-year-idx">year</span></a></li></ul><a href="#files-and-paths"><h2 id="files-and-paths-idx">Files and Paths</h2></a><ul><li><a href="#files-and-paths-base_file_name"><span id="files-and-paths-base_file_name-idx">base_file_name</span></a></li><li><a href="#files-and-paths-file_exists"><span id="files-and-paths-file_exists-idx">file_exists</span></a></li><li><a href="#files-and-paths-file_name"><span id="files-and-paths-file_name-idx">file_name</span></a></li><li><a href="#files-and-paths-file_path"><span id="files-and-paths-file_path-idx">file_path</span></a></li><li><a href="#files-and-paths-file_size"><span id="files-and-paths-file_size-idx">file_size</span></a></li><li><a href="#files-and-paths-file_suffix"><span id="files-and-paths-file_suffix-idx">file_suffix</span></a></li><li><a href="#files-and-paths-is_directory"><span id="files-and-paths-is_directory-idx">is_directory</span></a></li><li><a href="#files-and-paths-is_file"><span id="files-and-paths-is_file-idx">is_file</span></a></li></ul><a href="#form"><h2 id="form-idx">Formulario</h2></a><ul><li><a href="#form-current_parent_value"><span id="form-current_parent_value-idx">current_parent_value</span></a></li><li><a href="#form-current_value"><span id="form-current_value-idx">current_value</span></a></li></ul><a href="#fuzzy-matching"><h2 id="fuzzy-matching-idx">Concordancia aproximada</h2></a><ul><li><a href="#fuzzy-matching-hamming_distance"><span id="fuzzy-matching-hamming_distance-idx">hamming_distance</span></a></li><li><a href="#fuzzy-matching-levenshtein"><span id="fuzzy-matching-levenshtein-idx">levenshtein</span></a></li><li><a href="#fuzzy-matching-longest_common_substring"><span id="fuzzy-matching-longest_common_substring-idx">longest_common_substring</span></a></li><li><a href="#fuzzy-matching-soundex"><span id="fuzzy-matching-soundex-idx">soundex</span></a></li></ul><a href="#general"><h2 id="general-idx">General</h2></a><ul><li><a href="#general-env"><span id="general-env-idx">env</span></a></li><li><a href="#general-eval"><span id="general-eval-idx">eval</span></a></li><li><a href="#general-eval_template"><span id="general-eval_template-idx">eval_template</span></a></li><li><a href="#general-is_layer_visible"><span id="general-is_layer_visible-idx">is_layer_visible</span></a></li><li><a href="#general-layer_property"><span id="general-layer_property-idx">layer_property</span></a></li><li><a href="#general-var"><span id="general-var-idx">var</span></a></li><li><a href="#general-with_variable"><span id="general-with_variable-idx">with_variable</span></a></li></ul><a href="#geometrygroup"><h2 id="geometrygroup-idx">Geometría</h2></a><ul><li><a href="#geometrygroup-dollar-area"><span id="geometrygroup-dollar-area-idx">$area</span></a></li><li><a href="#geometrygroup-dollar-geometry"><span id="geometrygroup-dollar-geometry-idx">$geometry</span></a></li><li><a href="#geometrygroup-dollar-length"><span id="geometrygroup-dollar-length-idx">$length</span></a></li><li><a href="#geometrygroup-dollar-perimeter"><span id="geometrygroup-dollar-perimeter-idx">$perimeter</span></a></li><li><a href="#geometrygroup-dollar-x"><span id="geometrygroup-dollar-x-idx">$x</span></a></li><li><a href="#geometrygroup-dollar-x_at"><span id="geometrygroup-dollar-x_at-idx">$x_at</span></a></li><li><a href="#geometrygroup-dollar-y"><span id="geometrygroup-dollar-y-idx">$y</span></a></li><li><a href="#geometrygroup-dollar-y_at"><span id="geometrygroup-dollar-y_at-idx">$y_at</span></a></li><li><a href="#geometrygroup-angle_at_vertex"><span id="geometrygroup-angle_at_vertex-idx">angle_at_vertex</span></a></li><li><a href="#geometrygroup-area"><span id="geometrygroup-area-idx">area</span></a></li><li><a href="#geometrygroup-azimuth"><span id="geometrygroup-azimuth-idx">azimuth</span></a></li><li><a href="#geometrygroup-boundary"><span id="geometrygroup-boundary-idx">boundary</span></a></li><li><a href="#geometrygroup-bounds"><span id="geometrygroup-bounds-idx">bounds</span></a></li><li><a href="#geometrygroup-bounds_height"><span id="geometrygroup-bounds_height-idx">bounds_height</span></a></li><li><a href="#geometrygroup-bounds_width"><span id="geometrygroup-bounds_width-idx">bounds_width</span></a></li><li><a href="#geometrygroup-buffer"><span id="geometrygroup-buffer-idx">buffer</span></a></li><li><a href="#geometrygroup-buffer_by_m"><span id="geometrygroup-buffer_by_m-idx">buffer_by_m</span></a></li><li><a href="#geometrygroup-centroid"><span id="geometrygroup-centroid-idx">centroid</span></a></li><li><a href="#geometrygroup-close_line"><span id="geometrygroup-close_line-idx">close_line</span></a></li><li><a href="#geometrygroup-closest_point"><span id="geometrygroup-closest_point-idx">closest_point</span></a></li><li><a href="#geometrygroup-collect_geometries"><span id="geometrygroup-collect_geometries-idx">collect_geometries</span></a></li><li><a href="#geometrygroup-combine"><span id="geometrygroup-combine-idx">combine</span></a></li><li><a href="#geometrygroup-contains"><span id="geometrygroup-contains-idx">contains</span></a></li><li><a href="#geometrygroup-convex_hull"><span id="geometrygroup-convex_hull-idx">convex_hull</span></a></li><li><a href="#geometrygroup-crosses"><span id="geometrygroup-crosses-idx">crosses</span></a></li><li><a href="#geometrygroup-difference"><span id="geometrygroup-difference-idx">difference</span></a></li><li><a href="#geometrygroup-disjoint"><span id="geometrygroup-disjoint-idx">disjoint</span></a></li><li><a href="#geometrygroup-distance"><span id="geometrygroup-distance-idx">distance</span></a></li><li><a href="#geometrygroup-distance_to_vertex"><span id="geometrygroup-distance_to_vertex-idx">distance_to_vertex</span></a></li><li><a href="#geometrygroup-end_point"><span id="geometrygroup-end_point-idx">end_point</span></a></li><li><a href="#geometrygroup-extend"><span id="geometrygroup-extend-idx">extend</span></a></li><li><a href="#geometrygroup-exterior_ring"><span id="geometrygroup-exterior_ring-idx">exterior_ring</span></a></li><li><a href="#geometrygroup-extrude"><span id="geometrygroup-extrude-idx">extrude</span></a></li><li><a href="#geometrygroup-flip_coordinates"><span id="geometrygroup-flip_coordinates-idx">flip_coordinates</span></a></li><li><a href="#geometrygroup-force_rhr"><span id="geometrygroup-force_rhr-idx">force_rhr</span></a></li><li><a href="#geometrygroup-geom_from_gml"><span id="geometrygroup-geom_from_gml-idx">geom_from_gml</span></a></li><li><a href="#geometrygroup-geom_from_wkb"><span id="geometrygroup-geom_from_wkb-idx">geom_from_wkb</span></a></li><li><a href="#geometrygroup-geom_from_wkt"><span id="geometrygroup-geom_from_wkt-idx">geom_from_wkt</span></a></li><li><a href="#geometrygroup-geom_to_wkb"><span id="geometrygroup-geom_to_wkb-idx">geom_to_wkb</span></a></li><li><a href="#geometrygroup-geom_to_wkt"><span id="geometrygroup-geom_to_wkt-idx">geom_to_wkt</span></a></li><li><a href="#geometrygroup-geometry"><span id="geometrygroup-geometry-idx">geometry</span></a></li><li><a href="#geometrygroup-geometry_n"><span id="geometrygroup-geometry_n-idx">geometry_n</span></a></li><li><a href="#geometrygroup-hausdorff_distance"><span id="geometrygroup-hausdorff_distance-idx">hausdorff_distance</span></a></li><li><a href="#geometrygroup-inclination"><span id="geometrygroup-inclination-idx">inclination</span></a></li><li><a href="#geometrygroup-interior_ring_n"><span id="geometrygroup-interior_ring_n-idx">interior_ring_n</span></a></li><li><a href="#geometrygroup-intersection"><span id="geometrygroup-intersection-idx">intersection</span></a></li><li><a href="#geometrygroup-intersects"><span id="geometrygroup-intersects-idx">intersects</span></a></li><li><a href="#geometrygroup-intersects_bbox"><span id="geometrygroup-intersects_bbox-idx">intersects_bbox</span></a></li><li><a href="#geometrygroup-is_closed"><span id="geometrygroup-is_closed-idx">is_closed</span></a></li><li><a href="#geometrygroup-is_empty"><span id="geometrygroup-is_empty-idx">is_empty</span></a></li><li><a href="#geometrygroup-is_empty_or_null"><span id="geometrygroup-is_empty_or_null-idx">is_empty_or_null</span></a></li><li><a href="#geometrygroup-is_multipart"><span id="geometrygroup-is_multipart-idx">is_multipart</span></a></li><li><a href="#geometrygroup-is_valid"><span id="geometrygroup-is_valid-idx">is_valid</span></a></li><li><a href="#geometrygroup-length"><span id="geometrygroup-length-idx">length</span></a></li><li><a href="#geometrygroup-line_interpolate_angle"><span id="geometrygroup-line_interpolate_angle-idx">line_interpolate_angle</span></a></li><li><a href="#geometrygroup-line_interpolate_point"><span id="geometrygroup-line_interpolate_point-idx">line_interpolate_point</span></a></li><li><a href="#geometrygroup-line_locate_point"><span id="geometrygroup-line_locate_point-idx">line_locate_point</span></a></li><li><a href="#geometrygroup-line_merge"><span id="geometrygroup-line_merge-idx">line_merge</span></a></li><li><a href="#geometrygroup-line_substring"><span id="geometrygroup-line_substring-idx">line_substring</span></a></li><li><a href="#geometrygroup-m"><span id="geometrygroup-m-idx">m</span></a></li><li><a href="#geometrygroup-m_max"><span id="geometrygroup-m_max-idx">m_max</span></a></li><li><a href="#geometrygroup-m_min"><span id="geometrygroup-m_min-idx">m_min</span></a></li><li><a href="#geometrygroup-make_circle"><span id="geometrygroup-make_circle-idx">make_circle</span></a></li><li><a href="#geometrygroup-make_ellipse"><span id="geometrygroup-make_ellipse-idx">make_ellipse</span></a></li><li><a href="#geometrygroup-make_line"><span id="geometrygroup-make_line-idx">make_line</span></a></li><li><a href="#geometrygroup-make_point"><span id="geometrygroup-make_point-idx">make_point</span></a></li><li><a href="#geometrygroup-make_point_m"><span id="geometrygroup-make_point_m-idx">make_point_m</span></a></li><li><a href="#geometrygroup-make_polygon"><span id="geometrygroup-make_polygon-idx">make_polygon</span></a></li><li><a href="#geometrygroup-make_rectangle_3points"><span id="geometrygroup-make_rectangle_3points-idx">make_rectangle_3points</span></a></li><li><a href="#geometrygroup-make_regular_polygon"><span id="geometrygroup-make_regular_polygon-idx">make_regular_polygon</span></a></li><li><a href="#geometrygroup-make_square"><span id="geometrygroup-make_square-idx">make_square</span></a></li><li><a href="#geometrygroup-make_triangle"><span id="geometrygroup-make_triangle-idx">make_triangle</span></a></li><li><a href="#geometrygroup-minimal_circle"><span id="geometrygroup-minimal_circle-idx">minimal_circle</span></a></li><li><a href="#geometrygroup-nodes_to_points"><span id="geometrygroup-nodes_to_points-idx">nodes_to_points</span></a></li><li><a href="#geometrygroup-num_geometries"><span id="geometrygroup-num_geometries-idx">num_geometries</span></a></li><li><a href="#geometrygroup-num_interior_rings"><span id="geometrygroup-num_interior_rings-idx">num_interior_rings</span></a></li><li><a href="#geometrygroup-num_points"><span id="geometrygroup-num_points-idx">num_points</span></a></li><li><a href="#geometrygroup-num_rings"><span id="geometrygroup-num_rings-idx">num_rings</span></a></li><li><a href="#geometrygroup-offset_curve"><span id="geometrygroup-offset_curve-idx">offset_curve</span></a></li><li><a href="#geometrygroup-order_parts"><span id="geometrygroup-order_parts-idx">order_parts</span></a></li><li><a href="#geometrygroup-oriented_bbox"><span id="geometrygroup-oriented_bbox-idx">oriented_bbox</span></a></li><li><a href="#geometrygroup-overlaps"><span id="geometrygroup-overlaps-idx">overlaps</span></a></li><li><a href="#geometrygroup-perimeter"><span id="geometrygroup-perimeter-idx">perimeter</span></a></li><li><a href="#geometrygroup-point_n"><span id="geometrygroup-point_n-idx">point_n</span></a></li><li><a href="#geometrygroup-point_on_surface"><span id="geometrygroup-point_on_surface-idx">point_on_surface</span></a></li><li><a href="#geometrygroup-pole_of_inaccessibility"><span id="geometrygroup-pole_of_inaccessibility-idx">pole_of_inaccessibility</span></a></li><li><a href="#geometrygroup-project"><span id="geometrygroup-project-idx">project</span></a></li><li><a href="#geometrygroup-relate"><span id="geometrygroup-relate-idx">relate</span></a></li><li><a href="#geometrygroup-reverse"><span id="geometrygroup-reverse-idx">reverse</span></a></li><li><a href="#geometrygroup-rotate"><span id="geometrygroup-rotate-idx">rotate</span></a></li><li><a href="#geometrygroup-segments_to_lines"><span id="geometrygroup-segments_to_lines-idx">segments_to_lines</span></a></li><li><a href="#geometrygroup-shortest_line"><span id="geometrygroup-shortest_line-idx">shortest_line</span></a></li><li><a href="#geometrygroup-simplify"><span id="geometrygroup-simplify-idx">simplify</span></a></li><li><a href="#geometrygroup-simplify_vw"><span id="geometrygroup-simplify_vw-idx">simplify_vw</span></a></li><li><a href="#geometrygroup-single_sided_buffer"><span id="geometrygroup-single_sided_buffer-idx">single_sided_buffer</span></a></li><li><a href="#geometrygroup-smooth"><span id="geometrygroup-smooth-idx">smooth</span></a></li><li><a href="#geometrygroup-start_point"><span id="geometrygroup-start_point-idx">start_point</span></a></li><li><a href="#geometrygroup-sym_difference"><span id="geometrygroup-sym_difference-idx">sym_difference</span></a></li><li><a href="#geometrygroup-tapered_buffer"><span id="geometrygroup-tapered_buffer-idx">tapered_buffer</span></a></li><li><a href="#geometrygroup-touches"><span id="geometrygroup-touches-idx">touches</span></a></li><li><a href="#geometrygroup-transform"><span id="geometrygroup-transform-idx">transform</span></a></li><li><a href="#geometrygroup-translate"><span id="geometrygroup-translate-idx">translate</span></a></li><li><a href="#geometrygroup-union"><span id="geometrygroup-union-idx">union</span></a></li><li><a href="#geometrygroup-wedge_buffer"><span id="geometrygroup-wedge_buffer-idx">wedge_buffer</span></a></li><li><a href="#geometrygroup-within"><span id="geometrygroup-within-idx">within</span></a></li><li><a href="#geometrygroup-x"><span id="geometrygroup-x-idx">x</span></a></li><li><a href="#geometrygroup-x_max"><span id="geometrygroup-x_max-idx">x_max</span></a></li><li><a href="#geometrygroup-x_min"><span id="geometrygroup-x_min-idx">x_min</span></a></li><li><a href="#geometrygroup-y"><span id="geometrygroup-y-idx">y</span></a></li><li><a href="#geometrygroup-y_max"><span id="geometrygroup-y_max-idx">y_max</span></a></li><li><a href="#geometrygroup-y_min"><span id="geometrygroup-y_min-idx">y_min</span></a></li><li><a href="#geometrygroup-z"><span id="geometrygroup-z-idx">z</span></a></li><li><a href="#geometrygroup-z_max"><span id="geometrygroup-z_max-idx">z_max</span></a></li><li><a href="#geometrygroup-z_min"><span id="geometrygroup-z_min-idx">z_min</span></a></li></ul><a href="#layout"><h2 id="layout-idx">Diseño</h2></a><ul><li><a href="#layout-item_variables"><span id="layout-item_variables-idx">item_variables</span></a></li></ul><a href="#map-layers"><h2 id="map-layers-idx">Capas de mapa</h2></a><ul><li><a href="#map-layers-decode_uri"><span id="map-layers-decode_uri-idx">decode_uri</span></a></li></ul><a href="#maps"><h2 id="maps-idx">Mapas</h2></a><ul><li><a href="#maps-from_json"><span id="maps-from_json-idx">from_json</span></a></li><li><a href="#maps-hstore_to_map"><span id="maps-hstore_to_map-idx">hstore_to_map</span></a></li><li><a href="#maps-json_to_map"><span id="maps-json_to_map-idx">json_to_map</span></a></li><li><a href="#maps-map"><span id="maps-map-idx">map</span></a></li><li><a href="#maps-map_akeys"><span id="maps-map_akeys-idx">map_akeys</span></a></li><li><a href="#maps-map_avals"><span id="maps-map_avals-idx">map_avals</span></a></li><li><a href="#maps-map_concat"><span id="maps-map_concat-idx">map_concat</span></a></li><li><a href="#maps-map_delete"><span id="maps-map_delete-idx">map_delete</span></a></li><li><a href="#maps-map_exist"><span id="maps-map_exist-idx">map_exist</span></a></li><li><a href="#maps-map_get"><span id="maps-map_get-idx">map_get</span></a></li><li><a href="#maps-map_insert"><span id="maps-map_insert-idx">map_insert</span></a></li><li><a href="#maps-map_to_hstore"><span id="maps-map_to_hstore-idx">map_to_hstore</span></a></li><li><a href="#maps-map_to_json"><span id="maps-map_to_json-idx">map_to_json</span></a></li><li><a href="#maps-to_json"><span id="maps-to_json-idx">to_json</span></a></li></ul><a href="#math"><h2 id="math-idx">Matemáticas</h2></a><ul><li><a href="#math-abs"><span id="math-abs-idx">abs</span></a></li><li><a href="#math-acos"><span id="math-acos-idx">acos</span></a></li><li><a href="#math-asin"><span id="math-asin-idx">asin</span></a></li><li><a href="#math-atan"><span id="math-atan-idx">atan</span></a></li><li><a href="#math-atan2"><span id="math-atan2-idx">atan2</span></a></li><li><a href="#math-azimuth"><span id="math-azimuth-idx">azimuth</span></a></li><li><a href="#math-ceil"><span id="math-ceil-idx">ceil</span></a></li><li><a href="#math-clamp"><span id="math-clamp-idx">clamp</span></a></li><li><a href="#math-cos"><span id="math-cos-idx">cos</span></a></li><li><a href="#math-degrees"><span id="math-degrees-idx">degrees</span></a></li><li><a href="#math-exp"><span id="math-exp-idx">exp</span></a></li><li><a href="#math-floor"><span id="math-floor-idx">floor</span></a></li><li><a href="#math-inclination"><span id="math-inclination-idx">inclination</span></a></li><li><a href="#math-ln"><span id="math-ln-idx">ln</span></a></li><li><a href="#math-log"><span id="math-log-idx">log</span></a></li><li><a href="#math-log10"><span id="math-log10-idx">log10</span></a></li><li><a href="#math-max"><span id="math-max-idx">max</span></a></li><li><a href="#math-min"><span id="math-min-idx">min</span></a></li><li><a href="#math-pi"><span id="math-pi-idx">pi</span></a></li><li><a href="#math-radians"><span id="math-radians-idx">radians</span></a></li><li><a href="#math-rand"><span id="math-rand-idx">rand</span></a></li><li><a href="#math-randf"><span id="math-randf-idx">randf</span></a></li><li><a href="#math-round"><span id="math-round-idx">round</span></a></li><li><a href="#math-scale_exp"><span id="math-scale_exp-idx">scale_exp</span></a></li><li><a href="#math-scale_linear"><span id="math-scale_linear-idx">scale_linear</span></a></li><li><a href="#math-sin"><span id="math-sin-idx">sin</span></a></li><li><a href="#math-sqrt"><span id="math-sqrt-idx">sqrt</span></a></li><li><a href="#math-tan"><span id="math-tan-idx">tan</span></a></li></ul><a href="#processing"><h2 id="processing-idx">Processing</h2></a><ul><li><a href="#processing-parameter"><span id="processing-parameter-idx">parameter</span></a></li></ul><a href="#python"><h2 id="python-idx">Python</h2></a><ul><li><a href="#python-dollar-mask_geometry"><span id="python-dollar-mask_geometry-idx">$mask_geometry</span></a></li><li><a href="#python-in_mask"><span id="python-in_mask-idx">in_mask</span></a></li></ul><a href="#rasters"><h2 id="rasters-idx">Rásters</h2></a><ul><li><a href="#rasters-raster_statistic"><span id="rasters-raster_statistic-idx">raster_statistic</span></a></li><li><a href="#rasters-raster_value"><span id="rasters-raster_value-idx">raster_value</span></a></li></ul><a href="#record-and-attributes"><h2 id="record-and-attributes-idx">Registros y atributos</h2></a><ul><li><a href="#record-and-attributes-dollar-currentfeature"><span id="record-and-attributes-dollar-currentfeature-idx">$currentfeature</span></a></li><li><a href="#record-and-attributes-dollar-id"><span id="record-and-attributes-dollar-id-idx">$id</span></a></li><li><a href="#record-and-attributes-attribute"><span id="record-and-attributes-attribute-idx">attribute</span></a></li><li><a href="#record-and-attributes-attributes"><span id="record-and-attributes-attributes-idx">attributes</span></a></li><li><a href="#record-and-attributes-display_expression"><span id="record-and-attributes-display_expression-idx">display_expression</span></a></li><li><a href="#record-and-attributes-get_feature"><span id="record-and-attributes-get_feature-idx">get_feature</span></a></li><li><a href="#record-and-attributes-get_feature_by_id"><span id="record-and-attributes-get_feature_by_id-idx">get_feature_by_id</span></a></li><li><a href="#record-and-attributes-is_selected"><span id="record-and-attributes-is_selected-idx">is_selected</span></a></li><li><a href="#record-and-attributes-maptip"><span id="record-and-attributes-maptip-idx">maptip</span></a></li><li><a href="#record-and-attributes-num_selected"><span id="record-and-attributes-num_selected-idx">num_selected</span></a></li><li><a href="#record-and-attributes-represent_value"><span id="record-and-attributes-represent_value-idx">represent_value</span></a></li><li><a href="#record-and-attributes-sqlite_fetch_and_increment"><span id="record-and-attributes-sqlite_fetch_and_increment-idx">sqlite_fetch_and_increment</span></a></li><li><a href="#record-and-attributes-uuid"><span id="record-and-attributes-uuid-idx">uuid</span></a></li></ul><a href="#string"><h2 id="string-idx">Cadena</h2></a><ul><li><a href="#string-ascii"><span id="string-ascii-idx">ascii</span></a></li><li><a href="#string-char"><span id="string-char-idx">char</span></a></li><li><a href="#string-concat"><span id="string-concat-idx">concat</span></a></li><li><a href="#string-format"><span id="string-format-idx">format</span></a></li><li><a href="#string-format_date"><span id="string-format_date-idx">format_date</span></a></li><li><a href="#string-format_number"><span id="string-format_number-idx">format_number</span></a></li><li><a href="#string-left"><span id="string-left-idx">left</span></a></li><li><a href="#string-length"><span id="string-length-idx">length</span></a></li><li><a href="#string-lower"><span id="string-lower-idx">lower</span></a></li><li><a href="#string-lpad"><span id="string-lpad-idx">lpad</span></a></li><li><a href="#string-regexp_match"><span id="string-regexp_match-idx">regexp_match</span></a></li><li><a href="#string-regexp_replace"><span id="string-regexp_replace-idx">regexp_replace</span></a></li><li><a href="#string-regexp_substr"><span id="string-regexp_substr-idx">regexp_substr</span></a></li><li><a href="#string-replace"><span id="string-replace-idx">replace</span></a></li><li><a href="#string-right"><span id="string-right-idx">right</span></a></li><li><a href="#string-rpad"><span id="string-rpad-idx">rpad</span></a></li><li><a href="#string-strpos"><span id="string-strpos-idx">strpos</span></a></li><li><a href="#string-substr"><span id="string-substr-idx">substr</span></a></li><li><a href="#string-title"><span id="string-title-idx">title</span></a></li><li><a href="#string-to_string"><span id="string-to_string-idx">to_string</span></a></li><li><a href="#string-trim"><span id="string-trim-idx">trim</span></a></li><li><a href="#string-upper"><span id="string-upper-idx">upper</span></a></li><li><a href="#string-wordwrap"><span id="string-wordwrap-idx">wordwrap</span></a></li></ul>
<div id="aggregates" class="group"><h2><a href="#aggregates-idx">grupo agregados</a></h2>
<div class="description"><p>Contiene funciones que agregan valores sobre capas y campos.</p></div></div>
<div class="function"><html>
<body>
<h3 id="aggregates-aggregate"><a href="#aggregates-aggregate-idx">
función aggregate
</a></h3>
<div class="description">
<p>
Devuelve un valor agregado calculado usando objetos de otra capa.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
aggregate
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
aggregate
</span>
,
<span class="argument">
expression
</span>
[,
<span class="argument">
filter
</span>
][,
<span class="argument">
concatenator
</span>
][,
<span class="argument">
order_by
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
Una cadena que represente el nombre o la ID de una capa
</td>
</tr>
<tr>
<td class="argument">
aggregate
</td>
<td>
a string corresponding to the aggregate to calculate. Valid options are:
<br/>
<ul>
<li>
count
</li>
<li>
count_distinct
</li>
<li>
count_missing
</li>
<li>
min
</li>
<li>
max
</li>
<li>
sum
</li>
<li>
mean
</li>
<li>
median
</li>
<li>
stdev
</li>
<li>
stdevsample
</li>
<li>
range
</li>
<li>
minority
</li>
<li>
majority
</li>
<li>
q1: first quartile
</li>
<li>
q3: third quartile
</li>
<li>
iqr: inter quartile range
</li>
<li>
min_length: minimum string length
</li>
<li>
max_length: maximum string length
</li>
<li>
concatenate: join strings with a concatenator
</li>
<li>
concatenate_unique: join unique strings with a concatenator
</li>
<li>
collect: create an aggregated multipart geometry
</li>
<li>
array_agg: create an array of aggregated values
</li>
</ul>
</td>
</tr>
<tr>
<td class="argument">
expression
</td>
<td>
sub expresión o nombre de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión de filtrado opcional para limitar los objetos usados para calcular el agregado. Los campos y geometrías son de los objetos de la capa unida. Se puede acceder al objeto de origen con la variable @parent.
</td>
</tr>
<tr>
<td class="argument">
concatenator
</td>
<td>
cadena opcional a usar para unir valores para el agregado 'concatenar'
</td>
</tr>
<tr>
<td class="argument">
order_by
</td>
<td>
optional filter expression to order the features used for calculating the aggregate. Fields and geometry are from the features on the joined layer.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
aggregate(layer:='rail_stations',aggregate:='sum',expression:="passengers")
</code>
<code>
suma de todos los valores del campo passengers de la capa rail_stations
</code>
</li>
<li>
<code>
aggregate('rail_stations','sum', "passengers"/7)
</code>
<code>
calcula una media diaria de "passengers" dividiendo el campo "passengers" por 7 antes de sumar los valores
</code>
</li>
<li>
<code>
aggregate(layer:='rail_stations',aggregate:='sum',expression:="passengers",filter:="class"&gt;3)
</code>
<code>
suma todos los valores del campo "passengers" de los objetos en los que el atributo "class" es mayor que 3
</code>
</li>
<li>
<code>
aggregate(layer:='rail_stations',aggregate:='concatenate', expression:="name", concatenator:=',')
</code>
<code>
lista separada por comas del campo name para todos los objetos de la capa rail_stations
</code>
</li>
<li>
<code>
aggregate(layer:='países', aggregate:='max', expression:="código", filter:=intersects( $geometry, geometry(@parent) ) )
</code>
<code>
El código del país de un país que intersecte en la capa 'países'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-array_agg"><a href="#aggregates-array_agg-idx">
función array_agg
</a></h3>
<div class="description">
<p>
Devuelve una matriz de valores agregados a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_agg
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
][,
<span class="argument">
order_by
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
<tr>
<td class="argument">
order_by
</td>
<td>
optional expression to use to order features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_agg("name",group_by:="state")
</code>
<code>
lista de nombres, agrupados por campo de estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-collect"><a href="#aggregates-collect-idx">
función collect
</a></h3>
<div class="description">
<p>
Devuelve la geometría multiparte de geometrías agregadas a partir una expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
collect
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
expresión de geometría a agregar.
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
collect( $geometry )
</code>
<code>
geometría multiparte de geometrías agregadas
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-concatenate"><a href="#aggregates-concatenate-idx">
función concatenate
</a></h3>
<div class="description">
<p>
Returns all aggregated strings from a field or expression joined by a delimiter.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
concatenate
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
][,
<span class="argument">
concatenator
</span>
][,
<span class="argument">
order_by
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
<tr>
<td class="argument">
concatenator
</td>
<td>
cadena opcional a usar para unir valores
</td>
</tr>
<tr>
<td class="argument">
order_by
</td>
<td>
optional expression to use to order features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
concatenar("nombre_ciudad",agrupar_por:="estado",concatenador:=',')
</code>
<code>
lista separada por comas de nombres_ciudad, agrupados por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-concatenate_unique"><a href="#aggregates-concatenate_unique-idx">
función concatenate_unique
</a></h3>
<div class="description">
<p>
Returns all unique strings from a field or expression joined by a delimiter.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
concatenate_unique
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
][,
<span class="argument">
concatenator
</span>
][,
<span class="argument">
order_by
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
<tr>
<td class="argument">
concatenator
</td>
<td>
cadena opcional a usar para unir valores
</td>
</tr>
<tr>
<td class="argument">
order_by
</td>
<td>
optional expression to use to order features used to calculate aggregate
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
concatenar("nombre_ciudad",agrupar_por:="estado",concatenador:=',')
</code>
<code>
comma separated list of unique town_names, grouped by state field
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-count"><a href="#aggregates-count-idx">
función count
</a></h3>
<div class="description">
<p>
Devuelve el recuento de objetos coincidentes.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
count
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
contar("estaciones",agrupar_por:="estado")
</code>
<code>
cuenta de estaciones, agrupados por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-count_distinct"><a href="#aggregates-count_distinct-idx">
función count_distinct
</a></h3>
<div class="description">
<p>
Devuelve el recuento de valores distintos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
count_distinct
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
contar_distintos("estaciones",agrupar_por:="estado")
</code>
<code>
cuenta de valores distintos de estaciones, agrupados por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-count_missing"><a href="#aggregates-count_missing-idx">
función count_missing
</a></h3>
<div class="description">
<p>
Devuelve el recuento de valores que faltan (nulo).
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
count_missing
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
contar_faltantes("estaciones",agrupar_por:="estado")
</code>
<code>
cuenta de valores que faltan (nulos) de estaciones, agrupados por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-iqr"><a href="#aggregates-iqr-idx">
función iqr
</a></h3>
<div class="description">
<p>
Devuelve el rango de intercuartil calculado a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
iqr
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
iqr("population",group_by:="state")
</code>
<code>
rango de intercuartil del valor de población, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-majority"><a href="#aggregates-majority-idx">
función majority
</a></h3>
<div class="description">
<p>
Devuelve la mayoría agregada de los valores (valores que aparecen de forma más común) de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
majority
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
mayoría("clase",agrupar_por:="estado")
</code>
<code>
valor de clase que ocurre con más frecuencia, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-max_length"><a href="#aggregates-max_length-idx">
función max_length
</a></h3>
<div class="description">
<p>
Devuelve la longitud máxima de cadenas a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
max_length
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
longitud_max("nombre_ciudad",agrupar_por:="estado")
</code>
<code>
longitud máxima de nombre_ciudad, agrupada por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-maximum"><a href="#aggregates-maximum-idx">
función maximum
</a></h3>
<div class="description">
<p>
Devuelve el valor máximo agregado a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
maximum
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
máximo("población",agrupar_por:="estado")
</code>
<code>
valor máximo de población, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-mean"><a href="#aggregates-mean-idx">
función mean
</a></h3>
<div class="description">
<p>
Devuelve el valor medio agregado a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
mean
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
media("población",agrupar_por:="estado")
</code>
<code>
valor medio de población, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-median"><a href="#aggregates-median-idx">
función median
</a></h3>
<div class="description">
<p>
Devuelve el valor de la mediana agregada a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
median
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
mediana("población",agrupar_por:="estado")
</code>
<code>
valor mediana de población, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-min_length"><a href="#aggregates-min_length-idx">
función min_length
</a></h3>
<div class="description">
<p>
Devuelve la longitud mínima de cadenas a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
min_length
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
longitud_min("nombre_ciudad",agrupar_por:="estado")
</code>
<code>
longitud mínima de nombre_ciudad, agrupada por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-minimum"><a href="#aggregates-minimum-idx">
función minimum
</a></h3>
<div class="description">
<p>
Devuelve el valor mínimo agregado a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
minimum
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
mínimo("población",agrupar_por:="estado")
</code>
<code>
valor mínimo de población, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-minority"><a href="#aggregates-minority-idx">
función minority
</a></h3>
<div class="description">
<p>
Devuelve la minoría agregada de valores (valor que ocurre con menos frecuencia) a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
minority
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
mayoría("clase",agrupar_por:="estado")
</code>
<code>
valor de clase que ocurre con menos frecuencia, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-q1"><a href="#aggregates-q1-idx">
función q1
</a></h3>
<div class="description">
<p>
Devuelve el primer cuartil calculado a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
q1
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
q1("población",agrupar_por:="estado")
</code>
<code>
primer cuartil del valor de población, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-q3"><a href="#aggregates-q3-idx">
función q3
</a></h3>
<div class="description">
<p>
Devuelve el tercer cuartil calculado a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
q3
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
q3("población",agrupar_por:="estado")
</code>
<code>
tercer cuartil del valor de población, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-range"><a href="#aggregates-range-idx">
función range
</a></h3>
<div class="description">
<p>
Devuelve el rango agregado de valores (máximo - mínimo) de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
range
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
rango("población",agrupar_por:="estado")
</code>
<code>
rango de valores de población, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-relation_aggregate"><a href="#aggregates-relation_aggregate-idx">
función relation_aggregate
</a></h3>
<div class="description">
<p>
Devuelve un valor agregado calculado usando todos los objetos hijos coincidentes de una relación de capas.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
relation_aggregate
</span>
(
<span class="argument">
relation
</span>
,
<span class="argument">
aggregate
</span>
,
<span class="argument">
expression
</span>
[,
<span class="argument">
concatenator
</span>
][,
<span class="argument">
order_by
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
relation
</td>
<td>
una cadena que representa una ID de relación
</td>
</tr>
<tr>
<td class="argument">
aggregate
</td>
<td>
a string corresponding to the aggregate to calculate. Valid options are:
<br/>
<ul>
<li>
count
</li>
<li>
count_distinct
</li>
<li>
count_missing
</li>
<li>
min
</li>
<li>
max
</li>
<li>
sum
</li>
<li>
mean
</li>
<li>
median
</li>
<li>
stdev
</li>
<li>
stdevsample
</li>
<li>
range
</li>
<li>
minority
</li>
<li>
majority
</li>
<li>
q1: first quartile
</li>
<li>
q3: third quartile
</li>
<li>
iqr: inter quartile range
</li>
<li>
min_length: minimum string length
</li>
<li>
max_length: maximum string length
</li>
<li>
concatenate: join strings with a concatenator
</li>
<li>
concatenate_unique: join unique strings with a concatenator
</li>
<li>
collect: create an aggregated multipart geometry
</li>
<li>
array_agg: create an array of aggregated values
</li>
</ul>
</td>
</tr>
<tr>
<td class="argument">
expression
</td>
<td>
sub expresión o nombre de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
concatenator
</td>
<td>
cadena opcional a usar para unir valores para el agregado 'concatenar'
</td>
</tr>
<tr>
<td class="argument">
order_by
</td>
<td>
optional expression to order the features used for calculating the aggregate. Fields and geometry are from the features on the joined layer.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
relation_aggregate(relation:='my_relation',aggregate:='mean',expression:="passengers")
</code>
<code>
valor medio de todos los objetos hijos coincidentes usando la relación 'mi_relación'
</code>
</li>
<li>
<code>
relation_aggregate('my_relation','sum', "passengers"/7)
</code>
<code>
suma del campo pasajeros dividido por 7 de todos los objetos hijos coincidentes usando la relación 'mi_relación'
</code>
</li>
<li>
<code>
relation_aggregate('my_relation','concatenate', "towns", concatenator:=',')
</code>
<code>
lista separada por coma del campo ciudades para todos los objetos hijos coincidentes usando la relación 'mi_relación'
</code>
</li>
<li>
<code>
relation_aggregate('my_relation','array_agg', "id")
</code>
<code>
array of the id field from all matching child features using the 'my_relation' relation
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-stdev"><a href="#aggregates-stdev-idx">
función stdev
</a></h3>
<div class="description">
<p>
Devuelve la desviación estándar agregada a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
stdev
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
desv_est("población",agrupar_por:="estado")
</code>
<code>
desviación estándar del valor de población, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="aggregates-sum"><a href="#aggregates-sum-idx">
función sum
</a></h3>
<div class="description">
<p>
Devuelve el valor sumado agregado a partir de un campo o expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
sum
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
group_by
</span>
][,
<span class="argument">
filter
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
subexpresión de campo a agregar
</td>
</tr>
<tr>
<td class="argument">
group_by
</td>
<td>
expresión opcional a usar para agrupar cálculos de agregados
</td>
</tr>
<tr>
<td class="argument">
filter
</td>
<td>
expresión opcional a usar para filtrar objetos utilizados para calcular el agregado
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
suma("población",agrupar_por:="estado")
</code>
<code>
valor de población sumado, agrupado por el campo estado
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="arrays" class="group"><h2><a href="#arrays-idx">grupo matrices</a></h2>
<div class="description"><p>Este grupo contiene funciones de expresiones para la creación y manipulación de matrices (también conocidas como estructuras de datos en lista). El orden de los valores dentro de la matriz importa, a diferencia de la estructura de datos de "mapa", en donde el orden de pares clave-valor es irrelevante y los valores se identifican por sus claves.</p></div></div>
<div class="function"><html>
<body>
<h3 id="arrays-array"><a href="#arrays-array-idx">
función array
</a></h3>
<div class="description">
<p>
Devuelve una matriz que contiene todos los valores pasados como parámetros.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array
</span>
(
<span class="argument">
value1
</span>
,
<span class="argument">
value2
</span>
…)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
un valor
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array(2,10)
</code>
<code>
[ 2, 10 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_all"><a href="#arrays-array_all-idx">
función array_all
</a></h3>
<div class="description">
<p>
Returns true if an array contains all the values of a given array.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_all
</span>
(
<span class="argument">
array_a
</span>
,
<span class="argument">
array_b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array_a
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
array_b
</td>
<td>
the array of values to search
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_all(array(1,2,3),array(2,3))
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
array_all(array(1,2,3),array(1,2,4))
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_append"><a href="#arrays-array_append-idx">
función array_append
</a></h3>
<div class="description">
<p>
Devuelve una matriz con el valor dado añadido al final.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_append
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
el valor a añadir
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_append(array(1,2,3),4)
</code>
<code>
[ 1, 2, 3, 4 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_cat"><a href="#arrays-array_cat-idx">
función array_cat
</a></h3>
<div class="description">
<p>
Devuelve una matriz que contiene todas las matrices dadas concatenadas.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_cat
</span>
(
<span class="argument">
array1
</span>
,
<span class="argument">
array2
</span>
…)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_cat(array(1,2),array(2,3))
</code>
<code>
[ 1, 2, 2, 3 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_contains"><a href="#arrays-array_contains-idx">
función array_contains
</a></h3>
<div class="description">
<p>
Devuelve verdadero si una matriz contiene el valor dado.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_contains
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
el valor a buscar
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_contains(array(1,2,3),2)
</code>
<code>
verdadero
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_distinct"><a href="#arrays-array_distinct-idx">
función array_distinct
</a></h3>
<div class="description">
<p>
Devuelve una matriz que contiene los valores distintos de la matriz dada.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_distinct
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_distinct(array(1,2,3,2,1))
</code>
<code>
[ 1, 2, 3 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_filter"><a href="#arrays-array_filter-idx">
función array_filter
</a></h3>
<div class="description">
<p>
Devuelve una matriz con sólo los ítems para los cuales la expresión evalúa a verdadero.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_filter
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
expression
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
expression
</td>
<td>
an expression to evaluate on each item. The variable `@element` will be replaced by the current value.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_filter(array(1,2,3),@element &lt; 3)
</code>
<code>
[ 1, 2 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_find"><a href="#arrays-array_find-idx">
función array_find
</a></h3>
<div class="description">
<p>
Devuelve el índice de un valor dentro de una matriz (0 para el primero). Devuelve -1 si no se encuentra el valor.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_find
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
el valor a buscar
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_find(array(1,2,3),2)
</code>
<code>
1
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_first"><a href="#arrays-array_first-idx">
función array_first
</a></h3>
<div class="description">
<p>
Devuelve el primer valor de una matriz.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_first
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_first(array('a','b','c'))
</code>
<code>
'a'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_foreach"><a href="#arrays-array_foreach-idx">
función array_foreach
</a></h3>
<div class="description">
<p>
Returns an array with the given expression evaluated on each item.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_foreach
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
expression
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
expression
</td>
<td>
an expression to evaluate on each item. The variable `@element` will be replaced by the current value.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_foreach(array('a','b','c'),upper(@element))
</code>
<code>
[ 'A', 'B', 'C' ]
</code>
</li>
<li>
<code>
array_foreach(array(1,2,3),@element + 10)
</code>
<code>
[ 11, 12, 13 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_get"><a href="#arrays-array_get-idx">
función array_get
</a></h3>
<div class="description">
<p>
Devuelve el valor N de una matriz (0 para el primero).
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_get
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
index
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
index
</td>
<td>
el índica a obtener (basado en 0)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_get(array('a','b','c'),1)
</code>
<code>
'b'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_insert"><a href="#arrays-array_insert-idx">
función array_insert
</a></h3>
<div class="description">
<p>
Devuelve una matriz con el valor dado añadido en la posición indicada.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_insert
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
pos
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
pos
</td>
<td>
la posición en la que añadir (basado en 0)
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
el valor a añadir
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_insert(array(1,2,3),1,100)
</code>
<code>
[ 1, 100, 2, 3 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_intersect"><a href="#arrays-array_intersect-idx">
función array_intersect
</a></h3>
<div class="description">
<p>
Devuelve verdadero si un elemento de la matriz1 está presente en la matriz2.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_intersect
</span>
(
<span class="argument">
array1
</span>
,
<span class="argument">
array2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array1
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
array2
</td>
<td>
otra matriz
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_intersect(array(1,2,3,4),array(4,0,2,5))
</code>
<code>
verdadero
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_last"><a href="#arrays-array_last-idx">
función array_last
</a></h3>
<div class="description">
<p>
Devuelve el último valor de una matriz.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_last
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_last(array('a','b','c'))
</code>
<code>
'c'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_length"><a href="#arrays-array_length-idx">
función array_length
</a></h3>
<div class="description">
<p>
Devuelve el número de elementos de una matriz.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_length
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_length(array(1,2,3))
</code>
<code>
3
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_prepend"><a href="#arrays-array_prepend-idx">
función array_prepend
</a></h3>
<div class="description">
<p>
Devuelve una matriz con el valor dado añadido al principio.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_prepend
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
el valor a añadir
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_prepend(array(1,2,3),0)
</code>
<code>
[ 0, 1, 2, 3 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_remove_all"><a href="#arrays-array_remove_all-idx">
función array_remove_all
</a></h3>
<div class="description">
<p>
Devuelve una matriz con todas las entradas del valor dado eliminadas.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_remove_all
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
los valores a eliminar
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_remove_all(array('a','b','c','b'),'b')
</code>
<code>
[ 'a', 'c' ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_remove_at"><a href="#arrays-array_remove_at-idx">
función array_remove_at
</a></h3>
<div class="description">
<p>
Devuelve una matriz con el índice dado eliminado.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_remove_at
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
pos
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
pos
</td>
<td>
la posición a eliminar (basado en 0)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_remove_at(array(1,2,3),1)
</code>
<code>
[ 1, 3 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_reverse"><a href="#arrays-array_reverse-idx">
función array_reverse
</a></h3>
<div class="description">
<p>
Devuelve la matriz dada con los valores de la matriz en orden inverso.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_reverse
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_reverse(array(2,4,0,10))
</code>
<code>
[ 10, 0, 4, 2 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_slice"><a href="#arrays-array_slice-idx">
función array_slice
</a></h3>
<div class="description">
<p>
Devuelve una porción de la matriz. El fragmento es definido por los argumentos start_pos y end_pos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_slice
</span>
(
<span class="argument">
array
</span>
,
<span class="argument">
start_pos
</span>
,
<span class="argument">
end_pos
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
start_pos
</td>
<td>
el índice de la posición inicial del fragmento (basado en 0). El índice de start_pos se incluye en el fragmento. Si se usa una start_pos negativa, el índice se cuenta desde el final de la lista (basado en -1).
</td>
</tr>
<tr>
<td class="argument">
end_pos
</td>
<td>
el índice de la posición final del fragmento (basado en 0). El índice de end_pos se incluye en el fragmento. Si se usa una end_pos negativa, el índice se cuenta desde el final de la lista (basado en -1).
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_slice(array(1,2,3,4,5),0,3)
</code>
<code>
[ 1, 2, 3, 4 ]
</code>
</li>
<li>
<code>
array_slice(array(1,2,3,4,5),0,-1)
</code>
<code>
[ 1, 2, 3, 4, 5 ]
</code>
</li>
<li>
<code>
array_slice(array(1,2,3,4,5),-5,-1)
</code>
<code>
[ 1, 2, 3, 4, 5 ]
</code>
</li>
<li>
<code>
array_slice(array(1,2,3,4,5),0,0)
</code>
<code>
[ 1 ]
</code>
</li>
<li>
<code>
array_slice(array(1,2,3,4,5),-2,-1)
</code>
<code>
[ 4, 5 ]
</code>
</li>
<li>
<code>
array_slice(array(1,2,3,4,5),-1,-1)
</code>
<code>
[ 5 ]
</code>
</li>
<li>
<code>
array_slice(array('Dufour','Valmiera','Chugiak','Brighton'),1,2)
</code>
<code>
[ 'Valmiera', 'Chugiak' ]
</code>
</li>
<li>
<code>
array_slice(array_slice(array('Dufour','Valmiera','Chugiak','Brighton'),-2,-1)
</code>
<code>
[ 'Chugiak', 'Brighton' ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_sort"><a href="#arrays-array_sort-idx">
función array_sort
</a></h3>
<div class="description">
<p>
Returns the provided array with its elements sorted.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_sort
</span>
(
<span class="argument">
array
</span>
[,
<span class="argument">
ascending=true
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
una matriz
</td>
</tr>
<tr>
<td class="argument">
ascending
</td>
<td>
set this parameter to false to sort the array in descending order
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_sort(array(3,2,1))
</code>
<code>
[ 1, 2, 3 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-array_to_string"><a href="#arrays-array_to_string-idx">
función array_to_string
</a></h3>
<div class="description">
<p>
Concatenates array elements into a string separated by a delimiter and using optional string for empty values.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
array_to_string
</span>
(
<span class="argument">
array
</span>
[,
<span class="argument">
delimiter=','
</span>
][,
<span class="argument">
empty_value=''
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
la matriz de entrada
</td>
</tr>
<tr>
<td class="argument">
delimiter
</td>
<td>
el delimitador de cadena utilizado para separa los elementos de la matriz concatenados
</td>
</tr>
<tr>
<td class="argument">
empty_value
</td>
<td>
la cadena opcional usada como reemplazo para coincidencias vacías (longitud cero)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
array_to_string(array('1','2','3'))
</code>
<code>
'1,2,3'
</code>
</li>
<li>
<code>
array_to_string(array(1,2,3),'-')
</code>
<code>
'1-2-3'
</code>
</li>
<li>
<code>
array_to_string(array('1','','3'),',','0')
</code>
<code>
'1,0,3'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-generate_series"><a href="#arrays-generate_series-idx">
función generate_series
</a></h3>
<div class="description">
<p>
Creates an array containing a sequence of numbers.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
generate_series
</span>
(
<span class="argument">
start
</span>
,
<span class="argument">
stop
</span>
[,
<span class="argument">
step=1
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
start
</td>
<td>
first value of the sequence
</td>
</tr>
<tr>
<td class="argument">
stop
</td>
<td>
value that ends the sequence once reached
</td>
</tr>
<tr>
<td class="argument">
step
</td>
<td>
value used as the increment between values
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
generate_series(1,5)
</code>
<code>
[ 1, 2, 3, 4, 5 ]
</code>
</li>
<li>
<code>
generate_series(5,1,-1)
</code>
<code>
[ 5, 4, 3, 2, 1 ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-regexp_matches"><a href="#arrays-regexp_matches-idx">
función regexp_matches
</a></h3>
<div class="description">
<p>
Devuelve una matriz de todas las cadenas capturadas por grupos de captura, en el orden en el que los propios grupos aparecen en la expresión regular proporcionada contra la cadena.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
regexp_matches
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
regex
</span>
[,
<span class="argument">
empty_value=''
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
la cadena para capturar grupos desde la expresión regular
</td>
</tr>
<tr>
<td class="argument">
regex
</td>
<td>
la expresión regular usada para capturar grupos
</td>
</tr>
<tr>
<td class="argument">
empty_value
</td>
<td>
la cadena opcional usada como reemplazo para coincidencias vacías (longitud cero)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
regexp_matches('QGIS=&gt;rocks','(.*)=&gt;(.*)')
</code>
<code>
[ 'QGIS', 'rocks' ]
</code>
</li>
<li>
<code>
regexp_matches('key=&gt;','(.*)=&gt;(.*)','empty value')
</code>
<code>
[ 'key', 'empty value' ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="arrays-string_to_array"><a href="#arrays-string_to_array-idx">
función string_to_array
</a></h3>
<div class="description">
<p>
Divide una cadena en una matriz usando el delimitador proporcionado y una cadena opcional para valores vacíos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
string_to_array
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
delimiter=','
</span>
][,
<span class="argument">
empty_value=''
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
la cadena de entrada
</td>
</tr>
<tr>
<td class="argument">
delimiter
</td>
<td>
el delimitador de cadena utilizado para dividir la cadena de entrada
</td>
</tr>
<tr>
<td class="argument">
empty_value
</td>
<td>
la cadena opcional usada como reemplazo para coincidencias vacías (longitud cero)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
string_to_array('1,2,3',',')
</code>
<code>
[ '1', '2', '3' ]
</code>
</li>
<li>
<code>
string_to_array('1,,3',',','0')
</code>
<code>
[ '1', '0', '3' ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="color" class="group"><h2><a href="#color-idx">grupo color</a></h2>
<div class="description"><p>Este grupo contiene funciones para manipular colores</p></div></div>
<div class="function"><html>
<body>
<h3 id="color-color_cmyk"><a href="#color-color_cmyk-idx">
función color_cmyk
</a></h3>
<div class="description">
<p>
Devuelve una representación en forma de cadena de un color en base a sus componentes cian, magenta, amarillo y negro
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_cmyk
</span>
(
<span class="argument">
cyan
</span>
,
<span class="argument">
magenta
</span>
,
<span class="argument">
yellow
</span>
,
<span class="argument">
black
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
cyan
</td>
<td>
componente cian del color, como un valor entero de porcentaje de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
magenta
</td>
<td>
componente magenta del color, como un valor entero de porcentaje de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
yellow
</td>
<td>
componente amarillo del color, como un valor entero de porcentaje de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
black
</td>
<td>
componente negro del color, como un valor entero de porcentaje de 0 a 100
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
color_cmyk(100,50,0,10)
</code>
<code>
0,115,230
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-color_cmyka"><a href="#color-color_cmyka-idx">
función color_cmyka
</a></h3>
<div class="description">
<p>
Devuelve una representación en forma de cadena de un color en base a sus componentes cian, magenta, amarillo, negro y alfa (transparencia)
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_cmyka
</span>
(
<span class="argument">
cyan
</span>
,
<span class="argument">
magenta
</span>
,
<span class="argument">
yellow
</span>
,
<span class="argument">
black
</span>
,
<span class="argument">
alpha
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
cyan
</td>
<td>
componente cian del color, como un valor entero de porcentaje de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
magenta
</td>
<td>
componente magenta del color, como un valor entero de porcentaje de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
yellow
</td>
<td>
componente amarillo del color, como un valor entero de porcentaje de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
black
</td>
<td>
componente negro del color, como un valor entero de porcentaje de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
alpha
</td>
<td>
componente alfa como un valor entero de 0 (completamente transparente) a 255 (opaco).
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
color_cmyk(100,50,0,10,200)
</code>
<code>
0,115,230,200
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-color_grayscale_average"><a href="#color-color_grayscale_average-idx">
función color_grayscale_average
</a></h3>
<div class="description">
<p>
Applies a grayscale filter and returns a string representation from a provided color.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_grayscale_average
</span>
(
<span class="argument">
color
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color
</td>
<td>
una cadena de color
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
color_grayscale_average('255,100,50')
</code>
<code>
127,127,127,255
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-color_hsl"><a href="#color-color_hsl-idx">
función color_hsl
</a></h3>
<div class="description">
<p>
Devuelve una representación en forma de cadena de un color en base a sus atributos de matiz, saturación y luminosidad.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_hsl
</span>
(
<span class="argument">
hue
</span>
,
<span class="argument">
saturation
</span>
,
<span class="argument">
lightness
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
hue
</td>
<td>
matiz de un color, como un entero de 0 a 360
</td>
</tr>
<tr>
<td class="argument">
saturation
</td>
<td>
porcentaje de saturación del color, como un valor entero de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
lightness
</td>
<td>
porcentaje de luminosidad del color, como un valor entero de 0 a 100
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
color_hsl(100,50,70)
</code>
<code>
166,217,140
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-color_hsla"><a href="#color-color_hsla-idx">
función color_hsla
</a></h3>
<div class="description">
<p>
Devuelve una representación en forma de cadena de un color en base a sus atributos de matiz, saturación, luminosidad y canal alfa (transparencia).
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_hsla
</span>
(
<span class="argument">
hue
</span>
,
<span class="argument">
saturation
</span>
,
<span class="argument">
lightness
</span>
,
<span class="argument">
alpha
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
hue
</td>
<td>
matiz de un color, como un entero de 0 a 360
</td>
</tr>
<tr>
<td class="argument">
saturation
</td>
<td>
porcentaje de saturación del color, como un valor entero de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
lightness
</td>
<td>
porcentaje de luminosidad del color, como un valor entero de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
alpha
</td>
<td>
componente alfa como un valor entero de 0 (completamente transparente) a 255 (opaco).
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
color_hsla(100,50,70,200)
</code>
<code>
166,217,140,200
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-color_hsv"><a href="#color-color_hsv-idx">
función color_hsv
</a></h3>
<div class="description">
<p>
Devuelve una representación en forma de cadena de un color en base a sus atributos de matiz, saturación y valor.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_hsv
</span>
(
<span class="argument">
hue
</span>
,
<span class="argument">
saturation
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
hue
</td>
<td>
matiz de un color, como un entero de 0 a 360
</td>
</tr>
<tr>
<td class="argument">
saturation
</td>
<td>
porcentaje de saturación del color, como un valor entero de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
porcentaje de valor del color, como un valor entero de 0 a 100
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
color_hsv(40,100,100)
</code>
<code>
255,170,0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-color_hsva"><a href="#color-color_hsva-idx">
función color_hsva
</a></h3>
<div class="description">
<p>
Devuelve una representación en forma de cadena de un color en base a sus atributos de matiz, saturación, valor y canal alfa (transparencia).
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_hsva
</span>
(
<span class="argument">
hue
</span>
,
<span class="argument">
saturation
</span>
,
<span class="argument">
value
</span>
,
<span class="argument">
alpha
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
hue
</td>
<td>
matiz de un color, como un entero de 0 a 360
</td>
</tr>
<tr>
<td class="argument">
saturation
</td>
<td>
porcentaje de saturación del color, como un valor entero de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
porcentaje de valor del color, como un valor entero de 0 a 100
</td>
</tr>
<tr>
<td class="argument">
alpha
</td>
<td>
componente alfa como un valor entero de 0 (completamente transparente) a 255 (opaco)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
color_hsva(40,100,100,200)
</code>
<code>
255,170,0,200
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-color_mix_rgb"><a href="#color-color_mix_rgb-idx">
función color_mix_rgb
</a></h3>
<div class="description">
<p>
Returns a string representing a color mixing the red, green, blue, and alpha values of two provided colors based on a given ratio.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_mix_rgb
</span>
(
<span class="argument">
color1
</span>
,
<span class="argument">
color2
</span>
,
<span class="argument">
ratio
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color1
</td>
<td>
una cadena de color
</td>
</tr>
<tr>
<td class="argument">
color2
</td>
<td>
una cadena de color
</td>
</tr>
<tr>
<td class="argument">
ratio
</td>
<td>
una relación
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
color_mix_rgb('0,0,0','255,255,255',0.5)
</code>
<code>
127,127,127,255
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-color_part"><a href="#color-color_part-idx">
función color_part
</a></h3>
<div class="description">
<p>
Devuelve un componente específico de una cadena de color, por ejemplo el componente rojo o el alfa.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_part
</span>
(
<span class="argument">
color
</span>
,
<span class="argument">
component
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color
</td>
<td>
una cadena de color
</td>
</tr>
<tr>
<td class="argument">
component
</td>
<td>
una cadena que corresponde al componente del color a devolver. Las opciones válidas son:
<br/>
<ul>
<li>
red: componente rojo RGB (0-255)
</li>
<li>
green: componente verde RGB (0-255)
</li>
<li>
blue: componente azul RGB (0-255)
</li>
<li>
alpha: valor alfa (transparencia) (0-255)
</li>
<li>
hue: matiz HSV (0-360)
</li>
<li>
saturation: saturación HSV (0-100)
</li>
<li>
value: valor HSV (0-100)
</li>
<li>
hsl_hue: matiz HSL (0-360)
</li>
<li>
hsl_saturation: saturación HSL (0-100)
</li>
<li>
lightness: luminosidad HSL (0-100)
</li>
<li>
cyan: componente cian CMYK (0-100)
</li>
<li>
magenta: componente magenta CMYK (0-100)
</li>
<li>
yellow: componente amarillo CMYK (0-100)
</li>
<li>
black: componente negro CMYK (0-100)
</li>
</ul>
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
color_part('200,10,30','green')
</code>
<code>
10
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-color_rgb"><a href="#color-color_rgb-idx">
función color_rgb
</a></h3>
<div class="description">
<p>
Devuelve una representación en forma de cadena de un color en base a sus componentes rojo, verde y azul.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_rgb
</span>
(
<span class="argument">
red
</span>
,
<span class="argument">
green
</span>
,
<span class="argument">
blue
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
red
</td>
<td>
componente rojo del color, como un valor entero de 0 a 255
</td>
</tr>
<tr>
<td class="argument">
green
</td>
<td>
componente verde del color, como un valor entero de 0 a 255
</td>
</tr>
<tr>
<td class="argument">
blue
</td>
<td>
componente azul del color, como un valor entero de 0 a 255
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
color_rgb(255,127,0)
</code>
<code>
255,127,0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-color_rgba"><a href="#color-color_rgba-idx">
función color_rgba
</a></h3>
<div class="description">
<p>
Devuelve una representación en forma de cadena de un color en base a sus componentes rojo, verde, azul y alfa (transparencia).
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
color_rgba
</span>
(
<span class="argument">
red
</span>
,
<span class="argument">
green
</span>
,
<span class="argument">
blue
</span>
,
<span class="argument">
alpha
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
red
</td>
<td>
componente rojo del color, como un valor entero de 0 a 255
</td>
</tr>
<tr>
<td class="argument">
green
</td>
<td>
componente verde del color, como un valor entero de 0 a 255
</td>
</tr>
<tr>
<td class="argument">
blue
</td>
<td>
componente azul del color, como un valor entero de 0 a 255
</td>
</tr>
<tr>
<td class="argument">
alpha
</td>
<td>
componente alfa como un valor entero de 0 (completamente transparente) a 255 (opaco).
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
color_rgba(255,127,0,200)
</code>
<code>
255,127,0,200
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-create_ramp"><a href="#color-create_ramp-idx">
función create_ramp
</a></h3>
<div class="description">
<p>
Devuelve una rampa de gradiente de un mapa de colores y pasos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
create_ramp
</span>
(
<span class="argument">
map
</span>
[,
<span class="argument">
discrete
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
a map of color strings and steps
</td>
</tr>
<tr>
<td class="argument">
discrete
</td>
<td>
declarar si la rampa de color es discreta
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
ramp_color(create_array(map(0,'0,0,0',1,'255,0,0')),1)
</code>
<code>
'255,0,0,255'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-darker"><a href="#color-darker-idx">
función darker
</a></h3>
<div class="description">
<p>
Devuelve una cadena de color más oscura (o más clara)
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
darker
</span>
(
<span class="argument">
color
</span>
,
<span class="argument">
factor
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color
</td>
<td>
una cadena de color
</td>
</tr>
<tr>
<td class="argument">
factor
</td>
<td>
un número entero que corresponde al factor de oscurecimiento:
<ul>
<li>
Si el factor es mayor de 100, esta función devuelve un color más oscuro (por ej., establecer el factor a 300 devuelve un color que tiene un tercio de brillo);
</li>
<li>
Si el factor es menor que 100, el color devuelto es más claro, pero se recomienda usar la función lighter() para este propósito;
</li>
<li>
Si el factor es 0 o negativo, el valor devuelto es inespecífico.
</li>
</ul>
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
darker('200,10,30',300)
</code>
<code>
'66,3,10,255'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-lighter"><a href="#color-lighter-idx">
función lighter
</a></h3>
<div class="description">
<p>
Devuelve una cadena de color más clara (o más oscura)
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
lighter
</span>
(
<span class="argument">
color
</span>
,
<span class="argument">
factor
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color
</td>
<td>
una cadena de color
</td>
</tr>
<tr>
<td class="argument">
factor
</td>
<td>
un número entero que corresponde al factor de aclarado:
<ul>
<li>
Si el factor es mayor de 100, esta función devuelve un color más claro (por ej., establecer el factor a 150 devuelve un color que es un 50% más brillante);
</li>
<li>
Si el factor es menor que 100, el color devuelto es más oscuro, pero se recomienda usar la función darker() para este propósito;
</li>
<li>
Si el factor es 0 o negativo, el valor devuelto es inespecífico.
</li>
</ul>
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
lighter('200,10,30',200)
</code>
<code>
'255,158,168,255'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-project_color"><a href="#color-project_color-idx">
función project_color
</a></h3>
<div class="description">
<p>
Devuelve un color del esquema de color del proyecto.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
project_color
</span>
(
<span class="argument">
name
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
name
</td>
<td>
el nombre de un color
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
project_color('Logo color')
</code>
<code>
20,140,50
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-ramp_color"><a href="#color-ramp_color-idx">
función ramp_color
</a></h3>
<div class="description">
<p>
Devuelve una cadena que representa un color de una rampa de color.
</p>
</div>
<h3 id="color-ramp_color"><a href="#color-ramp_color-idx">
Variante de rampa guardada
</a></h3>
<div class="description">
Devuelve una cadena que representa un color de una rampa guardada
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
ramp_color
</span>
(
<span class="argument">
ramp_name
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
ramp_name
</td>
<td>
el nombre de la rampa de color como una cadena, por ejemplo 'Spectral'
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
la posición en la rampa de la que seleccionar el color, como un número real entre 0 y 1
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
ramp_color('Spectral',0.3)
</code>
<code>
'253,190,115,255'
</code>
</li>
</ul>
</div>
<h4>
Notas
</h4>
<div class="notes">
<p>
Las rampas de color disponibles varían entre instalaciones de QGIS. Esta función puede no dar el resultado esperado su mueve su proyecto de QGIS entre instalaciones.
</p>
</div>
<h3 id="color-ramp_color"><a href="#color-ramp_color-idx">
Variante de rampa creada por expresión
</a></h3>
<div class="description">
Devuelve una cadena que representa un color de una rampa creada por expresión
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
ramp_color
</span>
(
<span class="argument">
ramp
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
ramp
</td>
<td>
la rampa de color
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
la posición en la rampa de la que seleccionar el color, como un número real entre 0 y 1
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
ramp_color(create_ramp(map(0,'0,0,0',1,'255,0,0')),1)
</code>
<code>
'255,0,0,255'
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="color-set_color_part"><a href="#color-set_color_part-idx">
función set_color_part
</a></h3>
<div class="description">
<p>
Establece el componente de un color específico para la cadena de un color, por ejemplo el componente rojo o el alfa.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
set_color_part
</span>
(
<span class="argument">
color
</span>
,
<span class="argument">
component
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
color
</td>
<td>
una cadena de color
</td>
</tr>
<tr>
<td class="argument">
component
</td>
<td>
una cadena que corresponde al componente del color a establecer. Las opciones válidas son:
<br/>
<ul>
<li>
red: componente rojo RGB (0-255)
</li>
<li>
green: componente verde RGB (0-255)
</li>
<li>
blue: componente azul RGB (0-255)
</li>
<li>
alpha: valor alfa (transparencia) (0-255)
</li>
<li>
hue: matiz HSV (0-360)
</li>
<li>
saturation: saturación HSV (0-100)
</li>
<li>
value: valor HSV (0-100)
</li>
<li>
hsl_hue: matiz HSL (0-360)
</li>
<li>
hsl_saturation: saturación HSL (0-100)
</li>
<li>
lightness: luminosidad HSL (0-100)
</li>
<li>
cyan: componente cian CMYK (0-100)
</li>
<li>
magenta: componente magenta CMYK (0-100)
</li>
<li>
yellow: componente amarillo CMYK (0-100)
</li>
<li>
black: componente negro CMYK (0-100)
</li>
</ul>
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
valor nuevo para el componente de color, restetando los rangos listados arriba
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
set_color_part('200,10,30','green',50)
</code>
<code>
200,50,30
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="conditionals" class="group"><h2><a href="#conditionals-idx">grupo condicionales</a></h2>
<div class="description"><p>Este grupo contiene funciones para realizar comprobaciones condicionales en expresiones.</p></div></div>
<div class="function"><html>
<body>
<h3 id="conditionals-coalesce"><a href="#conditionals-coalesce-idx">
función coalesce
</a></h3>
<div class="description">
<p>
Devuelve el primer valor no-NULO de la lista de expresiones
<br/>
Esta función puede tomar cualquier número de argumentos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
coalesce
</span>
(
<span class="argument">
expression1
</span>
,
<span class="argument">
expression2
</span>
…)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
cualquier expresión o valor válidos, sin importar el tipo.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
coalesce(NULO, 2)
</code>
<code>
2
</code>
</li>
<li>
<code>
coalesce(NULO, 2, 3)
</code>
<code>
2
</code>
</li>
<li>
<code>
coalesce(7, NULO, 3*2)
</code>
<code>
7
</code>
</li>
<li>
<code>
coalesce("campoA", "fallbackField", 'ERROR')
</code>
<code>
el valor del campoA si no es NULO, de lo contrario el valor de "fallbackField" o la cadena 'ERROR' si ambos son NULO
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conditionals-if"><a href="#conditionals-if-idx">
función if
</a></h3>
<div class="description">
<p>
Prueba una condición y devuelve un resultado diferente dependiendo de la comprobación condicional.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
if
</span>
(
<span class="argument">
condition
</span>
,
<span class="argument">
result_when_true
</span>
,
<span class="argument">
result_when_false
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
condition
</td>
<td>
la condición que se debe evaluar
</td>
</tr>
<tr>
<td class="argument">
result_when_true
</td>
<td>
el resultado que se devolverá cuando la condición sea verdadera u otro valor que no convierta a falso.
</td>
</tr>
<tr>
<td class="argument">
result_when_false
</td>
<td>
el resultado que se devolverá cuando la condición sea falsa u otro valor que convierta a falso como 0 o ". NULO también se convertirá a falso.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
if( 1+1=2, 'Yes', 'No' )
</code>
<code>
'Sí'
</code>
</li>
<li>
<code>
if( 1+1=3, 'Yes', 'No' )
</code>
<code>
'No'
</code>
</li>
<li>
<code>
if( 5 &gt; 3, 1, 0)
</code>
<code>
1
</code>
</li>
<li>
<code>
if( '', 'It is true (not empty)', 'It is false (empty)' )
</code>
<code>
'It is false (empty)'
</code>
</li>
<li>
<code>
if( ' ', 'It is true (not empty)', 'It is false (empty)' )
</code>
<code>
'It is true (not empty)'
</code>
</li>
<li>
<code>
if( 0, 'One', 'Zero' )
</code>
<code>
'Cero'
</code>
</li>
<li>
<code>
if( 10, 'One', 'Zero' )
</code>
<code>
'Uno'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conditionals-nullif"><a href="#conditionals-nullif-idx">
función nullif
</a></h3>
<div class="description">
<p>
Returns a null value if value1 equals value2; otherwise it returns value1. This can be used to conditionally substitute values with NULL.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
nullif
</span>
(
<span class="argument">
value1
</span>
,
<span class="argument">
value2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value1
</td>
<td>
The value that should either be used or substituted with NULL.
</td>
</tr>
<tr>
<td class="argument">
value2
</td>
<td>
The control value that will trigger the NULL substitution.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
nullif('(none)', '(none)')
</code>
<code>
NULO
</code>
</li>
<li>
<code>
nullif('text', '(none)')
</code>
<code>
'text'
</code>
</li>
<li>
<code>
nullif("name", '')
</code>
<code>
NULL, if name is an empty string (or already NULL), the name in any other case.
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conditionals-regexp_match"><a href="#conditionals-regexp_match-idx">
función regexp_match
</a></h3>
<div class="description">
<p>
Devuelve la primera posición que coincide con una expresión regular dentro de una cadena o 0 si no se encuentra la subcadena.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
regexp_match
</span>
(
<span class="argument">
input_string
</span>
,
<span class="argument">
regex
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
input_string
</td>
<td>
La cadena a probar frente a la expresión regular
</td>
</tr>
<tr>
<td class="argument">
regex
</td>
<td>
La expresión regular frente a la que probar. El carácter barra invertida se debe escapar doblemente (ej.: "\\s" para capturar un carácter espacio en blanco).
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
regexp_match('QGIS ROCKS','\\sROCKS')
</code>
<code>
4
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conditionals-try"><a href="#conditionals-try-idx">
función try
</a></h3>
<div class="description">
<p>
Intenta ejecutar una expresión y devuelve su valor si está libre de error. Si la expresión devuelve un error, se regresará un valor alternativo cuando se proporcione, de otro modo devolverá nulo.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
try
</span>
(
<span class="argument">
expression
</span>
[,
<span class="argument">
alternative
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
la expresión que debe utilizarse
</td>
</tr>
<tr>
<td class="argument">
alternative
</td>
<td>
el resultado que será devuelto si la expresión regresa un error.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
try( to_int( '1' ), 0 )
</code>
<code>
1
</code>
</li>
<li>
<code>
try( to_int( 'a' ), 0 )
</code>
<code>
0
</code>
</li>
<li>
<code>
try( to_date( 'invalid_date' ) )
</code>
<code>
NULO
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="conversions" class="group"><h2><a href="#conversions-idx">grupo conversiones</a></h2>
<div class="description"><p>Este grupo contiene funciones para convertir unos tipos de datos en otros, por ejemplo cadena a entero o entero a cadena.</p></div></div>
<div class="function"><html>
<body>
<h3 id="conversions-from_base64"><a href="#conversions-from_base64-idx">
función from_base64
</a></h3>
<div class="description">
<p>
Decodes a string in the Base64 encoding into a binary value.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
from_base64
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to decode
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
from_base64('UUdJUw==')
</code>
<code>
'QGIS'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-hash"><a href="#conversions-hash-idx">
función hash
</a></h3>
<div class="description">
<p>
Creates a hash from a string with a given method.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
hash
</span>
(
<span class="argument">
string
</span>
,
<span class="argument">
method
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to hash
</td>
</tr>
<tr>
<td class="argument">
method
</td>
<td>
The hash method among 'md4', 'md5', 'sha1', 'sha224', 'sha384', 'sha512', 'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512', 'keccak_224', 'keccak_256', 'keccak_384', 'keccak_512'
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
hash('QGIS', md4)
</code>
<code>
'c0fc71c241cdebb6e888cbac0e2b68eb'
</code>
</li>
<li>
<code>
hash('QGIS', md5)
</code>
<code>
'57470aaa9e22adaefac7f5f342f1c6da'
</code>
</li>
<li>
<code>
hash('QGIS', sha1)
</code>
<code>
'f87cfb2b74cdd5867db913237024e7001e62b114'
</code>
</li>
<li>
<code>
hash('QGIS', sha224)
</code>
<code>
'4093a619ada631c770f44bc643ead18fb393b93d6a6af1861fcfece0'
</code>
</li>
<li>
<code>
hash('QGIS', sha256)
</code>
<code>
'eb045cba7a797aaa06ac58830846e40c8e8c780bc0676d3393605fae50c05309'
</code>
</li>
<li>
<code>
hash('QGIS', sha384)
</code>
<code>
'91c1de038cc3d09fdd512e99f9dd9922efadc39ed21d3922e69a4305cc25506033aee388e554b78714c8734f9cd7e610'
</code>
</li>
<li>
<code>
hash('QGIS', sha512)
</code>
<code>
'c2c092f2ab743bf8edbeb6d028a745f30fc720408465ed369421f0a4e20fa5e27f0c90ad72d3f1d836eaa5d25cd39897d4cf77e19984668ef58da6e3159f18ac'
</code>
</li>
<li>
<code>
hash('QGIS', sha3_224)
</code>
<code>
'467f49a5039e7280d5d42fd433e80d203439e338eaabd701f0d6c17d'
</code>
</li>
<li>
<code>
hash('QGIS', sha3_256)
</code>
<code>
'540f7354b6b8a6e735f2845250f15f4f3ba4f666c55574d9e9354575de0e980f'
</code>
</li>
<li>
<code>
hash('QGIS', sha3_384)
</code>
<code>
'96052da1e77679e9a65f60d7ead961b287977823144786386eb43647b0901fd8516fa6f1b9d243fb3f28775e6dde6107'
</code>
</li>
<li>
<code>
hash('QGIS', sha3_512)
</code>
<code>
'900d079dc69761da113980253aa8ac0414a8bd6d09879a916228f8743707c4758051c98445d6b8945ec854ff90655005e02aceb0a2ffc6a0ebf818745d665349'
</code>
</li>
<li>
<code>
hash('QGIS', keccak_224)
</code>
<code>
'5b0ce6acef8b0a121d4ac4f3eaa8503c799ad4e26a3392d1fb201478'
</code>
</li>
<li>
<code>
hash('QGIS', keccak_256)
</code>
<code>
'991c520aa6815392de24087f61b2ae0fd56abbfeee4a8ca019c1011d327c577e'
</code>
</li>
<li>
<code>
hash('QGIS', keccak_384)
</code>
<code>
'c57a3aed9d856fa04e5eeee9b62b6e027cca81ba574116d3cc1f0d48a1ef9e5886ff463ea8d0fac772ee473bf92f810d'
</code>
</li>
<li>
<code>
keccak_512('QGIS')
</code>
<code>
'6f0f751776b505e317de222508fa5d3ed7099d8f07c74fed54ccee6e7cdc6b89b4a085e309f2ee5210c9'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-md5"><a href="#conversions-md5-idx">
función md5
</a></h3>
<div class="description">
<p>
Creates a md5 hash from a string.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
md5
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to hash
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
md5('QGIS')
</code>
<code>
'57470aaa9e22adaefac7f5f342f1c6da'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-sha256"><a href="#conversions-sha256-idx">
función sha256
</a></h3>
<div class="description">
<p>
Creates a sha256 hash from a string.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
sha256
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
the string to hash
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
sha256('QGIS')
</code>
<code>
'eb045cba7a797aaa06ac58830846e40c8e8c780bc0676d3393605fae50c05309'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-to_base64"><a href="#conversions-to_base64-idx">
función to_base64
</a></h3>
<div class="description">
<p>
Encodes a binary value into a string, using the Base64 encoding.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_base64
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
the binary value to encode
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_base64('QGIS')
</code>
<code>
'UUdJUw=='
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-to_date"><a href="#conversions-to_date-idx">
función to_date
</a></h3>
<div class="description">
<p>
Convierte una cadena de caracteres en un objeto fecha. Una cadena opcional de formato puede proporcionarse para formatear la cadena; ver
<a href="https://doc.qt.io/qt-5/qdate.html#fromString-1">
QDate::fromString
</a>
para documentación adicional sobre el formato.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_date
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
cadena que representa un valor de fecha
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
format used to convert the string into a date
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
idioma (minúsculas, dos- o tres-letras, código de idioma ISO 639) usado para convertir la cadena a fecha
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_date('2012-05-04')
</code>
<code>
2012-05-04
</code>
</li>
<li>
<code>
to_date('June 29, 2019','MMMM d, yyyy')
</code>
<code>
2019-06-29
</code>
</li>
<li>
<code>
to_date('29 juin, 2019','d MMMM, yyyy','fr')
</code>
<code>
2019-06-29
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-to_datetime"><a href="#conversions-to_datetime-idx">
función to_datetime
</a></h3>
<div class="description">
<p>
Convierte una cadena de caracteres en un objeto fecha-hora. Una cadena opcional de formato puede proporcionarse para formatear la cadena; ver
<a href="https://doc.qt.io/qt-5/qdatetime.html#fromString-1">
QDate::fromString
</a>
para documentación adicional sobre el formato.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_datetime
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
cadena que representa un valor de fecha y hora
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
formato usado para convertir la cadena a fecha-hora
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
idioma (minúsculas, dos- o tres-letras, código de idioma ISO 639) usado para convertir la cadena a fecha-hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_datetime('2012-05-04 12:50:00')
</code>
<code>
2012-05-04T12:50:00
</code>
</li>
<li>
<code>
to_datetime('June 29, 2019 @ 12:34','MMMM d, yyyy @ HH:mm')
</code>
<code>
2019-06-29T12:34
</code>
</li>
<li>
<code>
to_datetime('29 juin, 2019 @ 12:34','d MMMM, yyyy @ HH:mm','fr')
</code>
<code>
2019-06-29T12:34
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-to_dm"><a href="#conversions-to_dm-idx">
función to_dm
</a></h3>
<div class="description">
<p>
Convertir una coordenada a grados, minutos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_dm
</span>
(
<span class="argument">
coordinate
</span>
,
<span class="argument">
axis
</span>
,
<span class="argument">
precision
</span>
[,
<span class="argument">
formatting
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
coordinate
</td>
<td>
Un valor de latitud o longitud.
</td>
</tr>
<tr>
<td class="argument">
axis
</td>
<td>
El eje de la coordenada. Ya sea 'x' o 'y'.
</td>
</tr>
<tr>
<td class="argument">
precision
</td>
<td>
Número de decimales.
</td>
</tr>
<tr>
<td class="argument">
formatting
</td>
<td>
Designa el tipo de formato. Valores aceptables son NULL, 'aligned' o 'suffix'.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_dm(6.3545681, 'x', 3)
</code>
<code>
6°21.274′
</code>
</li>
<li>
<code>
to_dm(6.3545681, 'y', 4, 'suffix')
</code>
<code>
6°21.2741′N
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-to_dms"><a href="#conversions-to_dms-idx">
función to_dms
</a></h3>
<div class="description">
<p>
Convertir una coordenada a grados, minutos, segundos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_dms
</span>
(
<span class="argument">
coordinate
</span>
,
<span class="argument">
axis
</span>
,
<span class="argument">
precision
</span>
[,
<span class="argument">
formatting
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
coordinate
</td>
<td>
Un valor de latitud o longitud.
</td>
</tr>
<tr>
<td class="argument">
axis
</td>
<td>
El eje de la coordenada. Ya sea 'x' o 'y'.
</td>
</tr>
<tr>
<td class="argument">
precision
</td>
<td>
Número de decimales.
</td>
</tr>
<tr>
<td class="argument">
formatting
</td>
<td>
Designa el tipo de formato. Valores aceptables son NULL, 'aligned' o 'suffix'.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_dms(6.3545681, 'x', 3)
</code>
<code>
6°21′16.445″
</code>
</li>
<li>
<code>
to_dms(6.3545681, 'y', 4, 'suffix')
</code>
<code>
6°21′16.4452″N
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-to_int"><a href="#conversions-to_int-idx">
función to_int
</a></h3>
<div class="description">
<p>
Convierte una cadena a número entero. No devuelve nada si un valor no se puede convertir a entero (ej.: '123asd' no es válido).
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_int
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
cadena a convertir a número entero
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_int('123')
</code>
<code>
123
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-to_interval"><a href="#conversions-to_interval-idx">
función to_interval
</a></h3>
<div class="description">
<p>
Converts a string to a interval type. Can be used to take days, hours, month, etc of a date.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_interval
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
una cadena que representa un intervalo. Los formatos permitidos incluyen {n} días {n} horas {n} meses.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_datetime('2012-05-05 12:00:00') - to_interval('1 día 2 horas')
</code>
<code>
2012-05-04T10:00:00
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-to_real"><a href="#conversions-to_real-idx">
función to_real
</a></h3>
<div class="description">
<p>
Convierte una cadena a número real. No devuelve nada si un valor no se puede convertir a real (ej.: '123.56asd' no es válido). Los números se redondean después de guardar los cambios si la precisión es menor que el resultado de la conversión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_real
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
cadena a convertir a número real
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_real('123.45')
</code>
<code>
123.45
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-to_string"><a href="#conversions-to_string-idx">
función to_string
</a></h3>
<div class="description">
<p>
Convierte un número en cadena.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_string
</span>
(
<span class="argument">
number
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
number
</td>
<td>
Valor entero o real. El número a convertir en cadena.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_string(123)
</code>
<code>
'123'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="conversions-to_time"><a href="#conversions-to_time-idx">
función to_time
</a></h3>
<div class="description">
<p>
Converts a string into a time object. An optional format string can be provided to parse the string; see
<a href="https://doc.qt.io/qt-5/qtime.html#fromString-1">
QTime::fromString
</a>
for additional documentation on the format.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_time
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
cadena que representa un valor hora
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
formato utilizado para convertir la cadena a hora
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
idioma (minúsculas, dos- o tres-letras, código de idioma ISO 639) usado para convertir la cadena a hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_time('12:30:01')
</code>
<code>
12:30:01
</code>
</li>
<li>
<code>
to_time('12:34','HH:mm')
</code>
<code>
12:34:00
</code>
</li>
<li>
<code>
to_time('12:34','HH:mm','fr')
</code>
<code>
12:34:00
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="date-and-time" class="group"><h2><a href="#date-and-time-idx">grupo fecha y hora</a></h2>
<div class="description"><p>Este grupo contiene funciones para manipular datos de fecha y hora.</p></div></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-age"><a href="#date-and-time-age-idx">
función age
</a></h3>
<div class="description">
<p>
Devuelve la diferencia entre dos fechas o fechas y horas.
<br/>
La diferencia se devuelve como un
<code>
Intervalo
</code>
y es necesario usarla con una de las siguientes funciones para extraer información útil:
<br/>
</p>
<ul>
<li>
<code>
año
</code>
</li>
<li>
<code>
mes
</code>
</li>
<li>
<code>
semana
</code>
</li>
<li>
<code>
día
</code>
</li>
<li>
<code>
hora
</code>
</li>
<li>
<code>
minuto
</code>
</li>
<li>
<code>
segundo
</code>
</li>
</ul>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
age
</span>
(
<span class="argument">
datetime1
</span>
,
<span class="argument">
datetime2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
datetime1
</td>
<td>
una cadena, fecha o fecha y hora que representa la fecha posterior
</td>
</tr>
<tr>
<td class="argument">
datetime2
</td>
<td>
una cadena, fecha o fecha y hora que representa la fecha anterior
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
day(age('2012-05-12','2012-05-02'))
</code>
<code>
10
</code>
</li>
<li>
<code>
hour(age('2012-05-12','2012-05-02'))
</code>
<code>
240
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-datetime_from_epoch"><a href="#date-and-time-datetime_from_epoch-idx">
función datetime_from_epoch
</a></h3>
<div class="description">
<p>
Returns a datetime whose date and time are the number of milliseconds, msecs, that have passed since 1970-01-01T00:00:00.000, Coordinated Universal Time (Qt.UTC), and converted to Qt.LocalTime.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
datetime_from_epoch
</span>
(
<span class="argument">
int
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
int
</td>
<td>
number (milliseconds)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
datetime_from_epoch(1483225200000)
</code>
<code>
2017-01-01T00:00:00
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-day"><a href="#date-and-time-day-idx">
función day
</a></h3>
<div class="description">
<p>
Extracts the day from a date, or the number of days from an interval.
</p>
</div>
<h3 id="date-and-time-day"><a href="#date-and-time-day-idx">
Variante de fecha
</a></h3>
<div class="description">
Extracts the day from a date or datetime.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
day
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
una fecha o fecha y hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
day('2012-05-12')
</code>
<code>
12
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-day"><a href="#date-and-time-day-idx">
Variante de intervalo
</a></h3>
<div class="description">
Calculates the length in days of an interval.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
day
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
intervalo del que devolver el número de días
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
day(to_interval('3 days'))
</code>
<code>
3
</code>
</li>
<li>
<code>
day(to_interval('3 weeks 2 days'))
</code>
<code>
23
</code>
</li>
<li>
<code>
day(age('2012-01-01','2010-01-01'))
</code>
<code>
730
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-day_of_week"><a href="#date-and-time-day_of_week-idx">
función day_of_week
</a></h3>
<div class="description">
<p>
Devuelve el día de la semana para una fecha o fecha y hora especificadas. El valor devuelto varía entre 0 y 6, donde 0 corresponde a domingo y 6 a sábado.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
day_of_week
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
una fecha o fecha y hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
day_of_week(to_date('2015-09-21'))
</code>
<code>
1
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-epoch"><a href="#date-and-time-epoch-idx">
función epoch
</a></h3>
<div class="description">
<p>
Returns the interval in milliseconds between the unix epoch and a given date value.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
epoch
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
una fecha o fecha y hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
epoch(to_date('2017-01-01'))
</code>
<code>
1483203600000
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-format_date"><a href="#date-and-time-format_date-idx">
función format_date
</a></h3>
<div class="description">
<p>
Formats a date type or string into a custom string format. Uses Qt date/time format strings. See
<a href="https://doc.qt.io/qt-5/qdatetime.html#toString">
QDateTime::toString
</a>
.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
format_date
</span>
(
<span class="argument">
datetime
</span>
,
<span class="argument">
format
</span>
[,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
datetime
</td>
<td>
valor de fecha, hora o fecha y hora
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
String template used to format the string.
<table>
<thead>
<tr>
<th>
Expression
</th>
<th>
Output
</th>
</tr>
</thead>
<tr valign="top">
<td>
d
</td>
<td>
the day as number without a leading zero (1 to 31)
</td>
</tr>
<tr valign="top">
<td>
dd
</td>
<td>
the day as number with a leading zero (01 to 31)
</td>
</tr>
<tr valign="top">
<td>
ddd
</td>
<td>
the abbreviated localized day name (e.g. 'Mon' to 'Sun')
</td>
</tr>
<tr valign="top">
<td>
dddd
</td>
<td>
the long localized day name (e.g. 'Monday' to 'Sunday')
</td>
</tr>
<tr valign="top">
<td>
M
</td>
<td>
the month as number without a leading zero (1-12)
</td>
</tr>
<tr valign="top">
<td>
MM
</td>
<td>
the month as number with a leading zero (01-12)
</td>
</tr>
<tr valign="top">
<td>
MMM
</td>
<td>
the abbreviated localized month name (e.g. 'Jan' to 'Dec')
</td>
</tr>
<tr valign="top">
<td>
MMMM
</td>
<td>
the long localized month name (e.g. 'January' to 'December')
</td>
</tr>
<tr valign="top">
<td>
yy
</td>
<td>
the year as two digit number (00-99)
</td>
</tr>
<tr valign="top">
<td>
yyyy
</td>
<td>
the year as four digit number
</td>
</tr>
</table>
<p>
These expressions may be used for the time part of the format string:
</p>
<table>
<thead>
<tr>
<th>
Expression
</th>
<th>
Output
</th>
</tr>
</thead>
<tr valign="top">
<td>
h
</td>
<td>
the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
hh
</td>
<td>
the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
H
</td>
<td>
the hour without a leading zero (0 to 23, even with AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
HH
</td>
<td>
the hour with a leading zero (00 to 23, even with AM/PM display)
</td>
</tr>
<tr valign="top">
<td>
m
</td>
<td>
the minute without a leading zero (0 to 59)
</td>
</tr>
<tr valign="top">
<td>
mm
</td>
<td>
the minute with a leading zero (00 to 59)
</td>
</tr>
<tr valign="top">
<td>
s
</td>
<td>
the second without a leading zero (0 to 59)
</td>
</tr>
<tr valign="top">
<td>
ss
</td>
<td>
the second with a leading zero (00 to 59)
</td>
</tr>
<tr valign="top">
<td>
z
</td>
<td>
the milliseconds without trailing zeroes (0 to 999)
</td>
</tr>
<tr valign="top">
<td>
zzz
</td>
<td>
the milliseconds with trailing zeroes (000 to 999)
</td>
</tr>
<tr valign="top">
<td>
AP or A
</td>
<td>
interpret as an AM/PM time.
<i>
AP
</i>
must be either "AM" or "PM".
</td>
</tr>
<tr valign="top">
<td>
ap or a
</td>
<td>
Interpret as an AM/PM time.
<i>
ap
</i>
must be either "am" or "pm".
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
language (lowercase, two- or three-letter, ISO 639 language code) used to format the date into a custom string
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
format_date('2012-05-15','dd.MM.yyyy')
</code>
<code>
'15.05.2012'
</code>
</li>
<li>
<code>
format_date('2012-05-15','d MMMM yyyy','fr')
</code>
<code>
'15 juin 2012'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-hour"><a href="#date-and-time-hour-idx">
función hour
</a></h3>
<div class="description">
<p>
Extracts the hour part from a datetime or time, or the number of hours from an interval.
</p>
</div>
<h3 id="date-and-time-hour"><a href="#date-and-time-hour-idx">
Variante de hora
</a></h3>
<div class="description">
Extracts the hour part from a time or datetime.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
hour
</span>
(
<span class="argument">
datetime
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
datetime
</td>
<td>
un valor de hora o fecha y hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
hour('2012-07-22T13:24:57')
</code>
<code>
13
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-hour"><a href="#date-and-time-hour-idx">
Variante de intervalo
</a></h3>
<div class="description">
Calculates the length in hours of an interval.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
hour
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
intervalo del que devolver el número de horas
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
hour(tointerval('3 horas'))
</code>
<code>
3
</code>
</li>
<li>
<code>
hour(age('2012-07-22T13:00:00','2012-07-22T10:00:00'))
</code>
<code>
3
</code>
</li>
<li>
<code>
hour(age('2012-01-01','2010-01-01'))
</code>
<code>
17520
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-make_date"><a href="#date-and-time-make_date-idx">
función make_date
</a></h3>
<div class="description">
<p>
Creates a date value from year, month and day numbers.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_date
</span>
(
<span class="argument">
year
</span>
,
<span class="argument">
month
</span>
,
<span class="argument">
day
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
year
</td>
<td>
Year number. Years 1 to 99 are interpreted as is. Year 0 is invalid.
</td>
</tr>
<tr>
<td class="argument">
month
</td>
<td>
Month number, where 1=January
</td>
</tr>
<tr>
<td class="argument">
day
</td>
<td>
Day number, beginning with 1 for the first day in the month
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
make_date(2020,5,4)
</code>
<code>
date value 2020-05-04
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-make_datetime"><a href="#date-and-time-make_datetime-idx">
función make_datetime
</a></h3>
<div class="description">
<p>
Creates a datetime value from year, month, day, hour, minute and second numbers.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_datetime
</span>
(
<span class="argument">
year
</span>
,
<span class="argument">
month
</span>
,
<span class="argument">
day
</span>
,
<span class="argument">
hour
</span>
,
<span class="argument">
minute
</span>
,
<span class="argument">
second
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
year
</td>
<td>
Year number. Years 1 to 99 are interpreted as is. Year 0 is invalid.
</td>
</tr>
<tr>
<td class="argument">
month
</td>
<td>
Month number, where 1=January
</td>
</tr>
<tr>
<td class="argument">
day
</td>
<td>
Day number, beginning with 1 for the first day in the month
</td>
</tr>
<tr>
<td class="argument">
hour
</td>
<td>
Hour number
</td>
</tr>
<tr>
<td class="argument">
minute
</td>
<td>
Minutes
</td>
</tr>
<tr>
<td class="argument">
second
</td>
<td>
Seconds (fractional values include milliseconds)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
make_datetime(2020,5,4,13,45,30.5)
</code>
<code>
datetime value 2020-05-04 13:45:30.500
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-make_interval"><a href="#date-and-time-make_interval-idx">
función make_interval
</a></h3>
<div class="description">
<p>
Creates an interval value from year, month, weeks, days, hours, minute and seconds values.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_interval
</span>
([
<span class="argument">
years=0
</span>
][,
<span class="argument">
months=0
</span>
][,
<span class="argument">
weeks=0
</span>
][,
<span class="argument">
days=0
</span>
][,
<span class="argument">
hours=0
</span>
][,
<span class="argument">
minutes=0
</span>
][,
<span class="argument">
seconds=0
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
years
</td>
<td>
Number of years (assumes a 365.25 day year length).
</td>
</tr>
<tr>
<td class="argument">
months
</td>
<td>
Number of months (assumes a 30 day month length)
</td>
</tr>
<tr>
<td class="argument">
weeks
</td>
<td>
Number of weeks
</td>
</tr>
<tr>
<td class="argument">
days
</td>
<td>
Number of days
</td>
</tr>
<tr>
<td class="argument">
hours
</td>
<td>
Number of hours
</td>
</tr>
<tr>
<td class="argument">
minutes
</td>
<td>
Number of minutes
</td>
</tr>
<tr>
<td class="argument">
seconds
</td>
<td>
Number of seconds
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
make_interval(hours:=3)
</code>
<code>
3 hour interval
</code>
</li>
<li>
<code>
make_interval(days:=2, hours:=3)
</code>
<code>
2 day, 3 hour interval
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-make_time"><a href="#date-and-time-make_time-idx">
función make_time
</a></h3>
<div class="description">
<p>
Creates a time value from hour, minute and second numbers.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_time
</span>
(
<span class="argument">
hour
</span>
,
<span class="argument">
minute
</span>
,
<span class="argument">
second
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
hour
</td>
<td>
Hour number
</td>
</tr>
<tr>
<td class="argument">
minute
</td>
<td>
Minutes
</td>
</tr>
<tr>
<td class="argument">
second
</td>
<td>
Seconds (fractional values include milliseconds)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
make_time(13,45,30.5)
</code>
<code>
time value 13:45:30.500
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-minute"><a href="#date-and-time-minute-idx">
función minute
</a></h3>
<div class="description">
<p>
Extracts the minutes part from a datetime or time, or the number of minutes from an interval.
</p>
</div>
<h3 id="date-and-time-minute"><a href="#date-and-time-minute-idx">
Variante de hora
</a></h3>
<div class="description">
Extracts the minutes part from a time or datetime.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
minute
</span>
(
<span class="argument">
datetime
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
datetime
</td>
<td>
un valor de hora o fecha y hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
minute('2012-07-22T13:24:57')
</code>
<code>
24
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-minute"><a href="#date-and-time-minute-idx">
Variante de intervalo
</a></h3>
<div class="description">
Calculates the length in minutes of an interval.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
minute
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
intervalo del que devolver el número de minutos
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
minute(tointerval('3 minutos'))
</code>
<code>
3
</code>
</li>
<li>
<code>
minute(age('2012-07-22T00:20:00','2012-07-22T00:00:00'))
</code>
<code>
20
</code>
</li>
<li>
<code>
minute(age('2012-01-01','2010-01-01'))
</code>
<code>
1051200
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-month"><a href="#date-and-time-month-idx">
función month
</a></h3>
<div class="description">
<p>
Extracts the month part from a date, or the number of months from an interval.
</p>
</div>
<h3 id="date-and-time-month"><a href="#date-and-time-month-idx">
Variante de fecha
</a></h3>
<div class="description">
Extracts the month part from a date or datetime.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
month
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
una fecha o fecha y hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
month('2012-05-12')
</code>
<code>
05
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-month"><a href="#date-and-time-month-idx">
Variante de intervalo
</a></h3>
<div class="description">
Calculates the length in months of an interval.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
month
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
intervalo del que devolver el número de meses
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
month(to_interval('3 meses'))
</code>
<code>
3
</code>
</li>
<li>
<code>
month(age('2012-01-01','2010-01-01'))
</code>
<code>
4.03333
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-now"><a href="#date-and-time-now-idx">
función now
</a></h3>
<div class="description">
<p>
Returns the current date and time. The function is static and will return consistent results while evaluating. The time returned is the time when the expression is prepared.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
now
</span>
()
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
now()
</code>
<code>
2012-07-22T13:24:57
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-second"><a href="#date-and-time-second-idx">
función second
</a></h3>
<div class="description">
<p>
Extracts the seconds part from a datetime or time, or the number of seconds from an interval.
</p>
</div>
<h3 id="date-and-time-second"><a href="#date-and-time-second-idx">
Variante de hora
</a></h3>
<div class="description">
Extracts the seconds part from a time or datetime.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
second
</span>
(
<span class="argument">
datetime
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
datetime
</td>
<td>
un valor de hora o fecha y hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
second('2012-07-22T13:24:57')
</code>
<code>
57
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-second"><a href="#date-and-time-second-idx">
Variante de intervalo
</a></h3>
<div class="description">
Calculates the length in seconds of an interval.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
second
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
intervalo del que devolver el número de segundos
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
second(age('2012-07-22T00:20:00','2012-07-22T00:00:00'))
</code>
<code>
1200
</code>
</li>
<li>
<code>
second(age('2012-01-01','2010-01-01'))
</code>
<code>
63072000
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-to_date"><a href="#date-and-time-to_date-idx">
función to_date
</a></h3>
<div class="description">
<p>
Convierte una cadena de caracteres en un objeto fecha. Una cadena opcional de formato puede proporcionarse para formatear la cadena; ver
<a href="https://doc.qt.io/qt-5/qdate.html#fromString-1">
QDate::fromString
</a>
para documentación adicional sobre el formato.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_date
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
cadena que representa un valor de fecha
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
format used to convert the string into a date
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
idioma (minúsculas, dos- o tres-letras, código de idioma ISO 639) usado para convertir la cadena a fecha
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_date('2012-05-04')
</code>
<code>
2012-05-04
</code>
</li>
<li>
<code>
to_date('June 29, 2019','MMMM d, yyyy')
</code>
<code>
2019-06-29
</code>
</li>
<li>
<code>
to_date('29 juin, 2019','d MMMM, yyyy','fr')
</code>
<code>
2019-06-29
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-to_datetime"><a href="#date-and-time-to_datetime-idx">
función to_datetime
</a></h3>
<div class="description">
<p>
Convierte una cadena de caracteres en un objeto fecha-hora. Una cadena opcional de formato puede proporcionarse para formatear la cadena; ver
<a href="https://doc.qt.io/qt-5/qdatetime.html#fromString-1">
QDate::fromString
</a>
para documentación adicional sobre el formato.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_datetime
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
cadena que representa un valor de fecha y hora
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
formato usado para convertir la cadena a fecha-hora
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
idioma (minúsculas, dos- o tres-letras, código de idioma ISO 639) usado para convertir la cadena a fecha-hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_datetime('2012-05-04 12:50:00')
</code>
<code>
2012-05-04T12:50:00
</code>
</li>
<li>
<code>
to_datetime('June 29, 2019 @ 12:34','MMMM d, yyyy @ HH:mm')
</code>
<code>
2019-06-29T12:34
</code>
</li>
<li>
<code>
to_datetime('29 juin, 2019 @ 12:34','d MMMM, yyyy @ HH:mm','fr')
</code>
<code>
2019-06-29T12:34
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-to_interval"><a href="#date-and-time-to_interval-idx">
función to_interval
</a></h3>
<div class="description">
<p>
Converts a string to a interval type. Can be used to take days, hours, month, etc of a date.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_interval
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
una cadena que representa un intervalo. Los formatos permitidos incluyen {n} días {n} horas {n} meses.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_datetime('2012-05-05 12:00:00') - to_interval('1 día 2 horas')
</code>
<code>
2012-05-04T10:00:00
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-to_time"><a href="#date-and-time-to_time-idx">
función to_time
</a></h3>
<div class="description">
<p>
Converts a string into a time object. An optional format string can be provided to parse the string; see
<a href="https://doc.qt.io/qt-5/qtime.html#fromString-1">
QTime::fromString
</a>
for additional documentation on the format.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_time
</span>
(
<span class="argument">
string
</span>
[,
<span class="argument">
format
</span>
][,
<span class="argument">
language
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
cadena que representa un valor hora
</td>
</tr>
<tr>
<td class="argument">
format
</td>
<td>
formato utilizado para convertir la cadena a hora
</td>
</tr>
<tr>
<td class="argument">
language
</td>
<td>
idioma (minúsculas, dos- o tres-letras, código de idioma ISO 639) usado para convertir la cadena a hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_time('12:30:01')
</code>
<code>
12:30:01
</code>
</li>
<li>
<code>
to_time('12:34','HH:mm')
</code>
<code>
12:34:00
</code>
</li>
<li>
<code>
to_time('12:34','HH:mm','fr')
</code>
<code>
12:34:00
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-week"><a href="#date-and-time-week-idx">
función week
</a></h3>
<div class="description">
<p>
Extracts the week number from a date, or the number of weeks from an interval.
</p>
</div>
<h3 id="date-and-time-week"><a href="#date-and-time-week-idx">
Variante de fecha
</a></h3>
<div class="description">
Extracts the week number from a date or datetime.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
week
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
una fecha o fecha y hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
week('2012-05-12')
</code>
<code>
19
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-week"><a href="#date-and-time-week-idx">
Variante de intervalo
</a></h3>
<div class="description">
Calculates the length in weeks of an interval.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
week
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
intervalo del que devolver el número de meses
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
week(to_interval('3 weeks'))
</code>
<code>
3
</code>
</li>
<li>
<code>
week(age('2012-01-01','2010-01-01'))
</code>
<code>
104.285
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="date-and-time-year"><a href="#date-and-time-year-idx">
función year
</a></h3>
<div class="description">
<p>
Extracts the year part from a date, or the number of years from an interval.
</p>
</div>
<h3 id="date-and-time-year"><a href="#date-and-time-year-idx">
Variante de fecha
</a></h3>
<div class="description">
Extracts the year part from a date or datetime.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
year
</span>
(
<span class="argument">
date
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
date
</td>
<td>
una fecha o fecha y hora
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
year('2012-05-12')
</code>
<code>
2012
</code>
</li>
</ul>
</div>
<h3 id="date-and-time-year"><a href="#date-and-time-year-idx">
Variante de intervalo
</a></h3>
<div class="description">
Calculates the length in years of an interval.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
year
</span>
(
<span class="argument">
interval
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
interval
</td>
<td>
intervalo del que devolver el número de años
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
year(to_interval('3 años'))
</code>
<code>
3
</code>
</li>
<li>
<code>
year(age('2012-01-01','2010-01-01'))
</code>
<code>
1.9986
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div id="files-and-paths" class="group"><h2><a href="#files-and-paths-idx">grupo files and paths</a></h2>
<div class="description"><p>Contains functions which manipulate file and path names.</p></div></div>
<div class="function"><html>
<body>
<h3 id="files-and-paths-base_file_name"><a href="#files-and-paths-base_file_name-idx">
función base_file_name
</a></h3>
<div class="description">
<p>
Returns the base name of the file without the directory or file suffix.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
base_file_name
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
base_file_name('/home/qgis/data/country_boundaries.shp')
</code>
<code>
'country_boundaries'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="files-and-paths-file_exists"><a href="#files-and-paths-file_exists-idx">
función file_exists
</a></h3>
<div class="description">
<p>
Returns true if a file path exists.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
file_exists
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
file_exists('/home/qgis/data/country_boundaries.shp')
</code>
<code>
verdadero
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="files-and-paths-file_name"><a href="#files-and-paths-file_name-idx">
función file_name
</a></h3>
<div class="description">
<p>
Returns the name of a file (including the file extension), excluding the directory.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
file_name
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
file_name('/home/qgis/data/country_boundaries.shp')
</code>
<code>
'country_boundaries.shp'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="files-and-paths-file_path"><a href="#files-and-paths-file_path-idx">
función file_path
</a></h3>
<div class="description">
<p>
Returns the directory component of a file path. This does not include the file name.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
file_path
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
file_path('/home/qgis/data/country_boundaries.shp')
</code>
<code>
'/home/qgis/data'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="files-and-paths-file_size"><a href="#files-and-paths-file_size-idx">
función file_size
</a></h3>
<div class="description">
<p>
Returns the size (in bytes) of a file.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
file_size
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
file_size('/home/qgis/data/country_boundaries.geojson')
</code>
<code>
5674
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="files-and-paths-file_suffix"><a href="#files-and-paths-file_suffix-idx">
función file_suffix
</a></h3>
<div class="description">
<p>
Returns the file suffix (extension) from a file path.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
file_suffix
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
file_suffix('/home/qgis/data/country_boundaries.shp')
</code>
<code>
'shp'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="files-and-paths-is_directory"><a href="#files-and-paths-is_directory-idx">
función is_directory
</a></h3>
<div class="description">
<p>
Returns true if a path corresponds to a directory.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_directory
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
is_directory('/home/qgis/data/country_boundaries.shp')
</code>
<code>
falso
</code>
</li>
<li>
<code>
is_directory('/home/qgis/data/')
</code>
<code>
verdadero
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="files-and-paths-is_file"><a href="#files-and-paths-is_file-idx">
función is_file
</a></h3>
<div class="description">
<p>
Returns true if a path corresponds to a file.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_file
</span>
(
<span class="argument">
path
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
path
</td>
<td>
a file path
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
is_file('/home/qgis/data/country_boundaries.shp')
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
is_file('/home/qgis/data/')
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="form" class="group">falta la ayuda de la función para Form</div>
<div class="function"><html>
<body>
<h3 id="form-current_parent_value"><a href="#form-current_parent_value-idx">
función current_parent_value
</a></h3>
<div class="description">
<p>
Only usable in an embedded form context, this function returns the current, unsaved value of a field in the parent form currently being edited. This will differ from the parent feature's actual attribute values for features which are currently being edited or have not yet been added to a parent layer. When used in a value-relation widget filter expression, this function should be wrapped into a 'coalesce()' that can retrieve the actual parent feature from the layer when the form is not used in an embedded context.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
current_parent_value
</span>
(
<span class="argument">
field_name
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
field_name
</td>
<td>
a field name in the current parent form
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
current_parent_value( 'FIELD_NAME' )
</code>
<code>
The current value of a field 'FIELD_NAME' in the parent form.
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="form-current_value"><a href="#form-current_value-idx">
función current_value
</a></h3>
<div class="description">
<p>
Returns the current, unsaved value of a field in the form or table row currently being edited. This will differ from the feature's actual attribute values for features which are currently being edited or have not yet been added to a layer.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
current_value
</span>
(
<span class="argument">
field_name
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
field_name
</td>
<td>
a field name in the current form or table row
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
current_value( 'FIELD_NAME' )
</code>
<code>
The current value of field 'FIELD_NAME'.
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="fuzzy-matching" class="group"><h2><a href="#fuzzy-matching-idx">grupo concordancia aproximada</a></h2>
<div class="description"><p>Este grupo contiene funciones para comparaciones simples entre valores.</p></div></div>
<div class="function"><html>
<body>
<h3 id="fuzzy-matching-hamming_distance"><a href="#fuzzy-matching-hamming_distance-idx">
función hamming_distance
</a></h3>
<div class="description">
<p>
Devuelve la distancia de Hamming entre dos cadenas. Esto es igual al número de caracteres en las posiciones correspondientes dentro de las cadenas de entrada donde los caracteres son diferentes. Las cadenas de entrada deben tener la misma longitud y la comparación es sensible a mayúsculas.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
hamming_distance
</span>
(
<span class="argument">
string1
</span>
,
<span class="argument">
string2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string1
</td>
<td>
una cadena
</td>
</tr>
<tr>
<td class="argument">
string2
</td>
<td>
una cadena
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
hamming_distance('abc','xec')
</code>
<code>
2
</code>
</li>
<li>
<code>
hamming_distance('abc','ABc')
</code>
<code>
2
</code>
</li>
<li>
<code>
hamming_distance(upper('abc'),upper('ABC'))
</code>
<code>
0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="fuzzy-matching-levenshtein"><a href="#fuzzy-matching-levenshtein-idx">
función levenshtein
</a></h3>
<div class="description">
<p>
Devuelve la distancia de edición de Levenshtein entre dos cadenas. Esto es el número mínimo de ediciones de caracteres (inserciones, borrados o sustituciones) necesario para convertir una cadena en otra.
<br/>
La distancia de Levenshtein es una medida de la similitud entre dos cadenas. Distancias menores significan que las cadenas son más parecidas y distancias mayores indican más diferencia entre las cadenas. La distancia distingue entre mayúsculas y minúsculas.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
levenshtein
</span>
(
<span class="argument">
string1
</span>
,
<span class="argument">
string2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string1
</td>
<td>
una cadena
</td>
</tr>
<tr>
<td class="argument">
string2
</td>
<td>
una cadena
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
levenshtein('mínimo','máximo')
</code>
<code>
2
</code>
</li>
<li>
<code>
levenshtein('Mínimo','mínimo')
</code>
<code>
1
</code>
</li>
<li>
<code>
levenshtein(upper('Mínimo'),upper('mínimo'))
</code>
<code>
0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="fuzzy-matching-longest_common_substring"><a href="#fuzzy-matching-longest_common_substring-idx">
función longest_common_substring
</a></h3>
<div class="description">
<p>
Devuelve la subcadena común más larga entre dos cadenas. Esta subcadena es la más larga que es una subcadena de las dos cadenas de entrada. Por ejemplo, la subcadena más larga común de "ABABC" y "BABCA" es "ABC". La subcadena distingue mayúsculas/minúsculas.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
longest_common_substring
</span>
(
<span class="argument">
string1
</span>
,
<span class="argument">
string2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string1
</td>
<td>
una cadena
</td>
</tr>
<tr>
<td class="argument">
string2
</td>
<td>
una cadena
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
longest_common_substring('ABABC','BABCA')
</code>
<code>
'ABC'
</code>
</li>
<li>
<code>
longest_common_substring('abcDeF','abcdef')
</code>
<code>
'abc'
</code>
</li>
<li>
<code>
longest_common_substring(upper('abcDeF'),upper('abcdex'))
</code>
<code>
'ABCDE'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="fuzzy-matching-soundex"><a href="#fuzzy-matching-soundex-idx">
función soundex
</a></h3>
<div class="description">
<p>
Devuelve la representación Soundex de una cadena. Soundex es un algoritmo de coincidencia fonética, de forma que cadenas con sonidos similares deben representarse por el mismo código Soundex.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
soundex
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
una cadena
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
soundex('robert')
</code>
<code>
'R163'
</code>
</li>
<li>
<code>
soundex('rupert')
</code>
<code>
'R163'
</code>
</li>
<li>
<code>
soundex('rubin')
</code>
<code>
'R150'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="general" class="group"><h2><a href="#general-idx">grupo general</a></h2>
<div class="description"><p>Este grupo contiene funciones generales variadas.</p></div></div>
<div class="function"><html>
<body>
<h3 id="general-env"><a href="#general-env-idx">
función env
</a></h3>
<div class="description">
<p>
Obtiene una variable de entorno y devuelve su contenido como cadena. Si la variable no se encuentra devuelve "NULO". Esto es útil para introducir configuraciones específicas del sistema, como la letra de unidad o prefijos de rutas. La definición de variables de entorno depende del sistema operativo, por favor consulte cómo se puede establecer con el administrador de su equipo o en la documentación del sistema operativo.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
env
</span>
(
<span class="argument">
name
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
name
</td>
<td>
El nombre de la variable de entorno que de debe recuperar.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
env( 'LANG' )
</code>
<code>
'en_US.UTF-8'
</code>
</li>
<li>
<code>
env( 'MY_OWN_PREFIX_VAR' )
</code>
<code>
'Z:'
</code>
</li>
<li>
<code>
env( 'I_DO_NOT_EXIST' )
</code>
<code>
NULO
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="general-eval"><a href="#general-eval-idx">
función eval
</a></h3>
<div class="description">
<p>
Evalúa una expresión que es pasada en una cadena. Útil para expandir parámetros dinámicos pasados como variables de contexto o campos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
eval
</span>
(
<span class="argument">
expression
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
expression
</td>
<td>
una cadena de expresión
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
eval(''nice'')
</code>
<code>
'nice'
</code>
</li>
<li>
<code>
eval(@expression_var)
</code>
<code>
[whatever the result of evaluating @expression_var might be…]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="general-eval_template"><a href="#general-eval_template-idx">
función eval_template
</a></h3>
<div class="description">
<p>
Evaluates a template which is passed in a string. Useful to expand dynamic parameters passed as context variables or fields.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
eval_template
</span>
(
<span class="argument">
template
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
template
</td>
<td>
a template string
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
eval_template('QGIS [% upper(\'rocks\') %]')
</code>
<code>
QGIS ROCKS
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="general-is_layer_visible"><a href="#general-is_layer_visible-idx">
función is_layer_visible
</a></h3>
<div class="description">
<p>
Devuelve verdadero si la capa especificada es visible.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_layer_visible
</span>
(
<span class="argument">
layer
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
Una cadena que represente el nombre o la ID de una capa
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
is_layer_visible('baseraster')
</code>
<code>
Verdadero
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="general-layer_property"><a href="#general-layer_property-idx">
función layer_property
</a></h3>
<div class="description">
<p>
Devuelve el valor de una propiedad o metadato de una capa.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
layer_property
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
property
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
Una cadena que represente el nombre o la ID de una capa
</td>
</tr>
<tr>
<td class="argument">
property
</td>
<td>
a string corresponding to the property to return. Valid options are:
<br/>
<ul>
<li>
name: layer name
</li>
<li>
id: layer ID
</li>
<li>
title: metadata title string
</li>
<li>
abstract: metadata abstract string
</li>
<li>
keywords: metadata keywords
</li>
<li>
data_url: metadata URL
</li>
<li>
attribution: metadata attribution string
</li>
<li>
attribution_url: metadata attribution URL
</li>
<li>
source: layer source
</li>
<li>
min_scale: minimum display scale for layer
</li>
<li>
max_scale: maximum display scale for layer
</li>
<li>
is_editable: if layer is in edit mode
</li>
<li>
crs: layer CRS
</li>
<li>
crs_definition: layer CRS full definition
</li>
<li>
crs_description: layer CRS description
</li>
<li>
extent: layer extent (as a geometry object)
</li>
<li>
distance_units: layer distance units
</li>
<li>
type: layer type, e.g., Vector or Raster
</li>
<li>
storage_type: storage format (vector layers only)
</li>
<li>
geometry_type: geometry type, e.g., Point (vector layers only)
</li>
<li>
feature_count: approximate feature count for layer (vector layers only)
</li>
<li>
path: File path to the layer data source. Only available for file based layers.
</li>
</ul>
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
layer_property('calles','title')
</code>
<code>
'Mapa base de calles'
</code>
</li>
<li>
<code>
layer_property('aeropuertos','feature_count')
</code>
<code>
120
</code>
</li>
<li>
<code>
layer_property('landsat','crs')
</code>
<code>
'EPSG:4326'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="general-var"><a href="#general-var-idx">
función var
</a></h3>
<div class="description">
<p>
Devuelve el valor guardado dentro de una variable especificada.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
var
</span>
(
<span class="argument">
name
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
name
</td>
<td>
un nombre de variable
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
var('qgis_version')
</code>
<code>
'2.12'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="general-with_variable"><a href="#general-with_variable-idx">
función with_variable
</a></h3>
<div class="description">
<p>
Esta función establece una variable para el código de cualquier expresión que se proporcionará como tercer argumento. Esto solo es útil para expresiones complejas, en las que se necesita usar el mismo valor calculado en diferentes sitios.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
with_variable
</span>
(
<span class="argument">
name
</span>
,
<span class="argument">
value
</span>
,
<span class="argument">
expression
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
name
</td>
<td>
el nombre de la variable a establecer
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
el valor a establecer
</td>
</tr>
<tr>
<td class="argument">
expression
</td>
<td>
la expresión para la que estará disponible la variable
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
with_variable('my_sum', 1 + 2 + 3, @my_sum * 2 + @my_sum * 5)
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="geometrygroup" class="group"><h2><a href="#geometrygroup-idx">grupo geometría</a></h2>
<div class="description"><p>Este grupo contiene funciones que operan sobre elementos de geometría, como longitud o área.</p></div></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-dollar-area"><a href="#geometrygroup-dollar-area-idx">
función $area
</a></h3>
<div class="description">
<p>
Devuelve el área del objeto actual. El área calculada por esta función respeta tanto la configuración del elipsoide del proyecto actual como la de las unidades de área. Por ejemplo, si se ha establecido un elipsoide para el proyecto, entonces el área calculada será elipsoidal y si no se ha establecido ningún elipsoide, entonces el área calculada será planimétrica.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
$area
</span>
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
$area
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-dollar-geometry"><a href="#geometrygroup-dollar-geometry-idx">
función $geometry
</a></h3>
<div class="description">
<p>
Devuelve la geometría del objeto actual. Se puede usar para procesos con otras funciones.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
$geometry
</span>
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geomToWKT( $geometry )
</code>
<code>
PUNTO(6 50)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-dollar-length"><a href="#geometrygroup-dollar-length-idx">
función $length
</a></h3>
<div class="description">
<p>
Devuelve la longitud de una cadena de líneas. Si necesita la longitud del contorno de un polígono, utilice mejor $perimeter. La longitud calculada por esta función respeta tanto la configuración del elipsoide del proyecto actual como la de las unidades de longitud. Por ejemplo, si se ha establecido un elipsoide para el proyecto, entonces la longitud calculada será elipsoidal y si no se ha establecido ningún elipsoide, entonces la longitud calculada será planimétrica.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
$length
</span>
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
$length
</code>
<code>
42.4711
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-dollar-perimeter"><a href="#geometrygroup-dollar-perimeter-idx">
función $perimeter
</a></h3>
<div class="description">
<p>
Devuelve la longitud del perímetro del objeto actual. El perímetro calculado por esta función respeta tanto la configuración del elipsoide del proyecto actual como la de las unidades de distancia. Por ejemplo, si se ha establecido un elipsoide para el proyecto, entonces el perímetro calculado será elipsoidal y si no se ha establecido ningún elipsoide, entonces el perímetro calculado será planimétrico.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
$perimeter
</span>
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
$perimeter
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-dollar-x"><a href="#geometrygroup-dollar-x-idx">
función $x
</a></h3>
<div class="description">
<p>
Devuelve la coordenada X del objeto actual.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
$x
</span>
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
$x
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-dollar-x_at"><a href="#geometrygroup-dollar-x_at-idx">
función $x_at
</a></h3>
<div class="description">
<p>
Obtiene una coordenada X de la geometría del objeto actual.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
$x_at
</span>
(
<span class="argument">
i
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
i
</td>
<td>
index of point of a line (indices start at 0; negative values apply from the last index, starting at -1)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
$x_at(1)
</code>
<code>
5
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-dollar-y"><a href="#geometrygroup-dollar-y-idx">
función $y
</a></h3>
<div class="description">
<p>
Devuelve la coordenada Y del objeto actual.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
$y
</span>
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
$y
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-dollar-y_at"><a href="#geometrygroup-dollar-y_at-idx">
función $y_at
</a></h3>
<div class="description">
<p>
Obtiene una coordenada Y de la geometría del objeto actual.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
$y_at
</span>
(
<span class="argument">
i
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
i
</td>
<td>
index of point of a line (indices start at 0; negative values apply from the last index, starting at -1)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
$y_at(1)
</code>
<code>
2
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-angle_at_vertex"><a href="#geometrygroup-angle_at_vertex-idx">
función angle_at_vertex
</a></h3>
<div class="description">
<p>
Devuelve un ángulo bisectriz (ángulo medio) a la geometría para un vértice especificado en una geometría de cadena de línea. Los ángulos están en grados en sentido horario a partir del norte.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
angle_at_vertex
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
vertex
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría de cadena de línea
</td>
</tr>
<tr>
<td class="argument">
vertex
</td>
<td>
vertex index, starting from 0; if the value is negative, the selected vertex index will be its total count minus the absolute value
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
angle_at_vertex(geometry:=geom_from_wkt('LineString(0 0, 10 0, 10 10)'),vertex:=1)
</code>
<code>
45.0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-area"><a href="#geometrygroup-area-idx">
función area
</a></h3>
<div class="description">
<p>
Devuelve el área de un objeto de geometría de tipo polígono. Los cálculos siempre son planimétricos en el Sistema de Rerefencia Espacial (SRE) de esta geometría y las unidades del área devuelta coincidirán con las unidades del SRE. Esto difiere de los cálculos hechos por la función $area, que hará cálculos elipsoidales basados en el elipsoide del proyecto y la configuración de las unidades de superficie.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
area
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
objeto de geometría poligonal
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
area(geom_from_wkt('POLYGON((0 0, 4 0, 4 2, 0 2, 0 0))'))
</code>
<code>
8.0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-azimuth"><a href="#geometrygroup-azimuth-idx">
función azimuth
</a></h3>
<div class="description">
<p>
Devuelve el azimut basado en el Norte como el ángulo en radianes medido en sentido horario desde la vertical en el punto_A al Punto_b.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
azimuth
</span>
(
<span class="argument">
point_a
</span>
,
<span class="argument">
point_b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point_a
</td>
<td>
geometría de punto
</td>
</tr>
<tr>
<td class="argument">
point_b
</td>
<td>
geometría de punto
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
degrees( azimuth( make_point(25, 45), make_point(75, 100) ) )
</code>
<code>
42.273689
</code>
</li>
<li>
<code>
degrees( azimuth( make_point(75, 100), make_point(25,45) ) )
</code>
<code>
222.273689
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-boundary"><a href="#geometrygroup-boundary-idx">
función boundary
</a></h3>
<div class="description">
<p>
Devuelve el cierre del límite combinatorio de la geometría (es decir, el límite topológico de la geometría). Por ejemplo, una geometría de polígono tendrá un límite que consta de líneas para cada anillo en el polígono. Algunos tipos de geometría no tienen un límite definido, por ejemplo, puntos o colecciones de geometrías, y se devolverán nulos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
boundary
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(boundary(geom_from_wkt('Polygon((1 1, 0 0, -1 1, 1 1))')))
</code>
<code>
'LineString(1 1,0 0,-1 1,1 1)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-bounds"><a href="#geometrygroup-bounds-idx">
función bounds
</a></h3>
<div class="description">
<p>
Devuelve una geometría que representa el recuadro delimitador de una geometría de entrada. Los cálculos están en el Sistema de Referencia Espacial de esta geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
bounds
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
bounds($geometry)
</code>
<code>
recuadro delimitador de $geometry
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-bounds_height"><a href="#geometrygroup-bounds_height-idx">
función bounds_height
</a></h3>
<div class="description">
<p>
Devuelve la altura del recuadro delimitador de una geometría. Los cálculos están en el Sistema de Referencia Espacial de esta geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
bounds_height
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
bounds_height($geometry)
</code>
<code>
altura del recuadro delimitador de $geometry
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-bounds_width"><a href="#geometrygroup-bounds_width-idx">
función bounds_width
</a></h3>
<div class="description">
<p>
Devuelve la anchura del recuadro delimitador de una geometría. Los cálculos están en el Sistema de Referencia Espacial de esta geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
bounds_width
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
bounds_width($geometry)
</code>
<code>
anchura del recuadro delimitador de $geometry
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-buffer"><a href="#geometrygroup-buffer-idx">
función buffer
</a></h3>
<div class="description">
<p>
Devuelve una geometría que representa todos los puntos cuya distancia desde esta geometría es menor o igual que distancia. Los cálculos están en el Sistema de Referencia Espacial de esta geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
buffer
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
distance
</span>
[,
<span class="argument">
segments=8
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
distancia de buffer en unidades de la capa
</td>
</tr>
<tr>
<td class="argument">
segments
</td>
<td>
número de segmentos a usar para representar un cuarto de círculo cuando se utilice un estilo de unión redondo. Un número mayor da como resultado un buffer más suave con más nodos.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
buffer($geometry, 10.5)
</code>
<code>
polígono de $geometry con un buffer de 10.5 unidades
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-buffer_by_m"><a href="#geometrygroup-buffer_by_m-idx">
función buffer_by_m
</a></h3>
<div class="description">
<p>
Creates a buffer along a line geometry where the buffer diameter varies according to the m-values at the line vertices.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
buffer_by_m
</span>
(
<span class="argument">
geometry
</span>
[,
<span class="argument">
segments=8
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometría de entrada. Debe ser una geometría (de varias líneas) con valores m.
</td>
</tr>
<tr>
<td class="argument">
segments
</td>
<td>
número de segmentos para aproximar las curvas del un cuarto de círculo en el buffer.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
buffer_by_m(geometry:=geom_from_wkt('LINESTRINGM(1 2 0.5, 4 2 0.2)'),segments:=8)
</code>
<code>
Un búfer de ancho variable que comienza con un diámetro de 0.5 y termina con un diámetro de 0.2 a lo largo de la geometría lineal.
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-centroid"><a href="#geometrygroup-centroid-idx">
función centroid
</a></h3>
<div class="description">
<p>
Devuelve el centro geométrico de una geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
centroid
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
centroid($geometry)
</code>
<code>
una geometría de punto
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-close_line"><a href="#geometrygroup-close_line-idx">
función close_line
</a></h3>
<div class="description">
<p>
Returns a closed line string of the input line string by appending the first point to the end of the line, if it is not already closed. If the geometry is not a line string or multi line string then the result will be null.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
close_line
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría de cadena de línea
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(close_line(geom_from_wkt('LINESTRING(0 0, 1 0, 1 1)')))
</code>
<code>
LineString (0 0, 1 0, 1 1, 0 0)
</code>
</li>
<li>
<code>
geom_to_wkt(close_line(geom_from_wkt('LINESTRING(0 0, 1 0, 1 1, 0 0)')))
</code>
<code>
LineString (0 0, 1 0, 1 1, 0 0)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-closest_point"><a href="#geometrygroup-closest_point-idx">
función closest_point
</a></h3>
<div class="description">
<p>
Returns the point on geometry1 that is closest to geometry2.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
closest_point
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
geometría en la que encontrar el punto más cercano
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
geometría a la que encontrar el punto más cercano
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(closest_point(geom_from_wkt('LINESTRING (20 80, 98 190, 110 180, 50 75 )'),geom_from_wkt('POINT(100 100)')))
</code>
<code>
Point(73.0769 115.384)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-collect_geometries"><a href="#geometrygroup-collect_geometries-idx">
función collect_geometries
</a></h3>
<div class="description">
<p>
Collects a set of geometries into a multi-part geometry object.
</p>
</div>
<h3 id="geometrygroup-collect_geometries"><a href="#geometrygroup-collect_geometries-idx">
List of arguments variant
</a></h3>
<div class="description">
Geometry parts are specified as separate arguments to the function.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
collect_geometries
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
…)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(collect_geometries(make_point(1,2), make_point(3,4), make_point(5,6)))
</code>
<code>
'MultiPoint ((1 2),(3 4),(5 6))'
</code>
</li>
</ul>
</div>
<h3 id="geometrygroup-collect_geometries"><a href="#geometrygroup-collect_geometries-idx">
Array variant
</a></h3>
<div class="description">
Geometry parts are specified as an array of geometry parts.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
collect_geometries
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
array of geometry objects
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(collect_geometries(array(make_point(1,2), make_point(3,4), make_point(5,6))))
</code>
<code>
'MultiPoint ((1 2),(3 4),(5 6))'
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-combine"><a href="#geometrygroup-combine-idx">
función combine
</a></h3>
<div class="description">
<p>
Devuelve la combinación de dos geometrías.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
combine
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 2 1)' ) ) )
</code>
<code>
MULTILINESTRING((4 4, 2 1), (3 3, 4 4), (4 4, 5 5))
</code>
</li>
<li>
<code>
geom_to_wkt( combine( geom_from_wkt( 'LINESTRING(3 3, 4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 6 6, 2 1)' ) ) )
</code>
<code>
LINESTRING(3 3, 4 4, 6 6, 2 1)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-contains"><a href="#geometrygroup-contains-idx">
función contains
</a></h3>
<div class="description">
<p>
Comprueba si una geometría contiene a otra. Devuelve verdadero si y solo si ningún punto de la geometría b cae en el exterior de la geometría a y al menos un punto del interior de b cae en el interior de a.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
contains
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
contains( geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))' ), geom_from_wkt( 'POINT(0.5 0.5 )' ) )
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
contains( geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-convex_hull"><a href="#geometrygroup-convex_hull-idx">
función convex_hull
</a></h3>
<div class="description">
<p>
Devuelve la envolvente convexa de una geometría. Representa la geometría convexa mínima que encierra todas las geometrías del conjunto.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
convex_hull
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( convex_hull( geom_from_wkt( 'LINESTRING(3 3, 4 4, 4 10)' ) ) )
</code>
<code>
POLYGON((3 3,4 10,4 4,3 3))
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-crosses"><a href="#geometrygroup-crosses-idx">
función crosses
</a></h3>
<div class="description">
<p>
Comprueba si una geometría cruza otra. Devuelve verdadero si las geometrías proporcionadas tienen algún punto interior en común, pero no todos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
crosses
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
crosses( geom_from_wkt( 'LINESTRING(3 5, 4 4, 5 3)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
crosses( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-difference"><a href="#geometrygroup-difference-idx">
función difference
</a></h3>
<div class="description">
<p>
Devuelve una geometría que representa la parte de la geometría_a que no interseca con la geometría_b.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
difference
</span>
(
<span class="argument">
geometry_a
</span>
,
<span class="argument">
geometry_b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry_a
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry_b
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( difference( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4)' ) ) )
</code>
<code>
LINESTRING(4 4, 5 5)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-disjoint"><a href="#geometrygroup-disjoint-idx">
función disjoint
</a></h3>
<div class="description">
<p>
Comprueba si las geometría no se intersecan espacialmente. Devuelve verdadero si las geometrías no comparten ningún espacio en común.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
disjoint
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
disjoint( geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0 ))' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
disjoint( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'POINT(4 4)' ))
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-distance"><a href="#geometrygroup-distance-idx">
función distance
</a></h3>
<div class="description">
<p>
Devuelve la distancia mínima (basada en la referencia espacial) entre dos geometrías en unidades proyectadas.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
distance
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
distance( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(4 8)' ) )
</code>
<code>
4
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-distance_to_vertex"><a href="#geometrygroup-distance_to_vertex-idx">
función distance_to_vertex
</a></h3>
<div class="description">
<p>
Devuelve la distancia a lo largo de la geometría a un vértice especificado.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
distance_to_vertex
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
vertex
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría de cadena de línea
</td>
</tr>
<tr>
<td class="argument">
vertex
</td>
<td>
vertex index, starting from 0; if the value is negative, the selected vertex index will be its total count minus the absolute value
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
distance_to_vertex(geometry:=geom_from_wkt('LineString(0 0, 10 0, 10 10)'),vertex:=1)
</code>
<code>
10.0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-end_point"><a href="#geometrygroup-end_point-idx">
función end_point
</a></h3>
<div class="description">
<p>
Devuelve el último nodo de una geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
end_point
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
objeto de geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(end_point(geom_from_wkt('LINESTRING(4 0, 4 2, 0 2)')))
</code>
<code>
'Point (0 2)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-extend"><a href="#geometrygroup-extend-idx">
función extend
</a></h3>
<div class="description">
<p>
Extiende el inicio y final de una geometría de cadena de líneas en una cantidad especificada. Las líneas se extienden usando el rumbo del primer y último segmentos de la línea. Las distancias están el Sistema de Referencia Espacial de esta geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
extend
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
start_distance
</span>
,
<span class="argument">
end_distance
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría de (multi)cadena de líneas
</td>
</tr>
<tr>
<td class="argument">
start_distance
</td>
<td>
distancia a extender el inicio de la línea
</td>
</tr>
<tr>
<td class="argument">
end_distance
</td>
<td>
distancia a extender el final de la línea.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(extend(geom_from_wkt('LineString(0 0, 1 0, 1 1)'),1,2))
</code>
<code>
LineString (-1 0, 1 0, 1 3)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-exterior_ring"><a href="#geometrygroup-exterior_ring-idx">
función exterior_ring
</a></h3>
<div class="description">
<p>
Devuelve una cadena de línea que representa el anillo exterior de una geometría de tipo polígono. Si la geometría no es un polígono entonces el resultado será nulo.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
exterior_ring
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría de polígono
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(exterior_ring(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),( 0.1 0.1, 0.1 0.2, 0.2 0.2, 0.2, 0.1, 0.1 0.1))')))
</code>
<code>
'LineString (-1 -1, 4 0, 4 2, 0 2, -1 -1)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-extrude"><a href="#geometrygroup-extrude-idx">
función extrude
</a></h3>
<div class="description">
<p>
Devuelve una versión extruida de la geometría de entrada (multi)curva o (multi)línea, con una extensión especificada por X e Y.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
extrude
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
x
</span>
,
<span class="argument">
y
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría de polígono
</td>
</tr>
<tr>
<td class="argument">
x
</td>
<td>
extensión X, valor numérico
</td>
</tr>
<tr>
<td class="argument">
y
</td>
<td>
extensión Y, valor numérico
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
extrude(geom_from_wkt('LineString(1 2, 3 2, 4 3)'), 1, 2)
</code>
<code>
Polygon ((1 2, 3 2, 4 3, 5 5, 4 4, 2 4, 1 2))
</code>
</li>
<li>
<code>
extrude(geom_from_wkt('MultiLineString((1 2, 3 2), (4 3, 8 3)'), 1, 2)
</code>
<code>
MultiPolygon (((1 2, 3 2, 4 4, 2 4, 1 2)),((4 3, 8 3, 9 5, 5 5, 4 3)))
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-flip_coordinates"><a href="#geometrygroup-flip_coordinates-idx">
función flip_coordinates
</a></h3>
<div class="description">
<p>
Returns a copy of the geometry with the x and y coordinates swapped. Useful for repairing geometries which have had their latitude and longitude values reversed.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
flip_coordinates
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(flip_coordinates(make_point(1, 2)))
</code>
<code>
Point (2 1)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-force_rhr"><a href="#geometrygroup-force_rhr-idx">
función force_rhr
</a></h3>
<div class="description">
<p>
Forces a geometry to respect the Right-Hand-Rule, in which the area that is bounded by a polygon is to the right of the boundary. In particular, the exterior ring is oriented in a clockwise direction and the interior rings in a counter-clockwise direction.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
force_rhr
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
a geometry. Any non-polygon geometries are returned unchanged.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(force_rhr(geometry:=geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1))')))
</code>
<code>
Polygon ((-1 -1, 0 2, 4 2, 4 0, -1 -1))
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-geom_from_gml"><a href="#geometrygroup-geom_from_gml-idx">
función geom_from_gml
</a></h3>
<div class="description">
<p>
Devuelve una geometría a partir de una representación GML de geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
geom_from_gml
</span>
(
<span class="argument">
gml
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
gml
</td>
<td>
Representación GML de una geometría como una cadena
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_from_gml('&lt;gml:LineString srsName="EPSG:4326"&gt;&lt;gml:coordinates&gt;4,4 5,5 6,6&lt;/gml:coordinates&gt;&lt;/gml:LineString&gt;')
</code>
<code>
a line geometry object
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-geom_from_wkb"><a href="#geometrygroup-geom_from_wkb-idx">
función geom_from_wkb
</a></h3>
<div class="description">
<p>
Returns a geometry created from a Well-Known Binary (WKB) representation.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
geom_from_wkb
</span>
(
<span class="argument">
binary
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
binary
</td>
<td>
Well-Known Binary (WKB) representation of a geometry (as a binary blob)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_from_wkb( geom_to_wkb( make_point(4,5) ) )
</code>
<code>
a point geometry object
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-geom_from_wkt"><a href="#geometrygroup-geom_from_wkt-idx">
función geom_from_wkt
</a></h3>
<div class="description">
<p>
Devuelve una geometría creada a partir de una representación WKT (Texto Bien Conocido).
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
geom_from_wkt
</span>
(
<span class="argument">
text
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
text
</td>
<td>
Representación WKT (Texto Bien Conocido) de una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_from_wkt( 'POINT(4 5)' )
</code>
<code>
un objeto de geometría
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-geom_to_wkb"><a href="#geometrygroup-geom_to_wkb-idx">
función geom_to_wkb
</a></h3>
<div class="description">
<p>
Returns the Well-Known Binary (WKB) representation of a geometry
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
geom_to_wkb
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkb( $geometry )
</code>
<code>
binary blob containing a geometry object
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-geom_to_wkt"><a href="#geometrygroup-geom_to_wkt-idx">
función geom_to_wkt
</a></h3>
<div class="description">
<p>
Devuelve una representación WKT (Texto Bien Conocido) de la geometría sin metadatos SRID.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
geom_to_wkt
</span>
(
<span class="argument">
geometry
</span>
[,
<span class="argument">
precision
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
precision
</td>
<td>
numeric precision
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( $geometry )
</code>
<code>
PUNTO(6 50)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-geometry"><a href="#geometrygroup-geometry-idx">
función geometry
</a></h3>
<div class="description">
<p>
Devuelve la geometría de un objeto.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
geometry
</span>
(
<span class="argument">
feature
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
feature
</td>
<td>
un objeto espacial
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( geometry( get_feature( capa, campo, valor ) ) )
</code>
<code>
'PUNTO(6 50)'
</code>
</li>
<li>
<code>
intersects( $geometry, geometry( get_feature( capa, campo, valor ) ) )
</code>
<code>
verdadero
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-geometry_n"><a href="#geometrygroup-geometry_n-idx">
función geometry_n
</a></h3>
<div class="description">
<p>
Devuelve una geometría específica a partir de una colección de geometrías o nulo si la geometría de entrada no es una colección.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
geometry_n
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
index
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
colección de geometrías
</td>
</tr>
<tr>
<td class="argument">
index
</td>
<td>
índice de la geometría a devolver, donde 1 es la primera geometría de la colección
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(geometry_n(geom_from_wkt('GEOMETRYCOLLECTION(POINT(0 1), POINT(0 0), POINT(1 0), POINT(1 1))'),3))
</code>
<code>
'Point (1 0)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-hausdorff_distance"><a href="#geometrygroup-hausdorff_distance-idx">
función hausdorff_distance
</a></h3>
<div class="description">
<p>
Devuelve la distancia de Hausdorff entre dos geometrías. Esto es básicamente una medida de cómo de similares o diferentes son dos geometrías, con una distancia menor indicando geometrías más parecidas.
<br/>
La función se puede ejecutar con un argumento fracción de densificación opcional. Si no se especifica se usará una aproximación de la distancia estándar de Hausdorff. Esta aproximación es exacta o suficientemente aproximada para un gran subconjunto de casos útiles. Ejemplos de esto son:
<br/>
<br/>
</p>
<li>
procesar la distancia entre cadenas de líneas que son aproximadamente paralelas entre sí y aproximadamente iguales en longitud. Esto ocurre en redes lineales coincidentes.
</li>
<li>
Probar similitud de geometrías.
</li>
<br/>
<br/>
Si la aproximación predeterminada por este método es insuficiente, especifique el argumento opcional fracción de densificación. Al especificar este argumento se realiza una densificación de segmentos antes de procesar la distancia discreta de Hausdorff. El parámetro establece la fracción por la que densificar cada segmento. Cada segmento se dividirá en un número de subsegmentos de igual longitud, cuya fracción de la longitud total es la más cercana a la fracción dada. Disminuir el parámetro fracción de densificación hará que la distancia devuelta se aproxime a la distancia de Hausdorff verdadera para las geometrías.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
hausdorff_distance
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
[,
<span class="argument">
densify_fraction
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
densify_fraction
</td>
<td>
Densificar la cantidad de fracciones
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
hausdorff_distance( geometry1:= geom_from_wkt('LINESTRING (0 0, 2 1)'),geometry2:=geom_from_wkt('LINESTRING (0 0, 2 0)'))
</code>
<code>
2
</code>
</li>
<li>
<code>
hausdorff_distance( geom_from_wkt('LINESTRING (130 0, 0 0, 0 150)'),geom_from_wkt('LINESTRING (10 10, 10 150, 130 10)'))
</code>
<code>
14.142135623
</code>
</li>
<li>
<code>
hausdorff_distance( geom_from_wkt('LINESTRING (130 0, 0 0, 0 150)'),geom_from_wkt('LINESTRING (10 10, 10 150, 130 10)'),0.5)
</code>
<code>
70.0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-inclination"><a href="#geometrygroup-inclination-idx">
función inclination
</a></h3>
<div class="description">
<p>
Devuelve la inclinación medida desde el cénit (0) al nadir (180) en el punto A al punto B.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
inclination
</span>
(
<span class="argument">
point_a
</span>
,
<span class="argument">
point_b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point_a
</td>
<td>
geometría de punto
</td>
</tr>
<tr>
<td class="argument">
point_b
</td>
<td>
geometría de punto
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, 5 ) )
</code>
<code>
0.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, 0 ) )
</code>
<code>
90.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 50, 100, 0 ) )
</code>
<code>
90.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, -5 ) )
</code>
<code>
180.0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-interior_ring_n"><a href="#geometrygroup-interior_ring_n-idx">
función interior_ring_n
</a></h3>
<div class="description">
<p>
Devuelve un anillo interior específico de una geometría de tipo polígono o nulo si la geometría no es un polígono.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
interior_ring_n
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
index
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometría de tipo polígono
</td>
</tr>
<tr>
<td class="argument">
index
</td>
<td>
índice del interior a devolver, donde 1 es el primer anillo interior
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(interior_ring_n(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),(-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1),(-1 -1, 4 0, 4 2, 0 2, -1 -1))'),1))
</code>
<code>
'LineString (-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1))'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-intersection"><a href="#geometrygroup-intersection-idx">
función intersection
</a></h3>
<div class="description">
<p>
Devuelve una geometría que representa la parte compartida de dos geometrías.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
intersection
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( intersection( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4)' ) ) )
</code>
<code>
LINESTRING(3 3, 4 4)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-intersects"><a href="#geometrygroup-intersects-idx">
función intersects
</a></h3>
<div class="description">
<p>
Comprueba si una geometría se interseca con otra. Devuelve verdadero si las geometrías se intersecan espacialmente (comparten alguna porción de espacio) y falso en caso contrario.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
intersects
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
intersects( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
intersects( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'POINT(5 5)' ) )
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-intersects_bbox"><a href="#geometrygroup-intersects_bbox-idx">
función intersects_bbox
</a></h3>
<div class="description">
<p>
Comprueba si el recuadro delimitador de una geometría solapa con el de otra geometría. Devuelve verdadero si los recuadros delimitadores de las geometrías se intersecan espacialmente y falso en caso contrario.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
intersects_bbox
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
intersects_bbox( geom_from_wkt( 'POINT(4 5)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
intersects_bbox( geom_from_wkt( 'POINT(6 5)' ), geom_from_wkt( 'POLYGON((3 3, 4 4, 5 5, 3 3))' ) )
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-is_closed"><a href="#geometrygroup-is_closed-idx">
función is_closed
</a></h3>
<div class="description">
<p>
Devuelve verdadero si una cadena de línea está cerrada (los puntos de inicio y final coinciden) o falso si la cadena de línea no está cerrada. Si la geometría no es una cadena de línea entonces el resultado será nulo.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_closed
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría de cadena de línea
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
is_closed(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)'))
</code>
<code>
falso
</code>
</li>
<li>
<code>
is_closed(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2, 0 0)'))
</code>
<code>
verdadero
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-is_empty"><a href="#geometrygroup-is_empty-idx">
función is_empty
</a></h3>
<div class="description">
<p>
Returns true if a geometry is empty (without coordinates), false if the geometry is not empty and NULL if there is no geometry. See also `is_empty_or_null`.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_empty
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
is_empty(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)'))
</code>
<code>
falso
</code>
</li>
<li>
<code>
is_empty(geom_from_wkt('LINESTRING EMPTY'))
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
is_empty(geom_from_wkt('POINT(7 4)'))
</code>
<code>
falso
</code>
</li>
<li>
<code>
is_empty(geom_from_wkt('POINT EMPTY'))
</code>
<code>
verdadero
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-is_empty_or_null"><a href="#geometrygroup-is_empty_or_null-idx">
función is_empty_or_null
</a></h3>
<div class="description">
<p>
Returns true if a geometry is NULL or empty (without coordinates) or false otherwise. This function is like the expression '$geometry IS NULL or is_empty($geometry)'
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_empty_or_null
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
is_empty_or_null(NULL)
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
is_empty_or_null(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)'))
</code>
<code>
falso
</code>
</li>
<li>
<code>
is_empty_or_null(geom_from_wkt('LINESTRING EMPTY'))
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
is_empty_or_null(geom_from_wkt('POINT(7 4)'))
</code>
<code>
falso
</code>
</li>
<li>
<code>
is_empty_or_null(geom_from_wkt('POINT EMPTY'))
</code>
<code>
verdadero
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-is_multipart"><a href="#geometrygroup-is_multipart-idx">
función is_multipart
</a></h3>
<div class="description">
<p>
Returns true if the geometry is of Multi type.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_multipart
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
is_multipart(geom_from_wkt('MULTIPOINT ((0 0),(1 1),(2 2))'))
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
is_multipart(geom_from_wkt('POINT (0 0)'))
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-is_valid"><a href="#geometrygroup-is_valid-idx">
función is_valid
</a></h3>
<div class="description">
<p>
Returns true if a geometry is valid; if it is well-formed in 2D according to the OGC rules.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_valid
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
is_valid(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2, 0 0)'))
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
is_valid(geom_from_wkt('LINESTRING(0 0)'))
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-length"><a href="#geometrygroup-length-idx">
función length
</a></h3>
<div class="description">
<p>
Devuelve el número de caracteres de una cadena o la longitud de la cadena que define una geometría.
</p>
</div>
<h3 id="geometrygroup-length"><a href="#geometrygroup-length-idx">
Variante de cadena
</a></h3>
<div class="description">
Devuelve el número de caracteres de una cadena.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
length
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
cadena de la que medir la longitud
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
length('hola')
</code>
<code>
5
</code>
</li>
</ul>
</div>
<h3 id="geometrygroup-length"><a href="#geometrygroup-length-idx">
Variante de geometría
</a></h3>
<div class="description">
Calcula la longitud de un objeto de geometría lineal. Los cálculos siempre son planimétricos en el Sistema de Rerefencia Espacial (SRE) de esta geometría y las unidades de la longitud devuelta coincidirán con las unidades del SRE. Esto difiere de los cálculos hechos por la función $lenght, que hará cálculos elipsoidales basados en el elipsoide del proyecto y la configuración de las unidades de longitud.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
length
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
objeto de geometría lineal
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
length(geom_from_wkt('LINESTRING(0 0, 4 0)'))
</code>
<code>
4.0
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-line_interpolate_angle"><a href="#geometrygroup-line_interpolate_angle-idx">
función line_interpolate_angle
</a></h3>
<div class="description">
<p>
Devuelve el ángulo paralelo a la geometría a una distancia especificada a lo largo de una geometría cadena de líneas (linestring). Los ángulos están en grados en sentido horario desde el Norte.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
line_interpolate_angle
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
distance
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría de cadena de línea
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
distancia a lo largo de la línea a la que interpolar el ángulo
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
line_interpolate_angle(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),distance:=5)
</code>
<code>
90.0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-line_interpolate_point"><a href="#geometrygroup-line_interpolate_point-idx">
función line_interpolate_point
</a></h3>
<div class="description">
<p>
Devuelve el punto interpolado a una distancia especificada a lo largo de una geometría cadena de líneas (linestring).
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
line_interpolate_point
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
distance
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría de cadena de línea
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
distancia a lo largo de la línea a la que interpolar
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(line_interpolate_point(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),distance:=5))
</code>
<code>
'Point (5 0)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-line_locate_point"><a href="#geometrygroup-line_locate_point-idx">
función line_locate_point
</a></h3>
<div class="description">
<p>
Devuelve la distancia a lo largo de un cadena de líneas que corresponde a la posición más cercana a la que llega la línea de una geometría de punto especificada.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
line_locate_point
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
point
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría de cadena de línea
</td>
</tr>
<tr>
<td class="argument">
point
</td>
<td>
geometría de punto a la que encontrar la posición más cercana desde la cadena de líneas
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
line_locate_point(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),point:=geom_from_wkt('Point(5 0)'))
</code>
<code>
5.0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-line_merge"><a href="#geometrygroup-line_merge-idx">
función line_merge
</a></h3>
<div class="description">
<p>
Devuelve una cadena de líneas o multicadena de líneas en la que cualquier cadena de líneas conectada desde la geometría de entrada se ha combinado en una única cadena de líneas. Esta función devolverá nulo si se pasa una geometría que no es una cadena de líneas/multicadena de líneas.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
line_merge
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría cadena de líneas/multicadena de líneas
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(line_merge(geom_from_wkt('MULTILINESTRING((0 0, 1 1),(1 1, 2 2))')))
</code>
<code>
'LineString(0 0,1 1,2 2)'
</code>
</li>
<li>
<code>
geom_to_wkt(line_merge(geom_from_wkt('MULTILINESTRING((0 0, 1 1),(11 1, 21 2))')))
</code>
<code>
'MultiLineString((0 0, 1 1),(11 1, 21 2)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-line_substring"><a href="#geometrygroup-line_substring-idx">
función line_substring
</a></h3>
<div class="description">
<p>
Returns the portion of a line (or curve) geometry which falls between the specified start and end distances (measured from the beginning of the line). Z and M values are linearly interpolated from existing values.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
line_substring
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
start_distance
</span>
,
<span class="argument">
end_distance
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a linestring or curve geometry
</td>
</tr>
<tr>
<td class="argument">
start_distance
</td>
<td>
distancia al inicio de la subcadena
</td>
</tr>
<tr>
<td class="argument">
end_distance
</td>
<td>
distancia al final de la subcadena
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(line_substring(geometry:=geom_from_wkt('LineString(0 0, 10 0)'),start_distance:=2,end_distance=6))
</code>
<code>
'LineString (2 0,6 0)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-m"><a href="#geometrygroup-m-idx">
función m
</a></h3>
<div class="description">
<p>
Devuelve el valor m de una geometría de punto.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
m
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría de punto
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
m( geom_from_wkt( 'POINTM(2 5 4)' ) )
</code>
<code>
4
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-m_max"><a href="#geometrygroup-m_max-idx">
función m_max
</a></h3>
<div class="description">
<p>
Returns the maximum m (measure) value of a geometry.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
m_max
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry containing m values
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
m_max( make_point_m( 0,0,1 ) )
</code>
<code>
1
</code>
</li>
<li>
<code>
m_max(make_line( make_point_m( 0,0,1 ), make_point_m( -1,-1,2 ), make_point_m( -2,-2,0 ) ) )
</code>
<code>
2
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-m_min"><a href="#geometrygroup-m_min-idx">
función m_min
</a></h3>
<div class="description">
<p>
Returns the minimum m (measure) value of a geometry.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
m_min
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry containing m values
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
m_min( make_point_m( 0,0,1 ) )
</code>
<code>
1
</code>
</li>
<li>
<code>
m_min(make_line( make_point_m( 0,0,1 ), make_point_m( -1,-1,2 ), make_point_m( -2,-2,0 ) ) )
</code>
<code>
0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-make_circle"><a href="#geometrygroup-make_circle-idx">
función make_circle
</a></h3>
<div class="description">
<p>
Crea un polígono circular.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_circle
</span>
(
<span class="argument">
center
</span>
,
<span class="argument">
radius
</span>
[,
<span class="argument">
segment=36
</span>
]…)
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
center
</td>
<td>
punto centro del círculo
</td>
</tr>
<tr>
<td class="argument">
radius
</td>
<td>
radio del círculo
</td>
</tr>
<tr>
<td class="argument">
segment
</td>
<td>
argumento opcional para la segmentación de polígonos. Por omisión, este valor es 36.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_circle(make_point(10,10), 5, 4))
</code>
<code>
'Polygon ((10 15, 15 10, 10 5, 5 10, 10 15))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_circle(make_point(10,10,5), 5, 4))
</code>
<code>
'PolygonZ ((10 15 5, 15 10 5, 10 5 5, 5 10 5, 10 15 5))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_circle(make_point(10,10,5,30), 5, 4))
</code>
<code>
'PolygonZM ((10 15 5 30, 15 10 5 30, 10 5 5 30, 5 10 5 30, 10 15 5 30))'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-make_ellipse"><a href="#geometrygroup-make_ellipse-idx">
función make_ellipse
</a></h3>
<div class="description">
<p>
Crea un polígono elíptico.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_ellipse
</span>
(
<span class="argument">
center
</span>
,
<span class="argument">
semi_major_axis
</span>
,
<span class="argument">
semi_minor_axis
</span>
,
<span class="argument">
azimuth
</span>
[,
<span class="argument">
segment=36
</span>
]…)
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
center
</td>
<td>
punto centro de la elipse
</td>
</tr>
<tr>
<td class="argument">
semi_major_axis
</td>
<td>
semieje mayor de la elipse
</td>
</tr>
<tr>
<td class="argument">
semi_minor_axis
</td>
<td>
semieje menor de la elipse
</td>
</tr>
<tr>
<td class="argument">
azimuth
</td>
<td>
orientación de la elipse
</td>
</tr>
<tr>
<td class="argument">
segment
</td>
<td>
argumento opcional para la segmentación de polígonos. Por omisión, este valor es 36.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_ellipse(make_point(10,10), 5, 2, 90, 4))
</code>
<code>
'Polygon ((15 10, 10 8, 5 10, 10 12, 15 10))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_ellipse(make_point(10,10,5), 5, 2, 90, 4))
</code>
<code>
'PolygonZ ((15 10 5, 10 8 5, 5 10 5, 10 12 5, 15 10 5))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_ellipse(make_point(10,10,5,30), 5, 2, 90, 4))
</code>
<code>
'PolygonZM ((15 10 5 30, 10 8 5 30, 5 10 5 30, 10 12 5 30, 15 10 5 30))'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-make_line"><a href="#geometrygroup-make_line-idx">
función make_line
</a></h3>
<div class="description">
<p>
Crea una geometría de línea a partir de una serie de geometrías de puntos.
</p>
</div>
<h3 id="geometrygroup-make_line"><a href="#geometrygroup-make_line-idx">
List of arguments variant
</a></h3>
<div class="description">
Line vertices are specified as separate arguments to the function.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_line
</span>
(
<span class="argument">
point1
</span>
,
<span class="argument">
point2
</span>
…)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point
</td>
<td>
a point geometry (or array of points)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_line(make_point(2,4),make_point(3,5)))
</code>
<code>
'LineString (2 4, 3 5)'
</code>
</li>
<li>
<code>
geom_to_wkt(make_line(make_point(2,4),make_point(3,5),make_point(9,7)))
</code>
<code>
'LineString (2 4, 3 5, 9 7)'
</code>
</li>
</ul>
</div>
<h3 id="geometrygroup-make_line"><a href="#geometrygroup-make_line-idx">
Array variant
</a></h3>
<div class="description">
Line vertices are specified as an array of points.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_line
</span>
(
<span class="argument">
array
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
array
</td>
<td>
array of points
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_line(array(make_point(2,4),make_point(3,5),make_point(9,7))))
</code>
<code>
'LineString (2 4, 3 5, 9 7)'
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-make_point"><a href="#geometrygroup-make_point-idx">
función make_point
</a></h3>
<div class="description">
<p>
Crea una geometría de punto a partir de unos valores de X e Y (y opcionalmente Z).
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_point
</span>
(
<span class="argument">
x
</span>
,
<span class="argument">
y
</span>
[,
<span class="argument">
z
</span>
][,
<span class="argument">
m
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
x
</td>
<td>
Coordenada X del punto
</td>
</tr>
<tr>
<td class="argument">
y
</td>
<td>
Coordenada Y del punto
</td>
</tr>
<tr>
<td class="argument">
z
</td>
<td>
coordenada Z opcional del punto
</td>
</tr>
<tr>
<td class="argument">
m
</td>
<td>
valor m opcional de punto
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_point(2,4))
</code>
<code>
'Point (2 4)'
</code>
</li>
<li>
<code>
geom_to_wkt(make_point(2,4,6))
</code>
<code>
'PointZ (2 4 6)'
</code>
</li>
<li>
<code>
geom_to_wkt(make_point(2,4,6,8))
</code>
<code>
'PointZM (2 4 6 8)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-make_point_m"><a href="#geometrygroup-make_point_m-idx">
función make_point_m
</a></h3>
<div class="description">
<p>
Crea una geometría de punto a partir de una coordenada X, Y y un valor m.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_point_m
</span>
(
<span class="argument">
x
</span>
,
<span class="argument">
y
</span>
,
<span class="argument">
m
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
x
</td>
<td>
Coordenada X del punto
</td>
</tr>
<tr>
<td class="argument">
y
</td>
<td>
Coordenada Y del punto
</td>
</tr>
<tr>
<td class="argument">
m
</td>
<td>
valor m de punto
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_point_m(2,4,6))
</code>
<code>
'PointM (2 4 6)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-make_polygon"><a href="#geometrygroup-make_polygon-idx">
función make_polygon
</a></h3>
<div class="description">
<p>
Crea una geometría de polígono a partir de un anillo exterior y series opcionales de geometrías interiores de anillo.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_polygon
</span>
(
<span class="argument">
outerRing
</span>
[,
<span class="argument">
innerRing1
</span>
][,
<span class="argument">
innerRing2
</span>
]…)
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
outerRing
</td>
<td>
geometría de línea cerrada para anillo exterior del polígono
</td>
</tr>
<tr>
<td class="argument">
innerRing
</td>
<td>
geometría de línea cerrada opcional para anillo interior
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_polygon(geom_from_wkt('LINESTRING( 0 0, 0 1, 1 1, 1 0, 0 0 )')))
</code>
<code>
'Polygon ((0 0, 0 1, 1 1, 1 0, 0 0))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_polygon(geom_from_wkt('LINESTRING( 0 0, 0 1, 1 1, 1 0, 0 0 )'),geom_from_wkt('LINESTRING( 0.1 0.1, 0.1 0.2, 0.2 0.2, 0.2 0.1, 0.1 0.1 )'),geom_from_wkt('LINESTRING( 0.8 0.8, 0.8 0.9, 0.9 0.9, 0.9 0.8, 0.8 0.8 )')))
</code>
<code>
'Polygon ((0 0, 0 1, 1 1, 1 0, 0 0),(0.1 0.1, 0.1 0.2, 0.2 0.2, 0.2 0.1, 0.1 0.1),(0.8 0.8, 0.8 0.9, 0.9 0.9, 0.9 0.8, 0.8 0.8))'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-make_rectangle_3points"><a href="#geometrygroup-make_rectangle_3points-idx">
función make_rectangle_3points
</a></h3>
<div class="description">
<p>
Creates a rectangle from 3 points.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_rectangle_3points
</span>
(
<span class="argument">
point1
</span>
,
<span class="argument">
point2
</span>
,
<span class="argument">
point3
</span>
[,
<span class="argument">
option=0
</span>
]…)
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point1
</td>
<td>
Primer punto.
</td>
</tr>
<tr>
<td class="argument">
point2
</td>
<td>
Segundo punto.
</td>
</tr>
<tr>
<td class="argument">
point3
</td>
<td>
Tercer punto.
</td>
</tr>
<tr>
<td class="argument">
option
</td>
<td>
An optional argument to construct the rectangle. By default this value is 0. Value can be 0 (distance) or 1 (projected). Option distance: Second distance is equal to the distance between 2nd and 3rd point. Option projected: Second distance is equal to the distance of the perpendicular projection of the 3rd point on the segment or its extension.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_rectangle(make_point(0, 0), make_point(0,5), make_point(5, 5), 0)))
</code>
<code>
'Polygon ((0 0, 0 5, 5 5, 5 0, 0 0))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_rectangle(make_point(0, 0), make_point(0,5), make_point(5, 3), 1)))
</code>
<code>
'Polygon ((0 0, 0 5, 5 5, 5 0, 0 0))'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-make_regular_polygon"><a href="#geometrygroup-make_regular_polygon-idx">
función make_regular_polygon
</a></h3>
<div class="description">
<p>
Crea un polígono regular.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_regular_polygon
</span>
(
<span class="argument">
center
</span>
,
<span class="argument">
radius
</span>
,
<span class="argument">
number_sides
</span>
[,
<span class="argument">
circle=0
</span>
]…)
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
center
</td>
<td>
centro del polígono regular
</td>
</tr>
<tr>
<td class="argument">
radius
</td>
<td>
segundo punto. El primero si el polígono regular es inscrito. El punto central de la primera cara si el polígono regular es circunscrito.
</td>
</tr>
<tr>
<td class="argument">
number_sides
</td>
<td>
Número de caras/bordes del polígono regular
</td>
</tr>
<tr>
<td class="argument">
circle
</td>
<td>
Argumento opcional para construir el polígono regular. Por omisión este valor es 0. El valor puede ser 0 (inscrito) o 1 (circunscrito).
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_regular_polygon(make_point(0,0), make_point(0,5), 5))
</code>
<code>
'Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_regular_polygon(make_point(0,0), project(make_point(0,0), 4.0451, radians(36)), 5))
</code>
<code>
'Polygon ((0 5, 4.76 1.55, 2.94 -4.05, -2.94 -4.05, -4.76 1.55, 0 5))'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-make_square"><a href="#geometrygroup-make_square-idx">
función make_square
</a></h3>
<div class="description">
<p>
Creates a square from a diagonal.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_square
</span>
(
<span class="argument">
point1
</span>
,
<span class="argument">
point2
</span>
…)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point1
</td>
<td>
First point of the regular polygon
</td>
</tr>
<tr>
<td class="argument">
point2
</td>
<td>
Segundo punto
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_square( make_point(0,0), make_point(5,5)))
</code>
<code>
'Polygon ((0 0, -0 5, 5 5, 5 0, 0 0))'
</code>
</li>
<li>
<code>
geom_to_wkt(make_square( make_point(5,0), make_point(5,5)))
</code>
<code>
'Polygon ((5 0, 2.5 2.5, 5 5, 7.5 2.5, 5 0))'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-make_triangle"><a href="#geometrygroup-make_triangle-idx">
función make_triangle
</a></h3>
<div class="description">
<p>
Crea un polígono triangular.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
make_triangle
</span>
(
<span class="argument">
point 1
</span>
,
<span class="argument">
point 2
</span>
,
<span class="argument">
point 3
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point 1
</td>
<td>
primer punto del triángulo
</td>
</tr>
<tr>
<td class="argument">
point 2
</td>
<td>
segundo punto del triángulo
</td>
</tr>
<tr>
<td class="argument">
point 3
</td>
<td>
tercer punto del triángulo
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(make_triangle(make_point(0,0), make_point(5,5), make_point(0,10)))
</code>
<code>
'Triangle ((0 0, 5 5, 0 10, 0 0))'
</code>
</li>
<li>
<code>
geom_to_wkt(boundary(make_triangle(make_point(0,0), make_point(5,5), make_point(0,10))))
</code>
<code>
'LineString (0 0, 5 5, 0 10, 0 0)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-minimal_circle"><a href="#geometrygroup-minimal_circle-idx">
función minimal_circle
</a></h3>
<div class="description">
<p>
Devuelve el círculo envolvente mínimo de una geometría. Representa el círculo mínimo que encierra todas las geometrías del conjunto.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
minimal_circle
</span>
(
<span class="argument">
geometry
</span>
[,
<span class="argument">
segment=36
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
segment
</td>
<td>
argumento opcional para la segmentación de polígonos. Por omisión, este valor es 36.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( minimal_circle( geom_from_wkt( 'LINESTRING(0 5, 0 -5, 2 1)' ), 4 ) )
</code>
<code>
Polygon ((0 5, 5 -0, -0 -5, -5 0, 0 5))
</code>
</li>
<li>
<code>
geom_to_wkt( minimal_circle( geom_from_wkt( 'MULTIPOINT(1 2, 3 4, 3 2)' ), 4 ) )
</code>
<code>
Polygon ((3 4, 3 2, 1 2, 1 4, 3 4))
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-nodes_to_points"><a href="#geometrygroup-nodes_to_points-idx">
función nodes_to_points
</a></h3>
<div class="description">
<p>
Devuelve una geometría multipunto consistente en cada nodo de la geometría de entrada.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
nodes_to_points
</span>
(
<span class="argument">
geometry
</span>
[,
<span class="argument">
ignore_closing_nodes=false
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
objeto de geometría
</td>
</tr>
<tr>
<td class="argument">
ignore_closing_nodes
</td>
<td>
argumento opcional que especifica si incluir nodos duplicados que cierran líneas o anillos de polígonos. El valor predeterminado es falso, establecer a verdadero para evitar incluir estos nodos duplicados en la colección de salida.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(nodes_to_points(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))
</code>
<code>
'MultiPoint ((0 0),(1 1),(2 2))'
</code>
</li>
<li>
<code>
geom_to_wkt(nodes_to_points(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1))'),true))
</code>
<code>
'MultiPoint ((-1 -1),(4 0),(4 2),(0 2))'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-num_geometries"><a href="#geometrygroup-num_geometries-idx">
función num_geometries
</a></h3>
<div class="description">
<p>
Devuelve el número de geometrías en una colección de geometrías o nulo si la geometría de entrada no es una colección.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
num_geometries
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
colección de geometrías
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
num_geometries(geom_from_wkt('GEOMETRYCOLLECTION(POINT(0 1), POINT(0 0), POINT(1 0), POINT(1 1))'))
</code>
<code>
4
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-num_interior_rings"><a href="#geometrygroup-num_interior_rings-idx">
función num_interior_rings
</a></h3>
<div class="description">
<p>
Devuelve el número de anillos interiores de un polígono o una colección de geometrías o nulo si la geometría de entrada no es un polígono o una colección.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
num_interior_rings
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometría de entrada
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
num_interior_rings(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),(-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1))'))
</code>
<code>
1
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-num_points"><a href="#geometrygroup-num_points-idx">
función num_points
</a></h3>
<div class="description">
<p>
Devuelve el número de vértices de una geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
num_points
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
num_points($geometry)
</code>
<code>
número de vértices en $geometry
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-num_rings"><a href="#geometrygroup-num_rings-idx">
función num_rings
</a></h3>
<div class="description">
<p>
Devuelve el número de anillos (incluidos los anillos exteriores) de un polígono o una colección de geometrías o nulo si la geometría de entrada no es un polígono o una colección.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
num_rings
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometría de entrada
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
num_rings(geom_from_wkt('POLYGON((-1 -1, 4 0, 4 2, 0 2, -1 -1),(-0.1 -0.1, 0.4 0, 0.4 0.2, 0 0.2, -0.1 -0.1))'))
</code>
<code>
2
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-offset_curve"><a href="#geometrygroup-offset_curve-idx">
función offset_curve
</a></h3>
<div class="description">
<p>
Devuelve una geometría formada desplazando una geometría de línea hacia un lado. Las distancias están en el Sistema de Referencia Espacial de esta geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
offset_curve
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
distance
</span>
[,
<span class="argument">
segments=8
</span>
][,
<span class="argument">
join=1
</span>
][,
<span class="argument">
miter_limit=2.0
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría de (multi)cadena de líneas
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
distancia de desplazamiento. Para valores positivos se hará un buffer a la izquierda de las líneas y para valores negativos para la derecha.
</td>
</tr>
<tr>
<td class="argument">
segments
</td>
<td>
número de segmentos a usar para representar un cuarto de círculo cuando se utilice un estilo de unión redondo. Un número mayor da como resultado una línea más suave con más nodos.
</td>
</tr>
<tr>
<td class="argument">
join
</td>
<td>
estilo de unión para esquinas, donde 1 = redondo, 2 = inglete y 3 = bisel
</td>
</tr>
<tr>
<td class="argument">
miter_limit
</td>
<td>
límite en el radio del inglete utilizado para esquinas muy agudas (solamente al utilizar uniones en inglete)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
offset_curve($geometry, 10.5)
</code>
<code>
desplazamiento de línea a la izquierda en 10,5 unidades
</code>
</li>
<li>
<code>
offset_curve($geometry, -10.5)
</code>
<code>
desplazamiento de línea a la derecha en 10,5 unidades
</code>
</li>
<li>
<code>
offset_curve($geometry, 10.5, segments=16, join=1)
</code>
<code>
desplazamiento de línea a la izquierda en 10,5 unidades, usando más segmentos para obtener una curva más suave
</code>
</li>
<li>
<code>
offset_curve($geometry, 10.5, join=3)
</code>
<code>
desplazamiento de línea a la izquierda por 10.5 unidades, usando una unión en bisel
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-order_parts"><a href="#geometrygroup-order_parts-idx">
función order_parts
</a></h3>
<div class="description">
<p>
Ordena las partes de una MultiGeometría por los criterios dados
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
order_parts
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
orderby
</span>
,
<span class="argument">
ascending
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría multi tipo
</td>
</tr>
<tr>
<td class="argument">
orderby
</td>
<td>
una cadena de expresión que define los criterios de ordenación
</td>
</tr>
<tr>
<td class="argument">
ascending
</td>
<td>
lógico, Verdadero para ascendente, Falso para descendente
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
order_parts(geom_from_wkt('MultiPolygon (((1 1, 5 1, 5 5, 1 5, 1 1)),((1 1, 9 1, 9 9, 1 9, 1 1)))'), 'area($geometry)', False)
</code>
<code>
MultiPolygon (((1 1, 9 1, 9 9, 1 9, 1 1)),((1 1, 5 1, 5 5, 1 5, 1 1)))
</code>
</li>
<li>
<code>
order_parts(geom_from_wkt('LineString(1 2, 3 2, 4 3)'), '1', True)
</code>
<code>
LineString(1 2, 3 2, 4 3)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-oriented_bbox"><a href="#geometrygroup-oriented_bbox-idx">
función oriented_bbox
</a></h3>
<div class="description">
<p>
Devuelve una geometría que representa el recuadro delimitador orientado mínimo de una geometría de entrada.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
oriented_bbox
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( oriented_bbox( geom_from_wkt( 'MULTIPOINT(1 2, 3 4, 3 2)' ) ) )
</code>
<code>
Polygon ((1 4, 1 2, 3 2, 3 4, 1 4))
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-overlaps"><a href="#geometrygroup-overlaps-idx">
función overlaps
</a></h3>
<div class="description">
<p>
Comprueba si una geometría solapa con otra. Devuelve verdadero si las geometrías comparten espacio, son de la misma dimensión, pero no están contenidas en la otra.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
overlaps
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
overlaps( geom_from_wkt( 'LINESTRING(3 5, 4 4, 5 5, 5 3)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
overlaps( geom_from_wkt( 'LINESTRING(0 0, 1 1)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-perimeter"><a href="#geometrygroup-perimeter-idx">
función perimeter
</a></h3>
<div class="description">
<p>
Devuelve el perímetro de un objeto de geometría de tipo polígono. Los cálculos siempre son planimétricos en el Sistema de Rerefencia Espacial (SRE) de esta geometría y las unidades del perímetro devuelto coincidirán con las unidades del SRE. Esto difiere de los cálculos hechos por la función $perimeter, que hará cálculos elipsoidales basados en el elipsoide del proyecto y la configuración de las unidades de distancia.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
perimeter
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
objeto de geometría poligonal
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
perimeter(geom_from_wkt('POLYGON((0 0, 4 0, 4 2, 0 2, 0 0))'))
</code>
<code>
12.0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-point_n"><a href="#geometrygroup-point_n-idx">
función point_n
</a></h3>
<div class="description">
<p>
Devuelve un nodo específico de una geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
point_n
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
index
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
objeto de geometría
</td>
</tr>
<tr>
<td class="argument">
index
</td>
<td>
index of node to return, where 1 is the first node; if the value is negative, the selected vertex index will be its total count minus the absolute value
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(point_n(geom_from_wkt('POLYGON((0 0, 4 0, 4 2, 0 2, 0 0))'),2))
</code>
<code>
'Point (4 0)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-point_on_surface"><a href="#geometrygroup-point_on_surface-idx">
función point_on_surface
</a></h3>
<div class="description">
<p>
Devuelve un punto garantizando que cae en la superficie de una geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
point_on_surface
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
point_on_surface($geometry)
</code>
<code>
una geometría de punto
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-pole_of_inaccessibility"><a href="#geometrygroup-pole_of_inaccessibility-idx">
función pole_of_inaccessibility
</a></h3>
<div class="description">
<p>
Calcula el polo aproximado de inaccesibilidad para una superficie, que es el punto interno de una superficie más distante del borde de la superficie. Esta función usa el algoritmo "polylabel" (Vladimir Agafonkin, 2016), que es una aproximación iterativa que garantiza encontrar el polo real de inaccesibilidad dentro de una tolerancia especificada. Tolerancias más precisas requieren más iteraciones y llevará más tiempo calcularlas.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
pole_of_inaccessibility
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
tolerance
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
tolerance
</td>
<td>
distancia máxima entre el punto devuelto y la localización del polo verdadero
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(pole_of_inaccessibility( geom_from_wkt('POLYGON((0 1,0 9,3 10,3 3, 10 3, 10 1, 0 1))'), 0.1))
</code>
<code>
Point(1.55, 1.55)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-project"><a href="#geometrygroup-project-idx">
función project
</a></h3>
<div class="description">
<p>
Returns a point projected from a start point using a distance, a bearing (azimuth) and an elevation in radians.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
project
</span>
(
<span class="argument">
point
</span>
,
<span class="argument">
distance
</span>
,
<span class="argument">
azimuth
</span>
[,
<span class="argument">
elevation
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point
</td>
<td>
punto de inicio
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
distancia a proyectar
</td>
</tr>
<tr>
<td class="argument">
azimuth
</td>
<td>
azimuth in radians clockwise, where 0 corresponds to north
</td>
</tr>
<tr>
<td class="argument">
elevation
</td>
<td>
angle of inclination in radians
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(project(make_point(1, 2), 3, radians(270)))
</code>
<code>
Point(-2, 2)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-relate"><a href="#geometrygroup-relate-idx">
función relate
</a></h3>
<div class="description">
<p>
Prueba la representación del Modelo de Intersección 9 Extendido Dimensional (DE-9IM) de la relación entre dos geometrías.
</p>
</div>
<h3 id="geometrygroup-relate"><a href="#geometrygroup-relate-idx">
Variante de relación
</a></h3>
<div class="description">
Devuelve la representación del Modelo de Intersección 9 Extendido Dimensional (DE-9IM) de la relación entre dos geometrías.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
relate
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
relate( geom_from_wkt( 'LINESTRING(40 40,120 120)' ), geom_from_wkt( 'LINESTRING(40 40,60 120)' ) )
</code>
<code>
'FF1F00102'
</code>
</li>
</ul>
</div>
<h3 id="geometrygroup-relate"><a href="#geometrygroup-relate-idx">
Variante de coincidencia de patrón
</a></h3>
<div class="description">
Prueba si la relación DE-9IM entre dos geometrías coincide con el patrón especificado.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
relate
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
geometry
</span>
,
<span class="argument">
pattern
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
pattern
</td>
<td>
Patrón DE-9IM con el que coincidir
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
relate( geom_from_wkt( 'LINESTRING(40 40,120 120)' ), geom_from_wkt( 'LINESTRING(40 40,60 120)' ), '**1F001**' )
</code>
<code>
Verdadero
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-reverse"><a href="#geometrygroup-reverse-idx">
función reverse
</a></h3>
<div class="description">
<p>
Cambia el sentido de una línea invirtiendo el orden de sus vértices.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
reverse
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(reverse(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))
</code>
<code>
'LINESTRING(2 2, 1 1, 0 0)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-rotate"><a href="#geometrygroup-rotate-idx">
función rotate
</a></h3>
<div class="description">
<p>
Returns a rotated version of a geometry. Calculations are in the Spatial Reference System of this geometry.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
rotate
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
rotation
</span>
[,
<span class="argument">
point
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
rotation
</td>
<td>
clockwise rotation in degrees
</td>
</tr>
<tr>
<td class="argument">
point
</td>
<td>
rotation center point. If not specified, the center of the geometry's bounding box is used.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
rotate($geometry, 45, make_point(4, 5))
</code>
<code>
geometry rotated 45 degrees clockwise around the (4, 5) point
</code>
</li>
<li>
<code>
rotate($geometry, 45)
</code>
<code>
geometry rotated 45 degrees clockwise around the center of its bounding box
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-segments_to_lines"><a href="#geometrygroup-segments_to_lines-idx">
función segments_to_lines
</a></h3>
<div class="description">
<p>
Devuelve una geometría multilínea que consiste en una línea para cada segmento de la geometría de entrada.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
segments_to_lines
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
objeto de geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(segments_to_lines(geom_from_wkt('LINESTRING(0 0, 1 1, 2 2)')))
</code>
<code>
'MultiLineString ((0 0, 1 1),(1 1, 2 2))'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-shortest_line"><a href="#geometrygroup-shortest_line-idx">
función shortest_line
</a></h3>
<div class="description">
<p>
Returns the shortest line joining geometry1 to geometry2. The resultant line will start at geometry1 and end at geometry2.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
shortest_line
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
geometría desde la que encontrar la línea más corta
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
geometría hasta la que encontrar la línea más corta
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(shortest_line(geom_from_wkt('LINESTRING (20 80, 98 190, 110 180, 50 75 )'),geom_from_wkt('POINT(100 100)')))
</code>
<code>
LineString(73.0769 115.384, 100 100)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-simplify"><a href="#geometrygroup-simplify-idx">
función simplify
</a></h3>
<div class="description">
<p>
Simplifica una geometría eliminando nodos usando un margen basado en distancia (esto es, el algoritmo Douglas Peucker). El algoritmo conserva grandes desviaciones de las geometrías y reduce el número de vértices en segmentos prácticamente rectos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
simplify
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
tolerance
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
tolerance
</td>
<td>
desviación máxima de segmentos rectos para eliminar puntos
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(simplify(geometry:=geom_from_wkt('LineString(0 0, 5 0.1, 10 0)'),tolerance:=5))
</code>
<code>
'LineString(0 0, 10 0)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-simplify_vw"><a href="#geometrygroup-simplify_vw-idx">
función simplify_vw
</a></h3>
<div class="description">
<p>
Simplifica una geometría eliminando nodos usando un margen basado en área (esto es, el algoritmo Visvalingam-Whyatt). El algoritmo elimina vértices que crean pequeñas áreas en las geometrías, por ejemplo salientes estrechos o segmentos prácticamente rectos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
simplify_vw
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
tolerance
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
tolerance
</td>
<td>
una medida del área máxima creada por un nodo para eliminar el nodo
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(simplify_vw(geometry:=geom_from_wkt('LineString(0 0, 5 0, 5.01 10, 5.02 0, 10 0)'),tolerance:=5))
</code>
<code>
'LineString(0 0, 10 0)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-single_sided_buffer"><a href="#geometrygroup-single_sided_buffer-idx">
función single_sided_buffer
</a></h3>
<div class="description">
<p>
Devuelve una geometría formada haciendo un buffer de una geometría de línea hacia un lado. Las distancias están en el Sistema de Referencia Espacial de esta geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
single_sided_buffer
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
distance
</span>
[,
<span class="argument">
segments=8
</span>
][,
<span class="argument">
join=1
</span>
][,
<span class="argument">
miter_limit=2.0
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría de (multi)cadena de líneas
</td>
</tr>
<tr>
<td class="argument">
distance
</td>
<td>
distancia de buffer. Para valores positivos se hará un buffer a la izquierda de las líneas y para valores negativos a la derecha.
</td>
</tr>
<tr>
<td class="argument">
segments
</td>
<td>
número de segmentos a usar para representar un cuarto de círculo cuando se utilice un estilo de unión redondo. Un número mayor da como resultado un buffer más suave con más nodos.
</td>
</tr>
<tr>
<td class="argument">
join
</td>
<td>
estilo de unión para esquinas, donde 1 = redondo, 2 = inglete y 3 = bisel
</td>
</tr>
<tr>
<td class="argument">
miter_limit
</td>
<td>
límite en el radio del inglete utilizado para esquinas muy agudas (solamente al utilizar uniones en inglete)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
single_sided_buffer($geometry, 10.5)
</code>
<code>
línea hecha buffer a la izquierda en 10,5 unidades
</code>
</li>
<li>
<code>
single_sided_buffer($geometry, -10.5)
</code>
<code>
línea hecha buffer a la derecha en 10,5 unidades
</code>
</li>
<li>
<code>
single_sided_buffer($geometry, 10.5, segments=16, join=1)
</code>
<code>
buffer de línea a la izquierda en 10.5 unidades, usando más segmentos para obtener un buffer más suabe.
</code>
</li>
<li>
<code>
single_sided_buffer($geometry, 10.5, join=3)
</code>
<code>
línea hecha buffer a la izquierda por 10.5 unidades, usando una unión en bisel
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-smooth"><a href="#geometrygroup-smooth-idx">
función smooth
</a></h3>
<div class="description">
<p>
Smooths a geometry by adding extra nodes which round off corners in the geometry. If input geometries contain Z or M values, these will also be smoothed and the output geometry will retain the same dimensionality as the input geometry.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
smooth
</span>
(
<span class="argument">
geometry
</span>
[,
<span class="argument">
iterations
</span>
][,
<span class="argument">
offset
</span>
][,
<span class="argument">
min_length
</span>
][,
<span class="argument">
max_angle
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
iterations
</td>
<td>
número de iteraciones de suavizado a aplicar. Números grandes dan lugar a geometrías más suaves, pero más complejas.
</td>
</tr>
<tr>
<td class="argument">
offset
</td>
<td>
valor entre 0 y 0,5 que controla hasta qué punto se ajusta la geometría suavizada a la original. Número pequeños dan lugar a un suavizado más ajustado, mientras que números mayores dan lugar a un ajustado más laxo.
</td>
</tr>
<tr>
<td class="argument">
min_length
</td>
<td>
longitud mínima de segmento a la que aplicar el suavizado. Este parámetro se puede usar para evitar colocar un número excesivo de nodos adicionales en los segmentos más cortos de la geometría.
</td>
</tr>
<tr>
<td class="argument">
max_angle
</td>
<td>
ángulo máximo en el nodo para aplicar suavizado (0-180). Disminuyendo el ángulo máximo se pueden conservar esquinas intencionadamente agudas de la geometría. Por ejemplo, un valor de 80 grados conservará los ángulos rectos de la geometría.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(smooth(geometry:=geom_from_wkt('LineString(0 0, 5 0, 5 5)'),iterations:=1,offset:=0.2,min_length:=-1,max_angle:=180))
</code>
<code>
'LineString (0 0, 4 0, 5 1, 5 5)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-start_point"><a href="#geometrygroup-start_point-idx">
función start_point
</a></h3>
<div class="description">
<p>
Devuelve el primer nodo de una geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
start_point
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
objeto de geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt(start_point(geom_from_wkt('LINESTRING(4 0, 4 2, 0 2)')))
</code>
<code>
'Point (4 0)'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-sym_difference"><a href="#geometrygroup-sym_difference-idx">
función sym_difference
</a></h3>
<div class="description">
<p>
Devuelve una geometría que representa las partes de dos geometrías que no se intersecan.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
sym_difference
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( sym_difference( geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ), geom_from_wkt( 'LINESTRING(3 3, 8 8)' ) ) )
</code>
<code>
LINESTRING(5 5, 8 8)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-tapered_buffer"><a href="#geometrygroup-tapered_buffer-idx">
función tapered_buffer
</a></h3>
<div class="description">
<p>
Crea un búfer a lo largo de una geometría lineal donde el diámetro del búfer varía uniformemente sobre la longitud de la línea.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
tapered_buffer
</span>
(
<span class="argument">
geometry
</span>
,
<span class="argument">
start_width
</span>
,
<span class="argument">
end_width
</span>
[,
<span class="argument">
segments=8
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
geometría de entrada. Debe ser una geometría de (varias) líneas.
</td>
</tr>
<tr>
<td class="argument">
start_width
</td>
<td>
ancho del búfer al inicio de la línea,
</td>
</tr>
<tr>
<td class="argument">
end_width
</td>
<td>
ancho del búfer al final de la línea.
</td>
</tr>
<tr>
<td class="argument">
segments
</td>
<td>
número de segmentos para aproximar las curvas del un cuarto de círculo en el buffer.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
tapered_buffer(geometry:=geom_from_wkt('LINESTRING(1 2, 4 2)'),start_width:=1,end_width:=2,segments:=8)
</code>
<code>
Un búfer estrechado comenzando con un diámetro de 1 y terminando con un diámetro de 2 a lo largo de una geometría de cadena de líneas.
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-touches"><a href="#geometrygroup-touches-idx">
función touches
</a></h3>
<div class="description">
<p>
Comprueba si una geometría toca a otra. Devuelve verdadero si las geometrías tienen al menos un punto en común, pero sus interiores no se intersecan.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
touches
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
touches( geom_from_wkt( 'LINESTRING(5 3, 4 4)' ), geom_from_wkt( 'LINESTRING(3 3, 4 4, 5 5)' ) )
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
touches( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(5 5)' ) )
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-transform"><a href="#geometrygroup-transform-idx">
función transform
</a></h3>
<div class="description">
<p>
Devuelve la geometría transformada desde un SRC de origen a otro de destino.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
transform
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
source_auth_id
</span>
,
<span class="argument">
dest_auth_id
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
source_auth_id
</td>
<td>
ID del SRC de origen
</td>
</tr>
<tr>
<td class="argument">
dest_auth_id
</td>
<td>
ID del SRC de destino
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( transform( $geometry, 'EPSG:2154', 'EPSG:4326' ) )
</code>
<code>
POINT(0 51)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-translate"><a href="#geometrygroup-translate-idx">
función translate
</a></h3>
<div class="description">
<p>
Devuelve una versión convertida de una geometría. Los cálculos se hacen en el Sistema de Referencia Espacial de la geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
translate
</span>
(
<span class="argument">
geom
</span>
,
<span class="argument">
dx
</span>
,
<span class="argument">
dy
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
dx
</td>
<td>
delta x
</td>
</tr>
<tr>
<td class="argument">
dy
</td>
<td>
delta y
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
convertir($geometría,5,10)
</code>
<code>
una geometría del mismo tipo que la original
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-union"><a href="#geometrygroup-union-idx">
función union
</a></h3>
<div class="description">
<p>
Devuelve una geometría que representa el conjunto unión de los puntos de las geometrías.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
union
</span>
(
<span class="argument">
geometry1
</span>
,
<span class="argument">
geometry2
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry1
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry2
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
geom_to_wkt( union( geom_from_wkt( 'POINT(4 4)' ), geom_from_wkt( 'POINT(5 5)' ) ) )
</code>
<code>
MULTIPOINT(4 4, 5 5)
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-wedge_buffer"><a href="#geometrygroup-wedge_buffer-idx">
función wedge_buffer
</a></h3>
<div class="description">
<p>
Regresa un búfer en forma de cuña originado de una geometría de punto.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
wedge_buffer
</span>
(
<span class="argument">
center
</span>
,
<span class="argument">
azimuth
</span>
,
<span class="argument">
width
</span>
,
<span class="argument">
outer_radius
</span>
[,
<span class="argument">
inner_radius=0.0
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
center
</td>
<td>
punto central (origen) del buffer. Debe ser una geometría de punto.
</td>
</tr>
<tr>
<td class="argument">
azimuth
</td>
<td>
ángulo (en grados) desde la mitad de la cuña a un punto.
</td>
</tr>
<tr>
<td class="argument">
width
</td>
<td>
ancho de búfer (en grados). Note que la cuña se extenderá a la mitad de la anchura angular por ambos lados en la dirección azimutal.
</td>
</tr>
<tr>
<td class="argument">
outer_radius
</td>
<td>
radio exterior para los buffers
</td>
</tr>
<tr>
<td class="argument">
inner_radius
</td>
<td>
radio interno opcional para buffers
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
wedge_buffer(center:=geom_from_wkt('POINT(1 2)'),azimuth:=90,width:=180,outer_radius:=1)
</code>
<code>
Un búfer en forma de cuña centrado en el punto (1,2), apuntando hacia el Este, con un ancho de 180 grados y radio externo de 1.
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-within"><a href="#geometrygroup-within-idx">
función within
</a></h3>
<div class="description">
<p>
Comprueba si una geometría está dentro de otra. Devuelve verdadero si la geometría a está completamente dentro de la geometría b.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
within
</span>
(
<span class="argument">
geometry a
</span>
,
<span class="argument">
geometry b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry a
</td>
<td>
una geometría
</td>
</tr>
<tr>
<td class="argument">
geometry b
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
within( geom_from_wkt( 'POINT( 0.5 0.5)' ), geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))' ) )
</code>
<code>
verdadero
</code>
</li>
<li>
<code>
within( geom_from_wkt( 'POINT( 5 5 )' ), geom_from_wkt( 'POLYGON((0 0, 0 1, 1 1, 1 0, 0 0 ))' ) )
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-x"><a href="#geometrygroup-x-idx">
función x
</a></h3>
<div class="description">
<p>
Devuelve la coordenada X de una geometría de tipo punto o la coordenada X del centroide de una geometría que no sea de puntos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
x
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
x( geom_from_wkt( 'POINT(2 5)' ) )
</code>
<code>
2
</code>
</li>
<li>
<code>
x( $geometría)
</code>
<code>
coordenada X del centroide del objeto actual
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-x_max"><a href="#geometrygroup-x_max-idx">
función x_max
</a></h3>
<div class="description">
<p>
Devuelve la coordenada X máxima de una geometría. Los cálculos están en el Sistema de Referencia Espacial de esta geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
x_max
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
x_max( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )
</code>
<code>
4
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-x_min"><a href="#geometrygroup-x_min-idx">
función x_min
</a></h3>
<div class="description">
<p>
Devuelve la coordenada X mínima de una geometría. Los cálculos están en el Sistema de Referencia Espacial de esta geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
x_min
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
x_min( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )
</code>
<code>
2
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-y"><a href="#geometrygroup-y-idx">
función y
</a></h3>
<div class="description">
<p>
Devuelve la coordenada Y de una geometría de tipo punto o la coordenada Y del centroide de una geometría que no sea de puntos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
y
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
y( geom_from_wkt( 'POINT(2 5)' ) )
</code>
<code>
5
</code>
</li>
<li>
<code>
y( $geometría )
</code>
<code>
coordenada Y del centroide del objeto actual
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-y_max"><a href="#geometrygroup-y_max-idx">
función y_max
</a></h3>
<div class="description">
<p>
Devuelve la coordenada Y máxima de una geometría. Los cálculos están en el Sistema de Referencia Espacial de esta geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
y_max
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
y_max( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )
</code>
<code>
8
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-y_min"><a href="#geometrygroup-y_min-idx">
función y_min
</a></h3>
<div class="description">
<p>
Devuelve la coordenada Y mínima de una geometría. Los cálculos están en el Sistema de Referencia Espacial de esta geometría.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
y_min
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
y_min( geom_from_wkt( 'LINESTRING(2 5, 3 6, 4 8)') )
</code>
<code>
5
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-z"><a href="#geometrygroup-z-idx">
función z
</a></h3>
<div class="description">
<p>
Devuelve la coordenada Z de una geometría de punto.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
z
</span>
(
<span class="argument">
geom
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geom
</td>
<td>
una geometría de punto
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
z( geom_from_wkt( 'POINTZ(2 5 7)' ) )
</code>
<code>
7
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-z_max"><a href="#geometrygroup-z_max-idx">
función z_max
</a></h3>
<div class="description">
<p>
Returns the maximum z coordinate of a geometry.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
z_max
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry with z coordinate
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
z_max( geom_from_wkt( 'POINT ( 0 0 1 )' ) )
</code>
<code>
1
</code>
</li>
<li>
<code>
z_max( make_line( make_point( 0,0,0 ), make_point( -1,-1,-2 ) ) )
</code>
<code>
0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="geometrygroup-z_min"><a href="#geometrygroup-z_min-idx">
función z_min
</a></h3>
<div class="description">
<p>
Returns the minimum z coordinate of a geometry.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
z_min
</span>
(
<span class="argument">
geometry
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
geometry
</td>
<td>
a geometry with z coordinate
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
z_min( geom_from_wkt( 'POINT ( 0 0 1 )' ) )
</code>
<code>
1
</code>
</li>
<li>
<code>
z_min( make_line( make_point( 0,0,0 ), make_point( -1,-1,-2 ) ) )
</code>
<code>
-2
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="layout" class="group">falta la ayuda de la función para Layout</div>
<div class="function"><html>
<body>
<h3 id="layout-item_variables"><a href="#layout-item_variables-idx">
función item_variables
</a></h3>
<div class="description">
<p>
Devuelve un mapa de variables a partir de un elemento del diseñador dentro de esta composición.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
item_variables
</span>
(
<span class="argument">
id
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
id
</td>
<td>
ID del elemento del diseñador
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
map_get(item_variables('mapa_principal'), 'escala_de_mapa')
</code>
<code>
2000
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="map-layers" class="group"><h2><a href="#map-layers-idx">grupo capas de mapa</a></h2>
<div class="description"><p>Contiene una lista de capas de mapa disponibles en el proyecto actual.</p></div></div>
<div class="function"><html>
<body>
<h3 id="map-layers-decode_uri"><a href="#map-layers-decode_uri-idx">
función decode_uri
</a></h3>
<div class="description">
<p>
Takes a layer and decodes the uri of the underlying data provider. It depends on the dataprovider, which data is available.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
decode_uri
</span>
(
<span class="argument">
layer
</span>
[,
<span class="argument">
part
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
The layer for which the uri should be decoded.
</td>
</tr>
<tr>
<td class="argument">
part
</td>
<td>
The part of the uri to return. If unspecified, a map with all uri parts will be returned.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
decode_uri(@layer)
</code>
<code>
{'layerId': '0', 'layerName': '', 'path': '/home/qgis/shapefile.shp'}
</code>
</li>
<li>
<code>
decode_uri(@layer)
</code>
<code>
{'layerId': NULL, 'layerName': 'layer', 'path': '/home/qgis/geopackage.gpkg'}
</code>
</li>
<li>
<code>
decode_uri(@layer, 'path')
</code>
<code>
'C:\my_data\qgis\shape.shp'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="maps" class="group"><h2><a href="#maps-idx">grupo mapas</a></h2>
<div class="description"><p>Este grupo contiene funciones de expresiones para la creación y manipulación de estructuras de datos de "mapa" (también conocidos como objetos de diccionario, pares clave-valor o matrices asociativas). Se pueden asignar valores a las claves dadas. El orden de los pares clave-valor en el objeto de mapa es irrelevante.</p></div></div>
<div class="function"><html>
<body>
<h3 id="maps-from_json"><a href="#maps-from_json-idx">
función from_json
</a></h3>
<div class="description">
<p>
Loads a JSON formatted string.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
from_json
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
JSON texto
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
from_json('{"qgis":"rocks"}')
</code>
<code>
{ "qgis" : "rocks" }
</code>
</li>
<li>
<code>
from_json('[1,2,3]')
</code>
<code>
[1,2,3]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-hstore_to_map"><a href="#maps-hstore_to_map-idx">
función hstore_to_map
</a></h3>
<div class="description">
<p>
Creates a map from a hstore-formatted string.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
hstore_to_map
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
la cadena de entrada
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
hstore_to_map('qgis=&gt;rocks')
</code>
<code>
{ "qgis" : "rocks" }
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-json_to_map"><a href="#maps-json_to_map-idx">
función json_to_map
</a></h3>
<div class="description">
<p>
Creates a map from a json-formatted string.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
json_to_map
</span>
(
<span class="argument">
string
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
string
</td>
<td>
la cadena de entrada
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
json_to_map('{"qgis":"rocks"}')
</code>
<code>
{ "qgis" : "rocks" }
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-map"><a href="#maps-map-idx">
función map
</a></h3>
<div class="description">
<p>
Devuelve un mapa que contiene todas las claves y valores pasados como pares de parámetros.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
map
</span>
(
<span class="argument">
key1
</span>
,
<span class="argument">
value1
</span>
,
<span class="argument">
key2
</span>
,
<span class="argument">
value2
</span>
…)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
key
</td>
<td>
una clave (cadena)
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
un valor
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
map('1','uno','2', 'dos')
</code>
<code>
{ '1': 'uno', '2': 'dos' }
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-map_akeys"><a href="#maps-map_akeys-idx">
función map_akeys
</a></h3>
<div class="description">
<p>
Devuelve todas las claves de un mapa como una matriz.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_akeys
</span>
(
<span class="argument">
map
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
un mapa
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
map_akeys(map('1','uno','2','dos'))
</code>
<code>
[ '1', '2' ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-map_avals"><a href="#maps-map_avals-idx">
función map_avals
</a></h3>
<div class="description">
<p>
Devuelve todos los valores de un mapa como una matriz.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_avals
</span>
(
<span class="argument">
map
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
un mapa
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
map_avals(map('1','uno','2','dos'))
</code>
<code>
[ 'uno', 'dos' ]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-map_concat"><a href="#maps-map_concat-idx">
función map_concat
</a></h3>
<div class="description">
<p>
Devuelve un mapa que contiene todas las entradas de los mapas dados. Si dos mapas contienen la misma clave, se toma el valor del segundo mapa.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_concat
</span>
(
<span class="argument">
map1
</span>
,
<span class="argument">
map2
</span>
…)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
un mapa
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
map_concat(map('1','uno', '2','sobreescrito'),map('2','dos', '3','tres'))
</code>
<code>
{ '1': 'uno, '2': 'dos', '3': 'tres' }
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-map_delete"><a href="#maps-map_delete-idx">
función map_delete
</a></h3>
<div class="description">
<p>
Devuelve un mapa con las claves dadas y sus valores correspondientes borrados.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_delete
</span>
(
<span class="argument">
map
</span>
,
<span class="argument">
key
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
un mapa
</td>
</tr>
<tr>
<td class="argument">
key
</td>
<td>
la clave a borrar
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
map_delete(map('1','uno','2','dos'),'2')
</code>
<code>
{ '1': 'uno' }
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-map_exist"><a href="#maps-map_exist-idx">
función map_exist
</a></h3>
<div class="description">
<p>
Devuelve verdadero si la clave dada existe en el mapa.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_exist
</span>
(
<span class="argument">
map
</span>
,
<span class="argument">
key
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
un mapa
</td>
</tr>
<tr>
<td class="argument">
key
</td>
<td>
la clave a buscar
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
map_exist(map('1','uno','2','dos'),'3')
</code>
<code>
falso
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-map_get"><a href="#maps-map_get-idx">
función map_get
</a></h3>
<div class="description">
<p>
Devuelve el valor de un mapa, dada su clave.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_get
</span>
(
<span class="argument">
map
</span>
,
<span class="argument">
key
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
un mapa
</td>
</tr>
<tr>
<td class="argument">
key
</td>
<td>
la clave a buscar
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
map_get(map('1','uno','2','dos'),'2')
</code>
<code>
'dos'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-map_insert"><a href="#maps-map_insert-idx">
función map_insert
</a></h3>
<div class="description">
<p>
Devuelve un mapa con una clave/valor añadidos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_insert
</span>
(
<span class="argument">
map
</span>
,
<span class="argument">
key
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
un mapa
</td>
</tr>
<tr>
<td class="argument">
key
</td>
<td>
la clave a añadir
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
el valor a añadir
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
map_insert(map('1','uno'),'3','tres')
</code>
<code>
{ '1': 'uno', '3': 'tres' }
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-map_to_hstore"><a href="#maps-map_to_hstore-idx">
función map_to_hstore
</a></h3>
<div class="description">
<p>
Merge map elements into a hstore-formatted string.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_to_hstore
</span>
(
<span class="argument">
map
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
el mapa de entrada
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
map_to_hstore(map('qgis','rocks'))
</code>
<code>
"qgis"=&gt;"rocks"}
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-map_to_json"><a href="#maps-map_to_json-idx">
función map_to_json
</a></h3>
<div class="description">
<p>
Merge map elements into a json-formatted string.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
map_to_json
</span>
(
<span class="argument">
map
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
map
</td>
<td>
el mapa de entrada
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
map_to_json(map('qgis','rocks'))
</code>
<code>
{"qgis":"rocks"}
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="maps-to_json"><a href="#maps-to_json-idx">
función to_json
</a></h3>
<div class="description">
<p>
Crear una cadena en formato JSON a partir de un mapa, arreglo u otro valor.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
to_json
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
El valor de entrada
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
to_json(map('qgis','rocks'))
</code>
<code>
{"qgis":"rocks"}
</code>
</li>
<li>
<code>
to_json(array(1,2,3))
</code>
<code>
[1,2,3]
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="math" class="group"><h2><a href="#math-idx">grupo matemáticas</a></h2>
<div class="description"><p>Este grupo contiene funciones matemáticas, por ejemplo raíz cuadrada, seno y coseno</p></div></div>
<div class="function"><html>
<body>
<h3 id="math-abs"><a href="#math-abs-idx">
función abs
</a></h3>
<div class="description">
<p>
Devuelve el valor absoluto de un número.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
abs
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
un número
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
abs(-2)
</code>
<code>
2
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-acos"><a href="#math-acos-idx">
función acos
</a></h3>
<div class="description">
<p>
Devuelve el arco coseno de un valor en radianes.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
acos
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
coseno de un ángulo en radianes
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
acos(0.5)
</code>
<code>
1.0471975511966
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-asin"><a href="#math-asin-idx">
función asin
</a></h3>
<div class="description">
<p>
Devuelve el arcoseno de un valor en radianes.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
asin
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
seno de un ángulo en radianes
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
arcsen(1.0)
</code>
<code>
1.5707963267949
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-atan"><a href="#math-atan-idx">
función atan
</a></h3>
<div class="description">
<p>
Devuelve la arcotangente de un valor en radianes.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
atan
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
tangente de un ángulo en radianes
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
arctan(0.5)
</code>
<code>
0.463647609000806
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-atan2"><a href="#math-atan2-idx">
función atan2
</a></h3>
<div class="description">
<p>
Devuelve la arcotangente de dy/dx usandi los signos de los dos argumentos para determinar el cuadrante del resultado.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
atan2
</span>
(
<span class="argument">
dy
</span>
,
<span class="argument">
dx
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
dy
</td>
<td>
diferencia de la coordenada Y
</td>
</tr>
<tr>
<td class="argument">
dx
</td>
<td>
diferencia de la coordenada Y
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
arctan2(1.0, 1.732)
</code>
<code>
0.523611477769969
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-azimuth"><a href="#math-azimuth-idx">
función azimuth
</a></h3>
<div class="description">
<p>
Devuelve el azimut basado en el Norte como el ángulo en radianes medido en sentido horario desde la vertical en el punto_A al Punto_b.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
azimuth
</span>
(
<span class="argument">
point_a
</span>
,
<span class="argument">
point_b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point_a
</td>
<td>
geometría de punto
</td>
</tr>
<tr>
<td class="argument">
point_b
</td>
<td>
geometría de punto
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
degrees( azimuth( make_point(25, 45), make_point(75, 100) ) )
</code>
<code>
42.273689
</code>
</li>
<li>
<code>
degrees( azimuth( make_point(75, 100), make_point(25,45) ) )
</code>
<code>
222.273689
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-ceil"><a href="#math-ceil-idx">
función ceil
</a></h3>
<div class="description">
<p>
Redondea un número por arriba.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
ceil
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
un número
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
ceil(4.9)
</code>
<code>
5
</code>
</li>
<li>
<code>
ceil(-4.9)
</code>
<code>
-4
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-clamp"><a href="#math-clamp-idx">
función clamp
</a></h3>
<div class="description">
<p>
Restringe un valor de entrada a un rango especificado.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
clamp
</span>
(
<span class="argument">
minimum
</span>
,
<span class="argument">
input
</span>
,
<span class="argument">
maximum
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
minimum
</td>
<td>
el valor más pequeño que puede tomar
<i>
entrada
</i>
.
</td>
</tr>
<tr>
<td class="argument">
input
</td>
<td>
un valor que se puede restringir al intervalo especificado por
<i>
mínimo
</i>
y
<i>
máximo
</i>
</td>
</tr>
<tr>
<td class="argument">
maximum
</td>
<td>
el valor más grande que puede tomar
<i>
entrada
</i>
.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
clamp(1,5,10)
</code>
<code>
5
</code>
(
<i>
entrada
</i>
está entre 1 y 10 así que se devuelve sin cambio)
</li>
<li>
<code>
clamp(1,0,10)
</code>
<code>
1
</code>
(
<i>
entrada
</i>
es menor que el valor mínimo de 1, así que la función devuelve 1)
</li>
<li>
<code>
clamp(1,11,10)
</code>
<code>
10
</code>
(
<i>
entrada
</i>
es mayor que el valor máximo de 10, así que la función devuelve 10)
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-cos"><a href="#math-cos-idx">
función cos
</a></h3>
<div class="description">
<p>
Devuelve el coseno de un ángulo.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
cos
</span>
(
<span class="argument">
angle
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
angle
</td>
<td>
ángulo en radianes
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
cos(1.571)
</code>
<code>
0.000796326710733263
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-degrees"><a href="#math-degrees-idx">
función degrees
</a></h3>
<div class="description">
<p>
Convierte de radianes a grados.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
degrees
</span>
(
<span class="argument">
radians
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
radians
</td>
<td>
valor numérico
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
degrees(3.14159)
</code>
<code>
180
</code>
</li>
<li>
<code>
grados(1)
</code>
<code>
57.2958
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-exp"><a href="#math-exp-idx">
función exp
</a></h3>
<div class="description">
<p>
Devuelve la exponencial de un valor.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
exp
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
número del que devolver la exponencial
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
exp(1.0)
</code>
<code>
2.71828182845905
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-floor"><a href="#math-floor-idx">
función floor
</a></h3>
<div class="description">
<p>
Redondea un número por abajo.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
floor
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
un número
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
floor(4.9)
</code>
<code>
4
</code>
</li>
<li>
<code>
floor(-4.9)
</code>
<code>
-5
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-inclination"><a href="#math-inclination-idx">
función inclination
</a></h3>
<div class="description">
<p>
Devuelve la inclinación medida desde el cénit (0) al nadir (180) en el punto A al punto B.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
inclination
</span>
(
<span class="argument">
point_a
</span>
,
<span class="argument">
point_b
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
point_a
</td>
<td>
geometría de punto
</td>
</tr>
<tr>
<td class="argument">
point_b
</td>
<td>
geometría de punto
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, 5 ) )
</code>
<code>
0.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, 0 ) )
</code>
<code>
90.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 50, 100, 0 ) )
</code>
<code>
90.0
</code>
</li>
<li>
<code>
inclination( make_point( 5, 10, 0 ), make_point( 5, 10, -5 ) )
</code>
<code>
180.0
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-ln"><a href="#math-ln-idx">
función ln
</a></h3>
<div class="description">
<p>
Devuelve el logaritmo neperiano de un valor.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
ln
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
valor numérico
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
ln(1)
</code>
<code>
0
</code>
</li>
<li>
<code>
ln(2.7182818284590452354)
</code>
<code>
1
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-log"><a href="#math-log-idx">
función log
</a></h3>
<div class="description">
<p>
Devuelve el logaritmo del valor y la base pasados.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
log
</span>
(
<span class="argument">
base
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
base
</td>
<td>
cualquier número positivo
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
cualquier número positivo
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
log(2, 32)
</code>
<code>
5
</code>
</li>
<li>
<code>
log(0.5, 32)
</code>
<code>
-5
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-log10"><a href="#math-log10-idx">
función log10
</a></h3>
<div class="description">
<p>
Devuelve el logaritmo en base 10 de la expresión pasada.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
log10
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
cualquier número positivo
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
log10(1)
</code>
<code>
0
</code>
</li>
<li>
<code>
log10(100)
</code>
<code>
2
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-max"><a href="#math-max-idx">
función max
</a></h3>
<div class="description">
<p>
Devuelve el valor más grande de un conjunto de valores.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
max
</span>
(
<span class="argument">
value1
</span>
,
<span class="argument">
value2
</span>
…)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
un número
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
max(2,10.2,5.5)
</code>
<code>
10.2
</code>
</li>
<li>
<code>
max(20.5,NULL,6.2)
</code>
<code>
20.5
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-min"><a href="#math-min-idx">
función min
</a></h3>
<div class="description">
<p>
Devuelve el valor más pequeño de un conjunto de valores.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
min
</span>
(
<span class="argument">
value1
</span>
,
<span class="argument">
value2
</span>
…)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
un número
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
min(20.5,10,6.2)
</code>
<code>
6.2
</code>
</li>
<li>
<code>
min(2,-10.3,NULL)
</code>
<code>
-10.3
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-pi"><a href="#math-pi-idx">
función pi
</a></h3>
<div class="description">
<p>
Devuelve el valor de Pi para cálculos.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
pi
</span>
()
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
pi()
</code>
<code>
3.14159265358979
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-radians"><a href="#math-radians-idx">
función radians
</a></h3>
<div class="description">
<p>
Convierte de grados a radianes.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
radians
</span>
(
<span class="argument">
degrees
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
degrees
</td>
<td>
valor numérico
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
radianes(180)
</code>
<code>
3.14159
</code>
</li>
<li>
<code>
radianes(57.2958)
</code>
<code>
1
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-rand"><a href="#math-rand-idx">
función rand
</a></h3>
<div class="description">
<p>
Returns a random integer within the range specified by the minimum and maximum argument (inclusive). If a seed is provided, the returned will always be the same, depending on the seed.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
rand
</span>
(
<span class="argument">
min
</span>
,
<span class="argument">
max
</span>
[,
<span class="argument">
seed=null
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
min
</td>
<td>
un entero que representa el menor número aleatorio posible deseado
</td>
</tr>
<tr>
<td class="argument">
max
</td>
<td>
un entero que representa el mayor número aleatorio posible deseado
</td>
</tr>
<tr>
<td class="argument">
seed
</td>
<td>
any value to use as seed
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
rand(1, 10)
</code>
<code>
8
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-randf"><a href="#math-randf-idx">
función randf
</a></h3>
<div class="description">
<p>
Returns a random float within the range specified by the minimum and maximum argument (inclusive). If a seed is provided, the returned will always be the same, depending on the seed.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
randf
</span>
([
<span class="argument">
min=0.0
</span>
][,
<span class="argument">
max=1.0
</span>
][,
<span class="argument">
seed=null
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
min
</td>
<td>
un número de coma flotante que representa el menor número aleatorio posible deseado
</td>
</tr>
<tr>
<td class="argument">
max
</td>
<td>
un número de coma flotante que representa el mayor número aleatorio posible deseado
</td>
</tr>
<tr>
<td class="argument">
seed
</td>
<td>
any value to use as seed
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
randf(1, 10)
</code>
<code>
4.59258286403147
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-round"><a href="#math-round-idx">
función round
</a></h3>
<div class="description">
<p>
Redondea un número al número de posiciones decimales.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
round
</span>
(
<span class="argument">
value
</span>
[,
<span class="argument">
places=0
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
número decimal a redondear
</td>
</tr>
<tr>
<td class="argument">
places
</td>
<td>
Entero opcional que representa el número de posiciones decimales al que redondear. Puede ser negativo.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
round(1234.567, 2)
</code>
<code>
1234.57
</code>
</li>
<li>
<code>
round(1234.567)
</code>
<code>
1235
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-scale_exp"><a href="#math-scale_exp-idx">
función scale_exp
</a></h3>
<div class="description">
<p>
Transforma un valor dado de un dominio de entrada a un rango de salida usando una curva exponencial. Esta función se puede usar para facilitar valores dentro o fuera del rango de salida especificado.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
scale_exp
</span>
(
<span class="argument">
val
</span>
,
<span class="argument">
domain_min
</span>
,
<span class="argument">
domain_max
</span>
,
<span class="argument">
range_min
</span>
,
<span class="argument">
range_max
</span>
,
<span class="argument">
exponent
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
val
</td>
<td>
Un valor del dominio de entrada. La función devolverá un valor escalado correspondiente en el rango de salida.
</td>
</tr>
<tr>
<td class="argument">
domain_min
</td>
<td>
Especifica el valor mínimo del dominio de entrada, el valor más pequeño que debería tomar el valor de entrada.
</td>
</tr>
<tr>
<td class="argument">
domain_max
</td>
<td>
Especifica el valor máximo del dominio de entrada, el valor más grande que debería tomar el valor de entrada.
</td>
</tr>
<tr>
<td class="argument">
range_min
</td>
<td>
Especifica el valor mínimo del dominio de salida, el valor más pequeño que debería producir la función.
</td>
</tr>
<tr>
<td class="argument">
range_max
</td>
<td>
Especifica el valor máximo del dominio de salida, el valor más grande que debería producir la función.
</td>
</tr>
<tr>
<td class="argument">
exponent
</td>
<td>
Un valor positivo (mayor que 0) que dicta la forma en la que los valores de entrada son trasladados al rango de salida. Exponentes grandes harán que los valores de salida "converjan", comenzando lentamente antes de acelerar a medida que los valores de entrada se acercan al máximo del dominio. Exponentes más pequeños (menores que 1) harán que los valores de salida "diverjan", de forma que el traslado comienza rápidamente pero se ralentiza a medida que se aproxima al máximo del dominio.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
scale_exp(5,0,10,0,100,2)
</code>
<code>
25
</code>
("convergiendo", usando un exponente de 2)
</li>
<li>
<code>
scale_exp(3,0,10,0,100,0.5)
</code>
<code>
54.772
</code>
("divergiendo", usando un exponente de 0,5)
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-scale_linear"><a href="#math-scale_linear-idx">
función scale_linear
</a></h3>
<div class="description">
<p>
Transforma un valor dado de un dominio de entrada a un rango de salida usando interpolación lineal.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
scale_linear
</span>
(
<span class="argument">
val
</span>
,
<span class="argument">
domain_min
</span>
,
<span class="argument">
domain_max
</span>
,
<span class="argument">
range_min
</span>
,
<span class="argument">
range_max
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
val
</td>
<td>
Un valor del dominio de entrada. La función devolverá un valor escalado correspondiente en el rango de salida.
</td>
</tr>
<tr>
<td class="argument">
domain_min
</td>
<td>
Especifica el valor mínimo del dominio de entrada, el valor más pequeño que debería tomar el valor de entrada.
</td>
</tr>
<tr>
<td class="argument">
domain_max
</td>
<td>
Especifica el valor máximo del dominio de entrada, el valor más grande que debería tomar el valor de entrada.
</td>
</tr>
<tr>
<td class="argument">
range_min
</td>
<td>
Especifica el valor mínimo del dominio de salida, el valor más pequeño que debería producir la función.
</td>
</tr>
<tr>
<td class="argument">
range_max
</td>
<td>
Especifica el valor máximo del dominio de salida, el valor más grande que debería producir la función.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
scale_linear(5,0,10,0,100)
</code>
<code>
50
</code>
</li>
<li>
<code>
scale_linear(0.2,0,1,0,360)
</code>
<code>
72
</code>
(escalando un valor entre 0 y 1 a un ángulo entre 0 y 360)
</li>
<li>
<code>
scale_linear(1500,1000,10000,9,20)
</code>
<code>
9.6111111
</code>
(escalando una poblacion que varía entre 1000 y 10000 a un tamaño de letra entre 9 y 20)
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-sin"><a href="#math-sin-idx">
función sin
</a></h3>
<div class="description">
<p>
Devuelve el seno de un ángulo.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
sin
</span>
(
<span class="argument">
angle
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
angle
</td>
<td>
ángulo en radianes
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
sin(1.571)
</code>
<code>
0.999999682931835
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-sqrt"><a href="#math-sqrt-idx">
función sqrt
</a></h3>
<div class="description">
<p>
Devuelve la raíz cuadrada de un valor.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
sqrt
</span>
(
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
un número
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
sqrt(9)
</code>
<code>
3
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="math-tan"><a href="#math-tan-idx">
función tan
</a></h3>
<div class="description">
<p>
Devuelve la tangente de un ángulo.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
tan
</span>
(
<span class="argument">
angle
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
angle
</td>
<td>
ángulo en radianes
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
tan(1.0)
</code>
<code>
1.5574077246549
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="processing" class="group">falta la ayuda de la función para Processing</div>
<div class="function"><html>
<body>
<h3 id="processing-parameter"><a href="#processing-parameter-idx">
función parameter
</a></h3>
<div class="description">
<p>
Devuelve el valor del parámetro de entrada de un algoritmo de procesos
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
parameter
</span>
(
<span class="argument">
name
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
name
</td>
<td>
nombre del parámetro de entrada correspondiente
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
parameter('BUFFER_SIZE')
</code>
<code>
5.6
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="python" class="group">falta la ayuda de la función para Python</div>
<div class="function"><html>
<body>
<p>
falta la ayuda de la función para $mask_geometry
</p>
</body>
</html></div>
<div class="function"><html>
<body>
<p>
falta la ayuda de la función para in_mask
</p>
</body>
</html></div>
<div id="rasters" class="group"><h2><a href="#rasters-idx">grupo rásters</a></h2>
<div class="description"><p>Contains functions which calculate raster statistics and values.</p></div></div>
<div class="function"><html>
<body>
<h3 id="rasters-raster_statistic"><a href="#rasters-raster_statistic-idx">
función raster_statistic
</a></h3>
<div class="description">
<p>
Devuelve estadísticas de una capa ráster.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
raster_statistic
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
band
</span>
,
<span class="argument">
property
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
una cadena que representa bien el nombre de una capa ráster o el ID de la capa
</td>
</tr>
<tr>
<td class="argument">
band
</td>
<td>
entero que representa el número de banda de la capa ráster, comenzando por 1
</td>
</tr>
<tr>
<td class="argument">
property
</td>
<td>
una cadena que corresponde a la propiedad a devolver. Las opciones válidas son:
<br/>
<ul>
<li>
min: valor mínimo
</li>
<li>
max: valor máximo
</li>
<li>
avg: valor medio
</li>
<li>
stdev: desviación estándar de los valores
</li>
<li>
range: intervalo de valores (max - min)
</li>
<li>
sum: suma de todos los valores del ráster
</li>
</ul>
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
raster_statistic('lc',1,'avg')
</code>
<code>
Valor promedio de la banda 1 de la capa ráster 'lc'
</code>
</li>
<li>
<code>
raster_statistic('ac2010',3,'min')
</code>
<code>
Valor mínimo de la banda 3 de la capa ráster 'ac2010'
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="rasters-raster_value"><a href="#rasters-raster_value-idx">
función raster_value
</a></h3>
<div class="description">
<p>
Devuelve el valor ráster encontrado en el punto suministrado.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
raster_value
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
band
</span>
,
<span class="argument">
point
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
el nombre o id de una capa ráster
</td>
</tr>
<tr>
<td class="argument">
band
</td>
<td>
the band number to sample the value from.
</td>
</tr>
<tr>
<td class="argument">
point
</td>
<td>
point geometry (for multipart geometries having more than one part, a null value will be returned)
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
raster_value('dem', 1, make_point(1,1))
</code>
<code>
25
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div id="record-and-attributes" class="group"><h2><a href="#record-and-attributes-idx">grupo registros y atributos</a></h2>
<div class="description"><p>Este grupo contiene funciones que operan sobre identificadores de registros.</p></div></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-dollar-currentfeature"><a href="#record-and-attributes-dollar-currentfeature-idx">
función $currentfeature
</a></h3>
<div class="description">
<p>
Devuelve el objeto espacial que está siendo evaluado. Se puede usar con la función 'attribute' para evaluar los valores de atributo del objeto actual.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
$currentfeature
</span>
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
attribute( $currentfeature, 'nombre' )
</code>
<code>
valor guardado en el atributo 'nombre' del objeto actual
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-dollar-id"><a href="#record-and-attributes-dollar-id-idx">
función $id
</a></h3>
<div class="description">
<p>
Devuelve el ID del objeto de la fila actual.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
$id
</span>
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
$id
</code>
<code>
42
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-attribute"><a href="#record-and-attributes-attribute-idx">
función attribute
</a></h3>
<div class="description">
<p>
Returns an attribute from a feature.
</p>
</div>
<h3 id="record-and-attributes-attribute"><a href="#record-and-attributes-attribute-idx">
Variante 1
</a></h3>
<div class="description">
Devuelve el valor de un atributo del objeto actual.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
attribute
</span>
(
<span class="argument">
attribute_name
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
attribute_name
</td>
<td>
nombre del atributo a devolver
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
attribute( 'name' )
</code>
<code>
valor guardado en el atributo 'nombre' del objeto actual
</code>
</li>
</ul>
</div>
<h3 id="record-and-attributes-attribute"><a href="#record-and-attributes-attribute-idx">
Variante 2
</a></h3>
<div class="description">
Allows the target feature and attribute name to be specified.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
attribute
</span>
(
<span class="argument">
feature
</span>
,
<span class="argument">
attribute_name
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
feature
</td>
<td>
un objeto espacial
</td>
</tr>
<tr>
<td class="argument">
attribute_name
</td>
<td>
nombre del atributo a devolver
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
attribute( @atlas_feature, 'nombre' )
</code>
<code>
valor guardado en el atributo 'nombre' del objeto de atlas actual
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-attributes"><a href="#record-and-attributes-attributes-idx">
función attributes
</a></h3>
<div class="description">
<p>
Returns a map containing all attributes from a feature, with field names as map keys.
</p>
</div>
<h3 id="record-and-attributes-attributes"><a href="#record-and-attributes-attributes-idx">
Variante 1
</a></h3>
<div class="description">
Returns a map of all attributes from the current feature.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
attributes
</span>
()
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
attributes()['name']
</code>
<code>
valor guardado en el atributo 'nombre' del objeto actual
</code>
</li>
</ul>
</div>
<h3 id="record-and-attributes-attributes"><a href="#record-and-attributes-attributes-idx">
Variante 2
</a></h3>
<div class="description">
Allows the target feature to be specified.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
attributes
</span>
(
<span class="argument">
feature
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
feature
</td>
<td>
un objeto espacial
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
attributes( @atlas_feature )['name']
</code>
<code>
valor guardado en el atributo 'nombre' del objeto de atlas actual
</code>
</li>
</ul>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-display_expression"><a href="#record-and-attributes-display_expression-idx">
función display_expression
</a></h3>
<div class="description">
<p>
Returns the display expression for a given feature in a layer. If called with no parameters, it evaluates the current feature. The expression is evaluated by default.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
display_expression
</span>
([
<span class="argument">
feature=current feature
</span>
][,
<span class="argument">
layer=current layer
</span>
][,
<span class="argument">
evaluate=true
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
feature
</td>
<td>
The feature which should be evaluated.
</td>
</tr>
<tr>
<td class="argument">
layer
</td>
<td>
The layer (or its id or name).
</td>
</tr>
<tr>
<td class="argument">
evaluate
</td>
<td>
If the expression must be evaluated. If false, the expression will be returned as a string literal only (which could potentially be later evaluated using the 'eval' function).
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
display_expression()
</code>
<code>
The display expression of the current feature.
</code>
</li>
<li>
<code>
display_expression(get_feature_by_id('streets', 1), 'streets')
</code>
<code>
The display expression of the feature with the ID 1 on the layer 'streets'.
</code>
</li>
<li>
<code>
display_expression('a_layer_id', $currentfeature, 'False')
</code>
<code>
The display expression of the given feature not evaluated.
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-get_feature"><a href="#record-and-attributes-get_feature-idx">
función get_feature
</a></h3>
<div class="description">
<p>
Devuelve el primer objeto de una capa que coincide con un valor de atributo dado.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
get_feature
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
attribute
</span>
,
<span class="argument">
value
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
nombre o ID de capa
</td>
</tr>
<tr>
<td class="argument">
attribute
</td>
<td>
nombre del atributo
</td>
</tr>
<tr>
<td class="argument">
value
</td>
<td>
valor de atributo con el que coincidir
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
get_feature('calles','nombre','calle principal')
</code>
<code>
primer objeto encontrado en la capa "calles" con el valor "calle principal" en el campo "nombre"
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-get_feature_by_id"><a href="#record-and-attributes-get_feature_by_id-idx">
función get_feature_by_id
</a></h3>
<div class="description">
<p>
Devuelve el objeto de una capa con una ID.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
get_feature_by_id
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
feature_id
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
capa, nombre de capa o ID de capa
</td>
</tr>
<tr>
<td class="argument">
feature_id
</td>
<td>
la ID del objeto que se debe devolver
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
get_feature('calles', 1)
</code>
<code>
el objeto con ID 1 de la capa "calles"
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-is_selected"><a href="#record-and-attributes-is_selected-idx">
función is_selected
</a></h3>
<div class="description">
<p>
Returns True if a feature is selected. Can be used with zero, one or two arguments, see below for details.
</p>
</div>
<h3 id="record-and-attributes-is_selected"><a href="#record-and-attributes-is_selected-idx">
No parameters
</a></h3>
<div class="description">
If called with no parameters, the function will return true if the current feature in the current layer is selected.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_selected
</span>
()
</code>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
está_seleccionado()
</code>
<code>
True if the current feature in the current layer is selected.
</code>
</li>
</ul>
</div>
<h3 id="record-and-attributes-is_selected"><a href="#record-and-attributes-is_selected-idx">
One 'feature' parameter
</a></h3>
<div class="description">
If called with a 'feature' parameter only, the function returns true if the specified feature from the current layer is selected.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_selected
</span>
(
<span class="argument">
feature
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
feature
</td>
<td>
El objeto que se debería comprobar si está o no seleccionado.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
is_selected(@atlas_feature)
</code>
<code>
True if the current atlas feature is selected.
</code>
</li>
</ul>
</div>
<h3 id="record-and-attributes-is_selected"><a href="#record-and-attributes-is_selected-idx">
Two parameters
</a></h3>
<div class="description">
If the function is called with both a layer and a feature, it will return true if the specified feature from the specified layer is selected.
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
is_selected
</span>
(
<span class="argument">
layer
</span>
,
<span class="argument">
feature
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
The layer (or its ID or name) on which the selection will be checked.
</td>
</tr>
<tr>
<td class="argument">
feature
</td>
<td>
El objeto que se debería comprobar si está o no seleccionado.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
is_selected( 'streets', get_feature('streets', 'name', "street_name"))
</code>
<code>
True if the current building's street is selected (assuming the building layer has a field named 'street_name' and the 'streets' layer has a field called 'name').
</code>
</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-maptip"><a href="#record-and-attributes-maptip-idx">
función maptip
</a></h3>
<div class="description">
<p>
Returns the maptip for a given feature in a layer. If called with no parameters, it evaluates the current feature. The maptip is evaluated by default.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
maptip
</span>
([
<span class="argument">
feature=current feature
</span>
][,
<span class="argument">
layer=current layer
</span>
][,
<span class="argument">
evaluate=true
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
feature
</td>
<td>
The feature which should be evaluated.
</td>
</tr>
<tr>
<td class="argument">
layer
</td>
<td>
The layer (or its id or name).
</td>
</tr>
<tr>
<td class="argument">
evaluate
</td>
<td>
If the expression must be evaluated. If false, the expression will be returned as a string literal only (which could potentially be later evaluated using the 'eval_template' function).
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
maptip()
</code>
<code>
The maptip of the current feature.
</code>
</li>
<li>
<code>
maptip(get_feature('streets', 1), 'streets')
</code>
<code>
The maptip of the feature with the ID 1 on the layer 'streets'.
</code>
</li>
<li>
<code>
maptip('a_layer_id', $currentfeature, 'False')
</code>
<code>
The maptip of the given feature not evaluated.
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-num_selected"><a href="#record-and-attributes-num_selected-idx">
función num_selected
</a></h3>
<div class="description">
<p>
Devuelve el número de objetos seleccionados de una capa dada. Por omisión se aplica a la capa en la que se evalúa la expresión.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
num_selected
</span>
([
<span class="argument">
layer=current layer
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
layer
</td>
<td>
La capa (o su ID o nombre) sobre la que se comprobará la selección.
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
num_selected()
</code>
<code>
El número de objetos seleccionados de la capa actual.
</code>
</li>
<li>
<code>
num_selected('calles')
</code>
<code>
El ńumero de objetos seleccionados de la capa calles
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-represent_value"><a href="#record-and-attributes-represent_value-idx">
función represent_value
</a></h3>
<div class="description">
<p>
Returns the configured representation value for a field value. It depends on the configured widget type. Often, this is useful for 'Value Map' widgets.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
represent_value
</span>
(
<span class="argument">
value
</span>
,
<span class="argument">
fieldName
</span>
)
</code>
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
value
</td>
<td>
El valor que se debe resolver. Probablemente un campo.
</td>
</tr>
<tr>
<td class="argument">
fieldName
</td>
<td>
El nombre de campo para el que se debe cargar la configuración del control. (Opcional).
</td>
</tr>
</table>
</div>
<h4>
Ejemplos
</h4>
<div class="examples">
<ul>
<li>
<code>
represent_value("field_with_value_map")
</code>
<code>
Descripción para valor
</code>
</li>
<li>
<code>
represent_value('static value', 'field_name')
</code>
<code>
Descripción para valor estático
</code>
</li>
</ul>
</div>
</div>
</body>
</html></div>
<div class="function"><html>
<body>
<h3 id="record-and-attributes-sqlite_fetch_and_increment"><a href="#record-and-attributes-sqlite_fetch_and_increment-idx">
función sqlite_fetch_and_increment
</a></h3>
<div class="description">
<p>
Manage autoincrementing values in sqlite databases.
</p>
<p>
SQlite default values can only be applied on insert and not prefetched.
</p>
<p>
This makes it impossible to acquire an incremented primary key via AUTO_INCREMENT before creating the row in the database. Sidenote: with postgres, this works via the option
<i>
evaluate default values
</i>
.
</p>
<p>
When adding new features with relations, it is really nice to be able to already add children for a parent, while the parents form is still open and hence the parent feature uncommitted.
</p>
<p>
To get around this limitation, this function can be used to manage sequence values in a separate table on sqlite based formats like gpkg.
</p>
<p>
The sequence table will be filtered for a sequence id (filter_attribute and filter_value) and the current value of the id_field will be incremented by 1 and the incremented value returned.
</p>
<p>
If additional columns require values to be specified, the default_value map can be used for this purpose.
</p>
<p>
<b>
Note
</b>
<br/>
This function modifies the target sqlite table. It is intended for usage with default value configurations for attributes.
</p>
<p>
When the database parameter is a layer and the layer is in transaction mode, the value will only be retrieved once during the lifetime of a transaction and cached and incremented. This makes it unsafe to work on the same database from several processes in parallel.
</p>
</div>
<h4>
Sintaxis
</h4>
<div class="syntax">
<code>
<span class="functionname">
sqlite_fetch_and_increment
</span>
(
<span class="argument">
database
</span>
,
<span class="argument">
table
</span>
,
<span class="argument">
id_field
</span>
,
<span class="argument">
filter_attribute
</span>
,
<span class="argument">
filter_value
</span>
[,
<span class="argument">
default_values
</span>
])
</code>
<br/>
<br/>
[ ] marque componentes opcionales
<h4>
Argumentos
</h4>
<div class="arguments">
<table>
<tr>
<td class="argument">
database
</td>
<td>
Path to the sqlite file or geopackage layer
</td>
</tr>
<tr>
<td class="argument">
table
</td>
<td>
Name of the table that manages the sequences
</td>
</tr>
<tr>
<td class="argument">
id_field
</td>
<td>
Name of the field that contains the current value
</td>
</tr>
<tr>
<td class="argument">
filter_attribute
</td>
<td>
Name the field that contains a unique identifier for this sequence. Must have a UNIQUE index.
</td>
</tr>
<tr>
<td class="argument">
filter_value
</td>
<td>
Name of the sequence to use.
</td>
</tr>
<tr>
<td class="argument">
default_values
</td>
<td>
Map with default values for additional columns on the table. The values need to be fully quoted. Functions are allowed.
</td>
</tr>
</table>
</div>
<h4>
Ejem
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment