查看单个帖子
旧 2006-12-04, 10:22 PM   #1
Robin
初级会员
 
注册日期: 06-12
帖子: 3
精华: 0
现金: 12 标准币
资产: 12 标准币
Robin 向着好的方向发展
默认 could you find a better or rapid search method to get all local coordinate systems?

Dear Robin,

My goal is to find all local coordinate systems from 5000 features. But it takes about 5 seconds when I try to iterate these features via the following code. I think that it is too slow for an iterative operation of features.

Could you help me find a better or rapid search method to get all local coordinate systems?

Thanks in advance.

My code as follows:

LPDISPATCH dFeature = NULL;

LPDISPATCH dNextFeature = NULL;

// import the supported features

while (dFeature != NULL)

{

IFEATURE swFeature(dFeature);

CString featureTypeName = swFeature.GetTypeName();

// is this a coordinate system feature

if (featureTypeName.Compare(swTnCoordinateSystem) == 0)

{

CString CSysName = swFeature.GetName();

// do simple things

}

// get next feature

dNextFeature = swFeature.GetNextFeature();

// release current feature

swFeature.DetachDispatch();

if (dFeature)

{

dFeature->Release();

dFeature = NULL;

}

dFeature = dNextFeature;

}
Robin离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)