1

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.

http://i4.tietuku.com/43e65f8e7c48c508.png

I'm using QGIS 2.8.3

Update

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

http://i11.tietuku.com/f2240d86f01a885b.png

The figure above seems to be right.

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

http://i11.tietuku.com/02ec8227504ea5a7.png

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

3

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! ヽ(✿゚▽゚)ノ – Han Zhengzu Feb 27 '16 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. – SpatialSuccess Feb 28 '16 at 4:17
2

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, privacy policy and cookie policy

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