关闭

获取Multipatch图层中模型的底面图形和模型的高度

标签: ArcGISc#esri
1237人阅读 评论(0) 收藏 举报
分类:

获取Multipatch图层中模型的底面图形和模型的高度

 

1、获取Multipatch图层

 

IFeatureClass pFeatureClass =pFeatureWorkspace.OpenFeatureClass(layername);

 

2、获取模型数据要素

 

IFeatureCursor pFeatureCursor =pFeatureClass.Search(null,false);

 

3、获取模型要素并获取底面

(通过模型要素的Envelope和模型要素的Geometry进行相交操作)

IFeature pFeature =pFeatureCursor.NextFeature();

IGeometry pGeometry = null;

 

pGeometry = null;
pGeometry = pFeature.ShapeCopy;

pMultiPatch = pGeometry asIMultiPatch;

 

pEnvelope = null;

pEnvelope = pMultiPatch.Envelope;

 

pTopologicalOperator = null;

pTopologicalOperator = pGeometry asITopologicalOperator;

pNewGeometry = pTopologicalOperator.Intersect(pEnvelope, esriGeometryDimension.esriGeometry2Dimension);

 

4、获取最大和最小高程

 

IZCollection pZCollection = null;

pZCollection = pMultiPatch asIZCollection;

               

double zmax =pZCollection.ZMax;

double zmin =pZCollection.ZMin;

double high = zmax - zmin;

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:417954次
    • 积分:6999
    • 等级:
    • 排名:第3435名
    • 原创:292篇
    • 转载:3篇
    • 译文:1篇
    • 评论:36条
    最新评论