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;
} |