<?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: Convert raster in model builder: unable to open feature in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479983#M16121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make tx107.tif a precondition to the Calculate Value to make sure Name1 gets refreshed for every iteration.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Apr 2017 04:18:39 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2017-04-27T04:18:39Z</dc:date>
    <item>
      <title>Convert raster in model builder: unable to open feature</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479977#M16115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried to use model builder to convert several rasters to polygons. Here is the script exported to Python:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;# -*- coding: utf-8 -*-&lt;BR /&gt;# ---------------------------------------------------------------------------&lt;BR /&gt;# convertraster.py&lt;BR /&gt;# Created on: 2017-04-24 11:38:52.00000&lt;BR /&gt;#&amp;nbsp;&amp;nbsp; (generated by ArcGIS/ModelBuilder)&lt;BR /&gt;# Description: &lt;BR /&gt;# ---------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Import arcpy module&lt;BR /&gt;import arcpy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Load required toolboxes&lt;BR /&gt;arcpy.ImportToolbox("Model Functions")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# Local variables:&lt;BR /&gt;copiesx = "C:\\Documents\\GIS\\temp\\copiesx"&lt;BR /&gt;tx_107_tif = "C:\\Documents\\GIS\\temp\\copiesx\\tx_107.tif"&lt;BR /&gt;v_name__shp = "C:\\Documents\\GIS\\temp\\shapx\\%name%.shp"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Iterate Rasters&lt;BR /&gt;arcpy.IterateRasters_mb(copiesx, "", "", "NOT_RECURSIVE")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Process: Raster to Polygon&lt;BR /&gt;arcpy.RasterToPolygon_conversion(tx_107_tif, v_name__shp, "NO_SIMPLIFY", "Value")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I've restarted ArcMap (10.2. ) several times because the model keeps failing with the following message:&lt;/P&gt;&lt;P&gt;ERROR 010157: Unable to open feature class ... Failed to execute (Raster to Polygon).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked the error code. '... This may be due to incorrect paths or lack of permissions to access folders.' Don't think it's that, I know where the files are and made them myself, I have the permissions. It also says that the files could be corrupt, but I can load the files without problem. I executed one Raster to Polygon outside the model and it worked. Any guesses how to get the model to work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Apr 2017 16:50:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479977#M16115</guid>
      <dc:creator>johnpolo</dc:creator>
      <dc:date>2017-04-24T16:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert raster in model builder: unable to open feature</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479978#M16116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;iterators can only be&lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/modelbuilder-toolbox/iterate-rasters.htm"&gt; used in modelbuilder&lt;/A&gt; the fine-print is hidden at the &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/tools/modelbuilder-toolbox/an-overview-of-the-iterator-toolset.htm"&gt;top of the documentation here&lt;/A&gt;&amp;nbsp; which isn't repeated elsewhere... but it states for all iterators (except for and while...)&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Note:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;The tools are intended for use only in ModelBuilder and &lt;STRONG&gt;not in Python scripting&lt;/STRONG&gt;.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Apr 2017 17:25:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479978#M16116</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-04-24T17:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert raster in model builder: unable to open feature</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479979#M16117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Dan, for replying. Very sorry that I was unclear; I was trying to use the iterator and model inside the model window. I did not try to use the iterator or model in Python. I only exported the model to Python because I thought it might make the model steps appear clear without having to make a screen shot of the model. I should have wrote that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wonder if the problem was with using .tifs as my input rasters, instead of the native format, .grid or whathaveyou.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Apr 2017 18:45:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479979#M16117</guid>
      <dc:creator>johnpolo</dc:creator>
      <dc:date>2017-04-24T18:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert raster in model builder: unable to open feature</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479980#M16118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok... try a different folder then... anything in 'Documents' could be iffy, but your paths print fine, so not 'finding' them is not the issue I suspect&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Apr 2017 19:42:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479980#M16118</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2017-04-24T19:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Convert raster in model builder: unable to open feature</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479981#M16119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm with Dan, it looks an awful lot like a pathname issue, for example if the output model element %Name% contains spaces within an iteration you will see an error message like this as shapefile names can't have spaces, so the feature class (shapefile) can't be created with that pathname. Similarly make sure you are avoiding special characters. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An automated fix in &lt;A href="https://community.esri.com/group/1218" target="_blank"&gt;Model Builder&lt;/A&gt;&amp;nbsp;is to use the Calculate Value tool to make the name legal. Rename the Calculate Value output element to %Name1%, connect it to your Raster To Polygon tool as a precondition, and then, in your output path, replace %Name% with %Name1%. This will convert an ugly name like "z1&amp;amp;.tif" to "z1__tif" that can be safely used for a shapefile name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fix_name&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;r&lt;SPAN class="string token"&gt;"%Name%"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code Block&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;fix_name&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;nm&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ValidateTableName&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;nm&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:11:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479981#M16119</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T21:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Convert raster in model builder: unable to open feature</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479982#M16120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Curtis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response. I did as you said. Here are screenshots of the steps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen shot of Raster to Polygon settings with path and new file indicated" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/348152_Clipboard02.jpg" style="width: 620px; height: 408px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen shot of Create Value output changed to match value in Raster to Polygon path" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/348153_Clipboard03.jpg" style="width: 620px; height: 408px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screen shot of model builder with Create Value tool inserted and pointing to Raster to Polygon as a precondition" class="image-3 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/348154_Clipboard04.jpg" style="width: 620px; height: 401px;" /&gt;&lt;/P&gt;&lt;P&gt;The model ran. While it ran, it seemed to iterate through all the rasters. However, it only created one polygon, the last one in my list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Apr 2017 15:49:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479982#M16120</guid>
      <dc:creator>johnpolo</dc:creator>
      <dc:date>2017-04-26T15:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Convert raster in model builder: unable to open feature</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479983#M16121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make tx107.tif a precondition to the Calculate Value to make sure Name1 gets refreshed for every iteration.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 04:18:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/convert-raster-in-model-builder-unable-to-open/m-p/479983#M16121</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2017-04-27T04:18:39Z</dc:date>
    </item>
  </channel>
</rss>

