<?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: ExtractByMask for multidimensional raster in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/extractbymask-for-multidimensional-raster/m-p/1258335#M11861</link>
    <description>&lt;P&gt;I am not seeing ExtractByMask in the list of Raster function objects referenced here&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/image-analyst/foreach.htm" target="_blank"&gt;Foreach—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;and here&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm" target="_blank"&gt;Raster function objects—Common Data Types | ArcGIS Developers&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2023 01:01:14 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2023-02-15T01:01:14Z</dc:date>
    <item>
      <title>ExtractByMask for multidimensional raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/extractbymask-for-multidimensional-raster/m-p/1258305#M11860</link>
      <description>&lt;P&gt;I am trying to use the ExtractByMask tool on a multidimension raster dataset by using the ForEach tool,&lt;/P&gt;&lt;P&gt;The raster data is gridded historical climate data of monthly maximum air temperature.&lt;/P&gt;&lt;P&gt;The mask data is a vector data set of vegetation communities,&lt;/P&gt;&lt;P&gt;Here is the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import arcpy
climate_file_historic_monthly_1950_54 = r"D:\temp\climate_projections\macav2metdata_tasmax_GFDL-ESM2M_r1i1p1_historical_1950_1954_CONUS_monthly.nc"
max_temp_hist_monthly_raster = arcpy.Raster(climate_file_historic_monthly_1950_54,True)

eru_data_file = r"D:\temp\RegionalSeralStateDeparture.gdb\Ecological_Response_Unit"
arcpy.management.MakeFeatureLayer(eru_data_file,'eru_data',"R3ERUCODE = 'MCD'")

arcpy.CheckOutExtension('Spatial')

arcpy.sa.Foreach(max_temp_hist_monthly_raster,'ExtractByMask',{'in_mask_data':'eru_data'})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;The error returned is&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;RuntimeError&lt;/SPAN&gt;                              Traceback (most recent call last)
In  &lt;SPAN class=""&gt;[70]&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;1&lt;/SPAN&gt;:     arcpy.sa.Foreach(max_temp_hist_monthly_raster,&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;ExtractByMask&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;,{&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;in_mask_data&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;:&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;eru_data&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;})

File &lt;SPAN class=""&gt;C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\ia\_ia.py&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;Foreach&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;114&lt;/SPAN&gt;:   &lt;SPAN class=""&gt;return&lt;/SPAN&gt; arcgisscripting._ia.Foreach(in_raster=in_raster,

&lt;SPAN class=""&gt;RuntimeError&lt;/SPAN&gt;: Invalid Raster Function: 'ExtractByMask'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;The documentation on using the ForEach tool is a bit scanty.&amp;nbsp; Using the ExtractByMask tool from the analysis tools returns a single band raster. I am looking for the extracted data by each slice.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 00:03:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/extractbymask-for-multidimensional-raster/m-p/1258305#M11860</guid>
      <dc:creator>DavidAnderson_1701</dc:creator>
      <dc:date>2023-02-15T00:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: ExtractByMask for multidimensional raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/extractbymask-for-multidimensional-raster/m-p/1258335#M11861</link>
      <description>&lt;P&gt;I am not seeing ExtractByMask in the list of Raster function objects referenced here&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/image-analyst/foreach.htm" target="_blank"&gt;Foreach—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;and here&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm" target="_blank"&gt;Raster function objects—Common Data Types | ArcGIS Developers&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 01:01:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/extractbymask-for-multidimensional-raster/m-p/1258335#M11861</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2023-02-15T01:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: ExtractByMask for multidimensional raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/extractbymask-for-multidimensional-raster/m-p/1258632#M11862</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; &amp;nbsp;The documentation on using the ForEach function is not all that clear.&amp;nbsp; I assumed that any Spatial Analyst raster function could be used.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;After consulting the raster functions documentation I changed the code from ExtractByMask to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;max_temp_clip_raster = arcpy.sa.Foreach(max_temp_hist_monthly_raster,'Clip',{"ClippingGeometry":eru_data_feature_set, "ClippingType":1})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;use the Clip function.&lt;/P&gt;&lt;P&gt;That does not work.&amp;nbsp; This is the error returned:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;RuntimeError&lt;/SPAN&gt;                              Traceback (most recent call last)
In  &lt;SPAN class=""&gt;[17]&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;4&lt;/SPAN&gt;:     max_temp_clip_raster = arcpy.sa.Foreach(max_temp_hist_monthly_raster,&lt;SPAN class=""&gt;'&lt;/SPAN&gt;&lt;SPAN class=""&gt;Clip&lt;/SPAN&gt;&lt;SPAN class=""&gt;'&lt;/SPAN&gt;,{&lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;ClippingGeometry&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;:eru_data_feature_set, &lt;SPAN class=""&gt;"&lt;/SPAN&gt;&lt;SPAN class=""&gt;ClippingType&lt;/SPAN&gt;&lt;SPAN class=""&gt;"&lt;/SPAN&gt;:&lt;SPAN class=""&gt;1&lt;/SPAN&gt;})

File &lt;SPAN class=""&gt;C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\ia\_ia.py&lt;/SPAN&gt;, in &lt;SPAN class=""&gt;Foreach&lt;/SPAN&gt;:
Line &lt;SPAN class=""&gt;114&lt;/SPAN&gt;:   &lt;SPAN class=""&gt;return&lt;/SPAN&gt; arcgisscripting._ia.Foreach(in_raster=in_raster,

&lt;SPAN class=""&gt;RuntimeError&lt;/SPAN&gt;: Failed to apply Raster Function: 'Clip' (The parameter is incorrect. )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested out the Clip raster function in Pro UI.&amp;nbsp; From what I determine, the function will not clip a raster to a polygon boundary like the ExtractByMask function does.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 19:29:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/extractbymask-for-multidimensional-raster/m-p/1258632#M11862</guid>
      <dc:creator>DavidAnderson_1701</dc:creator>
      <dc:date>2023-02-15T19:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: ExtractByMask for multidimensional raster</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/extractbymask-for-multidimensional-raster/m-p/1487512#M12211</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/483343"&gt;@DavidAnderson_1701&lt;/a&gt;&amp;nbsp;&amp;nbsp;You ever figure this out I got the same issue.&amp;nbsp; Mask strips the dimensions and Subset is just a bounding box.&amp;nbsp; been posting here also with a sample.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/crop-multidimensional-raster-to-exact-shape/td-p/1193249" target="_blank"&gt;https://community.esri.com/t5/arcgis-pro-questions/crop-multidimensional-raster-to-exact-shape/td-p/1193249&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 23:26:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/extractbymask-for-multidimensional-raster/m-p/1487512#M12211</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2024-06-07T23:26:27Z</dc:date>
    </item>
  </channel>
</rss>

