1

I Have two layers, one is a polygon and the other is a polyline. I would like the solution to be using QGIS.

enter image description here

I want to create a new attribute in the polygon layer that take the average of the attribute (e.g., slope) from all of the polyline segments that cross the border &/or lie within the polygon segment.

For example, in the red selected polygon, there may be 10 different polyline segments that either cross it's border or lie completely within the polygon. I want to create a new attribute, slope, in the polygon that is the average of all of the slope attribute values for all of the polyline segments.

1 Answer 1

1

You can use Join attributes by location (summary) to join the polygon layer with the line layer and take the average of the slope values stored in the line attribute table into each polygon in the polygon layer.

Here is an example:

enter image description here

Here is the output:

enter image description here

As you can see above, the selected polygon appended the average slope of the two lines that intersected that polygon.

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.