<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Courier;
        panose-1:2 7 3 9 2 2 5 2 4 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"Стандартный HTML Знак";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.darkgray, li.darkgray, div.darkgray
        {mso-style-name:darkgray;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.sender
        {mso-style-name:sender;}
span.date
        {mso-style-name:date;}
span.HTML
        {mso-style-name:"Стандартный HTML Знак";
        mso-style-priority:99;
        mso-style-link:"Стандартный HTML";
        font-family:Consolas;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:2.0cm 42.5pt 2.0cm 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="RU" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:black;mso-fareast-language:EN-US">Good afternoon,
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black;mso-fareast-language:EN-US">how do I unsubscribe from the mailing list?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black;mso-fareast-language:EN-US">Sincerely,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black;mso-fareast-language:EN-US">Khalilov Artur<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:black;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From:</b> Qgis-user <qgis-user-bounces@lists.osgeo.org> <b>
On Behalf Of </b>Andrea Giudiceandrea<br>
<b>Sent:</b> Wednesday, January 19, 2022 3:00 PM<br>
<b>To:</b> qgis-user@lists.osgeo.org<br>
<b>Subject:</b> [Qgis-user] Virtual Layer query with "currentExtent" not working anymore<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="darkgray"><span class="sender"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:#666666"><a href="https://www.mail-archive.com/search?l=qgis-user@lists.osgeo.org&q=from:%22Bernd+Vogelgesang%22"><span style="color:#666666;text-decoration:none">Bernd
 Vogelgesan</span><span style="color:#666666;text-decoration:none">g</span></a></span></span><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif;color:#666666"> <span class="date"><a href="https://www.mail-archive.com/search?l=qgis-user@lists.osgeo.org&q=date:20220119"><span style="color:#666666;text-decoration:none">Wed,
 19 Jan 2022 03:34:05 -0800</span></a></span><o:p></o:p></span></p>
</div>
<div>
<pre style="background:white"><span style="font-size:10.5pt;font-family:Courier;color:black">A while ago, I figured out how to limit a query on a layer by the</span><span style="font-size:10.5pt;font-family:Courier"><o:p></o:p></span></pre>
<pre style="background:white"><span style="font-size:10.5pt;font-family:Courier;color:black">current map extent as a preparation for another query:</span><span style="font-size:10.5pt;font-family:Courier"><o:p></o:p></span></pre>
<pre style="background:white;white-space:pre-wrap;overflow-wrap: break-word"><span style="font-size:10.5pt;font-family:Courier;color:black">SELECT * FROM ASK_Geometrien WHERE</span><span style="font-size:10.5pt;font-family:Courier"><o:p></o:p></span></pre>
<pre style="background:white"><span style="font-size:10.5pt;font-family:Courier;color:black">st_intersects(ASK_Geometrien.geometry, currentExtent());</span><span style="font-size:10.5pt;font-family:Courier"><o:p></o:p></span></pre>
<pre style="background:white"><span style="font-size:10.5pt;font-family:Courier"><o:p> </o:p></span></pre>
<pre style="background:white"><span style="font-size:10.5pt;font-family:Courier;color:black">Now, when I try it again later, the test fails with "no such function:</span><span style="font-size:10.5pt;font-family:Courier"><o:p></o:p></span></pre>
<pre style="background:white"><span style="font-size:10.5pt;font-family:Courier;color:black">currentExtent"</span><span style="font-size:10.5pt;font-family:Courier"><o:p></o:p></span></pre>
</div>
</blockquote>
<p class="MsoNormal"><br>
Hi Bernd,<br>
AFAIK there is no currentExtent() inbuilt function.<br>
<br>
You need to define a custom currentExtent() function that returns the current extent.<br>
<br>
Please see, for example: <a href="https://gis.stackexchange.com/questions/303325/how-to-speed-up-a-query-in-a-virtual-layer-of-qgis">
https://gis.stackexchange.com/questions/303325/how-to-speed-up-a-query-in-a-virtual-layer-of-qgis</a><br>
<br>
Best regards.<br>
<br>
Andrea Giudiceandrea<o:p></o:p></p>
</div>
</body>
</html>