I have used the Lines to polygons tool to turn a city boundary linestring feature into a polygon. However, the tool has connected some nodes more than one time, resulting in multiple edges city boundary with multiple edges.

I would like to remove some edges but not the nodes, therefore I cannot use the Node tool. Is there any way to do this (or to keep the tool from connecting node more than one time)?


  • Is is possible to get the city boundary linestring as WKT? – user30184 May 25 '14 at 16:04

I suspect the original problem is with the quality of your boundary linestring. I see gaps in the polygon version (particularly the right corners), which suggests the linestring wasn't actually closed. The result looks like a common digitizing error where a polygon boundary crosses itself and so some areas are incorrectly interpreted as interior when they should be exterior.

Note this may occur (probably does) at new nodes, not necessarily input/existing nodes - it's not that it connected a node more than once, rather it followed the line to the end and then drew a straight line from the last connected node back to the begining node (or some variation on this depending on how the tool is written). That line may cross the boundary line in several places, and every place it does creates a new node. The resulting enclosed areas become polygons, but as mentioned above what is intended to be interior and exterior gets lost.

The first suggestion would be to go back to your original line boundary and clean it up - make sure all nodes connect and that it is in fact a closed line. Then rerun your Lines to Polygons tool.

If for whatever reason that isn't an option, there are several ways you could tackle the problem. Two would be:

  • Digitize a whole new shape, using a trace tool to follow the 'real' boundaries and ignore the 'shortcuts'.
  • Use Polygon to Line and Multipart to Singlepart down as far as you can break things. Then you can either use a split line at vertex method or go in and manually split the 'shortcuts' in the middle and start removing extras with the Node tool. Finally fill in the gaps of what is remaining so you have a continuous closed line and run Line to Polygon again.
| improve this answer | |
  • Yes, I see that the original linestring is flawed. I can break down the polygon that Lines to Polygons creates and then break that down into lines using Polygon to Line. However, when I then use Multipart to Singlepart on the lines, the individual segments of the lines do not break down further. I need to be able to select one of those segments by itself. Is it possible? – Jim May 25 '14 at 20:56
  • @Jim Sorry about that, I'm not as familiar with QGIS as ArcGIS yet and the workflows/specific tools are a little different. Or AutoCAD where that Explode tool would solve this in a single click. :) I've edited my answer with a link to another step/tool that should do what you need. In ArcGIS there is also a window that shows a numbered list of the nodes so you can select individuals even if they are stacked - not sure if QGIS has that or not. – Chris W May 26 '14 at 18:36

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.