[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 方 ...
随机推荐
- js性能优化的小知识
避免全局查找 function search() { //当我要使用当前页面地址和主机域名 alert(window.location.href + window.location.host); } ...
- MemcacheQ安装及使用
一.MemcacheQ安装记录1.安装libevent查看是否已经安装了libeventrpm -qa|grep libevent如果没有安装使用yum安装yum install libevent l ...
- OpenMP并行编程
什么是OpenMP?“OpenMP (Open Multi-Processing) is an application programming interface (API) that support ...
- Windows注册表(持续更新)
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Zoom 下, 设置DWORD 值 ZoomDisabled 等于 1.
- BAE3.0上的java+tomcat代码发布
---------------------------------2016/01/25更新-------------------------------------- 最近两天去百度开放云,发现它再也 ...
- opencv提取截获图像(总结摘来)
opencv提取截获图像(总结摘来) http://blog.csdn.net/wuxiaoyao12/article/details/7305865 版权声明:本文为博主原创文章,未经博主允许不得转 ...
- java JDK8 学习笔记——第13章 时间与日期
第十三章 时间与日期 13.1 认识时间与日期 13.1.1 时间的度量 1.格林威治标准时间GMT 格林威治标准时间的正午是太阳抵达天空最高点之时.现在已经不作为标准时间使用. 2.世界时UT世界时 ...
- IIS8中部署WCF服务出错:HTTP 错误 404.3 - Not Found
解决方法,以管理员身份进入命令行模式,运行: "%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ ...
- DOCTYPE、指定语言、字符集
<!DOCTYPE html> 在HTML的最开始部分声明DOCTYPE文档类型,可以让浏览器或其他用户代理知道你要使用的Html语言类型:无论你打算使用何种类型的HTML语言,DOCTY ...
- php——n维数组的遍历——递归
<?php /**** ****/function digui($arr){ foreach($arr as $key => $value) { if(is_ar ...