extracting values from raster by polyline

23402
4
08-19-2011 12:03 AM
AnnaHenriksson
New Contributor
Hi, I have altitude data in a raster and want to extract the altitude at a specific line. Like the sample tool but with a line instead of points, how do I do that?

Thanks!
0 Kudos
4 Replies
DanPatterson_Retired
MVP Emeritus
Why not convert the line to a grid then use sample, it can take a raster as input  (make sure that you use the same cell size and extent as the input raster)
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Sample/009z0000002v000000/
0 Kudos
TimothyHales
Esri Notable Contributor
A similar process to Dan's would be to convert the polyline to points using the Feature Vertices To Points tool.  There are a variety of options for determining which vertices to convert (ie: All, Mid, Ends).  Then proceed to use the sample tool with the points.
0 Kudos
EricRice
Esri Regular Contributor
Please use Extract by Mask.  If you run Feature Vertices to Points you won't be extracting all the cells underneath the line, unless you densify the line in advance to the resolution of the raster you wish to extract from.  Extract by Mask requires no conversion in advance of the process and will save you time.  The output will be just the pixel values underneath the line. 

What is your desired output?  Points, Raster, Table...

Regards,
Eric
AlperElci
New Contributor

This tool does not seem to work for a polyline. I am using ArcGIS 10.0 and the error message I got was:

ERROR 010092: Invalid output extent.

Failed to execute (ExtractByMask).

Isn't this tool only for mask areas?

0 Kudos