Identify a linear feature on a raster map and return a linear shape object using R

后端 未结 4 653
慢半拍i
慢半拍i 2021-01-31 11:22

I would like to identify linear features, such as roads and rivers, on raster maps and convert them to a linear spatial object (SpatialLines class) using R.

<
4条回答
  •  不要未来只要你来
    2021-01-31 12:11

    You can get the boundary of that polygon as SpatialLines by direct coercion:

    rLines <- as(rPoly, "SpatialLinesDataFrame")
    

    Summarizing the coordinates down to a single "centre line" would be possible, but nothing immediate that I know of. I think that process is generally called "skeletonization":

    http://en.wikipedia.org/wiki/Topological_skeleton

提交回复
热议问题