首页 / 浏览问题 / 组件GIS / 问题详情
选择集转为记录集出错
8EXP 2017年07月22日

报错是:索引超出了数组限制

 private void button5_MouseClick(object sender, MouseEventArgs e)
        {
            //获得被查询的矢量数据集 
            Layers layers = mapControl1.Map.Layers;
            DatasetVector datasetvector = workspace1.Datasources["基础地理信息地形要素分类数据库"].Datasets["一楼"] as DatasetVector;
            //获得地图上选择的几何对象
            Selection[] selection = mapControl1.Map.FindSelection(true);
            Recordset recordset = selection[0].ToRecordset();
            Geometry geometry = recordset.GetGeometry();

            //设定缓冲半径
            double bufferdistance = 50;

            //进行缓冲区查询
            Recordset recordsetresult = datasetvector.Query(geometry, bufferdistance, CursorType.Static);

            //处理查询结果,图形部分高亮显示
            Selection selection1 = new Selection();
            selection1.FromRecordset(recordset);
            layers[0].Selection = selection1;
            mapControl1.Map.Refresh();
        }

请问出现这个问题是什么原因,是数据集导入的问题吗

问题关闭原因: 已解决
...