<div style="font-family: 'verdana'; font-size: 12px; color: #000;"><span style="background-color: #ffffff;">Hi Chris,</span></div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;"><span style="background-color: #ffffff;">thanks for your suggestions!</span></div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;"><span style="background-color: #ffffff;"> </span></div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;">The data is in Shapefiles, I do not have a PostGIS installation at hand...</div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;"> </div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;">What you mention is indeed what I am looking for - some statistical parameters (mean, count, min, max) of the points that fall into a polygon counting only the points that have the same direction attribute as the polygon.</div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;">I will try with virtual layers.</div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;"> </div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;">Regards,</div>
<div style="font-family: 'verdana'; font-size: 12px; color: #000;">Roland</div>
<div id="sub-body-container" style="margin: 10px 5px 5px 10px; padding: 10px 0px 10px 10px; border-left: 2px solid rgb(195, 217, 229);">
<div style="margin: 0px 0px 10px;">
<div><strong>Gesendet: </strong>Mittwoch, 9. Juli 2025 um 15:28</div>
<div><strong>Von: </strong>"chris hermansen" <clhermansen@gmail.com></div>
<div><strong>An: </strong>"Roland Spielhofer" <rspiel@gmx.net></div>
<div><strong>CC: </strong>qgis-user <qgis-user@lists.osgeo.org></div>
<div><strong>Betreff: </strong>Re: [Qgis-user] Join attributes by location (summary) with condition</div>
</div>
<div>Roland and liat<br><br>
<div class="gmail_quote gmail_quote_container">
<div class="gmail_attr">On Wed, Jul 9, 2025, 01:33 Roland Spielhofer via QGIS-User <<a href="mailto:qgis-user@lists.osgeo.org" target="_blank" rel="noopener noreferrer">qgis-user@lists.osgeo.org</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex; border-left: 1.0px rgb(204,204,204) solid; padding-left: 1.0ex;">
<div style="font-family: verdana; font-size: 12.0px; color: #000000;"><span style="background-color: #ffffff;">Hi,</span></div>
<div style="font-family: verdana; font-size: 12.0px; color: #000000;"><span style="background-color: #ffffff;">I am trying to get mean values from points lying inside polygons - that would be easy with "join attributes by location (summary)".</span></div>
<div style="font-family: verdana; font-size: 12.0px; color: #000000;"><span style="background-color: #ffffff;"> </span></div>
<div style="font-family: verdana; font-size: 12.0px; color: #000000;"><span style="background-color: #ffffff;">But: I have overlapping polygons - coming from road segments (motorways with separate lines per direction). The points and the polygons have a common attribute ("+" or "-" per direction) .</span></div>
<div style="font-family: verdana; font-size: 12.0px; color: #000000;"><span style="background-color: #ffffff;"> </span></div>
<div style="font-family: verdana; font-size: 12.0px; color: #000000;"><span style="background-color: #ffffff;">I want to summarize the points of one direction that are lying inside the polygon of the same direction.</span></div>
<div style="font-family: verdana; font-size: 12.0px; color: #000000;"> </div>
<div style="font-family: verdana; font-size: 12.0px; color: #000000;"><span style="background-color: #ffffff;">Is there a way to achieve this?</span></div>
</blockquote>
</div>
<div> </div>
<div>Are you able to use SQL?</div>
<div> </div>
<div>This is a straightforward query in (for example) PostGIS, which offers spatial comparison operations such as "within"</div>
<div> </div>
<div><a href="https://postgis.net/docs/ST_Within.html" target="_blank" rel="noopener noreferrer">https://postgis.net/docs/ST_Within.html</a></div>
<div> </div>
<div>So if you select polygons and join the points using ST_within you can (for example) use GROUP BY and (for example) AVERAGE to get the average value of some attribute for all points within each polygon.</div>
<div> </div>
<div>Is this the kind of thing you are looking for?</div>
<div class="gmail_quote gmail_quote_container"> </div>
</div>
</div>