2

Is there a tool in QGIS similar to "Contruct polygons" in ArcGIS that creates polygons from existing lines? This is different from convert lines to polygons that requires closed loops (minimum of three vertices). Instead, I am interested in creating lot polygons from lot boundaries or creating city blocks based on streets.

4

Make sure that a new line begins and ends at each intersection, creating a topological network in which the lines are independent features that share nodes (their start- or end-points coincide), forming closed circuits.


Assuming that lines of the network are already cleaned (use v.clean if not).

The QGIS tool to do what you want is called Polygonize.

The output is a vector layer with a Polygon feature for each closed circuit.

In a later step they can be combined with the Dissolve tool.

  • Bear in mind, Polygonize requires completely closed loops and even miniscule (like a fraction of a millimeter) gaps will make the tool skip some boundaries. In this answer, I had to extend all the lines in the layer by a small value for the angled rectangles to get polygonized correctly. Otherwise, they don't necessarily need to meet at vertices. – Gabriel C. Jan 18 at 18:59
  • @GabrielC., that issue is part of the "use v.clean if not". In a topological network, two lines with a minuscule gap don't share a node and don't close a circuit. GRASS v.clean tool is specifically designed to clean topological networks, and includes a method to connect lines separated by a distance threshold. – Gabriel De Luca Jan 18 at 19:07
  • Yes, of course, but Polygonize can definitely work without having a topogical network. That was the purpose of my addition. I think I didn't make it clear enough. – Gabriel C. Jan 18 at 19:12
  • @GabrielC., I had not understood your comment. Thanks for the clarification. It may be that the algorithm does not need exclusively that the lines share a node, probably if the lines simply cross is sufficient. But the recommendation to work with clean topological networks is something I can not avoid. – Gabriel De Luca Jan 18 at 19:32
  • I wholeheartedly agree! A topologically sound network makes a happy network (and a sane geomatician). – Gabriel C. Jan 18 at 19:59
0

yes,

go to processing > toolbox.

In the search bar look for 'lines to polygons'

run the algorithm...

  • see edited question with screenshots illustrating why that does not work. As I mentioned in my initial question, I am dealing with situations where lines to polygons does not work. – user3386170 Jan 16 at 16:10
  • 1) First check the geometry for errors; 2) Put the erroneous sections in order; 3) The tool works correctly with the correct geometry ... – Cyril Jan 16 at 18:28
  • 1
    The tool (lines to polygons) works correctly with geometry with connected lines that join up in a particular order. It does not work for a topological network (for which the geometry has no errors). It is just a completely different set of lines. – user3386170 Jan 18 at 18:55

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.