5

I would like to turn my line into polygon in the symbology.

I found some hint here: https://anitagraser.com/2017/04/08/a-guide-to-geometry-generator-symbol-layers/ but I am not sure of the expression, which should be included.

I tried something like this, but the fill is not visible at all. I've got a line only.

enter image description here

How can I make fill for these enclosed lines?

1
  • 1
    Please provide the expression you use to create the polygon. If you don't have one, then there's your error.
    – Erik
    Aug 25 '20 at 13:54
6

Let's assume there is a polyline layer "line", see image below.

input

Proceed with RMT > Symbology > Single Symbol > Line > Geometry Generator

Use the following code make_polygon($geometry) in the "Geometry Generator"-field and change the Geometry Type into 'Polygon/MultiPolygon'.

result1

Additionally try convex_hull($geometry) that will produce a Convex hull.

result2

Note: Mind the forms/shape/guise of your lines.

P.S.: I can suggest inspecting the geometry menu in the 'Expression Dialog', see image below

geoemtry_tab

4
  • Perfect! It was exactly what I was looking for!
    – MKR
    Aug 25 '20 at 14:24
  • Which one did you use convex_hull() or make_polygon()?
    – Taras
    Aug 25 '20 at 15:00
  • I used convex_hull()
    – MKR
    Aug 25 '20 at 16:04
  • make_polygon is also fine, I've checked it
    – MKR
    Aug 25 '20 at 16:25

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.