[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 方 ... 
随机推荐
- Scrum会议8(Beta版本)
			组名:天天向上 组长:王森 组员:张政.张金生.林莉.胡丽娜 代码地址:HTTPS:https://git.coding.net/jx8zjs/llk.git SSH:git@git.coding.n ... 
- maven相关概念
			1.maven仓库分为:本地仓库,远程仓库.远程仓库分为私服.中央仓储和其他公共库. 2.mvn clean install 部署到本地仓库 3.mvn clean deploy 部署到远程仓储 4. ... 
- Shader Model 版本与DirectX的关系(OpenGL对应的呢?)
			http://blog.sina.com.cn/s/blog_6e521a600100q4dr.html DX9还是能支持到固定管线的,虽然说是在内部被转换成shader: DX10明确不再支持固定管 ... 
- python 线程使用
			################# 线程演示脚本 ####################### #coding=utf-8import threadingfrom time import ctim ... 
- ajax中文传送到模板显示为null
			问题: 名称空间声明语句必须是第一个语句中的脚本: Fatal error: Namespace declaration statement has to be the very first stat ... 
- 各种常用的JSON接口,开动你的大脑你就可以做出各种应用,值得收藏
			各种常用的JSON接口,开动你的大脑你就可以做出各种应用,值得收藏 浏览:1412 发布日期:2014/01/27 分类:技术分享 这里为大家搜集了一些能够返回JSON格式的服务接口.部分需要用J ... 
- linux卸载php
			卸载: rpm -qa | grep php 所以正确的卸载顺序是:# rpm -e php-mysql-5.1.6-27.el5_5.3 --allmatches #同名全部卸载# rpm -e ... 
- 【转】javascript中this的四种用法
			在函数执行时,this 总是指向调用该函数的对象.要判断 this 的指向,其实就是判断 this 所在的函数属于谁. 在<javaScript语言精粹>这本书中,把 this 出现的场景 ... 
- 抓包工具Charles 【转】
			今天就来看一下Mac上如何进行抓包,之前有一篇文章介绍了使用Fidder进行抓包 http://blog.csdn.net/jiangwei0910410003/article/details/1 ... 
- 文件管理php代码操作文件
			<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ... 
