CreateFeatureClass方法的一个bug?

Posted by 蒋波涛 17 January,2007 Views (7)Comment

我们在GIS程序中经常要写类似的代码:根据一个已经存在的要素类的schema,在其它工作空间中产生一个相同schema的要素类,这个过程有几个现成的函数,如IFeatureWorkspace.CreateFeatureClass或IFeatureDataset.CreateFeatureClass等。
但麻烦就出在这里,如果我们的源要素类是一个来自SDE类型工作空间的要素类pSourceFeatCls,诸如以下方法:
pSourceFeatCursor=pSourceFeatCls.Search(nothing,false)
没有问题。

再使用IFeatureWorkspace.CreateFeatureClass或IFeatureDataset.CreateFeatureClass在其它工作空间中产生一个要素类,然后再测试pSourceFeatCursor=pSourceFeatCls.Search(nothing,false),问题就出来了:

FDO_E_FIELD_NOT_FOUND -2147219885 An expected Field was not found or could not be retrieved properly.


如果这个要素类来自个人geodatabase则没有问题。

在IFeatureWorkspace.CreateFeatureClass或IFeatureDataset.CreateFeatureClass方法中,对源要素类的唯一使用是复制了一份源要素类的字段集对象。

解决不了,郁闷。

Related Items

Categories : ArcObjects Tags : ArcObjects  
Comments
2007-1-18 7:55:10

请问如何用VB+AE打开Grid文件,谢谢!

Posted by lzh Gravatar Icon

2007-1-22 10:31:56

是不是在field中没有oid引起的。

Posted by 看看看 Gravatar Icon

2007-1-22 11:22:07

OID绝对存在的,因为构建的是一个要素类,OID字段会自动生成的。

Posted by 蒋波涛 Gravatar Icon

2007-1-31 16:23:55

你是用的engine么,如果是,需要正确的初始化license才能在中sde正确create、edit要素

Posted by 阳光 Gravatar Icon

2007-2-2 21:32:12

用的是AO,最完整的版本.

Posted by 蒋波涛 Gravatar Icon

2007-9-19 19:59:46

对源要素类的字段集对象的复制过程中有问题吧?

Posted by kamixixi Gravatar Icon

2007-9-19 21:53:10

不是,原因出在权限上,要在SDE库中产生要素类使用的License与目前破解License不同。

Posted by 蒋波涛 Gravatar Icon

Leave a comment

Or, take a look at Archives and Categories

目录

存档