首页 / 浏览问题 / 三维GIS / 问题详情
组件如何实现三维网络分析
66EXP 2017年11月02日
我看了iobject.net 9d三维路径分析的例子,虽然是三维场景,但是路网的网络数据集却是二维的。我想实现三维的网络分析,我在idesktop 9d可以构建三维网络数据集,也可以用网络分析/最短路径功能,但是用iobject.net 9d中SuperMap.Analyst.NetworkAnalyst.Load()时, 出现“不支持该类型
参数名: AnalystSetting.NetworkDataset.Type”,我设置的参数是三维网络数据集,要如何才能用组件如何实现三维网络分析?

2 个回答

您好,三维网络分析需要用到SuperMap.Realspace.NetworkAnalyst命名空间,SuperMap.Analyst.NetworkAnalyst是针对二维网络的分析。
5,560EXP 2017年11月02日
在桌面上做网络分析可以的两个点,用组件代码执行以下ExcuteNetworkAnalyst方法,返回的经IsEmpty=true.请帮忙看下哪里代码有错?

public class NetworkAnalystHelper
    {
        // 用于存储分析所用的网络数据集
        private DatasetVector m_networkDataset;
        private TransportationAnalyst3D m_analyst;
        private TransportationAnalystParameter3D m_analystParameter;
        private bool m_IsInitialized = false;
        public void Initialize(string netDatasetName)
        {
            m_analyst = new TransportationAnalyst3D();
            var workspace = new Workspace();
            m_analystParameter = new TransportationAnalystParameter3D();
            var datasource = workspace.Datasources.Open(LocalVariables.SpatialDatasourceConnectionInfo);
            m_networkDataset = datasource.Datasets[netDatasetName] as DatasetVector;
            m_IsInitialized = true;
        }
        public GeoLine3D ExcuteNetworkAnalyst(Point3D startPoint, Point3D endPoint)
        {
            if (false == m_IsInitialized)
                throw new ArgumentNullException("m_IsInitialized");
            LoadModel();
            SetParameter(startPoint, endPoint);
            var result= BeginNetworkAnalyst(startPoint, endPoint);
            m_IsInitialized = false;
            return result;
        }
        /// <summary>
        /// 进行网络分析分析
        /// </summary>
        private GeoLine3D BeginNetworkAnalyst(Point3D startPoint, Point3D endPoint)
        {
            var analystResult = m_analyst.FindPath(m_analystParameter);
            GeoLine3D line = analystResult.Routes[0];
            var line3D = new GeoLine3D();

            //for (Int32 i = 0; i < line.PartCount; i++)
            //{
            //    line3D.AddPart(line[i].ToPoint3Ds());
            //}
            //line3D[0].Insert(0, new Point3D(startPoint.X, startPoint.Y, 0));
            //line3D[0].Add(new Point3D(endPoint.X, endPoint.Y, 0));
            return line3D;
        }
        /// <summary>
        /// 加载网络分析模型
        /// </summary>
        private void LoadModel()
        {
            // 加载分析模型
            // 设置网络分析基本环境,这一步骤需要设置 分析权重、节点、弧段标识字段、容限
            WeightFieldInfo3D weightInfo = new WeightFieldInfo3D();
            weightInfo.Name = "SmLength";
            weightInfo.FTWeightField = "SmLength";
            weightInfo.TFWeightField = "SmLength";

            TransportationAnalystSetting3D analystSetting = new TransportationAnalystSetting3D();

            analystSetting.NetworkDataset = m_networkDataset;
            analystSetting.EdgeIDField = "SmEdgeID";
            analystSetting.NodeIDField = "SmNodeID";
            analystSetting.FNodeIDField = "SmFNode";
            analystSetting.TNodeIDField = "SmTNode";
            analystSetting.Tolerance = 30;
            analystSetting.WeightFieldInfos.Add(weightInfo);

            m_analyst.AnalystSetting = analystSetting;
            m_analyst.Load();
        }
        private void SetParameter(Point3D startPoint, Point3D endPoint)
        {
            Point3Ds points = new Point3Ds(new Point3D[] { startPoint, endPoint });

            m_analystParameter.IsRoutesReturn = true;
            m_analystParameter.WeightName = "Smlength";

            m_analystParameter.Points = points;
        }
    }
你好,想请教您一个问题,我现在电脑上安装了SuperMap iDesktop 10i,想进行三维网络分析,需要使用SuperMap.Realspace.NetworkAnalyst 命名空间进行三维网络分析,但是我查了一下需要安装SuperMap iObjects组件,但是超图官网上iObjects有很多版本,我这种情况需要安装哪个版本呢?该如何安装呢?不需要开发。
65EXP 2020年11月02日
...