4

I need help with fixing my two dangle-errors: enter image description here

there are 2 dangles on the top right and one small hole on the top-left corner. enter image description here

I can deduct them with the Geometry Checker, but I cannot fix it (automatically).

This is only an example-file. I need the skill for a big file with hundreds of lines that need fixing before polygonizing...

Has someone an idea why v.clean (I ticked line and break, snap, rmdangle with tresholds 0,5,5) or geometry fixer cannot do that?

I already studied useful information like that:

... but still it is not working.

7
  • 0,5,5? Are they thresholds? 0 sounds wrong. Change it to the amount that things can move. Like 1 metre, for example. Lat long data will use smaller numbers.
    – wingnut
    Apr 27, 2021 at 10:42
  • as far as I know it is only a dummy for "break"
    – Carina
    Apr 27, 2021 at 11:01
  • I added a solution. However, Lines to polygons can handle lines that are not closed. Maybe you can explain why you first need to close the lines?
    – Babel
    Apr 27, 2021 at 12:27
  • 1
    Without knowing the coordinate system units and the distances involved it is hard to say if there is a problem. In terms of dangles "The rmdangle tool deletes a dangle if the (combined) length is shorter than thresh or thresh < 0. If the combined length is larger than thresh, nothing is deleted" so your dangles may have exceeded the threshold and would remain. If the corner gap is larger than your snap tolerance then that would be unaffected. I usually set a v.in.ogr snap tolerance too. If you used the polygonize tool to create polys the dangles wouldn't matter but closing the gap would.
    – johns
    Apr 27, 2021 at 13:16
  • 1
    It's hard to see in the scaled down screenshots, but I guess your scale is larger than 1:10000. This would mean that the snap and rmdangle tolerances are not adapted to your circumstances. Instead of 0,5,5 you could try larger values. The Zero is ok, though, since 0 is a dummy value for the break tool, as far as I know.
    – thymaro
    Sep 18, 2021 at 8:34

1 Answer 1

3

You can use QGIS expressions with Geometry Generator or Geometry by expression for this - see here for details about these two options. In both cases, simply use this expression: close_line( $geometry).

Screenshot: Blue=original line; red=line created with the above expression: enter image description here

4
  • Will Geometry Generator permanently fix such problems, so that if in the future the line layer were added to a new QGIS project the gap would be closed? Or is G.G. a temporary "cosmetic" fix for the current project only?
    – Stu Smith
    Apr 27, 2021 at 17:59
  • 1
    Geometry generator is for visualization purpose only and does not create actual gemetries. If you need actual geometries, this can be done with Geometry by Expression- it will create a new layer with permanenrly stored lines. In both cases, use the same expression. See the link in my answer for more details.
    – Babel
    Apr 27, 2021 at 18:44
  • Thank you! That helped for the holes : )
    – Carina
    Apr 29, 2021 at 7:13
  • Great. As a new user please note that this site tries to avoid thank you messages. You have the possibility instead to upvote and/or accept (hit the checkmark) a helpful answer.
    – Babel
    Apr 29, 2021 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.