您的位置:首页 > 大数据

【AE】大数据点文件读取生成SHP文件时使用IFeatureBuffer快速提高读取效率

2017-08-03 19:10 489 查看


Creating features

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Creating_features/00010000049v000000/ #region 创建要素

            int featCount = 0;

            IFeatureClass pFeatClass = pFeatLayer.FeatureClass;

      IFeatureCursor pFeatureCursor = pFeatClass.Insert(true);

            foreach (var id_car in m_dicCar_Obj)

            {

                foreach (var trace in id_car.Value.TraceList)

                {

                    IFeatureBuffer pFeatureBuffer = pFeatClass.CreateFeatureBuffer();

                   

                    IPoint pPoint = new ESRI.ArcGIS.Geometry.Point();

                    pPoint.X = trace._cp.Lng;

                    pPoint.Y = trace._cp.Lat;

                    pFeatureBuffer.Shape = pPoint;

                    pFeatureBuffer.set_Value(pFeatureBuffer.Fields.FindField("车辆识别码"), id_car.Key);

                    pFeatureBuffer.set_Value(pFeatureBuffer.Fields.FindField("GPS时间"), trace.GPSTime);

                    pFeatureBuffer.set_Value(pFeatureBuffer.Fields.FindField("经度"), trace._cp.Lng);

                    pFeatureBuffer.set_Value(pFeatureBuffer.Fields.FindField("纬度"), trace._cp.Lat);

                    pFeatureBuffer.set_Value(pFeatureBuffer.Fields.FindField("方向"), trace.GPSDirection);

                    pFeatureBuffer.set_Value(pFeatureBuffer.Fields.FindField("里程仪速"), trace.GPSSpeed);

                    pFeatureCursor.InsertFeature(pFeatureBuffer);

                    featCount++;

                }
            }

            pFeatureCursor.Flush();

            System.Runtime.InteropServices.Marshal.ReleaseComObject(pFeatureCursor);

            #endregion
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐