Exemple #1
0
        public IRasterCatalog CreateRasterCat(string name, string sdePath)
        {
            ESRI.ArcGIS.Geoprocessor.Geoprocessor geoProcessor = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
            CreateRasterCatalog createRasterCatalog            = new CreateRasterCatalog();
            IGPCoordinateSystem rSR = new GPCoordinateSystemClass();
            IGPSpatialReference gSR = new GPSpatialReferenceClass();

            rSR.SpatialReference = new UnknownCoordinateSystemClass();
            gSR.SpatialReference = new UnknownCoordinateSystemClass();

            createRasterCatalog.out_path = sdePath;
            createRasterCatalog.out_name = name;
            createRasterCatalog.raster_spatial_reference = (object)rSR;
            createRasterCatalog.spatial_reference        = (object)gSR;
            geoProcessor.Execute(createRasterCatalog, null);
            IRasterCatalog rastercat = ((IRasterWorkspaceEx)this.m_workSpace).OpenRasterCatalog(name);

            return(rastercat);
        }
        static void Main(string[] args)
        {

            #region Initialize the license 
                ESRI.ArcGIS.esriSystem.AoInitialize aoInit = null;
                try
                {
                    Console.WriteLine("Obtaining license");
                    ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
                    aoInit = new AoInitializeClass();
                    esriLicenseStatus licStatus = aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeStandard);
                    Console.WriteLine("Ready with license.");
                }
                catch (Exception exc)
                {
                    // If it fails at this point, shutdown the test and ignore any subsequent errors.
                    Console.WriteLine(exc.Message);
                }
            #endregion


            //Coordinate system for raster column
            IGPCoordinateSystem rSR = new GPCoordinateSystemClass();
            rSR.SpatialReference = CreateSpatialReference((int)esriSRProjCSType.esriSRProjCS_World_Mercator);
            //Coordinate system for geometry column
            IGPSpatialReference gSR = new GPSpatialReferenceClass();
            gSR.SpatialReference = CreateSpatialReference((int)esriSRProjCSType.esriSRProjCS_World_Mercator);

            //Creates raster catalog
            CreateRasterCatalog_GP(rSR, gSR);

            //Loads rasters in the given directory to raster catalog
            LoadDirToRasterCatalog(outRC, rasterFolder);
            System.Console.WriteLine("Loading completed");

            System.Console.ReadLine();//waiting user to click a key to finish

           //Do not make any call to ArcObjects after license is shut down.
            aoInit.Shutdown();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            #region Initialize the license
            ESRI.ArcGIS.esriSystem.AoInitialize aoInit = null;
            try
            {
                Console.WriteLine("Obtaining license");
                ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
                aoInit = new AoInitializeClass();
                esriLicenseStatus licStatus = aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeStandard);
                Console.WriteLine("Ready with license.");
            }
            catch (Exception exc)
            {
                // If it fails at this point, shutdown the test and ignore any subsequent errors.
                Console.WriteLine(exc.Message);
            }
            #endregion


            //Coordinate system for raster column
            IGPCoordinateSystem rSR = new GPCoordinateSystemClass();
            rSR.SpatialReference = CreateSpatialReference((int)esriSRProjCSType.esriSRProjCS_World_Mercator);
            //Coordinate system for geometry column
            IGPSpatialReference gSR = new GPSpatialReferenceClass();
            gSR.SpatialReference = CreateSpatialReference((int)esriSRProjCSType.esriSRProjCS_World_Mercator);

            //Creates raster catalog
            CreateRasterCatalog_GP(rSR, gSR);

            //Loads rasters in the given directory to raster catalog
            LoadDirToRasterCatalog(outRC, rasterFolder);
            System.Console.WriteLine("Loading completed");

            System.Console.ReadLine();//waiting user to click a key to finish

            //Do not make any call to ArcObjects after license is shut down.
            aoInit.Shutdown();
        }
Exemple #4
0
        public IRasterCatalog CreateRasterCat(string name, string sdePath)
        {
            ESRI.ArcGIS.Geoprocessor.Geoprocessor geoProcessor = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
            CreateRasterCatalog createRasterCatalog = new CreateRasterCatalog();
            IGPCoordinateSystem rSR = new GPCoordinateSystemClass();
            IGPSpatialReference gSR = new GPSpatialReferenceClass();
            rSR.SpatialReference = new UnknownCoordinateSystemClass();
            gSR.SpatialReference = new UnknownCoordinateSystemClass();

            createRasterCatalog.out_path = sdePath;
            createRasterCatalog.out_name = name;
            createRasterCatalog.raster_spatial_reference = (object)rSR;
            createRasterCatalog.spatial_reference = (object)gSR;
            geoProcessor.Execute(createRasterCatalog, null);
            IRasterCatalog rastercat = ((IRasterWorkspaceEx)this.m_workSpace).OpenRasterCatalog(name);
            return rastercat;
        }