I want to create points to represent lines from a line layer. This is similar to creating points to represent polygons. Does anyone have an idea on any useful plugin or the best way to do this?
- 36,307
- 5
- 123
- 178
- 1,427
- 3
- 13
- 31
-
1I'm assuming that when you talk about "creating points to represent polygons", you mean calculating the centroids of polygons. There really isn't an analogous formula for lines/polylines ... How would you want to derive a single point from a line? Would you use the midpoint of the line? Could you share a little more detail on what you're trying to do with the points you want to reduce the street to? – J. Taylor Dec 17 '15 at 06:01
-
Hi, i am trying to create points to represent each line in the layer. The line can be created on or along the line. – mapperx Dec 17 '15 at 06:37
-
1See: http://gis.stackexchange.com/questions/63201/how-to-create-points-in-a-specified-distance-along-the-line-in-qgis and http://gis.stackexchange.com/questions/27102/how-to-create-equidistant-points-in-qgis – Zoltan Dec 17 '15 at 06:44
-
Please use the [edit] button beneath your question to revise it with any requested clarifications. In this instance I suspect a diagram will make what you are trying to ask much clearer. – PolyGeo Dec 17 '15 at 06:46
-
What I think you should look for is a tool that converts a line feature to its a point feature at its midpoint, while retaining its attributes. – PolyGeo Dec 17 '15 at 08:12
-
I have used Locate points along lines and QChainage both plugins are similar in function. It creates a point to represent each line and also can add the attributes i want. The only drawback is that i want the points to be placed at the center of the line. – mapperx Dec 22 '15 at 05:43
1 Answers
I have found a suitable solution to the question I asked earlier. To do this I used the Convert Geometry Type function from MMQGIS plugin (the plugin must be installed). MMQGIS → Modify → Convert Geometry Type From the window I chose the layer(line type) and chose New Geometry Type (this has several options) I used Centroid and selected the Output Shapefile. The result is a shapefile of the centre points of all the lines with all the attributes from the original file. (Point to note, if a line is curved, the centre point will not appear close to the line).
Using the QChainage option creates points at the ends of the line, this is not what i wanted. Below is a screenshot comparing the result using MMQGIS the green points and QChainge the red points
- 1,427
- 3
- 13
- 31
