Monday 18 November 2019

arcgis desktop - Extracting raster values to polyline feature


I have a line overlaying a raster containing slope values. I would like to use the line to extract the slope values, and return to its attribute table an attribute containing percentage of slopes below 50 percent, and an attribute containing percentage of slopes above 50 percent along the total length. So far I have been able to extract the pixels coinciding with the line using "Extract by Mask". I am however stuck and not sure what to do with this resulting layer.



Answer




1) reclassify your slope raster as 0 (<=50%) or 1 (>50): Con("slope" > 50, 1,0)


2) convert your line to raster based on line ID


3) use zonal stat as a table : the mean value will be the proportion above 50% (1-mean will be the proportion below 50%, no need for 2 attributes)


Note that this will yield the proportion of maximum slope of the terrain that the line is crossing, not the proportion of the actual slope of the lines.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...