• IFeatureClass_CreateFeature_Example


    

    代码
    public void IFeatureClass_CreateFeature_Example(IFeatureClass featureClass)
    {
    //Function is designed to work with polyline data
    if (featureClass.ShapeType != ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline)
    {
    return;
    }
    //create a geometry for the features shape
    ESRI.ArcGIS.Geometry.IPolyline polyline = new ESRI.ArcGIS.Geometry.PolylineClass();
    ESRI.ArcGIS.Geometry.IPoint point
    = new ESRI.ArcGIS.Geometry.PointClass();
    point.X
    = 0;
    point.Y
    = 0;
    polyline.FromPoint
    = point;
    point
    = new ESRI.ArcGIS.Geometry.PointClass();
    point.X
    = 10; point.Y = 10;
    polyline.ToPoint
    = point;
    IFeature feature
    = featureClass.CreateFeature();
    //Apply the constructed shape to the new features shape
    feature.Shape = polyline;
    ISubtypes subtypes
    = (ISubtypes)featureClass;
    IRowSubtypes rowSubtypes
    = (IRowSubtypes)feature;
    if (subtypes.HasSubtype)
    // does the feature class have subtypes?
    {
    rowSubtypes.SubtypeCode
    = 1;
    //in this example 1 represents the Primary Pipeline subtype
    }
    // initalize any default values that the feature has
    rowSubtypes.InitDefaultValues();
    //Commit the default values in the feature to the database
    feature.Store();
    //update the value on a string field that indicates who installed the feature.
    feature.set_Value(feature.Fields.FindField("InstalledBy"), "K Johnston");
    //Commit the updated values in the feature to the database
    feature.Store();
    }
  • 相关阅读:
    [svc]linux启动过程及级别
    [svc]linux紧急情况处理
    [100]shell中exec解析
    [100]第一波命令及总结
    [100]find&xargs命令
    [svc]nginx优化
    hbase总结:如何监控region的性能
    hbase集群 常用维护命令
    navicat 导入sql文件乱码问题解决
    ue标签不见了,如何解决?
  • 原文地址:https://www.cnblogs.com/hl3292/p/1897790.html
Copyright © 2020-2023  润新知