2

I have a set of irregular and curved polygons which I would like to find the centre line of them. I've found some solutions for this problem such as Voronoi polygons but It doesn't work for me. It generates a zig-zag line with too many vertices. I used another solution creating centre lines joining the middle vertices from the short sides but it works well for straight polygons only but not for curved polygons. Adding points along the centre lines with QGIS

Ideally, I would like a simple central line for each polygon with 2 vertices only. Either using QGIS/Graphical Modeler or Python. My target is adding points to the centre line every 3 metres, as you can see on the image.

enter image description here

  • Why don't you use centroids or pole of inaccessibility to create these lines? – Erik May 7 at 9:13
  • I've tried to use 'centroids' and it generates points outside the polygon in some of them. Also I've tried the tool 'pole of inaccessibility' and it doesn't create mid points for the longest polygons. Thanks for your suggestion. – Senda May 7 at 10:00
  • обратите внимание на эти два решения, я думаю они вам должны помочь, правильно использовать геоинструменты: gis.stackexchange.com/a/295348/120129; gis.stackexchange.com/a/318733/120129 – Cyril May 7 at 10:04
  • @Cyril Thanks for that. I'll take a look at this solution. – Senda May 7 at 10:47
  • @Cyril Could you explain with more detail the step 4 on your first solution, please? I don't get the same result as you show. – Senda May 9 at 15:10
2

Try Thin greyscale image to skeleton plugin:

The Thin Greyscale plugin will thin a greyscale image to a greyscale skeleton image, given a set of levels

  1. Convert polygon to raster with Rasterize
  2. Run Thin greyscale image to skeleton plugin
  3. Convert to polyline using GRASS r.to.vect

enter image description here

  • thanks for your solution. I'll take a look at it. – Senda May 8 at 13:11

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.