Find percentage of raster classes inside polygon

Discussion created by adamczi on Aug 19, 2017
Latest reply on Apr 2, 2019 by tschlachter

I have a raster representing glacierized area with 2 classes: distinction between ice and snow. I also have DEM of the area. I would like to calculate an average height of the boundary between those two classes. I came up with an idea I could somehow calculate how many pixels of each class belong to a given height range (like 500-515m a.s.l.). For example (with a picture):


  • 100% of snow in this range isn't what I'm looking for (it's not a boundary)
  • 100% of ice neither
  • 80% of ice and 20% snow is not a boundary (could be a snow patch)
  • 40% of snow and 60% of ice probably is a boundary (values are arbitrary and I'd like to evaluate them)


So I reclassified DEM to 15m intervals and vectorized it. And now I have no clue. The Zonal Statistics tool only allows me to calculate statistics like MIN, MAX, MAJ etc., whereas I need a percentage - a custom equation. Or maybe there is a different way?