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();
    }
  • 相关阅读:
    JDBC
    Ajax:一种不用刷新整个页面便可与服务器通讯的办法
    Maven——自动化构建工具
    SSM整合
    MyBatis框架
    SpringMVC框架、Spring boot框架、SSM區別
    Spring开源框架
    切入点表达式
    面向切面编程之cglib代理方式
    动态JDK代理方式-实现类增强
  • 原文地址:https://www.cnblogs.com/hl3292/p/1897790.html
Copyright © 2011-2022 走看看