<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi John,</div>
<div>incuding</div>
<div> </div>
<div><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">st_point( avg(_gfsGEO_RECHTSWERT), avg(_gfsGEO_HOCHWERT) )</span></div>
<div> </div>
<div><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">works and I get the geometries.</span></div>
<div><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">Using the alias (x, y) does not work.</span></div>
<div> </div>
<div><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">Thanks for you help!</span></div>
<div>Roland</div>
<div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Montag, 30. September 2024 um 15:32 Uhr<br/>
<b>Von:</b> "John Stevenson - BGS" <jostev@bgs.ac.uk><br/>
<b>An:</b> "Roland Spielhofer" <rspiel@gmx.net>, "QGIS User" <qgis-user@lists.osgeo.org><br/>
<b>Betreff:</b> RE: [Qgis-user] Create Geometry for virtual layer</div>
<div name="quoted-content"><!--p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin: 0.0cm;
font-size: 12.0pt;
font-family: Aptos , sans-serif;
}
span.EmailStyle18 {
font-family: Arial , sans-serif;
color: windowtext;
}
*.MsoChpDefault {
font-size: 10.0pt;
}
div.WordSection1 {
page: WordSection1;
}
-->
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size: 11.0pt;font-family: Arial , sans-serif;">Try:</span><br/>
<br/>
<span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">select </span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> avg(_gfsGEO_RECHTSWERT) as x,</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> avg(_gfsGEO_HOCHWERT) as y,</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> Filename,</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> _gfsfid,</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> _gfsKURZNAME,</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> avg(T_C)</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> st_point(x, y) as geom</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">from Temp_near_GFS</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">group by Filename, _gfsfid</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> </span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">If that doesn’t work, you may need to replace x, y in the st_point call with the full calculations e.g.</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> </span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">st_point( avg(_gfsGEO_RECHTSWERT), avg(_gfsGEO_HOCHWERT) )</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> </span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">Cheers</span></p>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">John</span></p>
<p class="MsoNormal"><span style="font-size: 11.0pt;font-family: Arial , sans-serif;"> </span></p>
<div>
<div style="border: none;border-top: solid rgb(225,225,225) 1.0pt;padding: 3.0pt 0.0cm 0.0cm 0.0cm;">
<p class="MsoNormal"><b><span style="font-size: 11.0pt;font-family: Calibri , sans-serif;">From:</span></b><span style="font-size: 11.0pt;font-family: Calibri , sans-serif;"> QGIS-User <qgis-user-bounces@lists.osgeo.org> <b>On Behalf Of </b>Roland Spielhofer via QGIS-User<br/>
<b>Sent:</b> 30 September 2024 13:45<br/>
<b>To:</b> QGIS User <qgis-user@lists.osgeo.org><br/>
<b>Subject:</b> [Qgis-user] Create Geometry for virtual layer</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">Hi,</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">I have a query like this</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">SELECT avg(_gfsGEO_RECHTSWERT) as x, avg(_gfsGEO_HOCHWERT) as y, Filename, _gfsfid, _gfsKURZNAME, avg(T_C) FROM Temp_near_GFS group by Filename, _gfsfid</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">to average some values accoring to their attributes.</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">I get a new virtual layer and the attribute table content looks fine, x and y are populated as well with reasonable values.</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">What I am struggling is to create the actual points / geometries to make the locations visible.</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">How do I modify the statement so that I can specify a "geometry column" as expected by the Creat/Modify Virtual layer GUI in the bottom of the form?</span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;"> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size: 9.0pt;font-family: Verdana , sans-serif;">TIA Roland</span></p>
</div>
</div>
</div>
<br/>
<br/>
This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses.<br/>
</div>
</div>
</div>
</div>
</div></div></body></html>