Here is my question

Two shapefile:
* A: represent the outer boundary of the city area
* B: represent the inner boundaries of the city divisions.

I want to * Combine these two shapefile * Transform it into polygons which represent each divisions.

But I have failed to combine two layer using vector -> Data manager tool -> merge or dissolve with stats(the inner boundaries are consist of 48 line with the same User ID: 0)

Here is my two shapefiles:
A was in black color , B is in green color.


I'm using QGIS 2.8.3


I have already figured it out using MMQGIS.
But I don't know how to transform it into polygons.
If you are interested, please check this question I have asked and offer some valuable advices.

Update 2 2016-02-27

First step: Make two polylines file into Layer C using merge layer in MMQGIS


The figure above seems to be right.

Second step: Using Vector -> Geometry Tools -> Lines to Polygons on Layer C as the accepted answer.


The result shown on the figure doesn't show the correct boundaries.

2 Answers 2


Use the MMQGIS plugin to Combine -> Merge Layers, selecting your two polyline layers A and B as the inputs, and save the output as Layer C. Then use Vector -> Geometry Tools -> Lines to Polygons on Layer C and you will have your inner boundaries as polygons. If this tool gives odd results, use the Polygonize tool instead (see below). enter image description here

  • Sorry to disturb you again. Today, I tried to solve this problem which I had given up in January. I have written it on the Update 2. That'll be very kind to help me again! Thanks a lot! ヽ(✿゚▽゚)ノ Feb 27, 2016 at 15:16
  • I got the same result using Lines to Polygons on your uploaded layers. I tried the Polygonize tool instead (search the Processing Toolbox to find) and the output was correct. I will edit my answer to reflect this. Feb 28, 2016 at 4:17

In QGIS merge the two polyline layers into one polyline shape file. Use the GRASS plug-in to create polygons from borders, unfortunately GRASS plug-in is not available in QGIS 2.8, so upgrade to QGIS 2.12 or use standalone GRASS (I give the GRASS command name in brackets):

  1. Create a new GRASS location
  2. Import the shape file into GRASS(v.in.ogr)
  3. Convert lines to boundaries (v.type)
  4. Add centroids (v.centroids)
  5. Clean the dataset if necessary (v.clean)
  6. Rebuild topology (v.build)
  7. Export GRASS polygons to shape file (v.out.ogr)

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.