ArcGis添加地图标注,爆出错误:The Geometry has no Z values

解决方法如下:

public bool AddFeature( ESRI.ArcGIS.Geometry.IGeometry geometry,System.Collections.Generic.Dictionary<string ,object> properties)

        {

            try

            {

                ESRI.ArcGIS.Geodatabase.IFeature feature = _featureLayer.FeatureClass.CreateFeature();

                int index;

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

                IGeometryDef pGeometryDef;

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

                if (pGeometryDef.HasZ)

                {

                    IZAware pZAware = (IZAware)geometry;

                    pZAware.ZAware = true;

                    //IZ iz1 = (IZ)geometry;

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

                    IPoint point = (IPoint)geometry;

                    point.Z = 0;

                }

                else

                {

                    IZAware pZAware = (IZAware)geometry;

                    pZAware.ZAware = false;

                }

                if (pGeometryDef.HasM)

                {

                    IMAware pMAware = (IMAware)geometry;

                    pMAware.MAware = true;

                }

                else

                {

                    IMAware pMAware = (IMAware)geometry;

                    pMAware.MAware = false;

                }

                feature.Shape = geometry;

                foreach (string key in properties.Keys)

                {

                    SetFeatueProperty(feature, key, properties[key]);

                }

                feature.Store();  

                return true;

            }

            catch (Exception ee)

            {

                return false;

            }

        }

  

爆出错误:The Geometry has no Z values的更多相关文章

  1. The Geometry has no Z values 解决办法

    from:http://dufan20086.blog.163.com/blog/static/6616452320145269343675/ 我们在创建要素时,简单的IFeatureClass.Cr ...

  2. 【转】Geometry cannot have Z values

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

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

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

  4. ORA-00913错误:PL/SQL: ORA-00913: too many values

    ORA-00913错误 描写叙述:PL/SQL: ORA-00913: too many values 目标:编写一个能够循环插入数据的脚本 操作过程: SQL> desc tcustmer N ...

  5. github多用户git push错误remote: Permission to user1/z.git denied to user2

    背景:同一台电脑的public key同时添加到了github的两个账户,导致user1的仓库没法正常提交. 解决办法:为两个账户分别配置ssh key,配置~/.ssh/config文件(windo ...

  6. 【VS开发】【计算机视觉】使用opencv静态库编译程序时爆出错误的解决方案

    #[VS开发][计算机视觉]关于opencv静态库的使用说明 标签:[VS开发] [图像处理] --- 忽然间发现OpenCV中居然有已经编译好的静态链接库,于是尝试着使用一下,却遇到了比较多的问题, ...

  7. ArcEngine二次开发错误编码对照表(转)

    阅读数:3323 每当我们在进行AE开发,出现错误时经常会出现错误代码,但是我们并不知道它到底代表什么意思,这里的而错误编码我们可以对照着找到我们需要的时候常详细信息(问题是,经常还是会出现没有错误编 ...

  8. AE错误代码解释

    每当我们在进行AE开发,出现错误时经常会出现错误代码,但是我们并不知道它到底代表什么意思,这里的而错误编码我们可以对照着找到我们需要的时候常详细信息(问题是,经常还是会出现没有错误编码HRESULT ...

  9. ArcEngine开发各种几何错误代码

    E_GEOMETRY_AMBIGUOUSPARTTYPE - Static variable in interface com.esri.arcgis.geometry.esriGeometryErr ...

随机推荐

  1. mysql 中的数据类型

    unsigned   既为非负数,用此类型可以增加数据长度! 例如如果    tinyint最大是127,那    tinyint    unsigned    最大   就可以到    127 * ...

  2. SQL cmd 实用工具学习 -1

    启动 sqlcmd 实用工具并连接到 SQL Server 的默认实例 在"开始"菜单上,单击"运行". 在"打开"框中,键入 cmd,然后 ...

  3. iOS中UISearchBar(搜索框)使用总结

    http://my.oschina.net/u/2340880/blog/509756

  4. 实现VS2010整合NUnit进行单元测试

    1.下载安装NUnit(最新win版本为NUnit.3.2.1.msi) http://www.nunit.org/index.php?p=download 2.下载并安装VS的Visual Nuni ...

  5. vc中调用Com组件的方法详解

    vc中调用Com组件的方法详解 转载自:网络,来源未知,如有知晓者请告知我.需求:1.创建myCom.dll,该COM只有一个组件,两个接口:   IGetRes--方法Hello(),   IGet ...

  6. C#传值

    C#若不加限制传值时自带的类型为值传递,自创的类型为引用传递 using System; using System.Collections.Generic; using System.Linq; us ...

  7. C++访问声明

    代码: #include <iostream> #include <string> using namespace std; struct B{ private: int s; ...

  8. Nutch+Hadoop集群搭建

    转载自:http://www.open-open.com/lib/view/open1328670771405.html 1.Apache Nutch    Apache Nutch是一个用于网络搜索 ...

  9. C# post请求 HttpWebRequest

    //body是要传递的参数,格式"roleId=1&uid=2" //post的cotentType填写: //"application/x-www-form-u ...

  10. Struts2中的get、set方法作用:

    Struts2中的get.set方法作用: 在Struts2中,客户端和服务器之间的数据传输全部要用到get.set方法:用set方法 ,可以将表单中的值存入Action类.通过Struts2.0标签 ...