/// <summary> /// Borra los archivos raster del directorio temporal /// </summary> private void BorrarTemporales() { Geoprocessor gp = new Geoprocessor(); gp.SetEnvironmentValue("workspace", System.IO.Path.GetTempPath()); IGpEnumList rasters = gp.ListRasters("*", "All"); Delete del = new Delete(); string sRaster = rasters.Next(); del.data_type = "RasterDataset"; while (sRaster != "") { del.in_data = System.IO.Path.GetTempPath() + "\\" + sRaster; gp.Execute(del, null); sRaster = rasters.Next(); } try { IGpEnumList ws = gp.ListWorkspaces("*", "FileGDB"); string sRutaWs = ws.Next(); del.data_type = ""; while (sRutaWs != "") { del.in_data = sRutaWs; gp.Execute(del, null); sRutaWs = ws.Next(); } MessageBox.Show("Archivos Temporales Borrados"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void listRasters(Geoprocessor GP) { // List all TIFF files in the workspace and build pyramids. GP.SetEnvironmentValue("workspace", @"C:\Corey\Ccm\results"); IGpEnumList rasters = GP.ListRasters("*", "TIFF"); string raster = rasters.Next(); // Intialize the BuildPyramids tool. BuildPyramids pyramids = new BuildPyramids(); while (raster != "") { // Set input raster dataset. pyramids.in_raster_dataset = raster; GP.Execute(pyramids, null); raster = rasters.Next(); } }