skyline开发——加载Shapefile文件

Posted Lzm

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 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文件的主要内容,如果未能解决你的问题,请参考以下文章

ArcGIS Engine开发之地图基本操作

skyline二次开发system.runtime异常

Skyline开发4-IProject接口

Skyline WEB端开发2——添加一个定位点文本标签

Skyline开发2-第一个程序

基于Skyline的web开发(6.x)