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

报错"the geometry has no Z values"处理

时间:2015-03-03 18:22:35      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:


    from:http://blog.sina.com.cn/s/blog_6faf711d010138vq.html     
         
        
 
          

// <summary>/// 设置Z值和M值,解决The Geometry has no Z values错误
        
///</summary>///<param name="pF">要素</param>///<param name="pGeo">几何</param>publicstaticvoid SetZValue(IFeature pF, IGeometry pGeo)
        {
            int index;

            index = pF.Fields.FindField("Shape");

            IGeometryDef pGeometryDef;

            pGeometryDef = pF.Fields.get_Field(index).GeometryDef as IGeometryDef;

            if (pGeometryDef.HasZ)
            {

                IZAware pZAware = (IZAware)pGeo;

                pZAware.ZAware = true;

                IZ iz1 = (IZ)pGeo;

                iz1.SetConstantZ(0);  //将Z值设置为0

                
//IPoint point = (IPoint)pGeo;

                
//point.Z = 0;

            }

            else
            {
                IZAware pZAware = (IZAware)pGeo;
                pZAware.ZAware = false;
            }

            //M值
            if (pGeometryDef.HasM)
            {
                IMAware pMAware = (IMAware)pGeo;
                pMAware.MAware = true;
            }
            else
            {
                IMAware pMAware = (IMAware)pGeo;
                pMAware.MAware = false;

            }
        }//function

 

报错"the geometry has no Z values"处理

标签:

原文地址:http://www.cnblogs.com/94cool/p/4311376.html

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