<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculate mean aspect for polygons in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/1602962#M12302</link>
    <description>&lt;P&gt;Any thoughts on why the output for Aspect_Azm column is entirely null and the Aspect_Cls column is entirely 000 NO? I got the tool to run successfully. No errors popped up. I was super excited to find this and I'm hoping I can get it to work!&lt;/P&gt;</description>
    <pubDate>Fri, 04 Apr 2025 19:55:20 GMT</pubDate>
    <dc:creator>Hailey215</dc:creator>
    <dc:date>2025-04-04T19:55:20Z</dc:date>
    <item>
      <title>Calculate mean aspect for polygons</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/67951#M935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a dem and a polygon featureclass for which i want to calculate the mean aspect for every single polygon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found a topic about this problem in the old esri &lt;/SPAN&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=995&amp;amp;t=211300"&gt;forum&lt;/A&gt;&lt;SPAN&gt; , but unfortunaly i do not get a correct result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Generate the ASPECT for the dem&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Calculate COS and SIN for the Aspect-raster (COS = ([ASPECT] * 0.01745329)) (SIN([ASPECT] * 0.01745329))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Zonal Statistics to SUM the SIN and COS raster for every Polygon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4) RASTER = 360 + ATAN2([SUM_COS], [SUM_SIN]) * 180 / pi&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5) RESULT = MOD([RASTER], 360)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know what i am doing wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 06:43:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/67951#M935</guid>
      <dc:creator>JohannesRein</dc:creator>
      <dc:date>2012-03-21T06:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate mean aspect for polygons</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/67952#M936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you actually need "mean" aspect? Another option is to generate a trend surface and calculate aspect from that to get the overall aspect of a polygon - eg:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]12944[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To do this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;Clip and mask your DEM to the polygon &lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Convert the masked DEM to &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Raster_to_Point/001200000007000000/"&gt;points&lt;/A&gt;, or...&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000002r000000"&gt;Create Random Points&lt;/A&gt; constrained by your landslide polygon which you can use to &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Extract_Values_to_Points/009z0000002t000000/"&gt;sample&lt;/A&gt; the elevation values.&lt;/LI&gt;&lt;/UL&gt;&lt;SPAN&gt;Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;Generate the &lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Trend/009z0000006v000000/"&gt;elevation trend surface&lt;/A&gt; from those points and then calculate aspect (and slope if required) from that.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Mar 2012 00:19:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/67952#M936</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2012-03-23T00:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate mean aspect for polygons</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/67953#M937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The attached zip file contains a Python script tool that calculates zonal mean aspect azimuth, and mean aspect class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The syntax for the fundamental calculation is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;math.fmod(360 + (math.atan2(!MeanSin!, !MeanCos!)) * (180 / math.pi), 360)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Dec 2013 14:23:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/67953#M937</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2013-12-07T14:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate mean aspect for polygons</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/67954#M938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great sample.&amp;nbsp;&amp;nbsp;&amp;nbsp;Thought to add for reference if one wanted to calculate the output as Raster in Map Algebra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;from arcpy.sa import *
import math
asp = Aspect(inElevation)
aspNull = SetNull(asp, asp, "VALUE = -1")
aspCos = Cos(aspNull * math.pi / 180.0)
aspSin = Sin(aspNull * math.pi / 180.0)
xxSumSin = ZonalStatistics(inZones,"OBJECTID", "aspSin", "MEAN", "DATA")
xxSumCos = ZonalStatistics(inZones,"OBJECTID", aspCos, "MEAN", "DATA")
asp_azm = (360+(ATan2(xxSumSin,xxSumCos)) * (180 / math.pi)) % 360.0&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 15:59:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/67954#M938</guid>
      <dc:creator>RyanDeBruyn1</dc:creator>
      <dc:date>2021-12-12T15:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate mean aspect for polygons</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/1172690#M11676</link>
      <description>&lt;P&gt;I have roughly ~700 polygons that I would like to derive the mean aspect for each. I've downloaded the zip file and input the polygon featureclass. I've also specified the zoneID field but the tool won't accept any of my elevation rasters.&amp;nbsp;&lt;BR /&gt;I've tried exporting my rasters to ESRI grid, I've tried changing the source type properties from generic to elevation. I've tried shortening the file names and the tool always returns &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;ERROR&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;A target="_blank" rel="noopener noreferrer"&gt;-1&amp;nbsp;&lt;/A&gt;&lt;/STRONG&gt;&lt;SPAN&gt;Input must be an ESRI grid...&lt;BR /&gt;&lt;BR /&gt;I'm not sure where I've gone wrong. Any help/advice would be greatly appreciated&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 08:00:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/1172690#M11676</guid>
      <dc:creator>Laura_G</dc:creator>
      <dc:date>2022-05-11T08:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate mean aspect for polygons</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/1327095#M11986</link>
      <description>&lt;P&gt;I've revised the code to be compatible with ArcGIS Pro, and to accept either a TIFF or ESRI grid as the elevation raster.&lt;/P&gt;&lt;P&gt;The revised toolbox and user guidance are attached as a ZIP file.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Sep 2023 04:43:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/1327095#M11986</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2023-09-10T04:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate mean aspect for polygons</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/1548531#M12250</link>
      <description>&lt;P&gt;This rules. Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 21:22:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/1548531#M12250</guid>
      <dc:creator>suntoygeo</dc:creator>
      <dc:date>2024-10-14T21:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate mean aspect for polygons</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/1556168#M12255</link>
      <description>&lt;P&gt;The toolbox and &lt;STRONG&gt;revised user guidance&lt;/STRONG&gt; are attached here as a ZIP file.&lt;/P&gt;&lt;P&gt;The toolbox &lt;EM&gt;&lt;STRONG&gt;only&lt;/STRONG&gt;&lt;/EM&gt; runs in ArcGIS Pro.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 03:22:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/1556168#M12255</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2024-11-07T03:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate mean aspect for polygons</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/1602962#M12302</link>
      <description>&lt;P&gt;Any thoughts on why the output for Aspect_Azm column is entirely null and the Aspect_Cls column is entirely 000 NO? I got the tool to run successfully. No errors popped up. I was super excited to find this and I'm hoping I can get it to work!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 19:55:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/calculate-mean-aspect-for-polygons/m-p/1602962#M12302</guid>
      <dc:creator>Hailey215</dc:creator>
      <dc:date>2025-04-04T19:55:20Z</dc:date>
    </item>
  </channel>
</rss>

