3

I want to create tree canopies with uneven canopy extents.

A previous solution is below:

Representing uneven tree canopy spread around point in QGIS

A solution for uneven buffering has been provided for ARCGIS - link provided below. The method could also potentially be used for uneven tree canopies. However, I use QGIS.

The solution for uneven buffers (as in ArcGIS) may generate a more attractive representative tree canopy. Can this method also be undertaken in QGIS?

A representation of the ArcGIS solution enter image description here

Buffering point with different distance toward N, E, S, W using ArcGIS for Desktop?

2
  • 3
    As a point in fact, that "ArcGIS solution" isn't ArcGIS specific at all.
    – Vince
    Commented Mar 21, 2021 at 19:38
  • This answer cover several different solutions of the same problem : gis.stackexchange.com/questions/167308/…
    – J.R
    Commented Aug 13, 2022 at 13:25

1 Answer 1

12

You can use this expression to create such a polygon:

smooth (
    make_polygon( 
        make_line (
            project ($geometry, 10, radians(0)),
            project ($geometry, 15, radians(90)),
            project ($geometry, 5, radians(180)),
            project ($geometry, 20, radians(270))
        )
    ), 
    10
)

Add a symbol layer of the type Geometry generator, set it to Geomtry type Polygon and paste the expression. Change the values of the buffer distance (here: 10, 15, 5, 20) manually. In between you could add additional points if you like with the same syntax: project ($geometry, [distance], radians([degrees])): simply replace [distance] with a value for distance and [degrees] with the azimuth (angle from 0 to 360, measured clockwise starting from north).

This method is for visualization purpose only. If you want to create actual geometries however, use Menu processing / Toolbox / Geometry by expression and paste the same expression.

enter image description here

There is a slightly improved version of this solution to get rid of its major drawback: by smoothing the line, it does not pass any longer through the points defined. See on the next screenshot: the red points are those defined by distance and azimuth (lines 4 to 7 in the expression above). The black line connects them (line 3). The function smooth (first and penultimate line) makes this line smoother, so when creating a polygon out of it (line 2), the resulting geometry (green polygon) looks nice, but is much smaller as you would expect because it does not reach the red points any more:

enter image description here

By adding a factor that multiplies the distance, the created polygon gets larger. First use this expression in the geometry generator to see changes in real time and to adapt the value of the factor (line 3 in the following expression, in my case: 1.35) as long as the resulting polygon fits its size as to pass through (or pass nearby) the dots that define the extent of the canopy:

with_variable (
    'factor',
    1.35,
    smooth (
        make_polygon( 
            make_line (
                project ($geometry, 10*@factor, radians(0)),
                project ($geometry, 15*@factor, radians(90)),
                project ($geometry, 5*@factor, radians(180)),
                project ($geometry, 20*@factor, radians(270))
            )
        ), 
        5
    )
)

The green polygon is the one created in the first solution, the yellow one the one with the second one:

enter image description here

You can now further experiment and create repeated geometries with different distances, using the array_foreach to define an start- and end-distance as well as an interval to draw several different polygons with varying distances. If you than reduce the opacity of the color of the symbol layer, you can simulate nice "blurry" effects (see screenshot below): in the middle, the tree is darker than at its outer boundary:

collect_geometries (
    array_foreach( 
        generate_series(0.5, 1.45, 0.05),
        with_variable (
            'factor',
            @element,
            smooth (
                make_polygon( 
                    make_line (
                        project ($geometry, 10*@factor, radians(0)),
                        project ($geometry, 15*@factor, radians(90)),
                        project ($geometry, 5*@factor, radians(180)),
                        project ($geometry, 20*@factor, radians(270))
                    )
                ), 
                5
            )
        )
    )
)

enter image description here

You can further improve this effect by changing the blending mode of the features (see screenshot: I applied multiply), by reducing the interval between the individual polygons (screenshot: reduced to 0.01) and (further) reducing the opacity of the symbol layer's color:

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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