[ArcEngine]IFeatureBuffer使用
public static void LoadOnlyModeInsert(IFeatureClass featureClass, List < IGeometry >
geometryList)
{
// Cast the feature class to the IFeatureClassLoad interface.
IFeatureClassLoad featureClassLoad = (IFeatureClassLoad)featureClass; // Acquire an exclusive schema lock for the class.
ISchemaLock schemaLock = (ISchemaLock)featureClass;
try
{
schemaLock.ChangeSchemaLock(esriSchemaLock.esriExclusiveSchemaLock); // Enable load-only mode on the feature class.
featureClassLoad.LoadOnlyMode = true;
using(ComReleaser comReleaser = new ComReleaser())
{
// Create the feature buffer.
IFeatureBuffer featureBuffer = featureClass.CreateFeatureBuffer();
comReleaser.ManageLifetime(featureBuffer); // Create an insert cursor.
IFeatureCursor insertCursor = featureClass.Insert(true);
comReleaser.ManageLifetime(insertCursor); // All of the features to be created are classified as Primary Highways.
int typeFieldIndex = featureClass.FindField("TYPE");
featureBuffer.set_Value(typeFieldIndex, "Primary Highway"); foreach (IGeometry geometry in geometryList)
{
// Set the feature buffer's shape and insert it.
featureBuffer.Shape = geometry;
insertCursor.InsertFeature(featureBuffer);
} // Flush the buffer to the geodatabase.
insertCursor.Flush();
}
}
catch (Exception)
{
// Handle the failure in a way appropriate to the application.
}
finally
{
// Disable load-only mode on the feature class.
featureClassLoad.LoadOnlyMode = false; // Demote the exclusive schema lock to a shared lock.
schemaLock.ChangeSchemaLock(esriSchemaLock.esriSharedSchemaLock);
}
}
[ArcEngine]IFeatureBuffer使用的更多相关文章
- ArcEngine中合并断开的线要素(根据几何判断)
在上一篇ArcEngine环境下合并断开的线要素(根据属性)随笔中介绍了如何通过shp文件属性表中相同的属性字段进行线要素的合并.今天刚把通过几何条件判断的方式连接断开的线要素的ArcGIS 插件完成 ...
- ArcEngine查询、添加、删除要素的方法
原文 ArcEngine查询.添加.删除要素的方法 1.查找数据 1).利用FeaturCursor进行空间查询 //空间查询 ISpatialFilter spatialFilter = new S ...
- Arcengine效率探究之一——属性的读取(转载)
http://blog.csdn.net/lk103852503/article/details/6566652 在写一个对属性表的统计函数时,发现执行速度奇慢无比,百思不得其解,其实算法并不复杂,后 ...
- ArcEngine控制台应用程序
转自wbaolong原文 ArcEngine控制台应用程序 控制台应用程序相比其他应用程序,更加简单,简化了许多冗余,可以让我们更加关注于本质的东西. 现在让我们看一看ArcGIS Engine的控制 ...
- arcengine,深入理解游标Cursors,实现数据的快速查找,插入,删除,更新
风过无痕 原文 arcengine,深入理解游标Cursors,实现数据的快速查找,插入,删除,更新 深入理解游标Cursors,实现数据的快速查找,插入,删除,更新 1.查找数据Search Cu ...
- arcengine 要素类的复制
转自原文arcengine 要素类的复制 using System; using System.Collections.Generic; using System.Text; using ESRI.A ...
- ArcEngine开发_添加字段,数据删除,插入,更新细节
一.AE 向已存在的要素类中添加字段 链接: AE 向已存在的要素类中添加字段 在向已存在的要素类中添加字段的时候,需要用到ICLASS接口.于是,进一步的调整代码如下,问题得以解决 static ...
- Arcgis, ArcEngine, Arcgis Server使用开发汇总 索引
ArcGIS系列软件license及安装: Arcgis SDE10.1 和 Arcgis server10.1的授权文件license tnt_esri.dat Arcgis8.1安装license ...
- 【转载】Arcengine效率探究之二——属性的更新
文转载自hymyjl2010<Arcengine效率探究之二——属性的更新> 修改一批要素的属性有多种方法,当数据量较大时,若选择不当可能会大大影响速度. 一.IRowBuffer 方 ...
随机推荐
- 去掉网址中的 html编码
修改 web\urlManager createUrl函数,去掉 urlEncode函数
- 2016.05.04,英语,《Vocabulary Builder》Unit 22
acerb/acri: comes from the Latin adjective acer, meaning 'sharp' or 'sour'. acerbic: [ə'sɜːrbɪk] adj ...
- Nginx 笔记与总结(14)expires 缓存设置
设置缓存,可以提高网站性能. 当网站的部分内容,比如新闻站的图片,一旦发布就不太可能发生更改,此时需要用户在访问一次页面之后,把该页面的图片缓存在用户的浏览器端一段时间,就可以用到 nginx 的 e ...
- jQuery Ajax 确定 form 表单 submit 提交成功
使用 jQuery 提交表单,可以使用 同步方式(async: false). a.html 是 html 文件,a.php 是服务端文件,把 a.html 中表单的数据提交到 a.php 中,在提交 ...
- UItableview里面的header、footer
#import "ViewController.h" #import "MJRefresh.h" @interface ViewController () { ...
- Yii源码阅读笔记(八)
前面阅读了Yii2的两个基本类Object和Component,了解了Yii的三个重要概念属性.事件.行为,下面开始阅读Event类,Event类是所有事件类的基类: <?php /** * @ ...
- A20的板子笔记
除了串口可以登入控制台,还可以用SSH2. ftp连接的时候要打开 vi /usr/sbin/stupid-ftpd.conf 修改端口,修改完端口,登入的时候root的密码跟以前不一样,可以从st ...
- 浅析C++的内存管理
在C++中,内存分成5个区,他们分别是堆.栈.自由存储区.全局/ 静态存储区和常量存储区. 栈,就是那些由编译器在需要的时候分配,在不需要的时候自动清楚的变量的存储区.里面的变量通常是局部变量.函数参 ...
- freemarker 自定义标签
1.编写标签类 package com.pccw.business.fnd.common.filegen; import java.io.IOException; import java.io.Wri ...
- python标准库介绍
操作系统接口 os模块提供了不少与操作系统相关联的函数. >>> import os >>> os.getcwd() # 返回当前的工作目录 'C:\\Python ...