RasterConditionalOpClass does not work in arcgis 10.2 but works in 10.0

2797
0
11-30-2015 12:36 AM
MonirRahman
New Contributor II

I want to do DEM Reconditioning. For this purpose I have used DEM and stream. I do several operations on DEM and stream.

I am using .NET in arcGIS 10.2

# From stream , I made streamRaster with  ....conversionOp.ToRasterDataset((IGeoDataset)feaureClass, "GRID", workspace, string_RasterName);...

# Then  I do .... >>>>  logicalOp.IsNull((IGeoDataset)streamRaster); >>> mathOp.Minus(rawDEMGeo, smoothDropGeo);>>>conditionalOp.SetNull(conditionGeo, smoothDropFromDEMGeo);

and so on...

All this works fine If the input DEM is outside a gdb. But when The input DEM is inside a gdb, when I am going to do >>conditionalOp.SetNull(conditionGeo, smoothDropFromDEMGeo)<< this operation, an exception throws and it says an temp raster like (g_g123) can not open.

In arcGIS 10.0 , DEMReconditioning works well for both inside gdb  DEM and outside gdb  DEM. 

arcgis 10.0 and 10.2 any differences ?? Or how I can I overcome this .....

IRasterDataset streamRasterDataset = rasterFromFc.CreateRasterFromFc(_agreeStreamFC,_rawDEMRaster, "D:\\W", 10000);

            IRaster streamRaster = streamRasterDataset.CreateDefaultRaster();

           

           

             IConversionOp conversionOp = new RasterConversionOpClass() {

                 OutWorkspace = rasterFromFc.WorkSpace

            };

             IRasterMakerOp rasterMakerOp = new RasterMakerOpClass() {

                 OutWorkspace = rasterFromFc.WorkSpace

             };

             ILogicalOp logicalOp = (ILogicalOp)new RasterMathOps() {

                 OutWorkspace = rasterFromFc.WorkSpace

             };

             IMathOp mathOp = (IMathOp)new RasterMathOps() {

                 OutWorkspace = rasterFromFc.WorkSpace

             };

             IConditionalOp conditionalOp = new RasterConditionalOpClass() {

                 OutWorkspace = rasterFromFc.WorkSpace

             };

             IDistanceOp distanceOp = new RasterDistanceOpClass() {

                 OutWorkspace = rasterFromFc.WorkSpace

             };

            Console.WriteLine("Making buffer constant grid ..");

            IGeoDataset bufferGeo = rasterMakerOp.MakeConstant(bufferDist, false);

            Console.WriteLine("Making smooth constant grid ..");

            IGeoDataset smoothDropGeo = rasterMakerOp.MakeConstant(smoothDrop, false);

            Console.WriteLine("Making sharp constant grid ..");

            IGeoDataset sharpDropGeo = rasterMakerOp.MakeConstant(sharpDrop, false);

            IGeoDataset conditionGeo = logicalOp.IsNull((IGeoDataset)streamRaster);

            IGeoDataset smoothDropFromDEMGeo = mathOp.Minus(rawDEMGeo, smoothDropGeo);

            Console.WriteLine("Computing smooth drop/raise grid ..");

            IGeoDataset smoothGeo = conditionalOp.SetNull(conditionGeo, smoothDropFromDEMGeo);//  in ArcGis 10.2 , exception here

            Console.WriteLine("Computing vector distance grid ..");

            object obj = null;

            object obj2 = null;

            IGeoDataset vectorEucDistGeo = distanceOp.EucDistance(smoothGeo, ref obj, ref obj2);

            smoothGeo = mathOp.Int(smoothGeo);

Tags (2)
0 Kudos
0 Replies