报错"the geometry has no Z values"处理

// <summary>/// 设置Z值和M值,解决The Geometry has no Z values错误
///</summary>///<param name="pF">要素</param>///<param name="pGeo">几何</param>publicstaticvoid SetZValue(IFeature pF, IGeometry pGeo)
{
int index;

index = pF.Fields.FindField("Shape");

IGeometryDef pGeometryDef;

pGeometryDef = pF.Fields.get_Field(index).GeometryDef as IGeometryDef;

if (pGeometryDef.HasZ)
{

IZAware pZAware = (IZAware)pGeo;

pZAware.ZAware = true;

IZ iz1 = (IZ)pGeo;

iz1.SetConstantZ(0); //将Z值设置为0

//IPoint point = (IPoint)pGeo;

//point.Z = 0;

}

else
{
IZAware pZAware = (IZAware)pGeo;
pZAware.ZAware = false;
}

//M值
if (pGeometryDef.HasM)
{
IMAware pMAware = (IMAware)pGeo;
pMAware.MAware = true;
}
else
{
IMAware pMAware = (IMAware)pGeo;
pMAware.MAware = false;

}
}//function




本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/p/4311376.html,如需转载请自行联系原作者

上一篇:Windows 7 出错:Cann't access Input/Mic device or device is already in use.


下一篇:快速读懂容器服务Kubernetes版使用流程