[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 方 ...
随机推荐
- HDU 3639 Bone Collector II(01背包第K优解)
Bone Collector II Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others ...
- C++四种强转
C++风格的类型转换提供了4种类型转换操作符来应对不同场合的应用. const_cast,字面上理解就是去const属性. static_cast,命名上理解是静态类型转换.如int转换成char. ...
- CSS架构
CSS架构 有趣的是,我们通常不这样评判其他语言.一个Rails开发者不会因为他写的代码规范就认为他是一个好的开发者.因为这是最基本的.当然它必须是满 足规范,除此以外还要考虑其他方面:代码是否有可读 ...
- PHP 错误与异常 笔记与总结(12 )异常
① 异常的概念:异常和错误的区别 PHP 部分借鉴了 C++ 和 JAVA 中的异常处理机制.PHP 中的异常是指 程序运行和预期不太一致,与错误是两个不同的概念. ② 异常的语法结构 [例1] &l ...
- redis hash怎么用
public static void testHsh() { System.out.println("==Hash=="); Jedis jedis = RedisUtil.get ...
- jpush极光推送知识点总结
1.jpushClient.sendPush(pushpayLoad):是发送推送的主要方法 2.pushpayload是具体推送消息.推送对象范围的封装 3.jpushClient.sendPush ...
- 【翻译】CEDCE2010 制作魅力绘制而要知道的光学小知识
关于Silicon Studio 个人觉得他们的后处理技术在国际上还是有相对水准的,而且不少日系游戏也采用了他们的全平台YEBIS 3的中间件. YEBIS 3的特性可以看下这个 http:// ...
- Yii源码阅读笔记(七)
接上次的组件(component)代码: /** * Returns a list of behaviors that this component should behave as. * 定义该对象 ...
- SMS模型格网转换为MIKE21的格网源代码
program main !sms网格转换成mike21网格 DIMENSION X(),Y(),H(),NDNN(,),ncbd() dimension NBS(),NOBD(,),NSED(,), ...
- Iphone H5上传照片被旋转
最近做项目发现在Iphone下,我们上传图片都会被翻转,最后查阅资料发现,的确是IOS的问题 不说过程,直接解决方法 iOS下,html方式使用<input type="file&qu ...