<?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: ModelBuilder iterator and filenames in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267773#M9200</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Wade, Parse Path is new at 10.0 and a very nifty tool that avoids you having to get into Calculate Value and python coding like the example I posted to do that simple task.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Apr 2012 16:22:08 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2012-04-17T16:22:08Z</dc:date>
    <item>
      <title>ModelBuilder iterator and filenames</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267769#M9196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Got a weird problem that I can't track down.&amp;nbsp; I'm using an iterator in ModelBuilder to step through a list of rasters in a workspace and and apply a set of filters.&amp;nbsp; I'm getting the file mae of the raster (%Value%) and using it to name the results from the last slice result "3 Class Smoothed Output" (%Value%cl).&amp;nbsp; The problem is the filenames are 1 off.&amp;nbsp; It appears to be naming my results by the file name ahead of the one the results are based on.&amp;nbsp; I'm sure I need to but in a precondition somewhere, but I've looked at it until I'm cross-eyed and can't find the right spot.&amp;nbsp; Pic of the model is attached in case it is plainly obvious to someone other than me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks ahead,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wade[ATTACH=CONFIG]13563[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 20:32:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267769#M9196</guid>
      <dc:creator>WadeGivens</dc:creator>
      <dc:date>2012-04-16T20:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder iterator and filenames</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267770#M9197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You do not need to use the Parse Path tool. The cyan color output oval from the iterator called Name is the name of the input raster. Just use %Name% in your downstream tool output.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 21:38:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267770#M9197</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2012-04-16T21:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder iterator and filenames</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267771#M9198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That's what I started out using, but since the rasters I am processing are geoTIFF's, the Name variable gives me the file name plus the .tif extension.&amp;nbsp; When using %Name% for raster.tif in my results (%Name%_result.tif) I end up with raster.tif_result.tif.&amp;nbsp; I need to drop the .tif extension because the multiple .tif's in the resulting filenames are causing me headaches downstream.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the suggestion though,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wade&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2012 22:06:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267771#M9198</guid>
      <dc:creator>WadeGivens</dc:creator>
      <dc:date>2012-04-16T22:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder iterator and filenames</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267772#M9199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok. I see the you are iterating over tif. Try this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Create a precondition from output of the Parse Path tool to the "Slice to Equal Area 8 classes" tool. such that Parse path tool run before the Slice tool.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 15:22:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267772#M9199</guid>
      <dc:creator>ShitijMehta</dc:creator>
      <dc:date>2012-04-17T15:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder iterator and filenames</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267773#M9200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Wade, Parse Path is new at 10.0 and a very nifty tool that avoids you having to get into Calculate Value and python coding like the example I posted to do that simple task.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 16:22:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267773#M9200</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2012-04-17T16:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder iterator and filenames</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267774#M9201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the replies guys.&amp;nbsp; Adding the precondition in that spot did the trick Shitij.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Curtis, I'm using the Parse path tool extensively and it's pretty slick.&amp;nbsp; The problem I'm running in to is that I'm generating individual clipped raster files for a list shapefiles (bnd1_raster, bnd2_raster, etc.).&amp;nbsp; Due to some downstream processing, my rasters end up with names like bnd1_raster_tpi, bnd2_raster_tpi, etc.&amp;nbsp; I need to clip these again by the perspective shapefile feature.&amp;nbsp; Was thinking that using calculate field on %Value% (%Value% = bnd1_raster_tpi) and stripping the "_raster_tpi" and adding ".shp" would be the easiest way to specify the right shapefile to clip by in each iteration.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know this would be MUCH easier if I would just script it in Python, but now the Calculate Field tool is gettign the best of me and I can't have that happen... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wade&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 17:23:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267774#M9201</guid>
      <dc:creator>WadeGivens</dc:creator>
      <dc:date>2012-04-17T17:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: ModelBuilder iterator and filenames</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267775#M9202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Due to some downstream processing, my rasters end up with names like bnd1_raster_tpi, bnd2_raster_tpi, etc.&amp;nbsp; I need to clip these again by the perspective shapefile feature.&amp;nbsp; Was thinking that using calculate field on %Value% (%Value% = bnd1_raster_tpi) and stripping the "_raster_tpi" and adding ".shp" would be the easiest way to specify the right shapefile to clip by in each iteration.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Calculate Value can do this for you, using an expression like this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;r"%temp_raster%".replace("_raster_tpi","")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Set the output to String type set it as a precondition to the clip, and you can use that varaible embedded in the pathname for the shapefile.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I know this would be MUCH easier if I would just script it in Python, but now the Calculate Field tool is gettign the best of me and I can't have that happen... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There &lt;/SPAN&gt;&lt;STRONG&gt;is&lt;/STRONG&gt;&lt;SPAN&gt; a point where you have to hang it up and write a Python script, but a good grasp of Calculate Value makes ModelBuilder much more flexible and useful.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Apr 2012 18:36:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/modelbuilder-iterator-and-filenames/m-p/267775#M9202</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2012-04-17T18:36:46Z</dc:date>
    </item>
  </channel>
</rss>

