6

In my QGIS project I have a multi-linestring vector layer where each multi-linestring feature consists of small not connected linestrings.

I would like to show a bounding box around each of the parts of each multi-linestring object like in the following example:

One multilinestring object with styling of each single part object

If I use the following styling

bounds($geometry)

I just get a bounding box around the entire multi-linestring object.

Is it possible to visualise the bounding box of each of the parts of the multi-linestring objects without creating a new single part dataset?

1

1 Answer 1

2

With a small test sample as below:

(1) A multipart line layer.

enter image description here

(2) Created a polygon by geometry generator bounds($geometry). One large box encompasses all lines, as you have pointed out...

enter image description here

(3) So I used bounds(geometry_n($geometry, @geometry_part_num)), to create a box for each line.

enter image description here

Hope these red boxes (dashed) are what you were looking for.

2
  • @Chau Probably out of your scope...... I had spent hours trying to change the color for each box without success...... =(
    – Kazuhito
    Commented Dec 10, 2017 at 9:53
  • 1
    thanks for looking into this! I had long forgot about this but will use get back to it again now :)
    – Chau
    Commented Dec 11, 2017 at 8:47

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.