<?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 problem when casting IGeodataset to IRaster in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-when-casting-igeodataset-to-iraster/m-p/605792#M16222</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i want to select specified areas from the dem data, which is below a height value. firstly, i use the IMathOp interface to convert the raster to integer. then i use IRasterDescriptor and filter to query the specified area, however, a cast problem comes up:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;java.lang.ClassCastException: com.esri.arcgis.geodatabase.IGeoDatasetProxy cannot be cast to com.esri.arcgis.geodatabase.IRaster&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i'm using the arcobjects sdk 10.0 for java, the core codes are as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
RasterDataset rasterDataset = (RasterDataset) rasterWorkspace.openRasterDataset(demFileWithoutSuffix);
IMathOp mathOp = new RasterMathOps();
IGeoDataset geoDataset = mathOp.esri_int(rasterDataset);
...
IQueryFilter queryFilter = new QueryFilter();
queryFilter.setWhereClause("value&amp;lt;" + pHigh); //pHigh is the height value to query the specified areas
IRasterDescriptor descriptor = new RasterDescriptor();
descriptor.create((IRaster) geoDataset, queryFilter,"value");
...&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Is there anyone can help me , thanks very much!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 13 Apr 2013 08:25:49 GMT</pubDate>
    <dc:creator>WuDu</dc:creator>
    <dc:date>2013-04-13T08:25:49Z</dc:date>
    <item>
      <title>problem when casting IGeodataset to IRaster</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/problem-when-casting-igeodataset-to-iraster/m-p/605792#M16222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i want to select specified areas from the dem data, which is below a height value. firstly, i use the IMathOp interface to convert the raster to integer. then i use IRasterDescriptor and filter to query the specified area, however, a cast problem comes up:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;java.lang.ClassCastException: com.esri.arcgis.geodatabase.IGeoDatasetProxy cannot be cast to com.esri.arcgis.geodatabase.IRaster&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i'm using the arcobjects sdk 10.0 for java, the core codes are as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
RasterDataset rasterDataset = (RasterDataset) rasterWorkspace.openRasterDataset(demFileWithoutSuffix);
IMathOp mathOp = new RasterMathOps();
IGeoDataset geoDataset = mathOp.esri_int(rasterDataset);
...
IQueryFilter queryFilter = new QueryFilter();
queryFilter.setWhereClause("value&amp;lt;" + pHigh); //pHigh is the height value to query the specified areas
IRasterDescriptor descriptor = new RasterDescriptor();
descriptor.create((IRaster) geoDataset, queryFilter,"value");
...&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Is there anyone can help me , thanks very much!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Apr 2013 08:25:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/problem-when-casting-igeodataset-to-iraster/m-p/605792#M16222</guid>
      <dc:creator>WuDu</dc:creator>
      <dc:date>2013-04-13T08:25:49Z</dc:date>
    </item>
  </channel>
</rss>

