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

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Senda
  • 127
  • 10
  • Why don't you use centroids or pole of inaccessibility to create these lines? – Erik May 07 '19 at 09: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 07 '19 at 10:00
  • обратите внимание на эти два решения, я думаю они вам должны помочь, правильно использовать геоинструменты: https://gis.stackexchange.com/a/295348/120129; https://gis.stackexchange.com/a/318733/120129 – Cyril Mikhalchenko May 07 '19 at 10:04
  • @Cyril Thanks for that. I'll take a look at this solution. – Senda May 07 '19 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 09 '19 at 15:10
  • @Cyril Thanks. Now it's more clear. Unfortunately, I don't use PGAdmin. Is it better than using QGIS? – Senda May 10 '19 at 08:16
  • The thing is that someone is more comfortable to use. I’m more comfortable using PostgreSQL / PostGIS PGAdmin GUI for processing geodata, and for visualizing and symbolizing QGIS map objects ... – Cyril Mikhalchenko May 10 '19 at 13:43
  • @Cyril Where can I find the tool 'Association by Basis' that you mention in your second solution? I can't find it in Geoprocessing where you said and I'm using version 3.4.6 LTR. – Senda May 14 '19 at 15:10
  • Merge by grounds ...I hope for the correct translation ... – Cyril Mikhalchenko May 14 '19 at 16:47
  • Yes, I found it but it's Dissolve. Thanks – Senda May 15 '19 at 10:25
  • autotranslation is not always true, so I added a screenshot, the pictures are more understandable for all people on Earth: -) ... – Cyril Mikhalchenko May 15 '19 at 16:49

1 Answers1

3

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

BERA
  • 72,339
  • 13
  • 72
  • 161