SuperMap-导出数据

本文介绍了一种通过数据泵将地理信息系统(GIS)中的数据集导出为多种矢量或栅格格式的方法。支持的格式包括MIF、DXF、DGN、E00、SHP等矢量格式及BMP、JPG、TIF、ECW等栅格格式。文章详细展示了如何设置输出文件类型,并对每种格式进行了简要说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

导出数据为矢量或栅格

                string strDataSourceName = pListItem.Text;              // 数据源名
                string strSrcName = pListItem.SubItems[1].Text;         // 数据集名
                string strType = pListItem.SubItems[2].Text;            // 输出类型
                string strTargetName = pListItem.SubItems[3].Text;      // 数据集新名

                /// 数据源
                soDataSource pSoDataSource = m_soDataSources[strDataSourceName];
                if (pSoDataSource == null)
                {
                    bFlag = false;
                    Marshal.ReleaseComObject(pSoDataSource); pSoDataSource = null;

                    continue;
                }

                /// 数据泵
                soDataPump pSoDataPump = pSoDataSource.DataPump;
                if (pSoDataPump == null)
                {
                    bFlag = false;
                    Marshal.ReleaseComObject(pSoDataPump); pSoDataPump = null;
                    Marshal.ReleaseComObject(pSoDataSource); pSoDataSource = null;

                    continue;
                }

                string strExtention = Path.GetExtension(strType).Replace(")", "").Replace(".","").ToUpper();
                switch (strExtention)
                {
                    case "MIF":
                        pSoDataPump.FileType = seFileType.scfMIF;
                        strTargetName += ".mif";
                        break;

                    case "DXF":
                        pSoDataPump.FileType = seFileType.scfDXF;
                        strTargetName += ".dxf";
                        break;

                    case "DGN":
                        pSoDataPump.FileType = seFileType.scfDGN;
                        strTargetName += ".dgn";
                        break;

                    case "E00":
                        pSoDataPump.FileType = seFileType.scfE00;
                        strTargetName += ".e00";
                        break;

                    case "SHP":
                        pSoDataPump.FileType = seFileType.scfSHP;
                        strTargetName += ".shp";
                        break;

                    case "*.*": // COVERAGE文件
                        pSoDataPump.FileType = seFileType.scfCoverage;
                        break;

                    case "BMP":
                        pSoDataPump.FileType = seFileType.scfBMP;
                        strTargetName += ".bmp";
                        break;

                    case "JPG":
                        pSoDataPump.FileType = seFileType.scfJPG;
                        strTargetName += ".jpg";
                        break;

                    case "TIF":
                        pSoDataPump.FileType = seFileType.scfTIF;
                        strTargetName += ".tif";
                        break;
                       
                    case "ECW":
                        pSoDataPump.FileType = seFileType.scfECW;
                        strTargetName += ".ecw";
                        break;

                    default:
                        continue;
                }

                pSoDataPump.DatasetToBeExported = strSrcName;
                pSoDataPump.FileName = txtPath.Text + strTargetName;
                pSoDataPump.DefaultUnits = seUnits.scuMeter;

                if (!pSoDataPump.Export())
                {
                    bFlag = false;
                    continue;
                }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值