三位网络数据集导出成了二维

0 投票
  /// 路径分析
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Analyst_Click(object sender, EventArgs e)
        {
            try
            {
                if (point3ds.Count <2)
                {
                    MessageBox.Show("请选择两个以上经过点");
                    return;
                }
                DatasetVector datasetvector = workspace.Datasources[0].Datasets["ResultNetWork"] as DatasetVector;
                
                TransportationAnalystSetting3D transportationAnalystSetting = new TransportationAnalystSetting3D();
                transportationAnalystSetting.NetworkDataset = datasetvector;
                transportationAnalystSetting.NodeIDField = "SmNodeID";
                transportationAnalystSetting.EdgeIDField = "SmEdgeID";
                transportationAnalystSetting.FNodeIDField = "SmFNode";
                transportationAnalystSetting.TNodeIDField = "SmTNode";
                transportationAnalystSetting.Tolerance = 20;

                //设置权重信息
                WeightFieldInfo3D weightFieldInfo = new WeightFieldInfo3D();
                weightFieldInfo.Name = "SmLength";
                weightFieldInfo.FTWeightField = "SmLength";
                weightFieldInfo.TFWeightField = "SmLength";
                WeightFieldInfos3D weightFieldInfos = new WeightFieldInfos3D();
                weightFieldInfos.Add(weightFieldInfo);
                transportationAnalystSetting.WeightFieldInfos = weightFieldInfos;

                //构造一个三维交通网络分析对象,并设置分析环境
                TransportationAnalyst3D transportationAnalyst = new TransportationAnalyst3D();
                transportationAnalyst.AnalystSetting = transportationAnalystSetting;

                //加载网络模型
                Boolean isLoad = transportationAnalyst.Load();

                if (isLoad)
                {
                    //构造三维交通网络分析参数对象,并设置相关参数
                    TransportationAnalystParameter3D parameter = new TransportationAnalystParameter3D();
                    parameter.Points = point3ds;
                    parameter.WeightName = "SmLength";
                    parameter.IsNodesReturn = true;
                    parameter.IsEdgesReturn = true;
                    parameter.IsRoutesReturn = true;
                    parameter.IsStopIndexesReturn = true;

                    //进行最佳路径分析
                    TransportationAnalystResult3D result = transportationAnalyst.FindPath(parameter);
                    GeoLine3D geoline3d = result.Routes[0];
                    GeoStyle3D geostyle3d = new GeoStyle3D();
                    geostyle3d.LineColor = Color.Blue;
                    geostyle3d.AltitudeMode = AltitudeMode.ClampToGround;
                    geostyle3d.LineWidth = 5;
                    geoline3d.Style3D = geostyle3d;
                    scenecontrol.Scene.TrackingLayer.Add(geoline3d,"line");
                }
                
            }
            catch
            { 

8月 11, 2018 分类:  161次浏览 | 用户: kzhh1998 初出茅庐 (20 分)

2 个回答

0 投票
您好,这不是二维,而是平面场景,也是三维场景的一种类型。
8月 13, 2018 用户: 胡林 登峰造极 (5,972 分)
0 投票
您好!AltitudeMode.ClampToGround是贴地表模式,高度为零。您如果想让它有高度,可以将高度模式设置为绝对高度或相对高度。
8月 13, 2018 用户: 胡延南 名扬四海 (2,937 分)
...