首页 > 代码库 > skyline开发——加载Shapefile文件
skyline开发——加载Shapefile文件
1 //1)获取道路的GroupID 2 string dlId = ptm.FindGroupByName("道路"); 3 IFeatureLayer66 featureLayer = null; 4 string tShapeFileName = path + "out_feature_class.shp"; 5 string tConnectionString = String.Format("FileName={0};TEPlugName=OGR;", tShapeFileName); 6 featureLayer = sgworld.Creator.CreateFeatureLayer("clip_result", tConnectionString, dlId); 7 //featureLayer.DataSourceInfo.ConnectionString = path + "out_feature_class.shp"; 8 9 featureLayer.FeatureGroups.Polyline.SetProperty("Line Color", 16776960);10 featureLayer.FeatureGroups.Polyline.SetProperty("Line Width", 10);11 12 var featureLayerDataSource = featureLayer.DataSourceInfo;13 //var cAttributes = cFeatureLayerDataSource.Attributes;14 featureLayerDataSource.Attributes.ImportAll = true;15 16 featureLayer.Streaming = false;17 featureLayer.Load();18 19 20 //2) 定位到道路21 var cFlyToPos = featureLayer.Position.Copy();22 cFlyToPos.Pitch = -89.0; // Set camera to look downward on polygon23 //cFlyToPos.X = 10.50;24 //cFlyToPos.Y = 47.50;25 cFlyToPos.Distance = 3500;26 sgworld.Navigate.FlyTo(cFlyToPos, ActionCode.AC_FLYTO);
skyline开发——加载Shapefile文件
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。