<?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 How to Cast a IGeoDataset into IRaster in Java SDK(arcobjects) in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-cast-a-igeodataset-into-iraster-in-java-sdk/m-p/213126#M5530</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using arcgis 10.2 Java SDK (I'm using ArcObjects NOT the Runtime SDK) try to do a IDW interpolation and I'm following the instruction from &lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/arcobjects-java/concepts/engine/index.html#/Working_with_Spatial_Analyst/0001000006t9000000/" title="http://resources.arcgis.com/en/help/arcobjects-java/concepts/engine/index.html#/Working_with_Spatial_Analyst/0001000006t9000000/"&gt;ArcObjects Help for Java developers&lt;/A&gt; &lt;/P&gt;&lt;P&gt;but I got a ClassCastException when I deal with the returned object from IDW operation. &lt;/P&gt;&lt;P&gt;my code is like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IInterpolationOp interpolationOP = new RasterInterpolationOp();&lt;/P&gt;&lt;P&gt;IRasterAnalysisEnvironment interpolationEnv = (IRasterAnalysisEnvironment)interpolationOP;&lt;/P&gt;&lt;P&gt;interpolationEnv .setCellSize(esriRasterEnvSettingEnum.esriRasterEnvValue,&amp;nbsp; cellsize);&lt;/P&gt;&lt;P&gt;IRasterRadius radius = new RasterRadius();&lt;/P&gt;&lt;P&gt;radius .setFixed(10, new Integer(0));&lt;/P&gt;&lt;P&gt;IGeoDataset outGeo = interpolationOP.iDW(inputData, power, radius,&amp;nbsp; null);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;EM&gt;&lt;STRONG style="color: #3d3d3d;"&gt;IRaster raster = (IRaster)outGeo;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;RasterLayer rasterLayer = &lt;SPAN class="kwrd" style="font-size: 14.0799999237061px; color: #7f0055; font-weight: bold;"&gt;new&lt;/SPAN&gt; RasterLayer();&lt;/P&gt;&lt;P&gt;rasterLayer.createFromRaster(raster);&lt;/P&gt;&lt;P&gt; mapBean.addLayer(rasterLayer, 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the emphasized line is where the exception occurred. from the help document, it doesn't mention how to convert the geoDataset to a Raster so in my understanding it's a normal Java cast, but I'm wrong.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I also tried the deprecated method :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM style="font-size: 18.6666660308838px;"&gt;&lt;STRONG&gt;IRaster raster = new Raster(outGeo); &lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;doesn't work either.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I googled, there are a lot of c# sample code, just using a geoDataset as IRaster will do the trick,&amp;nbsp; but i couldn't find a java sample.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Any idea will be appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Ryan&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 15 Nov 2015 16:56:50 GMT</pubDate>
    <dc:creator>ryantan</dc:creator>
    <dc:date>2015-11-15T16:56:50Z</dc:date>
    <item>
      <title>How to Cast a IGeoDataset into IRaster in Java SDK(arcobjects)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-cast-a-igeodataset-into-iraster-in-java-sdk/m-p/213126#M5530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using arcgis 10.2 Java SDK (I'm using ArcObjects NOT the Runtime SDK) try to do a IDW interpolation and I'm following the instruction from &lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/arcobjects-java/concepts/engine/index.html#/Working_with_Spatial_Analyst/0001000006t9000000/" title="http://resources.arcgis.com/en/help/arcobjects-java/concepts/engine/index.html#/Working_with_Spatial_Analyst/0001000006t9000000/"&gt;ArcObjects Help for Java developers&lt;/A&gt; &lt;/P&gt;&lt;P&gt;but I got a ClassCastException when I deal with the returned object from IDW operation. &lt;/P&gt;&lt;P&gt;my code is like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IInterpolationOp interpolationOP = new RasterInterpolationOp();&lt;/P&gt;&lt;P&gt;IRasterAnalysisEnvironment interpolationEnv = (IRasterAnalysisEnvironment)interpolationOP;&lt;/P&gt;&lt;P&gt;interpolationEnv .setCellSize(esriRasterEnvSettingEnum.esriRasterEnvValue,&amp;nbsp; cellsize);&lt;/P&gt;&lt;P&gt;IRasterRadius radius = new RasterRadius();&lt;/P&gt;&lt;P&gt;radius .setFixed(10, new Integer(0));&lt;/P&gt;&lt;P&gt;IGeoDataset outGeo = interpolationOP.iDW(inputData, power, radius,&amp;nbsp; null);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;EM&gt;&lt;STRONG style="color: #3d3d3d;"&gt;IRaster raster = (IRaster)outGeo;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;RasterLayer rasterLayer = &lt;SPAN class="kwrd" style="font-size: 14.0799999237061px; color: #7f0055; font-weight: bold;"&gt;new&lt;/SPAN&gt; RasterLayer();&lt;/P&gt;&lt;P&gt;rasterLayer.createFromRaster(raster);&lt;/P&gt;&lt;P&gt; mapBean.addLayer(rasterLayer, 0);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the emphasized line is where the exception occurred. from the help document, it doesn't mention how to convert the geoDataset to a Raster so in my understanding it's a normal Java cast, but I'm wrong.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I also tried the deprecated method :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM style="font-size: 18.6666660308838px;"&gt;&lt;STRONG&gt;IRaster raster = new Raster(outGeo); &lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;doesn't work either.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I googled, there are a lot of c# sample code, just using a geoDataset as IRaster will do the trick,&amp;nbsp; but i couldn't find a java sample.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Any idea will be appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Ryan&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Nov 2015 16:56:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-cast-a-igeodataset-into-iraster-in-java-sdk/m-p/213126#M5530</guid>
      <dc:creator>ryantan</dc:creator>
      <dc:date>2015-11-15T16:56:50Z</dc:date>
    </item>
  </channel>
</rss>

