首页 / 浏览问题 / 组件GIS / 问题详情
超图组件导出arcgis mdb,字段过滤
256EXP 2020年09月01日

使用组件开发,导出arcgis mdb(PersonalGDBVector)时,不能过滤SmUserID字段,导出的数据始终存在UserID字段,请问需要怎么处理?

            Workspace workspace = new Workspace();
            DatasourceConnectionInfo dsConnectionInfo = new DatasourceConnectionInfo();
            dsConnectionInfo.EngineType = EngineType.UDBX;
            dsConnectionInfo.Alias = "Datasource";
            dsConnectionInfo.Server = @"D:\appDownload\source\ds20200722_1131.udbx";
            Datasource ds = workspace.Datasources.Open(dsConnectionInfo);

            object[] sourceDatas = new object[] { ds.Datasets[0], ds.Datasets[1] };
            string targetFile = @"D:\appDownload\source\test2.mdb";
            ExportSettingPersonalGDBVector exportSettingPersonalGDBVector = new ExportSettingPersonalGDBVector(sourceDatas, targetFile);
            exportSettingPersonalGDBVector.TargetFileType = FileType.PersonalGDBVector;
            exportSettingPersonalGDBVector.IgnoreFieldNames = new string[] {"SmUserID","UserID" };

            DataExport dataExport = new DataExport();
            ExportSettings ExportSettings = dataExport.ExportSettings;

            ExportSettings.Add(exportSettingPersonalGDBVector);

            dataExport.Run();

1个回答

smuserid比较特殊,无法过滤,如果不想要的话,可以导出后在arcmap中将该字段删除
4,620EXP 2020年09月01日
你好,其他字段过滤也不生效。。。
您好,如果要过滤掉UserID这个字段,只需要设置如下即可:

egdb.IgnoreFieldNames = new string[] { "SmUserID" };
不起作用的,兄弟。
...