3

I have a problem with a polygon in QGIS. Is a polygon that represents all street areas in a city:

enter image description here

And I want to slip all the area into smaller areas that represent the area of each street in the city, but when I use the split features it doesn't let me split the polygons:

Selecting the split feature

drawing the line to split the poligon

The error message

I've tried selecting the polygon and then trying to split, but also doesn't work:

Selecting the polygon

The error again

I made the experiment with less complex polygons and with no issue, the split works fine. So, someone knows what's happening? By the way: the area is one single polygon, so it has all the areas of all streets in one single polygon.

2
  • See here: gis.stackexchange.com/a/402990/88814 and gis.stackexchange.com/a/455558/88814 Also check if your polygon is valid and does not contain errors. Use Geometry Checker and Topology Checker Plugin. For further help. post your data (polygon, at least a sample) to test.
    – Babel
    May 14, 2023 at 9:55
  • 1
    What is your final task? I have the impression it is a XY problem: meta.stackexchange.com/questions/66377/what-is-the-xy-problem Splitting the layer manually is a huge work an extremely time consuming. I assume there is a better database available with streets already split. So what do you finally want to do with the data and why don't you use OpenStreetMap data for your task?
    – Babel
    May 14, 2023 at 10:03

2 Answers 2

0

I dont know what your final goal is but you can try:

  1. Create a grid with the extent of your layer
  2. Intersect it with your buffered roads

To split the road polygons into smaller parts. Then split. Then you will have to merge them together where the grid split them.

enter image description here

0

There are several reasons why splitting in your case can be problematic, as mentioned in the comments.

So another approach would be not splitting the polygon, but drawing lines in the middle of the parts that represents the sections you want to have as separate polygons. Buffer the lines and create the intersection with the polygon to get separate polygons.

Draw the lines as a separate line layer. Than use Geometry by expression with this expression:

intersection (
    overlay_nearest ('name_of_your_polygon_layer',$geometry)[0],  -- replace with the name of your polygon layer
    buffer ($geometry,1,cap:='flat')  -- adapt the buffer distance of 1 to a value apt for your data
)

Make the adaptations mentioned in the comments; you might use Geometry Generator first to see the result before running Geometry by expression, see here. Also play around with the optional arguments of buffer() function like cap, join and miter_limit, see documentation.

Left: Initial polygon in yellow, lines in different colors (each color represents a separate feature); middle: buffer around the lines; right: intersection of the initial polygon with the buffers: enter image description here

Variant: result without the cap argument: no gaps, but larger overlaps where lines meet. Depending on what you need, you could get rid of the overlaps in a next step, see below enter image description here

Convert the result of the last variant (without cap) to lines with Polygons to lines, then use these lines with Spit with lines on the initial polygon to get clean, separate features for each road. The intersections will be separate, but not overlapping features that you can let like this or merge with neighboring streets:

enter image description here

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.