创建shapefile文件
来源:互联网 发布:裂帛淘宝 编辑:程序博客网 时间:2024/05/07 01:29
public IFeatureClass CreateShapefile(string sPath, string sName, IFields pSrcFields)
{
IWorkspaceFactory pWorkspaceFactory = new ShapefileWorkspaceFactory();
IFeatureWorkspace pFWS = pWorkspaceFactory.OpenFromFile(sPath, 0) as IFeatureWorkspace;
IFeatureClass pFeatureClass = null;
// 如果创建失败,有可能是文件已存在!
pFeatureClass = pFWS.CreateFeatureClass(sName, pSrcFields, null, null, esriFeatureType.esriFTSimple, "Shape", string.Empty);
return pFeatureClass;
{
IWorkspaceFactory pWorkspaceFactory = new ShapefileWorkspaceFactory();
IFeatureWorkspace pFWS = pWorkspaceFactory.OpenFromFile(sPath, 0) as IFeatureWorkspace;
IFeatureClass pFeatureClass = null;
// 如果创建失败,有可能是文件已存在!
pFeatureClass = pFWS.CreateFeatureClass(sName, pSrcFields, null, null, esriFeatureType.esriFTSimple, "Shape", string.Empty);
return pFeatureClass;
}
注意事项:
按字段创建shapefile
1、不要设置OID、ObjectID类型字段,该方法会自动创建一个FID的自增主键
2.至少包含一个Shape[空间类型]字段,否则该CreateFeatureClass为出错
0 0
- 创建空白ShapeFile文件
- 创建shapefile文件
- C++、GDAL创建shapefile文件
- Shapefile文件
- 使用gdal ogr创建shapefile文件(c++)
- 使用gdal的ogr创建shapefile文件(c++)
- Shapefile文件组成,Shapefile文件的修复
- IDL读取Shapefile文件
- geotools读取shapefile文件
- Shapefile 文件的局限性
- C++、GDAL创建shapefile,并向矢量文件中添加网格
- android 平台下通过GDAL创建SHP(ShapeFile)文件至SD卡
- FeatureLayer到本地shapefile文件
- shapefile文件(shp)读取
- AE创建一个空白的Shapefile
- ArcGIS 学习笔记-创建graticule shapefile
- shapefile文件中单点的读取
- 小马看GIS--Shapefile文件解析(一)
- spring-mvc 3.2.12及以后<mvc:resource>配置处理的变化
- comboBox1 查找其他数据
- ASCII Codes Table
- IntelliJ IDEA 导入maven工程 点NEXT 没反应
- android 16进制/10进制/2进制转换
- 创建shapefile文件
- 九度oj 1079
- [leetcode][trie] Implement Trie (Prefix Tree)
- Java 集合深入学习--ArrayList,LinkedList和Vector
- php表单02-表单验证
- iOS开发 -- 程序常见错误(不定时更新,适合初学)
- Android Studio 快捷键 (Mac OS X 10.5+)
- Linux操作系统修改PATH的方法
- JS监听页面刷新或关闭事件