代码如下:
Int32 id=bd_layerNetLine.Selection[0];
if (m_lineRecordset != null)
{
m_lineRecordset.Dispose();
m_lineRecordset = null;
}
m_lineRecordset = bd_pipeNet.Query("SMID = " + id, CursorType.Static);
Datasource datasource = bd_datasource;
m_regionDataset = datasource.Datasets["Region"] as DatasetVector;
BufferAnalystParameter bufferAnalystParam = new BufferAnalystParameter();
bufferAnalystParam.EndType = BufferEndType.Round;
bufferAnalystParam.LeftDistance = m_leftRadius;
bufferAnalystParam.RightDistance = m_rightRadius;
m_bufferDataset=(DatasetVector)datasource.Datasets.CreateFromTemplate(bufferName,m_regionDataset);
Boolean isTrue = SuperMap.Analyst.SpatialAnalyst.BufferAnalyst.CreateBuffer(m_lineRecordset, m_bufferDataset, bufferAnalystParam, false, true);
先在网络数据集中获取点选的线记录集为m_lineRecordset,然后根据模板创建面数据集用来存放缓冲区图层,最后生成缓冲区出错,异常信息为不支持该类型:参数为sourceRecord,即m_lineRecordset 出错。求解。