I am a little new to QGIS (using v.2.18.0 La Palma) so perhaps someone can help me out. I am trying to find some faulty topology and understand the conversion from polylines to polygons.
I created five shapes with polylines in QGIS to demonstrate the problem and issues. I intended to post images demonstrating the issues I am having. However, this question/message board will only allow me to post two links. So, unfortunately, my description below will not be quite as clear as it would have been had I been able to post the images I can't post. You will have to go to the link at the bottom of the page to see all of the images.
In the images you will find the following shapes:
Upper Left: 1 polyline (closed)
Upper Right: 12 polylines (closed)
Middle: 17 polylines (closed but complex with many vertices)
Lower Left: 1 polyline (open)
Lower Right: 4 polylines (open)
The middle shape is really the one I am trying to convert to a polygon using either the Polygonize or Lines to Polygons tool, neither which seems to work for me. I ran the Topology Checker to look for dangling ends and the results are shown in the image below taken from a screenshot (dangling ends shown with red dots). I expected errors on the lower shapes because I know they have open ends. However, I cannot figure out why the middle shape has dangling end errors. I have snapped the ends of the lines together and when I zoom in, I cannot find any overshoots or undershoots. What else would cause the dangling end errors?
I ran both the Polygonize Tool and the Lines to Polygons Tool on these shapes. For the Polygonize Tool, both the upper closed shapes create polygons, regardless of whether they consist of one polyline or 12 polylines. The lower open shapes do not create polygons, though that doesn't surprise me. The middle shape also does not create a polygon, which I assume has something to do with the "dangling ends" errors that I can't find.
For the Lines To Polygons tool, only the shapes with one polyline are converted, regardless of whether it is closed or open. The shapes with multiple polylines do not convert, though I don't know why the closed shape in the upper right will not convert. I am at a loss to explain the partial results for the middle shape other than I presume it has something to do with the dangling ends I can't find.
The images I couldn't post and a zip file containing the QGIS project file and .shp file that created the above images can be found here: http://brucewiland.com/download/
Can anyone tell me how to find and correct the errors in the middle shape that would allow it to be converted to a polygon?
I would also be interested in how and why the Polygonize and Polylines to Polygon tools give different results i.e.when do you use one over the other?