我有一组要重新投影的要素类,其中一些具有度量。要在重新投影的要素中复制度量,我必须在投影之前找到要素的度量比例(某些要素类具有以千米为单位的度量)。
当我尝试测量比例时,它不够准确:
public static double measuresScaleFactor(IFeature pFeat, int iShpLenFld, out string sError)
{
// Get the scale factor of the feature measures assuming it has measures assigned
sError = "";
double dScale = 1;
IMSegmentation4 pSeg = null;
double dMax;
double dLength;
try
{
if (pFeat.Shape != null && pFeat.Shape.IsEmpty == false )
{
pSeg = (IMSegmentation4)pFeat.Shape;
dMax = pSeg.MMax;
dLength = (double)pFeat.Value[iShpLenFld];
dScale = dMax / dLength;
}
return dScale;
}
catch (Exception ex)
{
System.Diagnostics.StackTrace pStack = new System.Diagnostics.StackTrace(ex, true);
System.Diagnostics.StackFrame pFrame = pStack.GetFrame(pStack.FrameCount - 1);
int iLineNo = pFrame.GetFileLineNumber();
sError = "Error: measuresScaleFactor; Line: " + iLineNo + " \r\n" + ex.Message;
return dScale;
}
}
对于测试运行,dLength的值为745m,dMax为.741km。如果pFeat是一条多段线,并且部分重复了这些措施,那么也会出现问题。
有人能告诉我arcObjects中是否有一个包含比例因子(精确)值的细分信息接口?
谢谢
J