# Buffer 200 degrees (without north, northeast and -west) for polygons in QGIS

For shading analysis I buffer my objects (buildings, trees, etc. They are polygons) with a 40 m buffer.

Since in the northern hemispehre the sun is never shinning from the north I thought about a buffer without the southern part i.e. maybe just 200° (east, south and west)

rather something like that:

There is no shade in southern area of the polygon because the sun is never shining from the north.

How to do this?

• Shadows tend to fall in the direction opposite of the sun. So... maybe flip your shadows around.
– Erik
Sep 4, 2022 at 13:50
• yeah, you are right of course! Sep 4, 2022 at 14:02
• There are specialized tools for such tasks . Did you habe a Look what Grass offers? Sep 4, 2022 at 14:17
• not yet. no experience with GIS outside of QGIS. But I will look it up Sep 4, 2022 at 14:26
• Grass tools are available inside QGIS Sep 4, 2022 at 14:47

With QGIS expressions, you can achieve that (change buffer distance `100` and `300` and degrees `0` and `200` to fit your use case):

``````intersection (
buffer (\$geometry, 100),
wedge_buffer(
centroid (\$geometry),
0,
200,
300
)
)
``````

A regular buffer (light blue) around the buildings (yellow) is intersected with a wedge buffer (light red) to produce the result you're looking for: dark blue buffer polygons:

A better approach then a 200 degrees buffer would be:

1. Create a horizontal line in the south
2. Determine the surface of the buildings oriented towards this line (towards south), creating a polygon from the south line to the westmost and the easternmost points of the building
3. Create the intersection of this polygon with a buffer around your buildings.

Black line = south line (step 1); blue: polygon (step 2), red: intersection = the solution (step 3):

You can achieve that using QGIS expressions:

``````with_variable (
'south',
geometry (get_feature_by_id ('south', 1)),
difference (
intersection (
buffer (\$geometry, 30),
make_polygon (
make_line (
closest_point (
\$geometry,
extend (
make_line (
closest_point(
@south,
make_point (
x_max (bounds (\$geometry)),
y_min( bounds( \$geometry))
)
),
make_point (
x_max (bounds( \$geometry)),
y_min (bounds( \$geometry))
)
),
0,
1000
)
),
closest_point(
\$geometry,
extend (
make_line (
closest_point(
@south,
make_point (
x_min (bounds( \$geometry)),
y_min (bounds( \$geometry))
)
),
make_point (
x_min (bounds( \$geometry)),
y_min (bounds( \$geometry))
)
),
0,
1000
)
),
start_point (@south),
end_point(@south)
)
)
)
,
\$geometry
))
``````