Beispiel #1
0
        /// <summary>
        /// 创建MDB文件
        /// </summary>
        /// <param name="folder">路径</param>
        /// <param name="name">mdb文件名</param>
        /// <returns></returns>
        public static bool CreateAccess(string folder, string name)
        {
            var tool = new CreatePersonalGDB();

            tool.out_folder_path = folder;
            tool.out_name        = name;
            tool.out_version     = "CURRENT";
            return(Excute(tool));
        }
        /// <summary>
        /// 作用:新建一个mdb文件
        /// </summary>
        /// <param name="folder">文件目录</param>
        /// <param name="fileName">文件名称</param>
        /// <returns></returns>
        public static string CreatePersonalDataBase(string folder, string fileName)
        {
            var tool = new CreatePersonalGDB();

            tool.out_name        = fileName;
            tool.out_folder_path = folder;
            if (GPHelper.Excute(tool))
            {
                return(System.IO.Path.Combine(folder, fileName + ".mdb"));
            }
            return(string.Empty);
        }
Beispiel #3
0
        static void CreateUnmanagedRasterCatalog()
        {
            try
            {
                //Use geoprocessing to create the geodatabase, the raster catalog, and load our directory
                //to the raster catalog.
                Geoprocessor geoprocessor = new Geoprocessor();

                //Create personal GDB in the TEMP directory
                CreatePersonalGDB createPersonalGDB = new CreatePersonalGDB();
                createPersonalGDB.out_folder_path = outputFolder;
                createPersonalGDB.out_name        = tempPGDB;

                geoprocessor.Execute(createPersonalGDB, null);

                //Create an unmanaged raster catalog in the newly created personal GDB
                CreateRasterCatalog createRasterCatalog = new CreateRasterCatalog();

                createRasterCatalog.out_path = tempPGDBPath;
                createRasterCatalog.out_name = tempRasterCatalog;
                createRasterCatalog.raster_management_type = "unmanaged";

                geoprocessor.Execute(createRasterCatalog, null);

                //Load data into the unmanaged raster catalog
                WorkspaceToRasterCatalog wsToRasterCatalog = new WorkspaceToRasterCatalog();

                wsToRasterCatalog.in_raster_catalog      = tempRasterCatalogPath;
                wsToRasterCatalog.in_workspace           = inputFolder;
                wsToRasterCatalog.include_subdirectories = "INCLUDE_SUBDIRECTORIES";

                geoprocessor.Execute(wsToRasterCatalog, null);
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.Message);
            }
        }
        static void CreateUnmanagedRasterCatalog()
        {
            try
            {
                //Use geoprocessing to create the geodatabase, the raster catalog, and load our directory
                //to the raster catalog.
                Geoprocessor geoprocessor = new Geoprocessor();

                //Create personal GDB in the TEMP directory
                CreatePersonalGDB createPersonalGDB = new CreatePersonalGDB();
                createPersonalGDB.out_folder_path = outputFolder;
                createPersonalGDB.out_name = tempPGDB;

                geoprocessor.Execute(createPersonalGDB, null);

                //Create an unmanaged raster catalog in the newly created personal GDB
                CreateRasterCatalog createRasterCatalog = new CreateRasterCatalog();

                createRasterCatalog.out_path = tempPGDBPath;
                createRasterCatalog.out_name = tempRasterCatalog;
                createRasterCatalog.raster_management_type = "unmanaged";

                geoprocessor.Execute(createRasterCatalog, null);

                //Load data into the unmanaged raster catalog
                WorkspaceToRasterCatalog wsToRasterCatalog = new WorkspaceToRasterCatalog();

                wsToRasterCatalog.in_raster_catalog = tempRasterCatalogPath;
                wsToRasterCatalog.in_workspace = inputFolder;
                wsToRasterCatalog.include_subdirectories = "INCLUDE_SUBDIRECTORIES";

                geoprocessor.Execute(wsToRasterCatalog, null);
            }
            catch (Exception exc)
            {
                Console.WriteLine(exc.Message);
            }
        }