<?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: model builder to create NDVI in ModelBuilder Questions</title>
    <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-to-create-ndvi/m-p/804227#M3184</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My advice, first build a model that will work on one raster, then worry about iteration after that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may need to use the Calculate Value tool to pull out the paths of the band in the NAIP image. In the example below, I'm assuming you have a model element set up (of type Raster Layer) called "NAIP raster".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate Value parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14128041525343788" jivemacro_uid="_14128041525343788"&gt;
&lt;P&gt;f(r"%NAIP raster%")&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code block:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14128041633995987" jivemacro_uid="_14128041633995987"&gt;
&lt;P&gt;import os&lt;/P&gt;
&lt;P&gt;import arcpy&lt;/P&gt;
&lt;P&gt;def f(raster):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; raspath = arcpy.Describe(raster).catalogPath&lt;/P&gt;
&lt;P&gt;&amp;nbsp; return os.path.join(raspath, "Band_1")&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data type:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Raster Dataset&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would need one of these for each band. In ModelBuilder, they should be available for use in the Raster Calculator tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you get this working, you could nest this model inside another one that uses Iterate Rasters to run each raster in the folder in turn.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Oct 2014 21:39:00 GMT</pubDate>
    <dc:creator>curtvprice</dc:creator>
    <dc:date>2014-10-08T21:39:00Z</dc:date>
    <item>
      <title>model builder to create NDVI</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-to-create-ndvi/m-p/804226#M3183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to create an NDVI from multiple NAIP images and I will need to do it 3 or 4 times in the next year or 2.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have all the imagery in a folder which (I think) I will iterate through... but I need to generate an output in order to pull the bands I need into the raster calculator. advice?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Hank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Oct 2014 14:53:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-to-create-ndvi/m-p/804226#M3183</guid>
      <dc:creator>DavidAinley1</dc:creator>
      <dc:date>2014-10-06T14:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: model builder to create NDVI</title>
      <link>https://community.esri.com/t5/modelbuilder-questions/model-builder-to-create-ndvi/m-p/804227#M3184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My advice, first build a model that will work on one raster, then worry about iteration after that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may need to use the Calculate Value tool to pull out the paths of the band in the NAIP image. In the example below, I'm assuming you have a model element set up (of type Raster Layer) called "NAIP raster".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate Value parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14128041525343788" jivemacro_uid="_14128041525343788"&gt;
&lt;P&gt;f(r"%NAIP raster%")&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code block:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14128041633995987" jivemacro_uid="_14128041633995987"&gt;
&lt;P&gt;import os&lt;/P&gt;
&lt;P&gt;import arcpy&lt;/P&gt;
&lt;P&gt;def f(raster):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; raspath = arcpy.Describe(raster).catalogPath&lt;/P&gt;
&lt;P&gt;&amp;nbsp; return os.path.join(raspath, "Band_1")&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data type:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Raster Dataset&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would need one of these for each band. In ModelBuilder, they should be available for use in the Raster Calculator tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you get this working, you could nest this model inside another one that uses Iterate Rasters to run each raster in the folder in turn.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Oct 2014 21:39:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/modelbuilder-questions/model-builder-to-create-ndvi/m-p/804227#M3184</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-10-08T21:39:00Z</dc:date>
    </item>
  </channel>
</rss>

