This document "Skeletonizing Polygons
Using PostGIS" describes a process which utilises tools from PostGIS and GRASS, both of which might be callable. It mentions using PostGIS to create a skeleton of the vectors and cleaning it up using either PostGIS again or GRASS.
There are existing tools from the Processing Toolbox which hopefully simplifies things ...
I've added a script and some explanation about it.
You need polygon boundary for testing if voronoi line intersects boundary.
You need densified geometry. Because if polygon boundary has a long segment, skeleton will not be as desired (see the image). Densified geometry is just for generating voronoi lines. I used 10 meter. Depending on your data, you may ...
One, somewhat round-about option might be to use SAGA's grid skeletonization module (http://www.saga-gis.org/saga_module_doc/2.1.3/imagery_segmentation_1.html), either through QGIS or using the command line saga_cmd utility. You'd have to convert your polygon to a SAGA raster first.
Otherwise, as stated by @Alpha-beta-soup, you could use v.skeleton from ...
You can use pySkeleton as follows:
from pySkeleton import polygon
vertices = [(0,0), (0,5), (5,5), (5,0)]
edges = [(0,1), (1,2), (2,3), (3,0)]
p = polygon.Polygon(vertices, edges)
skeleton_graph = p.straight_skeleton()
You get a Graph-Object with Nodes and Arcs, which you can access simply by:
nodes = skeleton_graph.nodes
arcs = skeleton_graph.arcs
You should draw the Medial Axis Transform (skeleton or center-line) of the polygon. Options to do this:
use CGAL with arcobjects
Then utilize the centerlines calculate network based distanced between any two points and find the farthest ones.
The simplest, albeit not the most efficient way is to ...
Take the result of the Skeletonize method and remove the short line segments.
Since the output is a single feature, first split the segments into separate features. The tool Multipart to single parts should achieve this. If not, you may need to resort to Explode lines, which will split the line apart at the vertices.
Select the short lines with the Select ...
The GRASS module v.clean has a tool "rmdangle" to remove short lines that go nowhere. Might help in the first part of your question.
This module works on the vectorized layer; you pass it a threshold value to set what the maximum size of a dangle should be.
A russian mapper has made a tool for road network generalization, but it has three drawbacks:
It's in Visual Basic.
It reads and produces .mp files made with osm2mp.
Documentation is in Russian.
Sadly, @Mapper is right: there is no such general-purpose solution not only for OpenStreetMap data, but in general, for any open geodata format.