I'm trying to get a centreline representation for some polygon output from OSM but having tried the approach in this post (Skeletonize vectors in QGIS/Python) I'm getting very odd results. Here's the polygon, the output from and the 'centreline' given by v.voronoi.skeleton with the smoothness set to 0.01.
You can see this has resulted in a lot of points. If I don't set the smoothness that low I end up with lots of jagged sections that aren't oriented in the direction of the line.
What is the recommended approach to get to a final output that is like the following with right angles and points merged into longer line sections?
I'm trying to do this programmatically for x number of polygons.
EDIT: I've found using 'Simplify' and tweaking some of the settings can give close to the desired result, although orientation of the final line can be off.