代码如下:m_checkDataName = "LineNoOverlap-checkpop";
WorkspaceTreeNodeBase node = workspaceControl1.WorkspaceTree.SelectedNode as WorkspaceTreeNodeBase;
WorkspaceTreeNodeDataType type = node.NodeType;
DatasetVector dataset = node.GetData() as DatasetVector;
if(dataset.Type==DatasetType.Line)
{
mapControl1.Map.Layers.Clear();
mapControl1.Map.Layers.Add(dataset, true);
dataset.Datasource.Datasets.Delete(m_bufDatasetName);
DatasetVector m_bufDataset = (DatasetVector)dataset.Datasource.CopyDataset(dataset, m_bufDatasetName, dataset.EncodeType);
TopologyDatasetRelationItem topoItem = new TopologyDatasetRelationItem(m_bufDataset);
TopologyDatasetRelationItem[] items = { topoItem };
// 拓扑预处理,这个需要先调用
// Topology Preprocessing
TopologyValidator.Preprocess(items, 2);
// 检查线相重叠
//Check the topology according to the rule of LineNoOverlap
dataset.Datasource.Datasets.Delete(m_checkDataName);
DatasetVector resultDataset = TopologyValidator.Validate(m_bufDataset, m_bufDataset, TopologyRule.LineNoOverlap, 2, null, dataset.Datasource, m_checkDataName);
报错: