Calculate mean aspect for polygons

Discussion created by johannessbg on Mar 20, 2012
Latest reply on Jan 3, 2018 by rdebruyn_EAI

I have a dem and a polygon featureclass for which i want to calculate the mean aspect for every single polygon.

I found a topic about this problem in the old esri forum , but unfortunaly i do not get a correct result.

1) Generate the ASPECT for the dem
2) Calculate COS and SIN for the Aspect-raster (COS = ([ASPECT] * 0.01745329)) (SIN([ASPECT] * 0.01745329))
3) Zonal Statistics to SUM the SIN and COS raster for every Polygon.
4) RASTER = 360 + ATAN2([SUM_COS], [SUM_SIN]) * 180 / pi
5) RESULT = MOD([RASTER], 360)

The result i get from the calculations seems to be correct for a few areas, but in others it is shifted of 90 or 180 degrees.

I don't know what i am doing wrong.

Thank you.