Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

problem when casting IGeodataset to IRaster

$
0
0
hi,
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:
Code:

java.lang.ClassCastException: com.esri.arcgis.geodatabase.IGeoDatasetProxy cannot be cast to com.esri.arcgis.geodatabase.IRaster
i'm using the arcobjects sdk 10.0 for java, the core codes are as follows:
Code:

RasterDataset rasterDataset = (RasterDataset) rasterWorkspace.openRasterDataset(demFileWithoutSuffix);
IMathOp mathOp = new RasterMathOps();
IGeoDataset geoDataset = mathOp.esri_int(rasterDataset);
...
IQueryFilter queryFilter = new QueryFilter();
queryFilter.setWhereClause("value<" + pHigh); //pHigh is the height value to query the specified areas
IRasterDescriptor descriptor = new RasterDescriptor();
descriptor.create((IRaster) geoDataset, queryFilter,"value");
...

Is there anyone can help me , thanks very much!

Viewing all articles
Browse latest Browse all 1374

Trending Articles