<?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 grid output in python script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/grid-output-in-python-script/m-p/215083#M16585</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've recently updated to v10 and have been changing a python model to accommodate some of the new(?) arcpy geoprocessor formats (was previously using arcgisscripting in v9.2).&amp;nbsp; I'm having some issues with some of the functions that require a separate command for saving output.&amp;nbsp; Such as...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;extout = ExtractByMask(....)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;extout.save(....)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The second command that specifies the output has been temperamental.&amp;nbsp; In my model, I use concatenated strings to specify the output, such as...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;extout.save(path + label + "_1")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...where, for example, path = "C:/files/GIS/", label = "file", therefore path + label + "_1" returns "C:/files/GIS/file_1".&amp;nbsp; Sometimes this works, sometimes it doesn't.&amp;nbsp; When I type out the full path and file name and use that as the output argument it works fine but I don't want to do this this since I'm running the model in a for loop with different files each time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The most common error message I receive is some complaint about the output file being longer than the allowed length for grid files.&amp;nbsp; For example...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing: ExtractByMask "C:/Projects/GIS data/OBIA nearshore/Docks/130027" "C:/Projects/GIS data/OBIA nearshore/Docks/13002700_temp3.shp" "C:\Projects\GIS data\OBIA nearshore\Docks\Extract_13001"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Thu Feb 10 20:25:18 2011&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000879: Output raster: The length of the stack base name in C:\Projects\GIS data\OBIA nearshore\Docks\Extract_13001 is longer than 9.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (ExtractByMask). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The geoprocessor tries to make its own name for the output file since it doesn't recognize my input, which of course fails because it's longer than 9.&amp;nbsp; Is there anything I'm doing wrong here? How can I make this work without typing out the full path name?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Marcus&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Feb 2011 00:56:17 GMT</pubDate>
    <dc:creator>MarcusBeck</dc:creator>
    <dc:date>2011-02-11T00:56:17Z</dc:date>
    <item>
      <title>grid output in python script</title>
      <link>https://community.esri.com/t5/python-questions/grid-output-in-python-script/m-p/215083#M16585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've recently updated to v10 and have been changing a python model to accommodate some of the new(?) arcpy geoprocessor formats (was previously using arcgisscripting in v9.2).&amp;nbsp; I'm having some issues with some of the functions that require a separate command for saving output.&amp;nbsp; Such as...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;extout = ExtractByMask(....)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;extout.save(....)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The second command that specifies the output has been temperamental.&amp;nbsp; In my model, I use concatenated strings to specify the output, such as...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;extout.save(path + label + "_1")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...where, for example, path = "C:/files/GIS/", label = "file", therefore path + label + "_1" returns "C:/files/GIS/file_1".&amp;nbsp; Sometimes this works, sometimes it doesn't.&amp;nbsp; When I type out the full path and file name and use that as the output argument it works fine but I don't want to do this this since I'm running the model in a for loop with different files each time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The most common error message I receive is some complaint about the output file being longer than the allowed length for grid files.&amp;nbsp; For example...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing: ExtractByMask "C:/Projects/GIS data/OBIA nearshore/Docks/130027" "C:/Projects/GIS data/OBIA nearshore/Docks/13002700_temp3.shp" "C:\Projects\GIS data\OBIA nearshore\Docks\Extract_13001"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Thu Feb 10 20:25:18 2011&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute. Parameters are not valid.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000879: Output raster: The length of the stack base name in C:\Projects\GIS data\OBIA nearshore\Docks\Extract_13001 is longer than 9.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (ExtractByMask). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The geoprocessor tries to make its own name for the output file since it doesn't recognize my input, which of course fails because it's longer than 9.&amp;nbsp; Is there anything I'm doing wrong here? How can I make this work without typing out the full path name?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Marcus&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 00:56:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/grid-output-in-python-script/m-p/215083#M16585</guid>
      <dc:creator>MarcusBeck</dc:creator>
      <dc:date>2011-02-11T00:56:17Z</dc:date>
    </item>
  </channel>
</rss>

