Arcengine 开发,FeatureClass新增feature时“The Geometry has no z-value”或"The Geometry has null z-value"的解决方案

简介: Arcengine 开发,当图层含有Z值时,新增的feature没有Z值就会 出现“The Geometry has no z-value”的错误。意思很明显,新增的geometry没有Z值。 此时按照常规想法,取出geometry的每个点,分别设置Z=0,理论可行,但实际调试过程中依然报“The Geometry has no z-value”。

Arcengine 开发,当图层含有Z值时,新增的feature没有Z值就会 出现“The Geometry has no z-value”的错误。意思很明显,新增的geometry没有Z值。

此时按照常规想法,取出geometry的每个点,分别设置Z=0,理论可行,但实际调试过程中依然报“The Geometry has no z-value”。

可用解决方案如下:

IGeometry geometry = feature.ShapeCopy;
IZAware zAware = (IZAware)geometry;
zAware.ZAware = true;

这样转换一下,geometry就有Z属性了。zAware.ZAware是控制geometry是否有Z值的,当然也可以使用IZAware除去geometry的Z值。

 

故事到这里应该就结束了,可是调试时候又报错了,这时的错误是“The Geometry has null z-value”,意思也很明显,z为空,不通过....

这时再使用常规方案,取出geometry的每个点,分别设置Z=0...结果还是一样的报错。

解决方案如下:

IZ iz = (IZ)geometry;
iz.SetConstantZ(0);

运行,通过....

 

AE提供了很多转换接口,比我们自己写要简单和有效的很多...当然也是因为AE中有很多结构没有公开,我们的一些常规解决方案有时候不是那么有用。希望能帮到有这么方面困扰的AE coder!

相关文章
layui嵌套弹出模态框的Blocked a frame with origin null from的解决方案
layui嵌套弹出模态框的Blocked a frame with origin null from的解决方案
211 0
|
容器
Echarts报错 Cant read property getWidth of null的解决方案
Echarts报错 Cant read property getWidth of null的解决方案
236 0
|
3月前
|
Shell
Image provider: AssetImage(bundle: null, name: “assets/images/hot.png”) Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#9d9f7(), name: “assets/images/hot.png”, scale: 1) 图像无法加载,并且其他图标图像也出错的解决方案-优雅草卓伊凡
Image provider: AssetImage(bundle: null, name: “assets/images/hot.png”) Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#9d9f7(), name: “assets/images/hot.png”, scale: 1) 图像无法加载,并且其他图标图像也出错的解决方案-优雅草卓伊凡
58 12
|
4月前
|
JSON 前端开发 Java
【Bug合集】——Java大小写引起传参失败,获取值为null的解决方案
类中成员变量命名问题引起传送json字符串,但是变量为null的情况做出解释,@Data注解(Spring自动生成的get和set方法)和@JsonProperty
|
JSON 前端开发 API
【跨域报错解决方案】Access to XMLHttpRequest at ‘http://xxx.com/xxx‘ from origin ‘null‘ has been blocked by
【跨域报错解决方案】Access to XMLHttpRequest at ‘http://xxx.com/xxx‘ from origin ‘null‘ has been blocked by
3882 0
|
11月前
|
存储 关系型数据库 MySQL
Flink CDC中mysql cdc 抽取这个时间字段的值为null 有什么好的解决方案吗 ?
Flink CDC中mysql cdc 抽取这个时间字段的值为null 有什么好的解决方案吗 ?
294 0
|
Java 数据库连接 mybatis
There is no getter for property named ‘null‘ in ‘class
There is no getter for property named ‘null‘ in ‘class
250 0
There is no getter for property named ‘null‘ in ‘class
|
11月前
|
Java Spring
flowable 监听器无法获取spring bean ,自动注入bean为null,解决方案
flowable 监听器无法获取spring bean ,自动注入bean为null,解决方案
|
11月前
|
JSON 前端开发 Java
【SpringBoot实战专题】「开发实战系列」全方位攻克你的技术盲区之Spring定义Jackson转换Null的方法和实现案例
【SpringBoot实战专题】「开发实战系列」全方位攻克你的技术盲区之Spring定义Jackson转换Null的方法和实现案例
187 0
|
11月前
|
Java
Error:(15, 13) java: No property named “id” exists in source parameter(s). Did you mean “null”?
Error:(15, 13) java: No property named “id” exists in source parameter(s). Did you mean “null”?
301 1

热门文章

最新文章