<?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: ArcGIS 10 - selecting attributes from multiple bands in ArcGIS Spatial Analyst Questions</title>
    <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/arcgis-10-selecting-attributes-from-multiple-bands/m-p/719432#M10441</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In a python script using arcpy, to select a single band from a multi-band raster, just append "\\Layer_X" onto the path name.&amp;nbsp; For example, my multi-band raster is "D:\\temp\\test.img" (or r"D:\temp\test.img" or 'D:/temp/test.img').&amp;nbsp; The second band would be "D:\\temp\\test.img\\Layer_2".&amp;nbsp; Actually it could be called something other than Layer_X, you just have to look at how it is named when you load the raster into ArcMap (in ArcGIS 9 I think they were all named band_X).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To get the part of a raster with a specific value in a python script, you can use simple conditionals.&amp;nbsp; I'm not totally sure this is what you want, but maybe it will help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
arcpy.CheckOutExtension("Spatial")
input_raster = "D:\\temp\\test.img"
band1_obj = arcpy.sa.Raster(input_raster+"\\Layer_1")
band2_obj = arcpy.sa.Raster(input_raster+"\\Layer_2")
band3_obj = arcpy.sa.Raster(input_raster+"\\Layer_3")
output_obj = (band1_obj == 112) &amp;amp; (band2_obj == 115) &amp;amp; (band3_obj == 5)
output_obj.save(r"D:\\temp\\output.img")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure how to do this in raster calculator.&amp;nbsp; I was actually trying to figure that out when I found your post, but it is probably very similar though.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 06:47:33 GMT</pubDate>
    <dc:creator>CharlesMorton</dc:creator>
    <dc:date>2021-12-12T06:47:33Z</dc:date>
    <item>
      <title>ArcGIS 10 - selecting attributes from multiple bands</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/arcgis-10-selecting-attributes-from-multiple-bands/m-p/719431#M10440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to know the syntax for arcpy.sa or Raster Calculator to select the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; Band_1 from a raster where the Value is something specific.&amp;nbsp; Do I use ExtractByAttributes?&amp;nbsp; If so, what is the syntax to choose Band_1 from a multiband raster?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2.&amp;nbsp; Select from a combination of all three rasters like "Band_1","Value = 112"; "Band_2, "Value = 115"; "Band_3","Value = 5".&amp;nbsp; I have no idea of the syntax for this.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z00000029000000.htm"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z00000029000000.htm&lt;/A&gt;&lt;SPAN&gt; explains that you can use multiband rasters, but doesn't explain the syntax to do this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&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;KS&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2011 04:15:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/arcgis-10-selecting-attributes-from-multiple-bands/m-p/719431#M10440</guid>
      <dc:creator>KathSund</dc:creator>
      <dc:date>2011-07-28T04:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10 - selecting attributes from multiple bands</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/arcgis-10-selecting-attributes-from-multiple-bands/m-p/719432#M10441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In a python script using arcpy, to select a single band from a multi-band raster, just append "\\Layer_X" onto the path name.&amp;nbsp; For example, my multi-band raster is "D:\\temp\\test.img" (or r"D:\temp\test.img" or 'D:/temp/test.img').&amp;nbsp; The second band would be "D:\\temp\\test.img\\Layer_2".&amp;nbsp; Actually it could be called something other than Layer_X, you just have to look at how it is named when you load the raster into ArcMap (in ArcGIS 9 I think they were all named band_X).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To get the part of a raster with a specific value in a python script, you can use simple conditionals.&amp;nbsp; I'm not totally sure this is what you want, but maybe it will help:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
arcpy.CheckOutExtension("Spatial")
input_raster = "D:\\temp\\test.img"
band1_obj = arcpy.sa.Raster(input_raster+"\\Layer_1")
band2_obj = arcpy.sa.Raster(input_raster+"\\Layer_2")
band3_obj = arcpy.sa.Raster(input_raster+"\\Layer_3")
output_obj = (band1_obj == 112) &amp;amp; (band2_obj == 115) &amp;amp; (band3_obj == 5)
output_obj.save(r"D:\\temp\\output.img")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure how to do this in raster calculator.&amp;nbsp; I was actually trying to figure that out when I found your post, but it is probably very similar though.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 06:47:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/arcgis-10-selecting-attributes-from-multiple-bands/m-p/719432#M10441</guid>
      <dc:creator>CharlesMorton</dc:creator>
      <dc:date>2021-12-12T06:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS 10 - selecting attributes from multiple bands</title>
      <link>https://community.esri.com/t5/arcgis-spatial-analyst-questions/arcgis-10-selecting-attributes-from-multiple-bands/m-p/719433#M10442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In ArcGIS 9.x Raster Catalog, you can use a syntax like this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[KALI-1415.jpg - Band_1] &amp;lt;= 50 &amp;amp; [KALI-1415.jpg - Band_2] &amp;gt;= 120 &amp;amp; [KALI-1415.jpg - Band_3] &amp;lt;= 173&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In ArcGIS 10 Raster Catalog, use full catalog path names instead of layer names in the expression.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(("C:\Test\KALI-1415.jpg\Band_1") &amp;lt;= 50) &amp;amp; (("C:\Test\KALI-1415.jpg\Band_2") &amp;gt;= 120) &amp;amp; (("C:\Test\KALI-1415.jpg\Band_3") &amp;lt;= 173)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;*KALI-1415.jpg is my example image.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 22:35:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-spatial-analyst-questions/arcgis-10-selecting-attributes-from-multiple-bands/m-p/719433#M10442</guid>
      <dc:creator>PavanYadav</dc:creator>
      <dc:date>2011-08-18T22:35:54Z</dc:date>
    </item>
  </channel>
</rss>

