How to read pixel values in RasterLayer that intersects line features of VectorLayer, applying Python in QGIS?
in ArcMap application environment, there are multiple approaches to achieve desired objective, For example; you may extract underlying pixel values using 'Extract by Mask' tool available within ArcMap. The outcome of the tool will be another layer (raster) having pixels (with values) from intersection of input line feature.
Secondly, you may also convert your line feature into points (at specified interval) and then extract underlying raster values to these points. For the purpose, you have to create a point feature layer/Shapefile to carry extracted values in its table. Thereafter, start editing your line feature, select your line with select tool and then select 'Construct Points' available in Editor toolbar. You may change input parameters as per your requirement.
Hereafter, you can use 'Extract Values to Points' to get underlying raster pixel values in earlier created point feature class' table.
In case of DEM, an elegant way to extract raster values underlying line feature is to use 'Stack Profile' tool (3D Analyst)
I hope this works for you.