<div dir="ltr">Basically my expression was using an aggregate to capture that intersection count produced by the model and set the feature color based on that. The idea was that if you could find a way to dynamically produce individual features for overlapping areas you may be able to do everything using expressions, but I have no idea how you would go about accomplishing that.<div><br></div><div>After a brief bit of fiddling it seems even using the native "split by lines" or union tools result in topology that isn't very clean, so the aggregate doesn't work very well and that model that was linked to from github produces a much cleaner output.</div><div><br></div><div>The aggregate expression takes the input layer and gets a count of intersecting features. It doesn't really need anything other than the feature geometry. It could be extended to check intersection count with another layer though.</div><div><br></div><div>It may be somewhat useful if you are 100% restricted to not performing any preprocessing, but I think it would actually make a map more confusing in most instances.</div><div><br></div><div>I've linked to a screenshot[1] of my color based expression for reference. The label value in the attached image is expression based:</div><div><br></div><div>aggregate(@layer,aggregate:='count',expression:=1,filter:=intersects($geometry,geometry(@parent)))</div><div><br></div><div>From that you should see that you could feasibly obtain the same "count" value as the model using the field calculator, however it relies on clean input geometries that have already been split up.</div><div><br></div><div>In any event, this is of limited use for your particular use case, but as close as I could get using only dynamically generated parameters. Maybe one day we will have the ability to split or crack features with the geometry generators and this would have more utility.</div><div><br></div><div>[1] <a href="https://imgur.com/a/ZBfInpS">https://imgur.com/a/ZBfInpS</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 20 Jun 2021 at 09:33, Richard Duivenvoorde <<a href="mailto:rdmailings@duif.net">rdmailings@duif.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 6/20/21 1:22 AM, Charles Dixon-Paver wrote:<br>
<br>
> Basically my suggestion would be to use an expression like color_hsv(aggregate(@layer,aggregate:='count',expression:="id",filter:=intersects($geometry,geometry(@parent)))*40,100,100)<br>
<br>
Thanks Charles! Looks very interesting, but I'm not able to use it yet: what does it need as input layer(s)/features?<br>
Does it need a count column? This is only setting the color of overlapping features yes?<br>
<br>
Meanwhile I found<br>
<a href="https://github.com/kgjenkins/qgis-count-polygon-overlap" rel="noreferrer" target="_blank">https://github.com/kgjenkins/qgis-count-polygon-overlap</a><br>
<br>
Which happily counts the overlaps, after using my earlier expression to create the different polygons, so I can easily color them according to that count. See screenshot.<br>
<br>
I'm still very interested in your coloring expression though :-)<br>
<br>
Regards,<br>
<br>
Richard Duivenvoorde<br>
</blockquote></div>