from:http://dufan20086.blog.163.com/blog/static/6616452320145269343675/

我们在创建要素时,简单的IFeatureClass.CreateFeature之后,然后把IGeometry对象赋给Feature.shape,会引发“The Geometry has no Z values”的错误提示。类似的错误在做地图标注过程中也会出现。

本文所采用的解决办法参考了网上的一些资料:
http://blog.sina.com.cn/s/blog_6faf711d010138vq.html
http://hi.baidu.com/luoyuonline/item/2994bafc08e10f0dd99e7256
基本思路就是在CreateFeature之后,设置Z值(顺带将M值也一并设置)。
/// <summary>
        /// 设置Z值和M值,解决The Geometry has no Z values错误
        /// </summary>
        /// <param name="pF">要素</param>
        /// <param name="pGeo">几何</param>
        public static void 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
//在ArcEngine10.2中用下面的两行代码来设置
                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 解决办法的更多相关文章

  1. 爆出错误:The Geometry has no Z values

    ArcGis添加地图标注,爆出错误:The Geometry has no Z values 解决方法如下: public bool AddFeature( ESRI.ArcGIS.Geometry. ...

  2. 【转】Geometry cannot have Z values

    http://blog.csdn.net/tweeenty/article/details/44246407 在对矢量要素类添加要素,进行赋几何信息时(FeatureBuffer.Shape = IG ...

  3. Spring Boot连接DB2查询结果时报错“java.lang.AbstractMethodError: com.ibm.db2.jcc.t4.b.isValid(I)Z”的解决办法

    关于在maven项目中如何添加DB2的坐标的详细,见:https://www.cnblogs.com/zifeiy/p/7918554.html Spring Boot项目中的application. ...

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

    );  //将Z值设置为0 //IPoint point = (IPoint)pGeo; //point.Z = 0; } else            {                IZAwa ...

  5. user profile services提示“BAIL: MMS(7116): sql.cpp(8490): 0x80231334 (The sql connection string has unsupported values.)”解决办法

    user profile services的2个服务Forefront Identity Manager Service 和 Forefront Identity Manager Synchroniz ...

  6. Word2010撤销按钮失效,Ctrl+Z失效解决办法

    1.打开注册表编辑器.按Win+R,在运行框中键入regedit,然后单击“确定”. 2.在注册表编辑器中,展开到下列注册表子项: HKEY_CURRENT_USER\Software\Microso ...

  7. 【其他】3dmax撤销Ctrl+z不能用的解决办法

    转载请注明出处:http://www.cnblogs.com/shamoyuu/p/3dmax_ctrlz.html 如果你经常去网上下载各种模型参考学习的话,出现这个问题的概率会非常高.因为出现这个 ...

  8. Opencv ValueError: not enough values to unpack (expected 3, got 2)解决办法

    问题背景 有些人在用我去年的毕设运行时(感谢QAQ),报错 Opencv ValueError: not enough values to unpack (expected 3, got 2) 当时就 ...

  9. ASP.NET中引用dll“找不到指定模块"的完美解决办法 z

    DllImport是System.Runtime.InteropServices命名空间下的一个属性类,其功能是提供从非托管DLL导出的函数的必要调用信息.DllImport属性应用于方法,要求最少要 ...

随机推荐

  1. osx的终端软件iterm2 之 修改外观 和 常用快捷键小结

    1.修改外观:透明,自己配色,最好还有个透明的小背景,比如这样: 那么你就要这样修改: 2.快捷键小结 (1)⌘ + d 横着分屏 / ⌘ + shift + d 竖着分屏  : 适合多操作的时候 ( ...

  2. 从web移动端布局到react native布局

    在web移动端通常会有这样的需求,实现上中下三栏布局(上下导航栏位置固定,中间部分内容超出可滚动),如下图所示: 实现方法如下: HTML结构: <div class='container'&g ...

  3. SharePoint2013 - 移动文档

    In SharePoint 2010, the easiest way to transfer documents from one library to another involved using ...

  4. Android——检查网络是否已经链接

    新建一个项目testNet 添加一个button layout.xml: <RelativeLayout xmlns:android="http://schemas.android.c ...

  5. 【读书笔记】iOS-开发技巧-三种收起键盘的方法

    - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typica ...

  6. iOS-RegexKitLite导入错误

    RegexKitLite是什么? RegexKitLite是一个非常方便的处理正则表达式的第三方类库. 本身只有一个RegexKitLite.h和RegexKitLite.m 导入RegexKitLi ...

  7. jvm运行时环境属性一览

    前言: 在web编程技术内幕中看到一个用apache组件进行文件下载的例子,对于DiskFileUpload类的setRepositoryPath方法,设置临时文件的存放路径,里面指出如果不调用该方法 ...

  8. OC小实例关于init方法不小心的错误

    *:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } ...

  9. QA:Failed to deploy artifacts from/to snapshots XX Failed to transfer file Return code is: 405, ReasonPhrase:Method Not Allowed.

    QA: Failed to deploy artifacts from/to snapshots XX Failed to transfer file Return code is: 405, Rea ...

  10. jQuery Validate 表单验证插件----Validate简介,官方文档,官方下载地址

     一. jQuery Validate 插件的介绍 jQuery Validate 插件为表单提供了强大的验证功能,让客户端表单验证变得更简单,同时提供了大量的定制选项,满足应用程序各种需求.该插件捆 ...