Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a slope layer and I want to calculate the average slope along a line. This line isn't necessarily straight (e.g its a route, I would like to be able to input geographic coordinates along that line and have a script that outputs the average slope). Is this possible?

share|improve this question
up vote 2 down vote accepted

A simple approach that you could automate in ArcMap using Python would be to break your line into points at a chosen interval or even just at the vertices. Then extract values to points from the raster to get the longitudinal profile (make sure to select the interpolation option). Then simply calculate the average value of those points.

As @whuber mentioned there is an accuracy trade-off with simplicity, but if you're looking for a simple solution that you could script quickly the above should help.

share|improve this answer
(+1) Using an interval of the same magnitude as the cellsize (or slightly smaller) works. Using just the vertices does not work in general, because long spans between vertices will smooth out the variations and always underestimate mean slopes, sometimes by quite a lot. It is important to interpolate with 'extract values to points'; do not accept the default of using the nearest cell centers (that, too, would tend to mis-estimate slopes). Note that different averages will be obtained depending on how slopes are measured (angles or percent)! – whuber Oct 13 '11 at 18:25
Good catch - as @whuber said, vertices will very likely skew the data. An interval approach would be best and always interpolate. I've update my answer the address this. – Radar Oct 13 '11 at 18:37

If the slope layer only gives the slope value, it is not possible. To calculate the average slope value along the line you also need the slope planar orientation. The whole slope vector is necessary. Keep in mind slope computation usually depends a lot on the input DEM resolution.

share|improve this answer
its a slope layer calculated from a DEM. – Nevu Oct 12 '11 at 14:28
@Kixx In that case there are several ways you can do it, either directly by taking a profile from the DEM or indirectly by computing an aspect grid (the "slope planar orientation"). The question really comes down to how you want to do the calculation: it won't be straightforward and the appropriate solution depends on your skills and accuracy requirements. – whuber Oct 12 '11 at 17:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.