Q:

Conversion of raster features to polylines: skeletonization?

I would like to identify linear features, such as roads and rivers, on raster maps and convert them to a linear vector features (i.e. polylines).  I typically use R as my primary GIS, and have posed this question as it pertains to R, here, at StackOverflow without resolution.  Apologies for cross-posting, however, here I am seeking any means to do this efficiently, (preferably, but not necessarily, in a manner that can be automated using code.)
Converting linear features of a certain class on a raster to polygons can be done using rasterToPolygons() in the R package raster, for example.  But how can I turn these polygons into polylines objects (i.e. skeletonize these polygons to a centre line) efficiently and reproducibly without resorting to to manual steps in vector graphics software, for example.

A:

Mr. Huber described the steps to convert polygons to centerlines (Oct 17, 2002). I also found a centerline AML with the exact same steps. It looks pretty easy except you need to create Thiessen or Voronoi polygons as one of the steps. 
SAGA/RSAGA creates Voronoi with a Nearest Neighbor module but only in a Grid format, so you might need to vectorize the grid if you go this route.
I recommend using Geoscript (geoscript.geom.geom.voronoi), it will create Voronoi as vectors.
You should be able to script the whole thing.
centerline steps

