# Measuring length of edge of polygon

I have a layer of polygons, cadastrals, that i'd like to have the length of the edge of: 1. Dissolve the polygons
2. Create one large dissolved polygon
3. Making a; From polygon to Line

But from here, i don't know what to do next.

• Cut it up, and measure the length of the line, then join attributes so that the polygons get the data. But how? • which edges do u want to measure ? all the edges of the polygons or just those higlighted in purple on your second picture ? On which logic is based your selection ? – snaileater Mar 13 '19 at 10:32
• None of either. I want the lenght of the edge of the polygon that is underneath the lightlighted line. – MichaelR Mar 13 '19 at 10:40
• I would try to trim the purple line with the source polygon (inventory) of the Crop tool and measure the length of the outer edges, as the CSK in p. 7 suggests ... – Cyril Mar 14 '19 at 11:48

The purple line in your example looks like the road frontage of the real estate parcels. Therefore I refer to it as the "frontage line" throughout this answer.

I assume you've already created the frontage line by these or similar steps:

1. `Dissolve` the parcels
2. Convert parcels to lines using the `Polygons to lines` tool
3. Manually edit the polygon outline(s) down to the desired frontage line. One method here would be to split the at its vertices using the `Explode Lines` tool, then (manually) select and delete unwanted segments.

Now proceed as follows:

1. `Extract vertices` of the frontage line
2. `Buffer` the vertices by a very small amount.

• This amount should be smaller than the margin of error that you want in your final parcel frontage measurement. Eg, if you want frontage measurements accurate to within 1cm, buffer the vertices by 0.1mm.
• Note that the buffer tool uses the same units of measurement as the CRS of the point layer, so if the point layer uses meters, use 0.00001 to create a 0.1mm buffer.
3. Take the `Difference` between the buffer layer and the frontage line. This will clip the frontage line into segments. (There will be more than one frontage segment for some parcels, but that's okay. We'll handle that in step 8.)
4. Use the `Field Calculator` to add a length field to the frontage line segments layer created in step 6. Use this expression to calculate length:

``````\$length
``````
5. Use the `Join attributes by location (summary)` tool to calculate the sum of the length field for the frontage line segments that intersect each parcel. Note: All the `processing tools` used in this answer can be found in the Processing Toolbox panel. I would do the following, from Processing Toolbox:

1. Convert polygon/line vertices to points. Use as input the line you created.
2. Split line at points, using as input the line you created and the points that were output from step 1. Calculate lengths for these output lines
3. Join attributes by location, where your target layer is your initial polygons, join layer is the output from step 2, and geometric predicate = contains
• This method should work, except that there might be a bug in the `split line at points` tool. See this answer for a workaround if it creates lines that extend off the screen. – csk Mar 13 '19 at 17:50