• 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);
  • 相关阅读:
    最全负载均衡:算法、实现、亿级负载解决方案详解
    淘宝分布式架构演变案例详解
    分布式一致性协议实现原理
    ReentrantReadWriteLock的使用
    线程之单例
    线程的优先级
    java线程的6种状态
    mybatis <foreach> 标签
    java多线程 上下文切换
    docker的复制和挂载
  • 原文地址:https://www.cnblogs.com/jordonin/p/6484422.html
Copyright © 2020-2023  润新知