码迷,mamicode.com
首页 > 其他好文 > 详细

skyline开发——加载Shapefile文件

时间:2017-03-01 15:55:21      阅读:1289      评论:0      收藏:0      [点我收藏+]

标签:div   action   ups   nav   shape   定位   pos   inf   获取   

 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 polygon
23                 //cFlyToPos.X = 10.50;
24                 //cFlyToPos.Y = 47.50;
25                 cFlyToPos.Distance = 3500;
26                 sgworld.Navigate.FlyTo(cFlyToPos, ActionCode.AC_FLYTO);

 

skyline开发——加载Shapefile文件

标签:div   action   ups   nav   shape   定位   pos   inf   获取   

原文地址:http://www.cnblogs.com/jordonin/p/6484422.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!