注释修改

HHJ
huhaijun 3 days ago
parent aaf547fcab
commit cd2f07da67
  1. 6
      .gitignore
  2. 55
      Kingo.Plugins/Kingo.Plugin.DataLoad/Commands/CmdDataConversion.cs
  3. 20
      Kingo.Plugins/Kingo.Plugin.DataLoad/Commands/CmdLayerDataExport.cs
  4. 31
      Kingo.Plugins/Kingo.Plugin.DataLoad/Commands/CmdLoadBaseData.cs
  5. 5
      Kingo.Plugins/Kingo.Plugin.DataLoad/Commands/CmdLoadDB.cs
  6. 77
      Kingo.Plugins/Kingo.Plugin.DataLoad/Commands/CmdLoadProjectData.cs
  7. 59
      Kingo.Plugins/Kingo.Plugin.DataLoad/Commands/CmdSJTQ.cs
  8. 24
      Kingo.Plugins/Kingo.Plugin.DataLoad/Kingo.Plugin.DataLoad.csproj
  9. 33
      Kingo.Plugins/Kingo.Plugin.DataLoad/Manifest.xml
  10. 64
      Kingo.Plugins/Kingo.Plugin.DataLoad/View/FrmDataConversion.xaml
  11. 749
      Kingo.Plugins/Kingo.Plugin.DataLoad/View/FrmDataConversion.xaml.cs
  12. 51
      Kingo.Plugins/Kingo.Plugin.DataLoad/View/FrmLoadProjectData.xaml
  13. 176
      Kingo.Plugins/Kingo.Plugin.DataLoad/View/FrmLoadProjectData.xaml.cs
  14. 52
      Kingo.Plugins/Kingo.Plugin.DataLoad/View/FrmSJTQ.xaml
  15. 600
      Kingo.Plugins/Kingo.Plugin.DataLoad/View/FrmSJTQ.xaml.cs
  16. 119
      Kingo.Plugins/Kingo.Plugin.MapView/UcMapControl.cs

6
.gitignore vendored

@ -413,12 +413,6 @@ FodyWeavers.xsd
/发布
/Confused/Apps
/Apps/Template/JK_Task.jkrw
/在线建库/Kingo.DataRepairServiceAPI/日志
/在线建库/Kingo.DataRepairServiceAPI/Temp
/在线建库/Kingo.OnlineBuildDB.API1
/在线建库/Kingo.OnlineBuildDB.API.rar
/在线建库/Kingo.DataRepairServiceAPI/NO
/在线建库/WinServiceAPI/日志/log20240829.txt
/Kingo.Plugins/Apps/Plugins/Kingo.Plugin.DataCheck
/在线建库/linux.rar
/在线建库/WinServiceAPI/日志/log20240910.txt

@ -1,55 +0,0 @@
using ESRI.ArcGIS.Controls;
using KGIS.Framework.Commands;
using KGIS.Framework.Utils.Helper;
using Kingo.Plugin.DataLoad.View;
using System;
namespace Kingo.Plugin.DataLoad.Commands
{
public class CmdDataConversion : BaseMenuCommand
{
private EngineEditorClass pEditor = null;
public IHookHelper m_hookHelper;
public override void OnClick()
{
try
{
if (pEditor == null)
pEditor = new EngineEditorClass();
if (pEditor.EditState != esriEngineEditState.esriEngineStateNotEditing)
{
MessageHelper.ShowTips("请先关闭编辑!");
return;
}
FrmDataConversion main = new FrmDataConversion
{
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
};
main.ShowInMainWindow(true);
}
catch (Exception ex)
{
MessageHelper.ShowError("初始化数据转换页面异常:" + ex.Message);
PluginServiceInterface.CommonHelper.RecordsErrLog("初始化数据转换页面异常:", ex);
}
}
public override void OnCreate(object Hook)
{
if (Hook == null) return;
try
{
if (m_hookHelper == null)
m_hookHelper = new HookHelperClass { Hook = Hook };
if (pEditor == null)
pEditor = new EngineEditorClass();
}
catch
{
m_hookHelper = null;
return;
}
}
}
}

@ -3,14 +3,9 @@ using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Geodatabase;
using KGIS.Framework.AE.ExtensionMethod;
using KGIS.Framework.Maps;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Helper;
using Kingo.Plugin.DataLoad.View;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kingo.Plugin.DataLoad.Commands
{
@ -19,8 +14,9 @@ namespace Kingo.Plugin.DataLoad.Commands
/// </summary>
public class CmdLayerDataExport : BaseMapMenuCommand
{
private IEngineEditor editor = null;
private new IHookHelper m_hookHelper = null;
private IEngineEditor editor { get; set; }
private IHookHelper HookHelper { get; set; }
public override void OnClick()
{
try
@ -29,7 +25,7 @@ namespace Kingo.Plugin.DataLoad.Commands
{
editor = new EngineEditorClass();
}
object pTargetObj = m_hookHelper.GetCustomProperty();
object pTargetObj = HookHelper.GetCustomProperty();
if (pTargetObj != null)
{
IFeatureLayer pFeatureLayer = pTargetObj as IFeatureLayer;
@ -68,10 +64,12 @@ namespace Kingo.Plugin.DataLoad.Commands
{
try
{
if (m_hookHelper == null)
if (HookHelper == null)
{
m_hookHelper = new HookHelper();
m_hookHelper.Hook = Hook;
HookHelper = new HookHelper
{
Hook = Hook
};
}
editor = new EngineEditorClass();
}

@ -32,8 +32,10 @@ namespace Kingo.Plugin.DataLoad.Commands
}
try
{
FrmLoadBaseData frmLoadBaseData = new FrmLoadBaseData(m_hookHelper);
frmLoadBaseData.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
FrmLoadBaseData frmLoadBaseData = new FrmLoadBaseData(m_hookHelper)
{
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
};
frmLoadBaseData.ShowInMainWindow(true);
}
catch (Exception ex)
@ -45,7 +47,7 @@ namespace Kingo.Plugin.DataLoad.Commands
}
}
void main_Closed(object sender, EventArgs e)
private void Main_Closed(object sender, EventArgs e)
{
NotifyMsgPackage msg = new NotifyMsgPackage
{
@ -60,8 +62,7 @@ namespace Kingo.Plugin.DataLoad.Commands
{
try
{
if (NotifyMsgEven != null)
NotifyMsgEven(msg);
NotifyMsgEven?.Invoke(msg);
}
catch (Exception ex)
{
@ -69,16 +70,19 @@ namespace Kingo.Plugin.DataLoad.Commands
}
}
public override bool Enabled
{
get
{
return JudgeIsHaveTargetPath();
}
}
private bool JudgeIsHaveTargetPath()
{
try
{
ProjectInfo prj = MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo;
if (prj == null)
{
return false;
}
if (!(MapsManager.Instance.MapService.GetProjectInfo() is ProjectInfo prj)) return false;
return true;
}
catch (Exception ex)
@ -87,12 +91,5 @@ namespace Kingo.Plugin.DataLoad.Commands
return false;
}
}
public override bool Enabled
{
get
{
return JudgeIsHaveTargetPath();
}
}
}
}

@ -14,7 +14,6 @@ namespace Kingo.Plugin.DataLoad.Commands
IEngineEditor m_pEditor;
public override void OnCreate(object hook)
{
//throw new NotImplementedException();
m_pEditor = new EngineEditorClass();
}
@ -34,12 +33,12 @@ namespace Kingo.Plugin.DataLoad.Commands
MessageHelper.ShowError("举证成果加载出现错误,可能的原因是:" + ex.Message);
}
}
public override bool Enabled
{
get
{
ProjectInfo prj = MapsManager.Instance.CurrProjectInfo as ProjectInfo;
if (prj == null) return false;
if (!(MapsManager.Instance.CurrProjectInfo is ProjectInfo prj)) return false;
return !string.IsNullOrWhiteSpace(prj.BGDatabase) && m_pEditor.EditState == esriEngineEditState.esriEngineStateNotEditing;
}
}

@ -1,77 +0,0 @@
using ESRI.ArcGIS.Controls;
using KGIS.Framework.Commands;
using KGIS.Framework.Maps;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Helper;
using Kingo.Plugin.DataLoad.View;
using Kingo.PluginServiceInterface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kingo.Plugin.DataLoad.Commands
{
public class CmdLoadProjectData : BaseMenuCommand
{
private IEngineEditor pEditor = null;
private IHookHelper m_hookHelper = null;
public override void OnClick()
{
if (pEditor.EditState == esriEngineEditState.esriEngineStateEditing)
{
MessageHelper.ShowTips("请先关闭编辑!");
return;
}
try
{
FrmLoadProjectData frmLoadOtherData = new FrmLoadProjectData
{
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
};
frmLoadOtherData.ShowInMainWindow(true);
}
catch (Exception ex)
{
LogAPI.Debug("辅助功能:" + ex);
}
}
public override void OnCreate(object Hook)
{
if (m_hookHelper == null)
{
m_hookHelper = new HookHelperClass();
}
m_hookHelper.Hook = Hook;
pEditor = new EngineEditorClass();
}
public override bool Enabled
{
get
{
return JudgeIsHaveTargetPath();
}
}
private bool JudgeIsHaveTargetPath()
{
try
{
if (!(MapsManager.Instance.MapService.GetProjectInfo() is ProjectInfo prj))
{
return false;
}
return true;
}
catch (Exception ex)
{
LogAPI.Debug("判定 检测数据加载 按钮是否有效时失败,异常原因: " + ex + " ; ");
return false;
}
}
}
}

@ -1,59 +0,0 @@
using ESRI.ArcGIS.Controls;
using KGIS.Framework.Commands;
using KGIS.Framework.Maps;
using KGIS.Framework.Platform;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Helper;
using Kingo.Plugin.DataLoad.View;
using Kingo.PluginServiceInterface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kingo.Plugin.DataLoad.Commands
{
public class CmdSJTQ : BaseMenuCommand
{
IEngineEditor m_pEditor;
public override void OnCreate(object hook)
{
m_pEditor = new EngineEditorClass();
}
public override void OnClick()
{
try
{
List<DataDicTionary> Dics = Platform.Instance.DicHelper.GetDic(DicTypeEnum.QSDM, true);
if (Dics == null)
{
MessageHelper.ShowTips("请先设置权属字典!");
return;
}
FrmSJTQ main = new FrmSJTQ
{
Width = 430,
Height = 300,
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
};
main.ShowInMainWindow(true);
}
catch (Exception ex)
{
LogAPI.Debug(ex);
MessageHelper.ShowError("举证成果加载出现错误,可能的原因是:" + ex.Message);
}
}
public override bool Enabled
{
get
{
ProjectInfo prj = MapsManager.Instance.CurrProjectInfo as ProjectInfo;
if (prj == null) return false;
return !string.IsNullOrWhiteSpace(prj.BGDatabase) && m_pEditor.EditState == esriEngineEditState.esriEngineStateNotEditing;
}
}
}
}

@ -308,7 +308,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Activator.cs" />
<Compile Include="Commands\CmdDataConversion.cs" />
<Compile Include="Commands\CmdLayerDataExport.cs" />
<Compile Include="Commands\CmdLayerDataImport.cs" />
<Compile Include="Commands\CmdLoadBaseData.cs" />
@ -316,9 +315,7 @@
<Compile Include="Commands\CmdLoadDDTCData.cs" />
<Compile Include="Commands\CmdLoadGJWTTB.cs" />
<Compile Include="Commands\CmdLoadOtherData.cs" />
<Compile Include="Commands\CmdLoadProjectData.cs" />
<Compile Include="Commands\CmdLoadSurveyData.cs" />
<Compile Include="Commands\CmdSJTQ.cs" />
<Compile Include="GdalConfiguration.cs" />
<Compile Include="Helper\DLAECommonHelper.cs" />
<Compile Include="Helper\SetDicManageHelper.cs" />
@ -328,9 +325,6 @@
<Compile Include="Model\RuleTableEntity.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Service\ProofManager.cs" />
<Compile Include="View\FrmDataConversion.xaml.cs">
<DependentUpon>FrmDataConversion.xaml</DependentUpon>
</Compile>
<Compile Include="View\FrmDataExport.xaml.cs">
<DependentUpon>FrmDataExport.xaml</DependentUpon>
</Compile>
@ -352,12 +346,6 @@
<Compile Include="View\FrmLoadOtherData.xaml.cs">
<DependentUpon>FrmLoadOtherData.xaml</DependentUpon>
</Compile>
<Compile Include="View\FrmLoadProjectData.xaml.cs">
<DependentUpon>FrmLoadProjectData.xaml</DependentUpon>
</Compile>
<Compile Include="View\FrmSJTQ.xaml.cs">
<DependentUpon>FrmSJTQ.xaml</DependentUpon>
</Compile>
<Compile Include="View\UCSQLFilterCondition.xaml.cs">
<DependentUpon>UCSQLFilterCondition.xaml</DependentUpon>
</Compile>
@ -383,10 +371,6 @@
</None>
</ItemGroup>
<ItemGroup>
<Page Include="View\FrmDataConversion.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\FrmDataExport.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -415,14 +399,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\FrmLoadProjectData.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\FrmSJTQ.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="View\UCSQLFilterCondition.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

@ -32,38 +32,5 @@
TextImageRelation=""
LocationUri="Menu.Start.Group.DataLoad"
CommandId="Kingo.Plugin.DataLoad.Commands.CmdLoadOtherData"/>
<MenuItem Id="KGIS.UI.Menu.SJTQDataLoad"
Order="1"
Name="初始化变更范围"
Tooltip="初始化变更范围:将监测图斑或者是基础地类图斑提取为基础变更图斑。"
ItemType="CmdItem"
SmallImage="\Resources\整层更新数据入库.png"
LargeImage="\Resources\整层更新数据入库.png"
TextImageRelation=""
ShortcutKeys=""
LocationUri="Menu.Start.Group.NYDataLoad"
CommandId="Kingo.Plugin.DataLoad.Commands.CmdSJTQ"/>
<MenuItem Id="KGIS.UI.Menu.LoadProjectData"
Order="3"
Name="覆盖数据"
Tooltip="覆盖工程数据"
ItemType="CmdItem"
SmallImage="\Resources\整层更新数据入库.png"
LargeImage="\Resources\整层更新数据入库.png"
TextImageRelation=""
LocationUri="Menu.Start.Group.BGFZ"
CommandId="Kingo.Plugin.DataLoad.Commands.CmdLoadProjectData"/>
<MenuItem Id="KGIS.UI.Menu.DataConversion"
Order="6"
Name="数据转换"
Tooltip="数据转换"
HideWhere="2"
ItemType="CmdItem"
SmallImage="\Resources\整层更新数据入库.png"
LargeImage="\Resources\整层更新数据入库.png"
TextImageRelation=""
ShortcutKeys=""
LocationUri="Menu.Start.Group.BGFZ"
CommandId="Kingo.Plugin.DataLoad.Commands.CmdDataConversion"/>
</Extension>
</Bundle>

@ -1,64 +0,0 @@
<windows:BaseWindow xmlns:windows="clr-namespace:KGIS.Framework.Utils;assembly=KGIS.Framework.Utils"
x:Class="Kingo.Plugin.DataLoad.View.FrmDataConversion"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:kuiBtn="clr-namespace:KUI.Button;assembly=KUI" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
mc:Ignorable="d" Width="500" Height="280" ResizeMode="NoResize">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="70"/>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<Label Content="选择数据路径:" Grid.Column="0" VerticalAlignment="Center" Margin="5,0"/>
<dxe:TextEdit x:Name="cobYJGDTextEdit" Grid.Column="1" Height="30" IsReadOnly="True">
</dxe:TextEdit>
<kuiBtn:KImgButton Content="选 择" Width="80" Grid.Column="2" Height="30" CornerRadius="3" Foreground="White" Click="BtnSelectedYJGD_Click" />
</Grid>
<Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<Label Content="输出数据路径:" Grid.Column="0" VerticalAlignment="Center" Margin="5,0"/>
<dxe:TextEdit x:Name="cobTextEdit" Grid.Column="1" Height="30" IsReadOnly="True">
</dxe:TextEdit>
<kuiBtn:KImgButton Content="选 择" Width="80" Grid.Column="2" Height="30" CornerRadius="3" Foreground="White" Click="BtnGDBBaseData_Click" />
</Grid>
<Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Label Content="数据类型:" Margin="30,0,0,0"/>
<RadioButton x:Name="rdG" Content="GDB" GroupName="SJLY" Margin="30,0,0,0" VerticalAlignment="Center"/>
<RadioButton x:Name="rdM" Content="MDB" GroupName="SJLY" Margin="60,0,60,0" VerticalAlignment="Center"/>
<RadioButton x:Name="rdS" Content="Shape" GroupName="SJLY" Margin="0,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
</Grid>
<dxlc:LayoutItem Grid.Row="3" Grid.ColumnSpan="2">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<kuiBtn:KImgButton x:Name="btnLoad" Content="导 出" Click="BtnLoad_Click" Width="80" Height="30" CornerRadius="3" Margin="10,10" Foreground="White"/>
<kuiBtn:KImgButton x:Name="btnClose" Content="取 消" Click="BtnClose_Click" Width="80" Height="30" CornerRadius="3" Margin="10,10" Foreground="White"/>
</StackPanel>
</dxlc:LayoutItem>
<dxlc:LayoutItem Grid.Row="4" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal">
<TextBlock Text="注:将所选的GDB或者MDB数据库,转换为勾选的数据类型数据库到指定的输出路径" TextWrapping="Wrap" Width="580" Foreground="Red" ></TextBlock>
</StackPanel>
</dxlc:LayoutItem>
</Grid>
</windows:BaseWindow>

@ -1,749 +0,0 @@
using ESRI.ArcGIS.ADF;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
using KGIS.Framework.AE;
using KGIS.Framework.AE.Enum;
using KGIS.Framework.OpenData.Control;
using KGIS.Framework.OpenData.Filter;
using KGIS.Framework.OpenData.InterFace;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Helper;
using Kingo.OpenData.Filter;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Forms;
using KUI.Windows;
using Kingo.Plugin.DataLoad.Helper;
namespace Kingo.Plugin.DataLoad.View
{
/// <summary>
/// 数据转化 的交互逻辑
/// </summary>
public partial class FrmDataConversion : BaseWindow
{
/// <summary>
/// 源数据类型
/// </summary>
private string ImportDataType;
public FrmDataConversion()
{
InitializeComponent();
}
private void BtnSelectedYJGD_Click(object sender, RoutedEventArgs e)
{
try
{
using (ComReleaser com = new ComReleaser())
{
OpenDataDialog pDialog = new OpenDataDialog();
ISpatialDataObjectFilter pOFilter = new FilterGeoDatabasePersonal();
pDialog.AddFilter(pOFilter, true);
pOFilter = new FilterGeoDatabaseFile();
pDialog.AddFilter(pOFilter, true);
pDialog.AllowMultiSelect = false;
pDialog.Title = "选择MDB/GDB数据";
pDialog.RestoreLocation = true;
pDialog.StartLocation = pDialog.FinalLocation;
DialogResult dialogResult = pDialog.ShowDialog();
if (dialogResult == System.Windows.Forms.DialogResult.OK && pDialog.Selection.Count != 0)
{
ImportDataType = System.IO.Path.GetExtension(pDialog.FinalLocation).ToUpper().Replace('.', ' ').TrimStart();
if (string.IsNullOrWhiteSpace(ImportDataType) || (ImportDataType != "MDB" && ImportDataType != "GDB"))
{
MessageHelper.Show("选择的数据路径有误,请根据过滤条件,重新选择数据库!!");
return;
}
else if ("MDB,GDB".Contains(ImportDataType))
{
rdG.IsChecked = ImportDataType != "GDB";
rdG.IsEnabled = ImportDataType != "GDB";
rdM.IsChecked = ImportDataType != "MDB";
rdM.IsEnabled = ImportDataType != "MDB";
}
cobYJGDTextEdit.Text = pDialog.FinalLocation;
}
}
}
catch (Exception ex)
{
LogAPI.Debug("选择基础数据库失败:" + ex);
MessageHelper.Show("选择基础数据库失败:" + ex.Message);
}
}
private void BtnGDBBaseData_Click(object sender, RoutedEventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
DialogResult result = dialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.OK)
cobTextEdit.Text = dialog.SelectedPath;
}
private void BtnLoad_Click(object sender, RoutedEventArgs e)
{
try
{
#region 数据转化前置条件
if (!File.Exists(cobYJGDTextEdit.Text) && ImportDataType == "MDB")
{
MessageHelper.Show("请先选择源数据库!");
return;
}
if (!Directory.Exists(cobYJGDTextEdit.Text) && ImportDataType == "GDB")
{
MessageHelper.Show("请先选择源数据库!");
return;
}
if (string.IsNullOrWhiteSpace(cobTextEdit.Text))
{
MessageHelper.Show("请选择输出数据库路径!");
return;
}
if (rdG.IsChecked == false && rdM.IsChecked == false && rdS.IsChecked == false)
{
MessageHelper.Show("请选择输出的数据类型!");
return;
}
#endregion
this.ShowLoading("正在转化数据......", 0, 0);
System.Threading.Thread.Sleep(1000);
if (ImportDataType == "MDB" && rdG.IsChecked == true)
{
this.UpdateMsg("正在进行MDB转化为GDB数据中..........");
MDBConversionGDB(cobYJGDTextEdit.Text, cobTextEdit.Text);
}
else if (ImportDataType == "MDB" && rdS.IsChecked == true)
{
this.UpdateMsg("正在进行MDB转化为Shape数据中.........");
MGDBConversionShape(cobYJGDTextEdit.Text, cobTextEdit.Text, ImportDataType);
}
else if (ImportDataType == "GDB" && rdM.IsChecked == true)
{
this.UpdateMsg("正在进行GDB转化为MDB数据中..........");
GDBConversionMDB(cobYJGDTextEdit.Text, cobTextEdit.Text);
}
else if (ImportDataType == "GDB" && rdS.IsChecked == true)
{
this.UpdateMsg("正在进行GDB转化为Shape数据中.........");
MGDBConversionShape(cobYJGDTextEdit.Text, cobTextEdit.Text, ImportDataType);
}
this.CloseLoading();
MessageHelper.ShowTips("转化完成!");
}
catch (Exception ex)
{
this.CloseLoading();
MessageHelper.ShowTips("数据转化异常" + ex.Message);
LogAPI.Debug("数据转化异常" + ex.Message);
}
finally
{
this.CloseLoading();
}
}
/// <summary>
/// MDB 转 GDB
/// </summary>
/// <param name="S_Path">源路径</param>
/// <param name="E_Path">输出路径</param>
private void MDBConversionGDB(string S_MDBPath, string E_GDBPath)
{
WorkspaceAPI s_WsAPI = null;
WorkspaceAPI t_WsAPI = null;
IEnumDataset pEnumDataset = null;
try
{
s_WsAPI = new WorkspaceAPI(S_MDBPath, WorkspaceTypeEnum.MDBFile, true);
string MDBName = System.IO.Path.GetFileNameWithoutExtension(S_MDBPath);
string GDBTempPath = PluginServiceInterface.CommonHelper.CreateTempGDB(MDBName, E_GDBPath);
t_WsAPI = new WorkspaceAPI(GDBTempPath, WorkspaceTypeEnum.GDBFile, true);
pEnumDataset = s_WsAPI.CurrentWorkspace.Datasets[esriDatasetType.esriDTFeatureDataset];
if (pEnumDataset != null)
{
pEnumDataset.Reset();
IDataset pDataset = null;
//如果数据集是IFeatureDataset,则遍历它下面的子类
while ((pDataset = pEnumDataset.Next()) != null)
{
IDataset newDataset = null;
newDataset = DLAECommonHelper.CreateFeatureDataset(t_WsAPI);
if (newDataset == null) continue;
List<string> listFeatureClass = new List<string>();
List<string> listFeatureClassNameList = new List<string>();
IEnumDataset ed = pDataset.Subsets;
if (ed != null)
{
IDataset dataset = ed.Next();
while (dataset != null)
{
if ((dataset as IFeatureClass) != null)
{
string featureClassName = dataset.BrowseName;
if (!string.IsNullOrWhiteSpace(featureClassName) && !listFeatureClass.Contains(featureClassName))
{
listFeatureClass.Add(System.IO.Path.Combine(pDataset.Workspace.PathName.ToString(), pDataset.BrowseName, featureClassName));
listFeatureClassNameList.Add(featureClassName);
}
}
Marshal.FinalReleaseComObject(dataset);
dataset = ed.Next();
}
}
if (listFeatureClass.Count > 0)
InsertGDBFeatureClass(cobYJGDTextEdit.Text, listFeatureClassNameList, GDBTempPath, newDataset.BrowseName);
if (newDataset != null)
Marshal.FinalReleaseComObject(newDataset);
}
//若不存在数据集仅仅为要素类
List<IFeatureClass> featureClasses = s_WsAPI.GetAllFeatureClass(esriDatasetType.esriDTFeatureClass);
List<string> FeatureClassNameList = new List<string>();
foreach (IFeatureClass item in featureClasses)
{
if (!t_WsAPI.ExistFeatureClass((item as IDataset).Name) && !FeatureClassNameList.Contains((item as IDataset).Name))
{
FeatureClassNameList.Add((item as IDataset).Name);
IFeatureClassAPI featureTemp = s_WsAPI.OpenFeatureClass2((item as IDataset).Name);
if (featureTemp == null) continue;
IFeatureClassAPI TempFL = t_WsAPI.CreateFeatureClass((item as IDataset).Name, (featureTemp.FeatureClass as IGeoDataset).SpatialReference, featureTemp.FeatureClass.Fields);
featureTemp.FcToFc(TempFL.FeatureClass, null, true);
featureTemp?.CloseFeatureClass();
TempFL?.CloseFeatureClass();
}
}
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
t_WsAPI?.CloseWorkspace();
s_WsAPI?.CloseWorkspace();
if (pEnumDataset != null)
Marshal.ReleaseComObject(pEnumDataset);
}
}
private void GDBConversionMDB(string S_GDBFullPath, string E_MDBFullPath)
{
WorkspaceAPI t_WsAPI = null;
WorkspaceAPI s_WsAPI = null;
IEnumDataset pEnumDataset = null;
try
{
s_WsAPI = new WorkspaceAPI(S_GDBFullPath, WorkspaceTypeEnum.GDBFile, true);
string GDBName = System.IO.Path.GetFileNameWithoutExtension(S_GDBFullPath);
//创建mdb
string temp = SysAppPath.GetTemplatePath() + "Temp.mdb";
E_MDBFullPath = System.IO.Path.Combine(E_MDBFullPath, GDBName + ".mdb");
if (File.Exists(temp))
File.Copy(temp, E_MDBFullPath, true);
t_WsAPI = new WorkspaceAPI(E_MDBFullPath, WorkspaceTypeEnum.MDBFile, true);
pEnumDataset = s_WsAPI.CurrentWorkspace.Datasets[esriDatasetType.esriDTFeatureDataset];
if (pEnumDataset != null)
{
pEnumDataset.Reset();
IDataset pDataset = null;
//如果数据集是IFeatureDataset,则遍历它下面的子类
while ((pDataset = pEnumDataset.Next()) != null)
{
IDataset newDataset = null;
newDataset = DLAECommonHelper.CreateFeatureDataset(t_WsAPI);
if (newDataset == null) continue;
List<string> listFeatureClass = new List<string>();
List<string> listFeatureClassNameList = new List<string>();
IEnumDataset ed = pDataset.Subsets;
if (ed != null)
{
IDataset dataset = ed.Next();
while (dataset != null)
{
if ((dataset as IFeatureClass) != null)
{
string featureClassName = dataset.BrowseName;
if (!string.IsNullOrWhiteSpace(featureClassName) && !listFeatureClass.Contains(featureClassName))
{
listFeatureClass.Add(System.IO.Path.Combine(pDataset.Workspace.PathName.ToString(), pDataset.BrowseName, featureClassName));
listFeatureClassNameList.Add(featureClassName);
}
}
Marshal.FinalReleaseComObject(dataset);
dataset = ed.Next();
}
}
if (listFeatureClass.Count > 0)
InsertMDBFeatureClass(S_GDBFullPath, listFeatureClassNameList, E_MDBFullPath, newDataset.BrowseName, null);
if (newDataset != null)
Marshal.FinalReleaseComObject(newDataset);
}
}
if (t_WsAPI.ExistFeatureClass("MJHZJCTJB_YJJBNTTB"))
t_WsAPI.DeleteFeatureClass("MJHZJCTJB_YJJBNTTB");//删除多余的表结构数据
}
catch (Exception ex)
{
LogAPI.Debug(ex.Message);
}
finally
{
t_WsAPI?.CloseWorkspace();
s_WsAPI?.CloseWorkspace();
if (pEnumDataset != null)
Marshal.ReleaseComObject(pEnumDataset);
}
}
private void MGDBConversionShape(string S_M_GDBPath, string E_ShapePath, string DataType)
{
WorkspaceAPI s_WsAPI = null;
IEnumDataset pEnumDataset = null;
IWorkspaceFactory workFactory = null;
IWorkspace pWorkspace = null;
IWorkspaceAPI workspaceAPI = null;
try
{
if (DataType == "MDB")
{
s_WsAPI = new WorkspaceAPI(S_M_GDBPath, WorkspaceTypeEnum.MDBFile, true);
}
else if (DataType == "GDB")
{
s_WsAPI = new WorkspaceAPI(S_M_GDBPath, WorkspaceTypeEnum.GDBFile, true);
}
string GDBName = System.IO.Path.GetFileNameWithoutExtension(S_M_GDBPath);
E_ShapePath = System.IO.Path.Combine(E_ShapePath, GDBName);
if (!Directory.Exists(E_ShapePath))
Directory.CreateDirectory(E_ShapePath);
//PluginServiceInterface.CommonHelper.DelectDir(E_ShapePath);
pEnumDataset = s_WsAPI.CurrentWorkspace.Datasets[esriDatasetType.esriDTFeatureDataset];
if (pEnumDataset != null)
{
pEnumDataset.Reset();
IDataset pDataset = null;
//如果数据集是IFeatureDataset,则遍历它下面的子类
while ((pDataset = pEnumDataset.Next()) != null)
{
IEnumDataset ed = pDataset.Subsets;
if (ed != null)
{
IDataset dataset = ed.Next();
while (dataset != null)
{
if ((dataset as IFeatureClass) != null)
{
string featureClassName = dataset.BrowseName;
DLAECommonHelper.DeleteShp((dataset as IFeatureClass).AliasName, E_ShapePath);
DLAECommonHelper.ExportFeaturesToShp(dataset as IFeatureClass, null, E_ShapePath, featureClassName);
}
Marshal.FinalReleaseComObject(dataset);
dataset = ed.Next();
}
}
}
//若不存在数据集仅仅为要素类
List<IFeatureClass> featureClasses = s_WsAPI.GetAllFeatureClass(esriDatasetType.esriDTFeatureClass);
workFactory = new ESRI.ArcGIS.DataSourcesFile.ShapefileWorkspaceFactoryClass();
pWorkspace = workFactory.OpenFromFile(E_ShapePath, 0);
workspaceAPI = new WorkspaceAPI(pWorkspace);
foreach (IFeatureClass item in featureClasses)
{
if (!workspaceAPI.ExistFeatureClass((item as IDataset).Name))
{
IFeatureClassAPI featureTemp = s_WsAPI.OpenFeatureClass2((item as IDataset).Name);
if (featureTemp == null) continue;
DLAECommonHelper.DeleteShp(item.AliasName, E_ShapePath);
IFeatureClassAPI TempFL = workspaceAPI.CreateFeatureClass((item as IDataset).Name, (featureTemp.FeatureClass as IGeoDataset).SpatialReference, featureTemp.FeatureClass.Fields);
featureTemp.FcToFc(TempFL.FeatureClass, null, true);
featureTemp?.CloseFeatureClass();
TempFL?.CloseFeatureClass();
}
}
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (pEnumDataset != null)
Marshal.ReleaseComObject(pEnumDataset);
if (pWorkspace != null)
Marshal.ReleaseComObject(pWorkspace);
s_WsAPI?.CloseWorkspace();
workspaceAPI?.CloseWorkspace();
}
}
/// <summary>
/// 从MDB中拷贝要素类插入到GDB
/// </summary>
/// <param name="sFromGDBPath">GDB地址</param>
/// <param name="iFeatureClassNameList">GDB中要拷贝的要素类名称列表</param>
/// <param name="iOutPutMDBPath">要插入到的MDB的地址路径</param>
/// <param name="sOutPutDataSetName">输出的数据集的名字</param>
public void InsertGDBFeatureClass(string sFromGDBPath, List<string> iFeatureClassNameList, string iOutPutMDBPath, string sOutPutDataSetName)
{
IFeatureWorkspace fws_gdb = null;
WorkspaceAPI wsapi_gdb = null;
IFeatureClassAPI fcapi_gdb = null;
IFeatureClass fc_gdb = null;
IFeatureClass newFeatureClass = null;
IFeatureWorkspace fws_mdb = null;
int iAddSuccessCount = 0;
int iAddFailCount = 0;
int iFCToFCType = 0;//fc2fc类型(0不涉及到数据集的方式 1涉及到数据集的方式)
try
{
iFCToFCType = string.IsNullOrWhiteSpace(sOutPutDataSetName) == true ? 0 : 1;
if (string.IsNullOrWhiteSpace(sFromGDBPath) == true)
{
LogAPI.Debug("从MDB中拷贝要素类插入到GDB中 时失败,原因: MDB地址 为空 ; ");
throw new Exception("GDB地址 不能为空");
}
if (iFeatureClassNameList == null || iFeatureClassNameList.Count <= 0)
{
LogAPI.Debug("从MDB中拷贝要素类插入到GDB中 时失败,原因: MDB中要拷贝的要素类名称列表 为空 ; ");
throw new Exception("要转换的要素类 不能为空");
}
wsapi_gdb = new WorkspaceAPI(sFromGDBPath, WorkspaceTypeEnum.MDBFile, true);
fws_gdb = wsapi_gdb.CurrentWorkspace as IFeatureWorkspace;
IWorkspace ws_gdb = fws_gdb as IWorkspace;
WorkspaceAPI wsapi_mdb = new WorkspaceAPI(iOutPutMDBPath, WorkspaceTypeEnum.GDBFile, true);
fws_mdb = wsapi_mdb.CurrentWorkspace as IFeatureWorkspace;
for (int i = 0; i < iFeatureClassNameList.Count; i++)
{
fcapi_gdb = wsapi_gdb.OpenFeatureClass(iFeatureClassNameList[i]);
if (fcapi_gdb != null)
{
fc_gdb = fcapi_gdb.FeatureClass;
IGeoDataset geoDataset = fc_gdb as IGeoDataset;
bool bFC2FCResult_Temp;
if (iFCToFCType == 1)//fc2fc类型:1涉及到数据集的方式;
{
bFC2FCResult_Temp = MDBFc2FcGDB(fc_gdb, fws_mdb as IWorkspace, iFeatureClassNameList[i], sOutPutDataSetName, null);
#region 处理坐标参考系
IFeatureDataset dataSet = fws_mdb.OpenFeatureDataset(sOutPutDataSetName);
ISpatialReference sp = geoDataset.SpatialReference;
IGeoDataset pGeoDataset = dataSet as IGeoDataset;
IGeoDatasetSchemaEdit pGeoDatasetSchemaEdit = pGeoDataset as IGeoDatasetSchemaEdit;
if (pGeoDatasetSchemaEdit.CanAlterSpatialReference == true)
pGeoDatasetSchemaEdit.AlterSpatialReference(sp);
Marshal.ReleaseComObject(dataSet);
Marshal.ReleaseComObject(pGeoDataset);
#endregion
}
else
{
bFC2FCResult_Temp = MDBFc2FcGDB(fc_gdb, fws_mdb as IWorkspace, iFeatureClassNameList[i]);
#region 处理坐标参考系
newFeatureClass = fws_mdb.OpenFeatureClass(iFeatureClassNameList[i]);
IGeoDataset gdataset = newFeatureClass as IGeoDataset;
if (gdataset != null)
{
IGeoDatasetSchemaEdit pGeoDatasetSchemaEdit = gdataset as IGeoDatasetSchemaEdit;
if (pGeoDatasetSchemaEdit.CanAlterSpatialReference == true)
pGeoDatasetSchemaEdit.AlterSpatialReference(geoDataset.SpatialReference);
}
#endregion
Marshal.ReleaseComObject(gdataset);
}
Marshal.ReleaseComObject(geoDataset);
if (bFC2FCResult_Temp == true)
iAddSuccessCount += 1;
else
iAddFailCount += 1;
}
}
return;
}
catch (Exception ex)
{
LogAPI.Debug("将要素类拷贝至GDB中失败,异常原因: " + ex + " ; ");
LogAPI.DebugRunLog(ex, "将要素类拷贝至GDB中失败,异常原因: ", "InsertGDBFeatureClass");
throw new Exception("GDB转化成MDB地址失败");
}
finally
{
if (fws_gdb != null)
Marshal.ReleaseComObject(fws_gdb);
wsapi_gdb?.CloseWorkspace();
fcapi_gdb?.CloseFeatureClass();
if (fc_gdb != null)
Marshal.ReleaseComObject(fc_gdb);
if (fws_mdb != null)
{
Marshal.ReleaseComObject(fws_mdb);
fws_mdb = null;
}
if (newFeatureClass != null)
Marshal.ReleaseComObject(newFeatureClass);
}
}
/// <summary>
/// 从GDB中拷贝要素类插入到MDB中 2020-6-1 沈超
/// </summary>
/// <param name="sFromGDBPath">GDB地址</param>
/// <param name="iFeatureClassNameList">GDB中要拷贝的要素类名称列表</param>
/// <param name="iOutPutMDBPath">要插入到的MDB的地址路径</param>
/// <param name="sOutPutDataSetName">输出的数据集的名字</param>
/// <param name="sSpatialReference">输出坐标参考:如果不是要素集下的图层,则要赋坐标参考</param>
public void InsertMDBFeatureClass(string sFromGDBPath, List<string> iFeatureClassNameList, string iOutPutMDBPath, string sOutPutDataSetName, string sSpatialReference = null)
{
IFeatureWorkspace fws_gdb = null;
IWorkspace ws_gdb = null;
WorkspaceAPI wsapi_gdb = null;
IFeatureClassAPI fcapi_gdb = null;
IFeatureClass fc_gdb = null;
IFeatureClass newFeatureClass = null;
IFeatureWorkspace fws_mdb = null;
int iAddSuccessCount = 0;
int iAddFailCount = 0;
bool bFC2FCResult_Temp = false;
int iFCToFCType = 0;//fc2fc类型(0不涉及到数据集的方式 1涉及到数据集的方式)
try
{
iFCToFCType = string.IsNullOrWhiteSpace(sOutPutDataSetName) == true ? 0 : 1;
if (string.IsNullOrWhiteSpace(sFromGDBPath) == true)
{
LogAPI.Debug("从GDB中拷贝要素类插入到MDB中 时失败,原因: GDB地址 为空 ; ");
throw new Exception("GDB地址 不能为空");
}
if (iFeatureClassNameList == null || iFeatureClassNameList.Count <= 0)
{
LogAPI.Debug("从GDB中拷贝要素类插入到MDB中 时失败,原因: GDB中要拷贝的要素类名称列表 为空 ; ");
throw new Exception("要转换的要素类 不能为空");
}
WorkspaceAPI wsapi_MDB = new WorkspaceAPI(iOutPutMDBPath, WorkspaceTypeEnum.MDBFile, true);
fws_mdb = wsapi_MDB.CurrentWorkspace as IFeatureWorkspace;
if (fws_mdb == null)
throw new Exception("MDB地址 不能为空");
wsapi_gdb = new WorkspaceAPI(sFromGDBPath, WorkspaceTypeEnum.GDBFile, true);
fws_gdb = wsapi_gdb.CurrentWorkspace as IFeatureWorkspace;
ws_gdb = fws_gdb as IWorkspace;
for (int i = 0; i < iFeatureClassNameList.Count; i++)
{
fcapi_gdb = wsapi_gdb.OpenFeatureClass(iFeatureClassNameList[i]);
if (fcapi_gdb != null)
{
fc_gdb = fcapi_gdb.FeatureClass;
IGeoDataset geoDataset = fc_gdb as IGeoDataset;
if (iFCToFCType == 1)//fc2fc类型:1涉及到数据集的方式;
{
bFC2FCResult_Temp = GDBFc2FcMDB(fc_gdb, fws_mdb as IWorkspace, iFeatureClassNameList[i], sOutPutDataSetName, null);
#region 处理坐标参考系
IFeatureDataset dataSet = fws_mdb.OpenFeatureDataset(sOutPutDataSetName);
ISpatialReference sp = geoDataset.SpatialReference;
IGeoDataset pGeoDataset = dataSet as IGeoDataset;
IGeoDatasetSchemaEdit pGeoDatasetSchemaEdit = pGeoDataset as IGeoDatasetSchemaEdit;
if (pGeoDatasetSchemaEdit.CanAlterSpatialReference == true)
pGeoDatasetSchemaEdit.AlterSpatialReference(sp);
Marshal.ReleaseComObject(dataSet);
Marshal.ReleaseComObject(pGeoDataset);
#endregion
}
else//fc2fc类型:0不涉及到数据集的方式;
{
bFC2FCResult_Temp = GDBFc2FcMDB(fc_gdb, fws_mdb as IWorkspace, iFeatureClassNameList[i], null);
#region 处理坐标参考系
newFeatureClass = fws_mdb.OpenFeatureClass(iFeatureClassNameList[i]);
IGeoDataset gdataset = newFeatureClass as IGeoDataset;
if (gdataset != null)
{
IGeoDatasetSchemaEdit pGeoDatasetSchemaEdit = gdataset as IGeoDatasetSchemaEdit;
if (pGeoDatasetSchemaEdit.CanAlterSpatialReference == true)
pGeoDatasetSchemaEdit.AlterSpatialReference(geoDataset.SpatialReference);
}
#endregion
Marshal.ReleaseComObject(gdataset);
}
Marshal.ReleaseComObject(geoDataset);
if (bFC2FCResult_Temp == true)
{
iAddSuccessCount += 1;
}
else
{
iAddFailCount += 1;
}
}
}
return;
}
catch (Exception ex)
{
LogAPI.Debug("将要素类拷贝至MDB中失败,异常原因: " + ex + " ; ");
throw new Exception("GDB转化成MDB地址失败");
}
finally
{
if (fws_gdb != null)
{
Marshal.ReleaseComObject(fws_gdb);
fws_gdb = null;
}
wsapi_gdb?.CloseWorkspace();
fcapi_gdb?.CloseFeatureClass();
if (fc_gdb != null)
{
Marshal.ReleaseComObject(fc_gdb);
fc_gdb = null;
}
if (fws_mdb != null)
{
Marshal.ReleaseComObject(fws_mdb);
fws_mdb = null;
}
if (newFeatureClass != null)
{
Marshal.ReleaseComObject(newFeatureClass);
newFeatureClass = null;
}
}
}
public bool MDBFc2FcGDB(IFeatureClass pInFeatureClass, IWorkspace pOutWorkspace, string poutFatureName, string pOutDataSetName = null, IQueryFilter queryFilter = null)
{
try
{
if (pInFeatureClass == null || pOutWorkspace == null || string.IsNullOrEmpty(poutFatureName)) return false;
IFeatureClassName pInFeatureclassName;
IDataset pIndataset;
pIndataset = (IDataset)pInFeatureClass;
pInFeatureclassName = (IFeatureClassName)pIndataset.FullName;
IFeatureClassName pOutFeatureClassName;
IDatasetName pOutDatasetName;
IDataset pOutDataset;
pOutDataset = (IDataset)pOutWorkspace;
IEnumDatasetName dataset = pOutWorkspace.get_DatasetNames(esriDatasetType.esriDTFeatureDataset);
while ((pOutDatasetName = dataset.Next()) != null)
{
if (pOutDatasetName.Name == pOutDataSetName)
{
break;
}
}
pOutFeatureClassName = new FeatureClassNameClass() { Name = poutFatureName };
if (pOutDatasetName == null)
{
pOutDatasetName = (IDatasetName)pOutFeatureClassName;
pOutDatasetName.WorkspaceName = (IWorkspaceName)pOutDataset.FullName;
pOutDatasetName.Name = poutFatureName;
}
pOutFeatureClassName.FeatureDatasetName = pOutDatasetName;
IFields pInFields;
IFieldChecker pFieldChecker = new FieldCheckerClass();
pInFields = pInFeatureClass.Fields;
//pOutFields
pFieldChecker.Validate(pInFields, out IEnumFieldError pError, out IFields pOutFields);
Console.WriteLine(pError);
IFeatureDataConverter one2another = new FeatureDataConverterClass();
try
{
if (pOutWorkspace.Type == esriWorkspaceType.esriRemoteDatabaseWorkspace)
{
one2another.ConvertFeatureClass(pInFeatureclassName, null, null, pOutFeatureClassName, null, pOutFields, "", 1000, 0);
}
else
{
one2another.ConvertFeatureClass(pInFeatureclassName, queryFilter, pOutDatasetName as IFeatureDatasetName, pOutFeatureClassName, null, pOutFields, "", 1000, 0);
}
}
finally
{
Marshal.ReleaseComObject(one2another);
}
return true;
}
catch (Exception ex)
{
throw ex;
}
}
public bool GDBFc2FcMDB(IFeatureClass pInFeatureClass, IWorkspace pOutWorkspace, string poutFatureName, string pOutDataSetName = null, IQueryFilter queryFilter = null)
{
try
{
if (pInFeatureClass == null || pOutWorkspace == null || string.IsNullOrEmpty(poutFatureName)) return false;
IFeatureClassName pInFeatureclassName;
IDataset pIndataset;
pIndataset = (IDataset)pInFeatureClass;
pInFeatureclassName = (IFeatureClassName)pIndataset.FullName;
IFeatureClassName pOutFeatureClassName;
IDatasetName pOutDatasetName;
IDataset pOutDataset;
pOutDataset = (IDataset)pOutWorkspace;
IEnumDatasetName dataset = pOutWorkspace.get_DatasetNames(esriDatasetType.esriDTFeatureDataset);
while ((pOutDatasetName = dataset.Next()) != null)
{
if (pOutDatasetName.Name == pOutDataSetName)
{
break;
}
}
pOutFeatureClassName = new FeatureClassNameClass() { Name = poutFatureName };
if (pOutDatasetName == null)
{
pOutDatasetName = (IDatasetName)pOutFeatureClassName;
pOutDatasetName.WorkspaceName = (IWorkspaceName)pOutDataset.FullName;
pOutDatasetName.Name = poutFatureName;
}
pOutFeatureClassName.FeatureDatasetName = pOutDatasetName;
IFields pInFields, pOutFields;
IFieldChecker pFieldChecker = new FieldCheckerClass();
IEnumFieldError pError;
pInFields = pInFeatureClass.Fields;
//pOutFields
pFieldChecker.Validate(pInFields, out pError, out pOutFields);
Console.WriteLine(pError);
IFeatureDataConverter one2another = new FeatureDataConverterClass();
try
{
if (pOutWorkspace.Type == esriWorkspaceType.esriRemoteDatabaseWorkspace)
{
one2another.ConvertFeatureClass(pInFeatureclassName, null, null, pOutFeatureClassName, null,
pOutFields, "", 1000, 0);
}
else
{
one2another.ConvertFeatureClass(pInFeatureclassName, queryFilter, pOutDatasetName as IFeatureDatasetName, pOutFeatureClassName, null, pOutFields, "", 1000, 0);
}
}
finally
{
Marshal.ReleaseComObject(one2another);
}
return true;
}
catch (Exception ex)
{
throw ex;
}
}
private void BtnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}

@ -1,51 +0,0 @@
<windows:BaseWindow
xmlns:windows="clr-namespace:KGIS.Framework.Utils;assembly=KGIS.Framework.Utils"
x:Class="Kingo.Plugin.DataLoad.View.FrmLoadProjectData"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
xmlns:kuiBtn="clr-namespace:KUI.Button;assembly=KUI"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
mc:Ignorable="d" Width="600" Height="220">
<Grid Background="White" >
<Grid.RowDefinitions>
<RowDefinition Height="55"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<dxlc:LayoutControl Orientation="Vertical" Width="600" Grid.Row="0" Grid.ColumnSpan="3">
<dxlc:LayoutGroup Orientation="Horizontal">
<Label Content="数据覆盖目录:" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="14"/>
<dxe:TextEdit x:Name="btnPrjDir" Height="30" IsReadOnly="True" Margin="5,0,0,0"/>
<kuiBtn:KImgButton x:Name="btnSelectedPrjDir" Content="选 择" Width="80" Height="30" CornerRadius="3" Click="BtnSelectedOtherData_Click"/>
</dxlc:LayoutGroup>
</dxlc:LayoutControl>
<dxlc:LayoutItem Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalContentAlignment="Center">
<dxe:CheckEdit x:Name="cbOverlayBGData" Content="变更数据"/>
</dxlc:LayoutItem>
<dxlc:LayoutItem Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" HorizontalContentAlignment="Center">
<dxe:CheckEdit x:Name="cbOverlayZLData" Content="增量数据" IsChecked="True"/>
</dxlc:LayoutItem>
<dxlc:LayoutItem Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" HorizontalContentAlignment="Center">
<dxe:CheckEdit x:Name="cbOverlayNMData" Content="年末数据"/>
</dxlc:LayoutItem>
<dxlc:LayoutItem Grid.Row="2" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Center">
<TextBlock Text=" 注:可以将其他工程目录下的所有数据加载到软件中,进行数据排查" TextWrapping="Wrap" Foreground="Red" ></TextBlock>
</dxlc:LayoutItem>
<dxlc:LayoutItem Grid.Row="3" Grid.ColumnSpan="3" VerticalAlignment="Center" HorizontalContentAlignment="Center">
<StackPanel Orientation="Horizontal">
<kuiBtn:KImgButton x:Name="btnDele" Content="清 除" Width="80" Height="30" CornerRadius="3" Margin="10,10" Foreground="White" Click="BtnDele_Click" />
<kuiBtn:KImgButton x:Name="btnLoad" Content="加 载" Width="80" Height="30" CornerRadius="3" Margin="10,10" Foreground="White" Click="BtnLoad_Click" />
<kuiBtn:KImgButton x:Name="btnClose" Content="取 消" Width="80" Height="30" CornerRadius="3" Margin="10,10" Foreground="White" Click="BtnClose_Click" />
</StackPanel>
</dxlc:LayoutItem>
</Grid>
</windows:BaseWindow>

@ -1,176 +0,0 @@
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;
using KGIS.Framework.AE;
using KGIS.Framework.AE.Enum;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Dialog;
using KGIS.Framework.Utils.Helper;
using KUI.Windows;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Windows;
namespace Kingo.Plugin.DataLoad.View
{
/// <summary>
/// 覆盖工程数据 的交互逻辑
/// </summary>
public partial class FrmLoadProjectData : BaseWindow
{
public FrmLoadProjectData()
{
InitializeComponent();
this.Title = "覆盖工程数据";
}
private string SelectPathName = string.Empty;
private readonly List<string> ZLlays = new List<string>() { "DLTBGX", "DLTBGXGC", "CZCDYDGX", "CZCDYDGXGC", "CZCDYDGX", "CJDCQGX", "CJDCQJXGX", "CJDCQGXGC", "XZQGX", "XZQJXGX", "XZQGXGC", "TTQGX", "LMFWGX", "GCHZZGX", "GFBQGX", "GDDBGX", "CCWJQGX", "PDTGX" };
private void BtnSelectedOtherData_Click(object sender, RoutedEventArgs e)
{
try
{
FolderBrowserDialog m_Dialog = new FolderBrowserDialog();
System.Windows.Forms.DialogResult result = m_Dialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.Cancel) return;
string m_Dir = m_Dialog.SelectedPath.Trim();
SelectPathName = m_Dir;
this.btnPrjDir.Text = m_Dir;//工程路径
}
catch (Exception ex)
{
LogAPI.Debug("新建工程页面中-选择工程目录时失败,异常原因: " + ex + " ; ");
MessageHelper.ShowTips("操作异常:" + ex.Message);
}
}
private void BtnLoad_Click(object sender, RoutedEventArgs e)
{
IWorkspaceAPI s_WsAPI = null;
IFeatureClassAPI TempFCApi = null;
try
{
this.ShowLoading("正在进行数据覆盖中.......", 0, 0);
IFeatureLayer ImproDataLayer;
if (cbOverlayBGData.IsChecked == true)
{
this.UpdateMsg($"正在进行DLTBBG数据覆盖中.......");
s_WsAPI = new WorkspaceAPI(System.IO.Path.Combine(SelectPathName, "BGDB.gdb"), WorkspaceTypeEnum.GDBFile, true);
ImproDataLayer = KGIS.Framework.Maps.MapsManager.Instance.MapService.GetFeatureLayerByName("DLTBBG");
if (ImproDataLayer != null && ImproDataLayer.FeatureClass != null)
(ImproDataLayer.FeatureClass as FeatureClass).Workspace.ExecuteSQL("Delete From DLTBBG WHERE 1=1");
TempFCApi = s_WsAPI.OpenFeatureClass2("DLTBBG");
if (TempFCApi != null && s_WsAPI != null)
TempFCApi.FcToFc(ImproDataLayer.FeatureClass, null, false);
}
ImproDataLayer = null;
TempFCApi = null;
s_WsAPI = null;
if (cbOverlayZLData.IsChecked == true)
{
s_WsAPI = new WorkspaceAPI(System.IO.Path.Combine(SelectPathName, "ZLDB.gdb"), WorkspaceTypeEnum.GDBFile, true);
if (s_WsAPI == null) ZLlays.Clear();
foreach (var item in ZLlays)
{
this.UpdateMsg($"正在进行{item}数据覆盖中.......");
ImproDataLayer = KGIS.Framework.Maps.MapsManager.Instance.MapService.GetFeatureLayerByName(item);
if (ImproDataLayer == null) continue;
if (ImproDataLayer != null && ImproDataLayer.FeatureClass != null)
(ImproDataLayer.FeatureClass as FeatureClass).Workspace.ExecuteSQL($"Delete From {item} WHERE 1=1");
TempFCApi = s_WsAPI.OpenFeatureClass2(item);
if (TempFCApi != null && ImproDataLayer.FeatureClass != null && TempFCApi.FeatureClass.FeatureCount(null) != 0)
TempFCApi.FcToFc(ImproDataLayer.FeatureClass, null, false);
TempFCApi = null;
}
}
ImproDataLayer = null;
s_WsAPI = null;
if (cbOverlayNMData.IsChecked == true)
{
this.UpdateMsg($"正在进行DLTB_NMK数据覆盖中.......");
s_WsAPI = new WorkspaceAPI(System.IO.Path.Combine(SelectPathName, "NMDB.gdb"), WorkspaceTypeEnum.GDBFile, true);
ImproDataLayer = KGIS.Framework.Maps.MapsManager.Instance.MapService.GetFeatureLayerByName("DLTB_NMK");
if (ImproDataLayer != null)
{
if (ImproDataLayer != null && ImproDataLayer.FeatureClass != null)
(ImproDataLayer.FeatureClass as FeatureClass).Workspace.ExecuteSQL("Delete From DLTB_NMK WHERE 1=1");
TempFCApi = s_WsAPI.OpenFeatureClass2("DLTB_NMK");
if (TempFCApi != null && s_WsAPI != null)
TempFCApi.FcToFc(ImproDataLayer.FeatureClass, null, false);
}
}
this.CloseLoading();
MessageHelper.ShowTips("覆盖数据成功!");
}
catch (Exception ex)
{
this.CloseLoading();
LogAPI.Debug("覆盖数据异常:" + ex);
MessageHelper.ShowTips("覆盖数据异常:" + ex.Message);
}
finally
{
this.CloseLoading();
s_WsAPI?.CloseWorkspace();
TempFCApi?.CloseFeatureClass();
}
}
private void BtnClose_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void BtnDele_Click(object sender, RoutedEventArgs e)
{
IFeatureLayer DeleDataLayer = null;
try
{
if (cbOverlayBGData.IsChecked == false && cbOverlayZLData.IsChecked == false && cbOverlayNMData.IsChecked == false)
{
MessageHelper.ShowTips("清除数据至少勾选一项进行清除!");
return;
}
this.ShowLoading("正在进行数据清除中.......", 0, 0);
if (cbOverlayBGData.IsChecked == true)
{
this.UpdateMsg($"正在进行DLTBBG数据清除中.......");
DeleDataLayer = KGIS.Framework.Maps.MapsManager.Instance.MapService.GetFeatureLayerByName("DLTBBG");
if (DeleDataLayer != null && DeleDataLayer.FeatureClass != null)
(DeleDataLayer.FeatureClass as FeatureClass).Workspace.ExecuteSQL("Delete From DLTBBG WHERE 1=1");
}
if (cbOverlayZLData.IsChecked == true)
{
foreach (var item in ZLlays)
{
this.UpdateMsg($"正在进行{item}数据清除中.......");
DeleDataLayer = KGIS.Framework.Maps.MapsManager.Instance.MapService.GetFeatureLayerByName(item);
if (DeleDataLayer != null && DeleDataLayer.FeatureClass != null)
(DeleDataLayer.FeatureClass as FeatureClass).Workspace.ExecuteSQL($"Delete From {item} WHERE 1=1");
}
}
if (cbOverlayNMData.IsChecked == true)
{
this.UpdateMsg($"正在进行DLTB_NMK数据清除中.......");
DeleDataLayer = KGIS.Framework.Maps.MapsManager.Instance.MapService.GetFeatureLayerByName("DLTB_NMK");
if (DeleDataLayer != null && DeleDataLayer.FeatureClass != null)
(DeleDataLayer.FeatureClass as FeatureClass).Workspace.ExecuteSQL("Delete From DLTB_NMK WHERE 1=1");
}
this.CloseLoading();
KGIS.Framework.Maps.MapsManager.Instance.MapService.getAxMapControl().ActiveView.Refresh();
MessageHelper.ShowTips("清除数据结束!");
}
catch (Exception ex)
{
this.CloseLoading();
PluginServiceInterface.CommonHelper.RecordsErrLog("数据覆盖-清除数据异常", ex);
MessageHelper.ShowTips("清除数据异常:" + ex.Message);
}
finally
{
if (DeleDataLayer != null && DeleDataLayer.FeatureClass != null)
Marshal.ReleaseComObject(DeleDataLayer);
}
}
}
}

@ -1,52 +0,0 @@
<windows:BaseWindow
xmlns:windows="clr-namespace:KGIS.Framework.Utils;assembly=KGIS.Framework.Utils"
x:Class="Kingo.Plugin.DataLoad.View.FrmSJTQ"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:kuiBtn="clr-namespace:KUI.Button;assembly=KUI"
mc:Ignorable="d" Title="初始化变更范围" ResizeMode="NoResize"
Height="270" Width="430" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="35"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" x:Name="SelectLayer" Margin="20,10,20,10" VerticalAlignment="Center" Orientation="Horizontal">
<Label VerticalAlignment="Center" HorizontalAlignment="Center">数据来源图层:</Label>
<dxe:ComboBoxEdit x:Name="SeleComboxLayer" Width="270" Height="30" IsReadOnly="True">
<dxe:ComboBoxEditItem >地类图斑</dxe:ComboBoxEditItem>
</dxe:ComboBoxEdit>
</StackPanel>
<WrapPanel Grid.Row="1" Margin="10">
<RadioButton x:Name="rbXZ" Content="按照(乡镇)行政区范围提取" Margin="10,0" VerticalAlignment="Center" HorizontalAlignment="Center" GroupName="1" Checked="RadioButton_Checked">
</RadioButton>
<StackPanel x:Name="spCbx" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<dxe:ComboBoxEdit x:Name="ComboxSelXZQ" Height="30" Width="170" VerticalAlignment="Center" IsTextEditable="False">
<dxe:ComboBoxEdit.StyleSettings>
<dxe:CheckedComboBoxStyleSettings />
</dxe:ComboBoxEdit.StyleSettings>
</dxe:ComboBoxEdit>
</StackPanel>
</WrapPanel>
<RadioButton Grid.Row="2" x:Name="rbALL" Margin="20,10" Content="提取全部基础地类图斑数据" GroupName="1" Checked="RadioButton_Checked"/>
<StackPanel Grid.Row="3" Orientation="Horizontal">
<TextBlock Margin="20,0" Text="注:选择地类图斑来作为提取图层,可根据条件来提取部分或者全部的地类图斑数据。" TextWrapping="Wrap" Width="390" Foreground="Red" ></TextBlock>
</StackPanel>
<Grid Grid.Row="4" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="10">
<kuiBtn:KImgButton x:Name="btnOK" Content="提取图斑" Width="70" Height="30" CornerRadius="3" Margin="0,0,90,0" Foreground="White" Click="BtnTBTQ_Click" />
<kuiBtn:KImgButton x:Name="btnCanel" Content="关 闭" Width="70" Height="30" CornerRadius="3" Margin="90,0,0,0" Foreground="White" Click="BtnCanel_Click" />
</Grid>
<StackPanel VerticalAlignment="Top" HorizontalAlignment="Center" Orientation="Horizontal">
<Label Name="lblResult" Foreground="Red"></Label>
</StackPanel>
</Grid>
</windows:BaseWindow>

@ -1,600 +0,0 @@
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;
using KGIS.Framework.AE;
using KGIS.Framework.AE.GPHelper;
using KGIS.Framework.Maps;
using KGIS.Framework.Platform;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.ExtensionMethod;
using KGIS.Framework.Utils.Helper;
using Kingo.PluginServiceInterface;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using KUI.Windows;
namespace Kingo.Plugin.DataLoad.View
{
/// <summary>
/// 初始化图斑变更 的交互逻辑
/// </summary>
public partial class FrmSJTQ : BaseWindow
{
/// <summary>
/// 是否乡镇提取
/// </summary>
private bool _isXz = false;
/// <summary>
/// 坐落单位字典
/// </summary>
private List<DataDicTionary> ZLDMdataDic = null;
private List<DataDicTionary> DLBMDics = null;
public FrmSJTQ()
{
InitializeComponent();
rbXZ.IsChecked = true;
InitData();
}
private void InitData()
{
ProjectInfo info = (MapsManager.Instance.CurrProjectInfo as ProjectInfo);
//行政区下拉框绑定值
ComboxSelXZQ.ItemsSource = GetZLDWDMList().Values;
//默认-地类图斑
SeleComboxLayer.SelectedIndex = 0;
DLBMDics = Platform.Instance.DicHelper.GetDic(DicTypeEnum.DLBM);
}
/// <summary>
/// 是否禁用乡镇下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void RadioButton_Checked(object sender, RoutedEventArgs e)
{
RadioButton radioButton = sender as RadioButton;
if (radioButton.Content.ToString() == "提取全部基础地类图斑数据")
{
_isXz = false;
ComboxSelXZQ.IsEnabled = false;
}
else
{
_isXz = true;
ComboxSelXZQ.IsEnabled = true;
}
}
/// <summary>
/// 图层改变事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SeleComboxLayer_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (SeleComboxLayer.SelectedIndex.ToString() == "0")
{
rbXZ.IsEnabled = false;
rbALL.IsEnabled = false;
ComboxSelXZQ.IsEnabled = false;
}
else
{
rbXZ.IsEnabled = true;
rbALL.IsEnabled = true;
ComboxSelXZQ.IsEnabled = true;
if (rbALL.IsChecked == true)
ComboxSelXZQ.IsEnabled = false;
}
}
/// <summary>
/// 提取图斑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void BtnTBTQ_Clic(object sender, RoutedEventArgs e)
{
btnOK.IsEnabled = false;
btnCanel.IsEnabled = false;
try
{
//IFeatureClass jctbFC = MapsManager.Instance.MapService.GetFeatureClassByName("JCTB");
string SelIndex = SeleComboxLayer.SelectedIndex.ToString();
if (ComboxSelXZQ.SelectedItems.Count <= 0 && _isXz)
{
MessageHelper.ShowTips("请选择乡镇数据!");
return;
}
IFeatureClass TargetFC = MapsManager.Instance.MapService.GetFeatureClassByName("DLTBBG");
IFeatureLayer tempBG_Layer = GeoDBAPI.CreateFeatureLayerInmemeory("TempBG", "TempBG", (TargetFC as IGeoDataset).SpatialReference, TargetFC.ShapeType, TargetFC.Fields);
ITable pTable = TargetFC as ITable;
if (pTable.RowCount(null) != 0)
{
System.Windows.Forms.DialogResult result = MessageHelper.ShowYesNoCancelAndTips("变更图斑层数据不为空,是否清空现有数据?");
if (result == System.Windows.Forms.DialogResult.Yes)
{
pTable.DeleteSearchedRows(null);
}
else if (result == System.Windows.Forms.DialogResult.Cancel)
{
return;
}
}
this.ShowLoading("正在进行数据提取~", 0, 0);
int SJLYIndex = TargetFC.FindField("SJLY");
int BGTBYBHIndex = TargetFC.FindField("TBYBH");
int BGDLBMIndex = TargetFC.FindField("DLBM");
int BGDLMCIndex = TargetFC.FindField("DLMC");
if (SelIndex == "0")
{
#region 地类图斑提取数据
IFeatureClassAPI fCAPI_JCDLTB = new FeatureClassAPI(MapsManager.Instance.MapService.GetFeatureLayerByLayerName("地类图斑").FeatureClass);
string currentAppPath = SysAppPath.GetCurrentAppPath();
string templeteGDBPath = Path.Combine(currentAppPath, "Template", "TempGDB.gdb");
string resultPath = Path.Combine(currentAppPath, "Temp\\Temp_TQBGTB");
string savePath = Path.Combine(resultPath, Guid.NewGuid().ToString() + ".gdb");
DelectDir(resultPath);
CopyDirectory(templeteGDBPath, savePath, true);
WorkspaceAPI workspaceAPI_Temp = new WorkspaceAPI(savePath, KGIS.Framework.AE.Enum.WorkspaceTypeEnum.GDBFile, true);
IQueryFilter queryFilter = new QueryFilterClass();
if (_isXz)
{
string where = string.Empty;
if (GetZLDWDMList().Count != ComboxSelXZQ.SelectedItems.Count)
{
foreach (var item in ComboxSelXZQ.SelectedItems)
{
where += string.Format(" ZLDWDM like '{0}%' or", item.ToString().Split('_')[0].Substring(0, 9));
}
where = where.Substring(0, where.Length - 2);
queryFilter.WhereClause = where;
}
fCAPI_JCDLTB.FcToFc(tempBG_Layer.FeatureClass, queryFilter, false);
}
else
{
fCAPI_JCDLTB.FcToFc(tempBG_Layer.FeatureClass, null, false);
}
IFeatureLayer JCTBFL = MapsManager.Instance.MapService.GetFeatureLayerByName("JCTB");
if (JCTBFL.FeatureClass.FeatureCount(null) == 0)//无监测图斑直接提取
{
fCAPI_JCDLTB.FcToFc(TargetFC, queryFilter, false);
this.CloseLoading();
MessageHelper.ShowTips("提取完成!");
return;
}
IFeatureLayer SelectFeatureLayer = null;
GPParamClass gPParamClass = new GPParamClass
{
Tolerance = "0.0001",
FirstFeatureLayer = JCTBFL,
SecondFeatureLayer = tempBG_Layer,
IsGetOutPutFeature = true,
Overlap_type = "INTERSECT"
};
GeoprocessorHelper.SelectLayerByLocationAnalysis(gPParamClass, ref SelectFeatureLayer);
//基础图斑与监测图斑相交,
IFeatureLayer featureLayer = null;
gPParamClass = new GPParamClass
{
FirstFeatureLayer = tempBG_Layer,
SecondFeatureLayer = new FeatureLayerClass() { FeatureClass = JCTBFL.FeatureClass },
OutFeatureClassPath = savePath + "\\DLTBGX_UNION",
IsGetOutPutFeature = true
};
GeoprocessorHelper.UnionAnalysis(gPParamClass, ref featureLayer);
int indexBsm = featureLayer.FeatureClass.FindField("BSM");
int indexBSM = tempBG_Layer.FeatureClass.FindField("BSM");
StringBuilder stringBuilder = new StringBuilder();
StringBuilder JCOIDSBuilder = new StringBuilder();
StringBuilder JCSJLYBuilder = new StringBuilder();
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
Dictionary<string, string> JCValuePairs = new Dictionary<string, string>();
ICursor pCur = null;
IRow pRow = null;
IQueryDef pQDef = ((featureLayer.FeatureClass as FeatureClass).Workspace as IFeatureWorkspace).CreateQueryDef();
pQDef.Tables = "DLTBGX_UNION";
pQDef.WhereClause = " 1=1 AND FID_JCTB<>-1 AND BSM<>'' AND SHAPE_Area>=10.0 ";
pQDef.SubFields = "FID_JCTB,BSM,TBBH,FID_TempBG";
pCur = pQDef.Evaluate();
while ((pRow = pCur.NextRow()) != null)
{
//存储监测图斑OIDS
JCOIDSBuilder.Append(string.Format("{0},", pRow.get_Value(0).ToString()));
//存储基础库图斑OIDS
stringBuilder.Append(string.Format("{0},", pRow.get_Value(3).ToString()));
if (!string.IsNullOrWhiteSpace(pRow.get_Value(2).ToString()))
{
if (!keyValuePairs.ContainsKey(pRow.get_Value(1).ToString()))
{
//存储BSM和监测编号
keyValuePairs[pRow.get_Value(1).ToString()] = pRow.get_Value(2).ToString();
//存储BSM和监测OIDS
JCValuePairs[pRow.get_Value(1).ToString()] = pRow.get_Value(0).ToString();
}
else
{
//单个BSM对应多个JCBH
if (!keyValuePairs[pRow.get_Value(1).ToString()].Contains(pRow.get_Value(2).ToString()))
keyValuePairs[pRow.get_Value(1).ToString()] += "," + pRow.get_Value(2).ToString();
}
}
Marshal.ReleaseComObject(pRow);
}
Marshal.ReleaseComObject(pCur);
//擦除变更层中监测图斑
IFeatureClassAPI JC_FcAPI = new FeatureClassAPI(JCTBFL.FeatureClass);
IFeatureLayer jctb_Layer = GeoDBAPI.CreateFeatureLayerInmemeory("JCTBTemp", "JCTBTempData", (JCTBFL.FeatureClass as IGeoDataset).SpatialReference, JCTBFL.FeatureClass.ShapeType, JCTBFL.FeatureClass.Fields);
//与基础库图斑相交上的监测图斑
if (JCOIDSBuilder.Length > 0)
JC_FcAPI.FcToFc(jctb_Layer.FeatureClass, new QueryFilterClass() { WhereClause = string.Format("OBJECTID in({0}) ", JCOIDSBuilder.ToString().Trim(',')) }, false);
else
JC_FcAPI.FcToFc(jctb_Layer.FeatureClass, null, false);
//上一步生成的变更图斑擦除监测图斑
IFeatureLayer pdltbbgFeatureLayer = null;
gPParamClass = new GPParamClass
{
FirstFeatureLayer = tempBG_Layer,
SecondFeatureLayer = jctb_Layer,
OutFeatureClassPath = savePath + "\\" + "TempDLTBBG",
IsGetOutPutFeature = true
};
GeoprocessorHelper.EraseAnalysis(gPParamClass, ref pdltbbgFeatureLayer);
IFeatureLayer TempTBBG_Erase = null;
gPParamClass = new GPParamClass
{
FirstFeatureLayer = pdltbbgFeatureLayer,
OutFeatureClassPath = savePath + "\\" + "TempTBBG_Erase",
IsGetOutPutFeature = true
};
GeoprocessorHelper.MultipartToSinglePath(gPParamClass, ref TempTBBG_Erase);
IFeatureClassAPI Tebgfc_API = new FeatureClassAPI(TempTBBG_Erase.FeatureClass);
queryFilter.WhereClause = " SHAPE_Area >= 0.1";
Tebgfc_API.FcToFc(TargetFC, queryFilter, false);
IFeatureLayer featureLayer_Intercet = null;
gPParamClass = new GPParamClass
{
FirstFeatureLayer = tempBG_Layer,
SecondFeatureLayer = jctb_Layer,
Tolerance = "0.0001",
IsGetOutPutFeature = true,
OutFeatureClassPath = savePath + "\\" + "TempTBBG_Intersect",
};
GeoprocessorHelper.IntersectAnalysis(gPParamClass, ref featureLayer_Intercet);
int Index_JCTBYBH = featureLayer_Intercet.FeatureClass.FindField("TBYBH");
int Index_JCBH = featureLayer_Intercet.FeatureClass.FindField("TBBH");
int Index_JCSJLY = featureLayer_Intercet.FeatureClass.FindField("SJLY");
ITable table_JC = featureLayer_Intercet.FeatureClass as ITable;
ICursor cursor_JC = table_JC.Update(null, true);
IRow row_JC = null;
while ((row_JC = cursor_JC.NextRow()) != null)
{
row_JC.Value[Index_JCTBYBH] = row_JC.Value[Index_JCBH];
row_JC.Value[Index_JCSJLY] = "1";
cursor_JC.UpdateRow(row_JC);
}
cursor_JC.Flush();
IFeatureClassAPI Tejcfc_API = new FeatureClassAPI(featureLayer_Intercet.FeatureClass);
Tejcfc_API.FcToFc(TargetFC, null, false);
//根据变更BSM修改数据来源
//if (JCSJLYBuilder.Length != 0)
// (TargetFC as FeatureClass).Workspace.ExecuteSQL(string.Format("Update DLTBBG set SJLY = '1' WHERE BSM IN({0})", JCSJLYBuilder.ToString().TrimEnd(',')));
if (null != featureLayer)
Marshal.FinalReleaseComObject(featureLayer);
if (TargetFC != null)
Marshal.FinalReleaseComObject(TargetFC);
if (tempBG_Layer != null)
Marshal.FinalReleaseComObject(tempBG_Layer);
if (jctb_Layer != null)
Marshal.FinalReleaseComObject(jctb_Layer);
if (featureLayer_Intercet != null)
Marshal.FinalReleaseComObject(featureLayer_Intercet);
#endregion
}
this.CloseLoading();
MessageHelper.ShowTips("提取完成!");
}
catch (Exception ex)
{
MessageHelper.ShowTips(ex.Message);
LogAPI.Debug(ex.Message);
this.CloseLoading();
}
finally
{
btnOK.IsEnabled = true;
btnCanel.IsEnabled = true;
}
}
private void BtnTBTQ_Click(object sender, RoutedEventArgs e)
{
btnOK.IsEnabled = false;
btnCanel.IsEnabled = false;
IFeatureLayer featureLayer = null;
IFeatureLayer tempBG_Layer = null;
ICursor pCur = null;
try
{
string SelIndex = SeleComboxLayer.SelectedIndex.ToString();
if (ComboxSelXZQ.SelectedItems.Count <= 0 && _isXz)
{
MessageHelper.ShowTips("请选择乡镇数据!");
return;
}
IFeatureClass TargetFC = MapsManager.Instance.MapService.GetFeatureClassByName("DLTBBG");
tempBG_Layer = GeoDBAPI.CreateFeatureLayerInmemeory("TempBG", "TempBG", (TargetFC as IGeoDataset).SpatialReference, TargetFC.ShapeType, TargetFC.Fields);
ITable pTable = TargetFC as ITable;
if (pTable.RowCount(null) != 0)
{
System.Windows.Forms.DialogResult result = MessageHelper.ShowYesNoCancelAndTips("变更图斑层数据不为空,是否清空现有数据?");
if (result == System.Windows.Forms.DialogResult.Yes)
{
pTable.DeleteSearchedRows(null);
}
else if (result == System.Windows.Forms.DialogResult.Cancel)
{
return;
}
}
this.ShowLoading("正在进行数据提取~", 0, 0);
int SJLYIndex = TargetFC.FindField("SJLY");
int BGTBYBHIndex = TargetFC.FindField("TBYBH");
int BGDLBMIndex = TargetFC.FindField("DLBM");
int BGDLMCIndex = TargetFC.FindField("DLMC");
if (SelIndex == "0")
{
#region 地类图斑提取数据
IFeatureClassAPI fCAPI_JCDLTB = new FeatureClassAPI(MapsManager.Instance.MapService.GetFeatureLayerByLayerName("地类图斑").FeatureClass);
string currentAppPath = SysAppPath.GetCurrentAppPath();
string templeteGDBPath = Path.Combine(currentAppPath, "Template", "TempGDB.gdb");
string resultPath = Path.Combine(currentAppPath, "Temp\\Temp_TQBGTB");
string savePath = Path.Combine(resultPath, Guid.NewGuid().ToString() + ".gdb");
DelectDir(resultPath);
CopyDirectory(templeteGDBPath, savePath, true);
WorkspaceAPI workspaceAPI_Temp = new WorkspaceAPI(savePath, KGIS.Framework.AE.Enum.WorkspaceTypeEnum.GDBFile, true);
IQueryFilter queryFilter = new QueryFilterClass();
if (_isXz)
{
string where = string.Empty;
if (GetZLDWDMList().Count != ComboxSelXZQ.SelectedItems.Count)
{
foreach (var item in ComboxSelXZQ.SelectedItems)
{
where += string.Format(" ZLDWDM like '{0}%' or", item.ToString().Split('_')[0].Substring(0, 9));
}
where = where.Substring(0, where.Length - 2);
queryFilter.WhereClause = where;
}
fCAPI_JCDLTB.FcToFc(tempBG_Layer.FeatureClass, queryFilter, false);
}
else
{
fCAPI_JCDLTB.FcToFc(tempBG_Layer.FeatureClass, null, false);
}
IFeatureLayer JCTBFL = MapsManager.Instance.MapService.GetFeatureLayerByName("JCTB");
if (JCTBFL.FeatureClass.FeatureCount(null) == 0)//无监测图斑直接提取
{
this.CloseLoading();
MessageHelper.ShowTips("监测图斑没有数据!");
return;
}
IFeatureLayer SelectFeatureLayer = null;
GPParamClass gPParamClass = new GPParamClass
{
Tolerance = "0.0001",
FirstFeatureLayer = JCTBFL,
SecondFeatureLayer = tempBG_Layer,
IsGetOutPutFeature = true,
Overlap_type = "INTERSECT"
};
GeoprocessorHelper.SelectLayerByLocationAnalysis(gPParamClass, ref SelectFeatureLayer);
//基础图斑与监测图斑相交,
gPParamClass = new GPParamClass
{
FirstFeatureLayer = tempBG_Layer,
//SecondFeatureLayer = new FeatureLayerClass() { FeatureClass = JCTBFL.FeatureClass },
SecondFeatureLayer = JCTBFL,
OutFeatureClassPath = savePath + "\\DLTBGX_UNION",
IsGetOutPutFeature = true
};
GeoprocessorHelper.UnionAnalysis(gPParamClass, ref featureLayer);
int indexBsm = featureLayer.FeatureClass.FindField("BSM");
int indexBSM = tempBG_Layer.FeatureClass.FindField("BSM");
int DLBMIndex = TargetFC.FindField("DLBM");
StringBuilder JCSJLYBuilder = new StringBuilder();
IRow pRow = null;
IQueryDef pQDef = ((featureLayer.FeatureClass as FeatureClass).Workspace as IFeatureWorkspace).CreateQueryDef();
pQDef.Tables = "DLTBGX_UNION";
pQDef.WhereClause = " 1=1 AND FID_JCTB<>-1 AND BSM<>'' AND SHAPE_Area>=10.0 ";
pQDef.SubFields = "FID_JCTB,BSM,TBBH,FID_TempBG,NYRDDL";//NYRDDL替换当前基础图斑地类
pCur = pQDef.Evaluate();
while ((pRow = pCur.NextRow()) != null)
{
if (!string.IsNullOrWhiteSpace(pRow.get_Value(1).ToString()) && !string.IsNullOrWhiteSpace(pRow.get_Value(4).ToTrim()))
{
if (TargetFC.Fields.Field[DLBMIndex].Length >= pRow.get_Value(4).ToTrim().Length)
{
pRow.Value[DLBMIndex] = pRow.get_Value(4).ToTrim();
pCur.UpdateRow(pRow);
}
}
Marshal.ReleaseComObject(pRow);
}
pCur.Flush();
//if (!string.IsNullOrWhiteSpace(JCSJLYBuilder.ToString().Trim(',')))
queryFilter.WhereClause = " 1=1 AND FID_JCTB<>-1 AND BSM<>'' AND SHAPE_Area>=10.0 ";
////queryFilter.WhereClause = string.Format(" BSM IN({0})", JCSJLYBuilder.ToString().Trim(','));
//else
//{
// MessageHelper.ShowTips("当前未提取到数据!");
// if (null != featureLayer)
// Marshal.FinalReleaseComObject(featureLayer);
// if (tempBG_Layer != null)
// Marshal.FinalReleaseComObject(tempBG_Layer);
// if (pCur != null)
// Marshal.ReleaseComObject(pCur);
// return;
//}
IFeatureClassAPI classAPI = new FeatureClassAPI(featureLayer.FeatureClass);
classAPI.FcToFc(TargetFC, queryFilter, false);
#endregion
}
this.CloseLoading();
MessageHelper.ShowTips("提取完成!");
}
catch (Exception ex)
{
MessageHelper.ShowTips(ex.Message);
LogAPI.Debug(ex.Message);
this.CloseLoading();
}
finally
{
this.CloseLoading();
btnOK.IsEnabled = true;
btnCanel.IsEnabled = true;
if (null != featureLayer)
Marshal.FinalReleaseComObject(featureLayer);
if (tempBG_Layer != null)
Marshal.FinalReleaseComObject(tempBG_Layer);
if (pCur != null)
Marshal.ReleaseComObject(pCur);
}
}
/// <summary>
/// 删除该路径下的所有文件和目录
/// </summary>
/// <param name="srcPath"></param>
public static void DelectDir(string srcPath)
{
try
{
DirectoryInfo dir = new DirectoryInfo(srcPath);
FileSystemInfo[] fileinfo = dir.GetFileSystemInfos(); //返回目录中所有文件和子目录
foreach (FileSystemInfo i in fileinfo)
{
try
{
if (i is DirectoryInfo) //判断是否文件夹
{
DirectoryInfo subdir = new DirectoryInfo(i.FullName);
subdir.Delete(true); //删除子目录和文件
}
else
{
File.Delete(i.FullName); //删除指定文件
}
}
catch (Exception)
{
continue;
}
}
}
catch (Exception ex)
{
LogAPI.Debug(ex + ":此项错误不处理!");//文件占用报错
}
}
/// <summary>
/// 拷贝模板gdb文件夹
/// </summary>
/// <param name="SourcePath"></param>
/// <param name="DestinationPath"></param>
/// <param name="overwriteexisting"></param>
public static void CopyDirectory(string SourcePath, string DestinationPath, bool overwriteexisting)
{
try
{
SourcePath = SourcePath.EndsWith(@"\") ? SourcePath : SourcePath + @"\";
DestinationPath = DestinationPath.EndsWith(@"\") ? DestinationPath : DestinationPath + @"\";
if (Directory.Exists(SourcePath))
{
if (Directory.Exists(DestinationPath) == false)
Directory.CreateDirectory(DestinationPath);
foreach (string fls in Directory.GetFiles(SourcePath))
{
FileInfo flinfo = new FileInfo(fls);
flinfo.CopyTo(DestinationPath + flinfo.Name, overwriteexisting);
}
foreach (string drs in Directory.GetDirectories(SourcePath))
{
DirectoryInfo drinfo = new DirectoryInfo(drs);
CopyDirectory(drs, DestinationPath + drinfo.Name, overwriteexisting);
}
}
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 获取行政区代码及名称
/// </summary>
/// <param name="featureBG"></param>
/// <returns></returns>
private Dictionary<string, string> GetZLDWDMList()
{
try
{
ZLDMdataDic = Platform.Instance.DicHelper.GetNoGroupDic(DicTypeEnum.QSDM);
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
if (ZLDMdataDic != null)
{
foreach (var item in ZLDMdataDic.FindAll(x => x.CODE.Length == 9))
{
keyValuePairs[item.CODE] = item.CODE + "_" + item.NAME;
}
}
//验证代码BUG
LogAPI.Debug("获取坐落代码数量:" + keyValuePairs.Count);
return keyValuePairs;
}
catch (Exception ex)
{
LogAPI.Debug("获取坐落代码失败:" + ex.Message);
return null;
}
}
private void BtnCanel_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
}
}

@ -20,7 +20,6 @@ using KGIS.Framework.Platform;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.ExtensionMethod;
using KGIS.Framework.Utils.Helper;
//using KGIS.Framework.Utils.Model;
using KGIS.Framework.Views;
using Kingo.Framework.LayerStyleConvert.Common;
using Kingo.Framework.LayerStyleConvert.XSDClass;
@ -70,11 +69,10 @@ namespace Kingo.Plugin.MapView
/// <summary>
/// 工作目录服务接口
/// </summary>
IDataCatalogService _DataCatalog = null;
IWorkCatalog _workCatalog = null;
//IEngineEditor m_EngineEditor = new EngineEditorClass();
private IElementInfo ucJCTBTree { get; set; }
LayerCfg allLayerInfo = null;
IDataCatalogService _DataCatalog { get; set; }
IWorkCatalog _workCatalog { get; set; }
LayerCfg allLayerInfo { get; set; }
private UCProjectInfoSetting frmUserInfoSetting { get; set; }
public UcMapControl()
@ -94,43 +92,6 @@ namespace Kingo.Plugin.MapView
axMapControl.OnExtentUpdated += AxMapControl_OnExtentUpdated;
if (editor == null)
editor = new EngineEditorClass();
List<int> Listobjid_update = new List<int>();
List<int> Listobjid_insert = new List<int>();
editor.OnStopOperation += () =>
{
#region 变化图斑提取
//添加新的监测图斑时,自动维护相应的属性值
if (projectInfo != null && projectInfo.ProjType == EnumProjType.BHTBTQ)
{
IWorkspaceEdit2 workspaceEdit2 = (IWorkspaceEdit2)editor.EditWorkspace;
IDataChangesEx dataChangesEx = workspaceEdit2.get_EditDataChanges(esriEditDataChangesType.esriEditDataChangesWithinSession);
int featureOID = -1;
IFIDSet fids = dataChangesEx.ChangedIDs["JCTB", esriDifferenceType.esriDifferenceTypeInsert];
fids.Next(out featureOID);
while (featureOID != -1)
{
IFeatureLayer pFeatureLayer = MapsManager.Instance.MapService.GetFeatureLayerByName("JCTB");
IFeature feature = pFeatureLayer.FeatureClass.GetFeature(featureOID);
feature.Value[feature.Fields.FindField("XZQDM")] = projectInfo.CODE;
feature.Value[feature.Fields.FindField("XMC")] = GetXZQDic(projectInfo.CODE);
IArea area = feature.ShapeCopy as IArea;
IPoint point = new PointClass();
area.QueryCentroid(point);
if (area.Area > 0)
{
feature.Value[feature.Fields.FindField("XZB")] = point.X;
feature.Value[feature.Fields.FindField("YZB")] = point.Y;
feature.Value[feature.Fields.FindField("JCMJ")] = area.Area > 0 ? (area.Area / 666.7).ToDouble(2) : 0;
feature.Store();
}
Marshal.FinalReleaseComObject(feature);
feature = null;
fids.Next(out featureOID);
}
Marshal.FinalReleaseComObject(fids);
}
#endregion
};
panel1.MouseWheel += MapCtrlContainer_MouseWheel;
dockManager = dockManager1;
Platform.Instance.NotifyMsgEven2 += o =>
@ -158,52 +119,14 @@ namespace Kingo.Plugin.MapView
try
{
StrTig = o.Content.ToTrim();
axMapControl.ActiveView.Extent = o.Extend as IEnvelope;// MapsManager.Instance.MapService.getAxMapControl().Extent;
axMapControl.ActiveView.Extent = o.Extend as IEnvelope;
axMapControl.ActiveView.Refresh();
}
catch { }
}
};
}
/// <summary>
/// 根据区划代码获取县级名称
/// </summary>
/// <param name="Codes"></param>
/// <returns></returns>
public string GetXZQDic(string Codes)
{
IRDBHelper rdbHelper = null;
string CodeName = string.Empty;
try
{
string systemPath = SysAppPath.GetDataBasePath() + "System.mdb";
if (File.Exists(systemPath))
{
string connStr = SysConfigsOprator.GetDBConnectionByName("MDBOledbConnection");
connStr = string.Format(connStr, systemPath);
rdbHelper = RDBFactory.CreateDbHelper(connStr, DatabaseType.MSAccess);
string strSQL = "select OBJECTID AS ID, XZQ AS CODE,XZQMC AS NAME from XZQ Where XZQ LIKE '" + Codes + "%'";
DataTable dt = rdbHelper.ExecuteDatatable("Dic", strSQL, true);
if (dt != null)
{
CodeName = dt.Rows[0]["NAME"].ToString();
}
}
}
catch (Exception ex)
{
LogAPI.Debug(ex.Message);
LogAPI.Debug(ex.StackTrace);
}
finally
{
if (rdbHelper != null)
{
rdbHelper.DisConnect();
}
}
return CodeName;
}
private void AddMask()
{
try
@ -238,10 +161,11 @@ namespace Kingo.Plugin.MapView
}
catch (Exception ex)
{
PluginServiceInterface.CommonHelper.RecordsErrLog("执行AddMask发生异常:", ex);
return;
}
}
private void AxMapControl_OnExtentUpdated(object sender, IMapControlEvents2_OnExtentUpdatedEvent e)
{
if (StrTig != "Map2")
@ -478,7 +402,6 @@ namespace Kingo.Plugin.MapView
return allLayers;
}
/// <summary> 创建菜单项
/// </summary>
/// <param name="itemEntity"></param>
@ -1325,28 +1248,6 @@ namespace Kingo.Plugin.MapView
}
}
private void CreateXml(string path)
{
try
{
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.AppendChild(xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", null));
System.Xml.XmlElement root = xmlDoc.CreateElement("Root");
xmlDoc.AppendChild(root);
System.Xml.XmlElement roots = xmlDoc.CreateElement("File");
roots.SetAttribute("path", path);
root.AppendChild(roots);
xmlDoc.Save(m_XmlPath);
}
catch (Exception ex)
{
LogAPI.Debug("在初始化 目录切换 命令时异常,异常信息如下:");
LogAPI.Debug(ex);
LogAPI.Debug("在初始化 目录切换 命令时异常信息结束");
}
}
#region 接口函数
public void InitMapTools(IEnumerable<MenuPageEntity> pageDatas)
{
@ -1628,7 +1529,7 @@ namespace Kingo.Plugin.MapView
if (Platform.Instance.SystemType != SystemTypeEnum.DTBJK)
{
layerInfo2s.Remove(layerInfo2s[i]);
i--;
i--;
}
continue;
}
@ -1638,7 +1539,7 @@ namespace Kingo.Plugin.MapView
{
if (!Directory.Exists(layerInfo2s[i].FcPath))
{
if(Platform.Instance.SystemType != SystemTypeEnum.DTBJK)
if (Platform.Instance.SystemType != SystemTypeEnum.DTBJK)
{
layerInfo2s.Remove(layerInfo2s[i]);
i--;

Loading…
Cancel
Save