rasterToLineSegments function

Convert raster to lines