I am testing different tree crown drawing options in QGIS. At the moment, I have found this option to be the most suitable for me.



Problem is that uneven crowns look very good, but even crowns look like rounded squares. I would like lines to curve a bit. Right now they are straight. I understand how generator draws them, but not enough to make it work like I would like. Info from the code author and how it works. Look for Solution 3. Rounded square tree crowns


Here is a very simple approach: Just add some randomness using rand() in your denominator:


You may want to adjust the randmin (here 1) and randmax (here 3) argument in the first line, used as variables.

Here is an example result (I used 1 degree for west, east, north and south variable, it's in EPSG:4326 around the globe, thats why the northern ones are overly stretched):

enter image description here

I have also tried using an approach with point_on_surface() within a buffer of your convex hull outline as new vertex points of a polygon to make it more irregular. But seems like these point_on_surface() points aren't random. At least within my testings they got placed at the same location every time... Maybe I can get a result with some more testing. Update: got it working when including rand() here as well, but the result isnt really better than with this simple approach above, just takes a lot more computation...


Use smooth(geometry, n), where geometry is the expression you use to create your polygons and n is an arbitrary value: try different setting, what fits best your needs. n is optional, you could also use just smooth(geometry).

See the screenshot: The blue polygon is the smoothed version of the original (black line, here I used $geometry to smooth the current feature):

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.