2

I have some polylines. The origin of every line is the same and I would like to obtain the geometric centre of all the lines represented by a new polyline which must be the centroid of the lines.

How can I do that using QGIS ? Is there any name for this kind of geometry operation ? I think that 'centroid' is not the correct name for this operation.

enter image description here

kamome
  • 757
  • 2
  • 12
  • 25

1 Answers1

2

Use the QChainage plugin to create points at equal distances along the lines. Extract the coordinates of all points. Export your data to a csv file and open as a spreadsheet. For each distance value, average the x coords and average the y coords between all lines. The resulting pairs of coordinates should be an average of the lines at each distance along. Save the new averaged coordinates to a new .csv file and import it back into QGIS.

The above assumes your lines are the same or near to the same length. Another approach would be needed if you want to proportionally average lines of various lengths. You might want to divide the lengths of each line by a number, (say 100 for example), first and then run QChainage at a different value for each line so that you could average the x and y coordinates at every percentage of distance between lines, rather than the actual distances.

I'm not aware of any plugin for this yet.

herman
  • 111
  • 1
  • 1
  • 5