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?

Chau
  • 4,480
  • 4
  • 39
  • 57
  • maybe a custom function based on https://gis.stackexchange.com/questions/44799/how-to-transform-a-selected-multipart-feature-into-singlepart-features-while-edi ? – Ian Turton Oct 06 '16 at 10:22

1 Answers1

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.

Kazuhito
  • 30,746
  • 5
  • 69
  • 149
  • @Chau Probably out of your scope...... I had spent hours trying to change the color for each box without success...... =( – Kazuhito Dec 10 '17 at 09:53
  • 1
    thanks for looking into this! I had long forgot about this but will use get back to it again now :) – Chau Dec 11 '17 at 08:47