<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Well yes - but that is not a "live" point in polygon. It create separate layers which need to be kept up-to-date.</p>
<p>Harrissou was after a "live" point in polygon, which is automatically kept up-to-date through a QGIS expression.</p>
<p>Maybe Nyall knows how to write the correct aggregate expression for that?</p>
<p>Greetings,</p>
<p>Andreas</p>
<p>On 2016-10-19 14:11, Nicolas Cadieux wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div> </div>
<div>Try this.</div>
<div> </div>
<div><a href="http://www.qgistutorials.com/fr/docs/points_in_polygon.html">http://www.qgistutorials.com/fr/docs/points_in_polygon.html</a></div>
<div> </div>
<div>Nicolas</div>
<div><br />Le 19 oct. 2016 à 06:37, DelazJ [via <a href="http://OSGeo.org">OSGeo.org</a>] <<a>[hidden email]</a>> a écrit :<br /><br /></div>
<blockquote style="border-left: 2px solid #CCCCCC; padding: 0 1em;">
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>Hi,<br /><br /></div>
I have a polygon layer and a point one.</div>
I'd like to calculate for each polygon feature, the number of points that it covers. I thought the aggregates functions could help me find an easier and straight expression to perform this (without creating intermediate layers) but I fail to find any correct syntax. <br /><br /></div>
I tried aggregate ('mypoint', 'count', "id", intersects ($geometry, geometry($currentfeature)))<br /><br /> And many variants of the fourth option but It always return the total of points or an error. Actually this option is a filter and I wonder if i'm not missing a "group by" option in the aggregate function (which seems to be the appropriate one in my case). Is it possible?</div>
</div>
<div>The work around I found is to populate an ad'hoc field in the point layer with overlapping polygon id, thanks to the SpatialJoin plugin, then I create a one-to-many relation in the project between the two layers in other to use relation_aggregate function.</div>
<div>But I expected something more direct.</div>
<div><br />Any hint, please?<br /><br /></div>
Thanks,</div>
Harrissou</div>
<br />_______________________________________________ <br />Qgis-user mailing list <br /><a>[hidden email]</a> <br />List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br />Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a> <br /><br /><hr size="1" />
<div style="color: #444; font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
<div style="font-weight: bold;">If you reply to this email, your message will be added to the discussion below:</div>
<a href="http://osgeo-org.1560.x6.nabble.com/Using-aggregates-functions-to-count-intersected-features-from-another-layer-tp5291420.html">http://osgeo-org.1560.x6.nabble.com/Using-aggregates-functions-to-count-intersected-features-from-another-layer-tp5291420.html</a></div>
<div style="color: #666; font: 11px tahoma,geneva,helvetica,arial,sans-serif; margin-top: .4em; line-height: 1.5em;">To start a new topic under Quantum GIS - User, email <a>[hidden email]</a> <br /> To unsubscribe from Quantum GIS - User, <a>click here</a>.<br /><a style="font: 9px serif;" href="http://osgeo-org.1560.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml">NAML</a></div>
</div>
</blockquote>
<br /><hr align="left" width="300" />View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Using-aggregates-functions-to-count-intersected-features-from-another-layer-tp5291420p5291443.html">Re: Using aggregates functions to count intersected features from another layer</a><br /> Sent from the <a href="http://osgeo-org.1560.x6.nabble.com/Quantum-GIS-User-f4125267.html">Quantum GIS - User mailing list archive</a> at Nabble.com.<br /><br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">_______________________________________________<br /> Qgis-user mailing list<br /><a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br /> List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br /> Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></div>
</blockquote>
<p> </p>
<div> </div>
</body></html>