<?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: arcpy.Resample_management() syntax in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353782#M27756</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;The bug reference and description is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;BUG-000089799&lt;/STRONG&gt;: arcpy.Resample does not accept path to raster dataset as input to cell size parameter &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Aug 2015 07:20:04 GMT</pubDate>
    <dc:creator>AndySmith</dc:creator>
    <dc:date>2015-08-11T07:20:04Z</dc:date>
    <item>
      <title>arcpy.Resample_management() syntax</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353774#M27748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's the correct syntax for using the path of a raster dataset to set the output cell size as mentioned, but not explained, in the help docs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/EN/HELP/MAIN/10.2/index.html#//00170000009t000000" title="http://resources.arcgis.com/EN/HELP/MAIN/10.2/index.html#//00170000009t000000"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get "ERROR 000628: Cannot set input into parameter cell_size"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s. I know there are ways round this using GetRasterProperties etc but would like to know how to do it this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 10:28:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353774#M27748</guid>
      <dc:creator>BenLeslie1</dc:creator>
      <dc:date>2015-07-30T10:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Resample_management() syntax</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353775#M27749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="n"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="n"&gt;&lt;STRONG&gt;&lt;STRONG&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/resample.htm"&gt;http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/resample.htm&lt;/A&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="n"&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;Resample_management&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"image.tif"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"resample.tif"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"10"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"CUBIC"&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;H2&gt;&lt;/H2&gt;&lt;P&gt;where the cell size in in the units of the data, not what you want them to be&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 11:07:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353775#M27749</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-07-30T11:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Resample_management() syntax</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353776#M27750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think that answers my question, I want to set the cell size using the 'third way' as highlighted in bold in the extract from the help docs below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can specify the cell size in 3 different ways: &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Using a single number specifying a square cell size&lt;/LI&gt;&lt;LI&gt;Using two numbers that specify the X and Y cell size, which is space delimited&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Using the path of a raster dataset from which the square cell size will be imported&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 11:19:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353776#M27750</guid>
      <dc:creator>BenLeslie1</dc:creator>
      <dc:date>2015-07-30T11:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Resample_management() syntax</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353777#M27751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't want to use a number, then you have to specify the full path to a raster with the cell size you want.&amp;nbsp; It is best to use raw notation or use forward slashes in the path name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 12:28:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353777#M27751</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-07-30T12:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Resample_management() syntax</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353778#M27752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but that doesn't answer my question, I'd like to know the correct syntax for inputting the raster path; I have tried many variations, including your sugesstions, all without success such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using the env.workspace setting to set the path and then defining the raster file name&lt;/P&gt;&lt;P&gt;typing the full path using raw notation&lt;/P&gt;&lt;P&gt;typing the full path using forward slash notation&lt;/P&gt;&lt;P&gt;using single quotes&lt;/P&gt;&lt;P&gt;using double and single quotes&lt;/P&gt;&lt;P&gt;using single and double quotes&lt;/P&gt;&lt;P&gt;using triple double quotes&lt;/P&gt;&lt;P&gt;using double double quotes&lt;/P&gt;&lt;P&gt;setting the raster as a layer and using that&lt;/P&gt;&lt;P&gt;typing it as it appears in the GUI i.e. "Same as layer ............"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm beginning to suspect that the tool doesn't do what the help docs says it does.&lt;/P&gt;&lt;P&gt;As I said, I know there are other ways of doing this but I'm just a firm believer the help docs should:&lt;/P&gt;&lt;P&gt;1. Help&lt;/P&gt;&lt;P&gt;2. Reflect how the program works&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 12:53:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353778#M27752</guid>
      <dc:creator>BenLeslie1</dc:creator>
      <dc:date>2015-07-30T12:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Resample_management() syntax</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353779#M27753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then pass it on as a potential bug...since you have just about everything covered. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 14:50:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353779#M27753</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-07-30T14:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Resample_management() syntax</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353780#M27754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I run the tool manually and copy the Python snippet from the Results window, I see the following syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;arcpy.Resample_management(in_raster="C:/Forum/ZonalStatsPercLoop/gdb/Rasters.gdb/DEM10m",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_raster="C:/Users/Xander/Documents/ArcGIS/Default.gdb/DEM10m_Resample",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cell_size="C:/Forum/ZonalStatsPercLoop/gdb/Rasters.gdb/Raster25m",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resampling_type="NEAREST")&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run this script from as standalone script (including the import arcpy statement and changing the output name), it throws the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;EM&gt;ExecuteError: ERROR 000622: Failed to execute (Resample). Parameters are not valid.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;EM&gt;ERROR 000628: Cannot set input into parameter cell_size.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, yes you should definitely report this as a bug. For now you could use the following alternative to use the cellsize from an existing raster:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
ras_in = "C:/Forum/ZonalStatsPercLoop/gdb/Rasters.gdb/DEMint"
ras_out = "C:/Forum/ZonalStatsPercLoop/gdb/Rasters.gdb/DEM25m_v2"
ras_cell = "C:/Forum/ZonalStatsPercLoop/gdb/Rasters.gdb/Raster25m"

cellsize = "{0} {1}".format(arcpy.Describe(ras_cell).meanCellWidth,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Describe(ras_cell).meanCellHeight)
# environment
arcpy.env.extent = ras_cell
arcpy.env.snapRaster = ras_cell
arcpy.env.cellSize = ras_cell

arcpy.Resample_management(in_raster=ras_in,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; out_raster=ras_out,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cell_size=cellsize,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resampling_type="NEAREST")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:35:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353780#M27754</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T16:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Resample_management() syntax</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353781#M27755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to confirm this has been logged as a bug.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Aug 2015 14:16:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353781#M27755</guid>
      <dc:creator>BenLeslie1</dc:creator>
      <dc:date>2015-08-10T14:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.Resample_management() syntax</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353782#M27756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5; font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;The bug reference and description is as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;BUG-000089799&lt;/STRONG&gt;: arcpy.Resample does not accept path to raster dataset as input to cell size parameter &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 07:20:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-resample-management-syntax/m-p/353782#M27756</guid>
      <dc:creator>AndySmith</dc:creator>
      <dc:date>2015-08-11T07:20:04Z</dc:date>
    </item>
  </channel>
</rss>

