The parameter is (or has an element that is) the wrong kind of geometry
来源:互联网 发布:淘宝网打折耐克女鞋 编辑:程序博客网 时间:2024/06/05 00:33
今天开发遇到一个问题,就是将一个 IPolygon 对象添加到另外一个 IPolygon 中,代码示例如下:
IPolygon polygon1 = new PolygonClass();IPolygon polygon2 = new PolygonClass();IGeometryCollection collection = polygon1 as IGeometryCollection;object obj = Type.Missing;collection.AddGeometry(polygon2 as IGeometry, ref obj, ref obj);
结果执行 collection.AddGeometry(polygon2 as IGeometry, ref obj, ref obj); 这个语句时出现如上异常信息,提示的意思是几何对象的类型错误,心想 IGeometryCollection 不是可以添加 IGeometry 对象吗,而 IPolygon 转换为 IGeometry 也没错的啊。经过多次尝试后才知道并不是用 AddGeometry 方法,而该使用 AddGeometryCollection 方法。调整为如下代码,测试通过。
IGeometryCollection collection = polygon1 as IGeometryCollection;collection.AddGeometryCollection(polygon2 as IGeometryCollection);
- The parameter is (or has an element that is) the wrong kind of geometry
- The parameter is (or has an element that is) the wrong kind of geometry
- Bean property 'dao' is not writable or has an invalid setter method. Does the parameter type of the
- Bean property 'RegDao' is not writable or has an invalid setter method. Does the parameter type of t
- Bean property 'esyerDao' is not writable or has an invalid setter method. Does the parameter type of
- Given an array of size n, find the majority element. The majority element is the element that appear
- Bean property 'productService' is not writable or has an invalid setter method. Does the parameter t
- Question 30: What is the order of destructor calls for an object of class Y inherited from class X that has an object of class A
- Bean property 'address' is not readable or has an invalid getter method: Does the return type of th
- Error 47 "xxxxxxx"is an invalid value for the "InputManifest" parameter of the "GenerateApplicationM
- 处理编译错误"0" is an invalid value for the "DebugInformation" parameter of the "DCC" task.
- 今天又搞到个libDTL.so is not an ELF file - it has the wrong magic bytes at the start.
- ERROR: a parameter or an operation is not supported by the underlying object
- It is possible that this issue is resolved by uninstalling an existing version of the apk if it is
- It is possible that this issue is resolved by uninstalling an existing version of the apk if it is
- The server has either erred or is incapable of performing the requested operation. (HTTP 500)
- There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key ''.
- Bean property 'sqlSessionTemplate' is not writable or has an invalid setter method. Does the paramet
- 编程珠玑_第十三章_生成一个随机整数的有序集合
- SQL Azure是什么?
- SQL Azure vs SQL Server
- 关于Eclipse javadoc的问题
- VC和LUA混合开发之VC程序调用Lua脚本函数
- The parameter is (or has an element that is) the wrong kind of geometry
- CLCL和ClipX:最实用的剪贴板增强工具,免费超小
- poj1925
- 点、线、面相关的算法(2)
- WEB前端
- 深入分析S3C2440启动代码中大小端问题
- findMaxDistance
- 点、线、面相关的算法(1)
- WinForm问题及解决方法总结