5

I have two shapefiles: One is a line feature of the rivers and waterways of London, the other is a polygon feature of the reservoirs, lakes and ponds of the same area.

Is it possible please to merge these two different shapefiles into one using QGIS?

  • 6
    Shapefiles can only hold one geometry type: point, polygon, line. Either convert the river lines to polygons (buffer perhaps) or the lakes/reservoirs to bounding lines and then you can merge. – Michael Stimson Feb 22 '15 at 22:54
  • @MichaelMiles-Stimson Probably should make that an answer. I'm sure this question is a duplicate of one somewhere, but ten minutes of searching hasn't found me one. – Chris W Feb 23 '15 at 23:21
  • @ChrisW, I thought I'd seen it before too but also couldn't find it. I've put in an answer with some references to substantiate it. – Michael Stimson Feb 23 '15 at 23:36
  • Thank you very much for your response. Converting the river lines to polygons has enabled me to merge the two layers. – Gavin Feb 28 '15 at 21:50
8

According to the shapefile specification (page 4):

All the non-Null shapes in a shapefile are required to be of the same shape type. The values for shape type are as follows:

Value Shape Type
0 Null Shape 
1 Point 
3 PolyLine 
5 Polygon 
8 MultiPoint 
11 PointZ 
13 PolyLineZ 
15 PolygonZ 
18 MultiPointZ 
21 PointM 
23 PolyLineM 
25 PolygonM 
28 MultiPointM

This means that either all the shapes in the shapefile are polygon (5,15 or 25) or polyline (3, 13 or 23), in order to merge these you can either Convert the polygons in the reservoirs to lines, convert the lines to polygons or buffer the lines to make polygons. When they are the same geometry type then you can merge the shapefiles.

  • Thank you for your response, much appreciated. This has clarified the issues of differing geometry. Many thanks. – Gavin Feb 28 '15 at 21:52

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.