Beispiel #1
0
 public void Bind(object pArgument)
 {
     if (pArgument is mergeFunctionArguments)
     {
         mergeFunctionArguments arg = (mergeFunctionArguments)pArgument;
         inrs  = arg.InRaster;
         outrs = arg.OutRaster;
         //Console.WriteLine("Number of Bands in outrs = " + ((IRasterBandCollection)outrs).Count.ToString());
         ftrCls = arg.Boundary;
         IRasterProps rsProp = (IRasterProps)outrs;
         myFunctionHelper.Bind(outrs);
         myRasterInfo = myFunctionHelper.RasterInfo;
         myPixeltype  = myRasterInfo.PixelType;
         myValidFlag  = true;
     }
     else
     {
         throw new System.Exception("Incorrect arguments object. Expected: mergeFunctionArguments");
     }
 }
 public IFunctionRasterDataset calcMosaicFunction(IRaster[] inRasters, mergeType mType)
 {
     string tempAr = funcDir + "\\" + FuncCnt + ".afr";
     IFunctionRasterDataset frDset = new FunctionRasterDatasetClass();
     IFunctionRasterDatasetName frDsetName = new FunctionRasterDatasetNameClass();
     frDsetName.FullName = tempAr;
     frDset.FullName = (IName)frDsetName;
     IRasterFunction rsFunc = null;
     switch (mType)
     {
         case mergeType.LAST:
             rsFunc = new FunctionRasters.mergeFunctionDatasetLast();
             break;
         case mergeType.MIN:
             rsFunc = new FunctionRasters.mergeFunctionDatasetMin();
             break;
         case mergeType.MAX:
             rsFunc = new FunctionRasters.mergeFunctionDatasetMax();
             break;
         case mergeType.MEAN:
             rsFunc = new FunctionRasters.mergeFunctionDatasetMean();
             break;
         default:
             rsFunc = new FunctionRasters.mergeFunctionDatasetFirst();
             break;
     }
     FunctionRasters.mergeFunctionArguments args = new FunctionRasters.mergeFunctionArguments(this);
     args.InRaster = inRasters;
     frDset.Init(rsFunc, args);
     return frDset;
 }