コード例 #1
0
        public void LoadShp(string _shpFilePath)
        {
            SuperMap.Data.Conversion.DataImport m_dataImport = new SuperMap.Data.Conversion.DataImport();
            m_dataImport.ImportSettings.Clear();
            ImportSettingSHP imgSetting = new ImportSettingSHP();

            imgSetting.ImportMode         = ImportMode.Overwrite;
            imgSetting.SourceFilePath     = _shpFilePath;
            imgSetting.TargetDatasource   = UCEarthGlobal.m_MainSceneControl.Scene.Workspace.Datasources["Default"];
            imgSetting.IsAttributeIgnored = false;
            m_dataImport.ImportSettings.Add(imgSetting);
            m_dataImport.Run();
            IEnumerable <DatasetVector> dataimgList = UCEarthGlobal.m_MainSceneControl.Scene.Workspace.Datasources["Default"].Datasets.OfType <DatasetVector>();
            DatasetVector importResult = dataimgList.ToList().Find(v => v.Name == System.IO.Path.GetFileNameWithoutExtension(_shpFilePath)) as DatasetVector;
        }
コード例 #2
0
        public void LoadDom(string _domFilePath)
        {
            SuperMap.Data.Conversion.DataImport m_dataImport = new SuperMap.Data.Conversion.DataImport();
            m_dataImport.ImportSettings.Clear();
            ImportSettingIMG imgSetting1 = new ImportSettingIMG();

            imgSetting1.ImportMode          = ImportMode.Overwrite;
            imgSetting1.SourceFilePath      = _domFilePath;
            imgSetting1.TargetDatasource    = UCEarthGlobal.m_MainSceneControl.Scene.Workspace.Datasources["Default"];
            imgSetting1.MultiBandImportMode = MultiBandImportMode.MultiBand;
            imgSetting1.ImportingAsGrid     = false;

            m_dataImport.ImportSettings.Add(imgSetting1);
            m_dataImport.Run();
            IEnumerable <DatasetImage> dataimgList = UCEarthGlobal.m_MainSceneControl.Scene.Workspace.Datasources["Default"].Datasets.OfType <DatasetImage>();
            DatasetImage importResult = dataimgList.ToList().Find(v => v.Name == System.IO.Path.GetFileNameWithoutExtension(_domFilePath)) as DatasetImage;
        }
コード例 #3
0
        public void LoadDem(string _demFilePath)
        {
            SuperMap.Data.Conversion.DataImport m_dataImport = new SuperMap.Data.Conversion.DataImport();
            //导入dem
            m_dataImport.ImportSettings.Clear();
            ImportSettingIMG imgSetting = new ImportSettingIMG();

            imgSetting.ImportMode          = ImportMode.Overwrite;
            imgSetting.SourceFilePath      = _demFilePath;
            imgSetting.TargetDatasource    = UCEarthGlobal.m_MainSceneControl.Scene.Workspace.Datasources["Default"];
            imgSetting.MultiBandImportMode = MultiBandImportMode.SingleBand;
            imgSetting.ImportingAsGrid     = true;

            m_dataImport.ImportSettings.Add(imgSetting);
            m_dataImport.Run();
            IEnumerable <DatasetGrid> dataGridList = UCEarthGlobal.m_MainSceneControl.Scene.Workspace.Datasources["Default"].Datasets.OfType <DatasetGrid>();
            DatasetGrid importResult = dataGridList.ToList().Find(v => v.Name == System.IO.Path.GetFileNameWithoutExtension(_demFilePath)) as DatasetGrid;

            TerrainLayer terrainLayer = UCEarthGlobal.m_MainSceneControl.Scene.TerrainLayers.Add(importResult, true);

            UCEarthGlobal.m_MainSceneControl.Scene.Fly(new Camera {
                Latitude = terrainLayer.Bounds.Center.X, Longitude = terrainLayer.Bounds.Center.Y, Altitude = 10
            });
        }