I have a single band raster image with values of pixel 0 and 1. There's another line vector layer over the same area. I need to find the percentage of line which is overlapped by the pixels of value 1. I am thinking of using clipper in qgis or mask function in R but can't exactly figure out the way. Is there any way of doing this in QGIS or R?
I used the polygonise option to convert the raster to vector. Then I used a subtle buffer as discussed here: Fixing geometry validity errors in QGIS?. Then, I used the intersect option to get the required layer.