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();
    }
  • 相关阅读:
    vue中引用font-awesome
    创建VUE项目
    Core项目添加EF
    DBHelper,之前常用的代码,保存起来。
    appium+python的APP自动化(2)
    appium+python的APP自动化(1)
    单例模式
    双重检测机制解决缓存穿透问题
    mysql数据库
    java的三大特性----封装、集成、多态
  • 原文地址:https://www.cnblogs.com/hl3292/p/1897790.html
Copyright © 2011-2022 走看看