The Geometry has no Z values 解决办法

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

时间: 2024-07-29 08:38:30

The Geometry has no Z values 解决办法的相关文章

爆出错误:The Geometry has no Z values

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

报错&quot;the geometry has no Z values&quot;处理

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>pu

【转】Geometry cannot have Z values

http://blog.csdn.net/tweeenty/article/details/44246407 在对矢量要素类添加要素,进行赋几何信息时(FeatureBuffer.Shape = IGeometry)可能会报Geometry cannot have Z values 的错误,原因是赋值的IGeometry的属性值 IZAware.ZAware=true的,所以在进行赋值导致信息的不匹配,出现错误: 在赋值时进行修正: IGeometry ipGeometry = ipFeatur

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.properties文件内容如下: # DB Configuration for DB2 spring.datasource.url=jdbc:db2://localhost:50000/SAMPLE spring.datasource.username=zifeiy spring.datasour

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

1.打开注册表编辑器.按Win+R,在运行框中键入regedit,然后单击“确定”. 2.在注册表编辑器中,展开到下列注册表子项: HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Word\Options 3.在“编辑”菜单上,指向“新建”,然后单击“DWORD 值”.选择上更改“新值 #1”,键入UndoHistory,然后按 确认. 4.修改编辑 DWORD 值,单击“基数”下的“十进制”.在“值”框中键入一个介于 0 和 100 之间的值,

user profile services提示&ldquo;BAIL: MMS(7116): sql.cpp(8490): 0x80231334 (The sql connection string has unsupported values.)&rdquo;解决办法

user profile services的2个服务Forefront Identity Manager Service 和 Forefront Identity Manager Synchronization Service无法启动提示如下图错误:   执行如下powershell脚本: 利用下面的命令来获取到当前服务器场所有的UPS服务实例: $UPSInstances = Get-SPServiceInstance | ? {$_.GetType().ToString() -eq "Mic

在Eclipse配置并编译worldwind java2.1.0源码,选中Src目录下gov.nasa.worldwindx.examples包下ApplicationTemplate.java类文件run时提示“javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V”异常的解决办法

问题现象: 在Eclipse配置并编译worldwind java2.1.0源码,选中Src目录下gov.nasa.worldwindx.examples包下ApplicationTemplate.java类文件run时提示“javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V”异常. 解决办法: 1.定位到报错的方法为WWXML.java文件中的createDocumentBuilder方法: pub

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

DllImport是System.Runtime.InteropServices命名空间下的一个属性类,其功能是提供从非托管DLL导出的函数的必要调用信息.DllImport属性应用于方法,要求最少要提供包含入口点的dll的名称.DllImport的定义如下: [AttributeUsage(AttributeTargets.Method)] public class DllImportAttribute: System.Attribute { public DllImportAttribute

使用Jquery-easyUI的datagrid从后台加载数据不成功的解决办法

最近在用easyUI做一个注册页面总是出现从后台数加载不成功的问题,后来在一个师兄的指导下通过debug模式终于发现问题并解决了,以下记录我解决这一问题的过程.开发环境:jdk1.7,工具:eclipse,框架:spring-mvc spring-mvc的配置代码 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/sche