Exemple #1
0
        /// <summary>
        /// Creates a random raster given a template raster (defined extent and cell size)
        /// </summary>
        /// <param name="templateRasterPath">full path location of the template raster</param>
        /// <param name="outRasterPath">the full path location of the output random raster</param>
        /// <returns>geoprocessing messages</returns>
        public string createRandomRaster(string templateRasterPath, string outRasterPath)
        {
            ESRI.ArcGIS.SpatialAnalystTools.CreateRandomRaster cRndRst = new CreateRandomRaster();
            string         bnd     = "";
            IRasterDataset rDset   = rsUtil.openRasterDataset(templateRasterPath, out bnd);
            IRaster        rst     = rsUtil.createRaster(rDset);
            IRasterProps   rstProp = (IRasterProps)rst;
            IPnt           pnt     = rstProp.MeanCellSize();

            cRndRst.cell_size  = pnt.X;
            cRndRst.out_raster = outRasterPath;
            return(getMessages(gpExecute(cRndRst)));
        }
 /// <summary>
 /// Creates a random raster given a template raster (defined extent and cell size)
 /// </summary>
 /// <param name="templateRasterPath">full path location of the template raster</param>
 /// <param name="outRasterPath">the full path location of the output random raster</param>
 /// <returns>geoprocessing messages</returns>
 public string createRandomRaster(string templateRasterPath, string outRasterPath)
 {
     ESRI.ArcGIS.SpatialAnalystTools.CreateRandomRaster cRndRst = new CreateRandomRaster();
     string bnd = "";
     IRasterDataset rDset = rsUtil.openRasterDataset(templateRasterPath,out bnd);
     IRaster rst = rsUtil.createRaster(rDset);
     IRasterProps rstProp = (IRasterProps)rst;
     IPnt pnt = rstProp.MeanCellSize();
     cRndRst.cell_size = pnt.X;
     cRndRst.out_raster = outRasterPath;
     return getMessages(gpExecute(cRndRst));
 }