<?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 Select cells from raster layer in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/select-cells-from-raster-layer/m-p/49677#M1289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have a raster grid and I wanted to select cells based on its attribute. I reclassified that grid based on Value so that I could get an attribute table attached to it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now it has a field called "Value" in its attribute table , on which i want to perform "Select by attributes"&amp;nbsp; query and want those cells selected &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;like for a feature layer I would have simply done it as : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

If Not TypeOf pMap.Layer(0) Is IFeatureLayer Then Exit Sub
&amp;nbsp; Set pFeatureLayer = pMap.Layer(0)
&amp;nbsp; Set pFeatureSelection = pFeatureLayer 'QI
&amp;nbsp; 
&amp;nbsp; 'Create the query filter
&amp;nbsp; Set pQueryFilter = New QueryFilter
&amp;nbsp; pQueryFilter.WhereClause = "VALUE = 12"
&amp;nbsp; 
&amp;nbsp; 'Invalidate only the selection cache
&amp;nbsp; 'Flag the original selection
&amp;nbsp; pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
&amp;nbsp; 'Perform the selection
&amp;nbsp; pFeatureSelection.SelectFeatures pQueryFilter, esriSelectionResultNew, False
&amp;nbsp; 'Flag the new selection
&amp;nbsp; pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
&amp;nbsp; 


&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and could have those features selected. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can it be possible to select cells in a raster layer in a similar way through VB ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Priyanka&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Sep 2010 08:01:23 GMT</pubDate>
    <dc:creator>PriyankaMehta</dc:creator>
    <dc:date>2010-09-08T08:01:23Z</dc:date>
    <item>
      <title>Select cells from raster layer</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/select-cells-from-raster-layer/m-p/49677#M1289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have a raster grid and I wanted to select cells based on its attribute. I reclassified that grid based on Value so that I could get an attribute table attached to it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now it has a field called "Value" in its attribute table , on which i want to perform "Select by attributes"&amp;nbsp; query and want those cells selected &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;like for a feature layer I would have simply done it as : &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;

If Not TypeOf pMap.Layer(0) Is IFeatureLayer Then Exit Sub
&amp;nbsp; Set pFeatureLayer = pMap.Layer(0)
&amp;nbsp; Set pFeatureSelection = pFeatureLayer 'QI
&amp;nbsp; 
&amp;nbsp; 'Create the query filter
&amp;nbsp; Set pQueryFilter = New QueryFilter
&amp;nbsp; pQueryFilter.WhereClause = "VALUE = 12"
&amp;nbsp; 
&amp;nbsp; 'Invalidate only the selection cache
&amp;nbsp; 'Flag the original selection
&amp;nbsp; pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
&amp;nbsp; 'Perform the selection
&amp;nbsp; pFeatureSelection.SelectFeatures pQueryFilter, esriSelectionResultNew, False
&amp;nbsp; 'Flag the new selection
&amp;nbsp; pActiveView.PartialRefresh esriViewGeoSelection, Nothing, Nothing
&amp;nbsp; 


&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and could have those features selected. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can it be possible to select cells in a raster layer in a similar way through VB ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Priyanka&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Sep 2010 08:01:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/select-cells-from-raster-layer/m-p/49677#M1289</guid>
      <dc:creator>PriyankaMehta</dc:creator>
      <dc:date>2010-09-08T08:01:23Z</dc:date>
    </item>
  </channel>
</rss>

