当前位置: 首页 > news >正文

ArcGIS Engine 编辑- IWorkspaceEdit

转自原文 ArcGIS Engine 编辑- IWorkspaceEdit

这个例子中,我创建了1000条要素,并结合缓冲将数据写到文件中,并且添加了时间统计,当然数据是我捏造的,还请原谅,这个花费的时间为0.978秒,速度还行。

  IWorkspaceFactory pWsF = new ShapefileWorkspaceFactory();

                IFeatureWorkspace pFtWs = pWsF.OpenFromFile(@"E:\arcgis\Engine\数据", 0) as IFeatureWorkspace;

                IFeatureClass pFtClass = pFtWs.OpenFeatureClass("edit");

                IFeatureLayer pFt = new FeatureLayerClass();

                pFt.FeatureClass = pFtClass;
                pFt.Name = "画线";

                axMapControl1.Map.AddLayer(pFt as ILayer);

                axMapControl1.Refresh();

 

                //为了进一步说明Idataset,我特意从下面的代码

                IDataset pDataset = pFtClass as IDataset;

                IWorkspace pWs = pDataset.Workspace;

                pWsEdit = pWs as IWorkspaceEdit;

                pWsEdit.StartEditing(true);


                pWsEdit.StartEditOperation();


                pBoolStart = pWsEdit.IsBeingEdited();

                System.Diagnostics.Stopwatch TimeWatch = new System.Diagnostics.Stopwatch();

                TimeWatch.Start();

                IFeatureBuffer pFeatureBuffer = pFtClass.CreateFeatureBuffer();


                IFeatureCursor pFtCusor = pFtClass.Insert(true);


                ESRI.ArcGIS.Geometry.IPolyline polyline = new ESRI.ArcGIS.Geometry.PolylineClass();
                ESRI.ArcGIS.Geometry.IPoint pPoint = new ESRI.ArcGIS.Geometry.PointClass();

                ESRI.ArcGIS.Geometry.IPoint pPoint2 = new ESRI.ArcGIS.Geometry.PointClass();
                for (int i = 0; i < 1000; i++)
                {

                    pPoint.X = 48 + i * 102;

                    pPoint.Y = 65 + i * 10;

                    polyline.FromPoint = pPoint;

                    pPoint2.X = 480 + i * 10;

                    pPoint2.Y = 615 + i * 102;


                    polyline.ToPoint = pPoint2;

                    pFeatureBuffer.Shape = polyline;

                    pFeatureBuffer.set_Value(2, i);


                    object pFeatureOID = pFtCusor.InsertFeature(pFeatureBuffer);
                }

                pFtCusor.Flush();

                pWsEdit.StopEditing(true);

                axMapControl1.Refresh();
                TimeWatch.Stop();

                MessageBox.Show(TimeWatch.Elapsed.Milliseconds.ToString());

效果如下:

 

editor5

 

 

相关文章:

  • Access-Control-Allow-Origin与跨域
  • linux下alsa架构音频驱动播放wav格式文件
  • [转].NET Core配置文件加载与DI注入配置数据
  • Makefile注意点总结
  • 深入浅出Puppet(一)
  • Mirco F-measure and Macro F-measure
  • mac上使用zsh配置环境变量
  • find用法积累
  • c# 静态变量【学习笔记】
  • linux内核栈与用户栈【转】
  • NodeJS Stream 二:什么是 Stream
  • 枚举转中文,通过反射方法与描述的方式获取
  • log file sync 等待超高一例子
  • Unity 5 Stats窗口
  • svn 安装网站
  • 【翻译】babel对TC39装饰器草案的实现
  • Angular4 模板式表单用法以及验证
  • IDEA 插件开发入门教程
  • JavaScript 无符号位移运算符 三个大于号 的使用方法
  • Python进阶细节
  • RxJS: 简单入门
  • Sass 快速入门教程
  • Spark VS Hadoop:两大大数据分析系统深度解读
  • TypeScript迭代器
  • WebSocket使用
  • 聊聊sentinel的DegradeSlot
  • 前端代码风格自动化系列(二)之Commitlint
  • 算法-图和图算法
  • 再次简单明了总结flex布局,一看就懂...
  • Java总结 - String - 这篇请使劲喷我
  • ()、[]、{}、(())、[[]]命令替换
  • (C语言)共用体union的用法举例
  • (done) NLP “bag-of-words“ 方法 (带有二元分类和多元分类两个例子)词袋模型、BoW
  • (Java实习生)每日10道面试题打卡——JavaWeb篇
  • (二)正点原子I.MX6ULL u-boot移植
  • (附源码)node.js知识分享网站 毕业设计 202038
  • (没学懂,待填坑)【动态规划】数位动态规划
  • (企业 / 公司项目)前端使用pingyin-pro将汉字转成拼音
  • (十一)图像的罗伯特梯度锐化
  • (最简单,详细,直接上手)uniapp/vue中英文多语言切换
  • *p=a是把a的值赋给p,p=a是把a的地址赋给p。
  • .net core 控制台应用程序读取配置文件app.config
  • .Net 中Partitioner static与dynamic的性能对比
  • .net反编译工具
  • [ vulhub漏洞复现篇 ] AppWeb认证绕过漏洞(CVE-2018-8715)
  • [2013AAA]On a fractional nonlinear hyperbolic equation arising from relative theory
  • [AIGC] 开源流程引擎哪个好,如何选型?
  • [autojs]逍遥模拟器和vscode对接
  • [AX]AX2012 SSRS报表Drill through action
  • [C#]winform利用seetaface6实现C#人脸检测活体检测口罩检测年龄预测性别判断眼睛状态检测
  • [c++] 自写 MyString 类
  • [CF543A]/[CF544C]Writing Code
  • [CISCN2019 华东北赛区]Web2
  • [IE编程] IE 是如何决定Accept-Language 属性的
  • [Linux] Ubuntu install Miniconda