<meta http-equiv="content-type" content="text/html; charset=utf-8"><div></div><div>Try this.</div><div><br></div><div><a href="http://www.qgistutorials.com/fr/docs/points_in_polygon.html" target="_top" rel="nofollow" link="external">http://www.qgistutorials.com/fr/docs/points_in_polygon.html</a></div><div><br></div><div>Nicolas</div><div><br>Le 19 oct. 2016 à 06:37, DelazJ [via <a href="http://OSGeo.org" target="_top" rel="nofollow" link="external">OSGeo.org</a>] <<a href="/user/SendEmail.jtp?type=node&node=5291443&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> a écrit :<br><br></div><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' type="cite"><div>

        <div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>I have a polygon layer and a point one.<br></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?<br></div><br></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.<br></div><div>But I expected something more direct.<br></div><div><br>Any hint, please?<br><br></div>Thanks,<br></div>Harrissou<br></div>
<br>_______________________________________________
<br>Qgis-user mailing list
<br><a href="/user/SendEmail.jtp?type=node&node=5291420&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>
<br>List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_top" rel="nofollow" link="external">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_top" rel="nofollow" link="external">http://lists.osgeo.org/mailman/listinfo/qgis-user</a>

        
        
        
        <br>
        <br>
        <hr noshade="noshade" size="1" color="#cccccc">
        <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" target="_top" rel="nofollow" link="external">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 href="/user/SendEmail.jtp?type=node&node=5291443&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a> <br>
                To unsubscribe from Quantum GIS - User, <a href="" target="_top" rel="nofollow" link="external">click here</a>.<br>
                <a 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" rel="nofollow" style="font:9px serif" target="_top" link="external">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/>