skyline开发——读取Shapefile要素属性
Posted Lzm
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了skyline开发——读取Shapefile要素属性相关的知识,希望对你有一定的参考价值。
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要素属性的主要内容,如果未能解决你的问题,请参考以下文章
使用 GeoPandas/Fiona 从 shapefile 读取 M 值
GIS开发Esri Shapefile(.shp)矢量数据文件读取(C++Python)
AE开发中对GDB以及shapefile的读取对FeatureClass的相关操作