zoukankan      html  css  js  c++  java
  • 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();
    }
  • 相关阅读:
    一段简单的js让png24兼容ie6,单张图片有效
    “按需加载”的应用
    前端....
    项目小结
    Ember初始化实例
    Emberjs 分页
    Emberjs搜索
    promise链式
    Emberjs路由
    Emberjs笔记
  • 原文地址:https://www.cnblogs.com/hl3292/p/1897790.html
Copyright © 2011-2022 走看看