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

skyline开发——读取Shapefile要素属性

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

标签:span   tty   geo   else   str   lines   属性   ring   group   

 1 double len;
 2                 IFeatures66 features = featureLayer.FeatureGroups.Polyline.GetCurrentFeatures();
 3                 foreach (IFeature66 feature in features)
 4                 {
 5                     len = 0;
 6                     if (feature.ObjectType == ObjectTypeCode.OT_FEATURE)
 7                     {
 8                         TerraExplorerX.IGeometry geometry = feature.Geometry;
 9                         if (geometry.GeometryType == SGGeometryTypeId.SG_MULTILINESTRING)
10                         {
11                             IMultiLineString line = (IMultiLineString)geometry;
12                             len = line.Length;
13                         }
14                         else if (geometry.GeometryType == SGGeometryTypeId.SG_LINESTRING)
15                         {
16                             ILineString linestr = (ILineString)geometry;
17                             len = linestr.Length;
18                         }
19                         foreach (IFeatureAttribute66 attr in feature.FeatureAttributes)
20                         {
21                             if (attr.Name == "Id")
22                             {
23                                 SetDataTableValue(dt, attr.Value, Math.Round(len, 3));
24                                 break;
25                             }
26                         }
27                     }
28                 }

 

skyline开发——读取Shapefile要素属性

标签:span   tty   geo   else   str   lines   属性   ring   group   

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

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