To continue from this question about the format of a .csv file with network data.

I have two layers now: 1) layer with the coordinates (X,Y) of some nodes, and 2) layer that represents the lines connecting this coordinates (the .csv that contains that lines is in WKT with LINESTRING representing the lines). Both layers are displayed well within QGIS.

Now, I want to create a shapefile with these two layers. I tried to select the two layers and Save As> in ESRI Shapefile format. However, the new shapefile only contains the coordinates of the nodes, so I can only visualise the nodes, not the lines.

I don't see any option to do that. What do I need to do (if possible)? Is there any plug-in to do so? Any Python API that I can use?

  • "Now, I want to create a shapefile with these two layers" : do u mean u want to mix the two geometry types (points and lines) in a single layer ? QGIS won't allow that ... – snaileater Jun 1 '17 at 8:24

Check out this post: How to merge attributes of points and lines in QGIS

Essentially, you need to use the buffer tool (Vector--> Geoprocessing Tools --> Buffer) to create polygons for each of your points.

After that, you should be able to join the two layers spatially. If not, you could also try creating a buffer around your lines as well and then merging the two buffered layers.

Let me know if that helps.

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.