# Calculating width of unusually shaped polygon in QGIS

I have a large unusually shaped polygon of surface water within 15km radius of a site. I would like to calculate the widths of all the polygons. I would be open to calculating it at regular intervals, I'm just not sure how to do this.

It is a multipart polygon, so it's not all one big thing. I do have a center line layer, if that helps.

I have tried:

• Oriented minimum bounding boxes (but this wasn't appropriate as the squares were way to big for each section).
• Add geometry attributes (provides only area and perimeter)

The following images are zoomed in versions of the above map:

This is obviously only a quick sketch of how it may work for a lake shape. Ignore the lines going parallel to the lake side. It is the widths going across that I'd be interested in.

Similarly with the river width. I'm interested in the channel widths.

• I suppose you could manually create the sections as a line layer with unique IDs, then use intersect in order to clip them by the river width and add any relevant attributes from the rivers to the lines and then run \$length on the intersected lines. I'd be amazed if automatical creation of the sections were possible and would meet your demands.
– Erik
Mar 7, 2022 at 12:42

## 1 Answer

1. Find the centerline using v.voronoi.skeleton
2. Create points along the centerline (Points along geometry)
3. Create perpendicular lines to the points with Geometry by expression: extend( make_line( \$geometry, project ( \$geometry, 500, radians("angle"-90)) ), 500, 0 ) Adjust 500 which is the line length, 500 is about the max width of my river
4. Clip these with the input polygon layer
5. Add geometry attributes to calculate line length

• For some of the more complex river sections/polygons, the perpendicular lines crossed over within the same polygons. To select only the true widths. I converted the shapefile to single parts. I then put a very small buffer (0.05m) on each of the points along the center line and then used the intersect function on 'Select by Location'. I then saved the selected widths as a separate shapefile. Mar 9, 2022 at 11:49