Geometry cannot have Z values错误

在对矢量要素类添加要素,进行赋几何信息时(FeatureBuffer.Shape = IGeometry)可能会报Geometry cannot have Z values 的错误,原因是赋值的IGeometry的属性值 IZAware.ZAware=true的,所以在进行赋值导致信息的不匹配,出现错误;

在赋值时进行修正:

    IGeometry ipGeometry = ipFeature.ShapeCopy;
    IZAware ipZAware = ipGeometry as IZAware;
    if (ipZAware.ZAware == true)
    {
        ipZAware.ZAware = false;
    }
    ipFeatureBuffer.Shape = ipGeometry;


参考:http://gis-conquer.blog.sohu.com/244183308.html


注:如果矢量要素类具有Z Coordinate System,在处理数据时,速度会受到很大的影响;我们可能通过GP工具中的Environments中的ZValues的选项来删除掉矢量要素类的这个属性,

posted @ 2018-11-19 22:57  jamesinsun  阅读(474)  评论(0)    收藏  举报