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.