转自原文 AE创建拓扑

/// <summary>
/// 创建拓朴
/// </summary>
/// <param name="featureWorkspace">要素集工作空间</param>
/// <param name="featuredatasetName"></param>
/// <param name="featureClassName"></param>
/// <returns></returns>
public ITopology Create_Topology(IFeatureWorkspace featureWorkspace, string featuredatasetName, string featureClassName, string topologyName)
{
try
{
//1.---打开拓朴所在的要素数据集,并创建拓朴
IFeatureDataset featureDataset = featureWorkspace.OpenFeatureDataset(featuredatasetName);
if (featureDataset != null)
{
ITopologyContainer topologyContainer = (ITopologyContainer)featureDataset;
ITopology topology = topologyContainer.CreateTopology("topo", topologyContainer.DefaultClusterTolerance, -, ""); //在这个地方报错
//2.---给拓朴加入要素集
IFeatureClassContainer featureclassContainer = (IFeatureClassContainer)featureDataset;
IFeatureClass featureClass = featureclassContainer.get_ClassByName(featureClassName);
topology.AddClass(featureClass, , , , false); // Parameters: AddClass(IClass, double weight, int xyrank, int zrank, Boolean EventNotificationOnValidate).
//3.---返回拓朴
return topology;
}
}
catch (Exception ex)
{
//System.Diagnostics.Debug.WriteLine(ex.ToString());
MessageBox.Show(ex.ToString());
}
return null;
} private void CreateTopButton_Click(object sender, EventArgs e)
{
//打开目标数据库
IWorkspace fWorkspace = open_pGDB_Workspace("e:\\Topo.mdb");
IFeatureWorkspace fW = fWorkspace as IFeatureWorkspace;
//启动编辑
IWorkspaceEdit workspaceEdit = (IWorkspaceEdit)fWorkspace;
workspaceEdit.StartEditing(true);
workspaceEdit.StartEditOperation();
//调用创建拓朴的方法
ITopology topology = Create_Topology(fW, "HN_DS", "HN", "Polygon_Topo");
//停止编辑
workspaceEdit.StopEditOperation();
workspaceEdit.StopEditing(true);
if (topology != null)
{
MessageBox.Show("创建拓朴成功!");
}
}

启动编辑是后来加上去的,若不启动编辑,则提示没有权限执行操作。

AE创建拓扑的更多相关文章

  1. Mininet在创建拓扑的过程中为什么不打印信息了——了解Mininet的log系统

    前言 写这篇博客是为了给我的愚蠢和浪费的6个小时买单! 过程原因分析 我用Mininet创建过不少拓扑了,这次创建的拓扑非常简单,如下图,创建拓扑的代码见github.在以前的拓扑创建过程中,我都是用 ...

  2. Mininet python代码创建拓扑、交互式界面创建主机、交换机

          python代码创建拓扑: from mininet.net importMininet net =Mininet() # Creating nodes in the network. c ...

  3. 【已解决】ArcGIS Engine无法创建拓扑的问题(CreateTopology)

    也许,你的问题是这样的 ①System.Runtime.InteropServices.COMException:"未找到拓扑." ②myTopology结果是null,程序跳转到 ...

  4. AE创建组件失败,项目中已存在对esri.arcgis.***的引用

    AE创建组件失败,项目中已存在对esri.arcgis.***的引用 解决办法:在解决方案资源管理器的引用中把错误提示中的引用删掉,再创建组件就没问题了.

  5. AE创建一个空白的Shapefile

    1.IField和IFieldEdit区别: IFieldEdit是继承IField的,因为IField的属性大部分是只读的(read-only),所以IFieldEdit就在IField的基础上多了 ...

  6. AE 创建

    using System; using System.Drawing; using System.Runtime.InteropServices; using ESRI.ArcGIS.ADF; usi ...

  7. 【总结整理】关于ArcGIS中拓扑的理解

    空间拓扑: https://www.baidu.com/link?url=f8fd1d75GhwtT1JuyPDZydZlWCgEXB9DeuTzDqGQIIRpq0bM-8t3MlC5tXYvEwQ ...

  8. AE开发概念辨析

    樱木 原文 AE开发之概念辨析2,AE开发涉及相关概念,AE开发相关概念 1 AE中的类库 AE总共包括了21个子库,分别是SYSTEM,SYSTEMUI,GEOMETRY,DISPLAY,SERVE ...

  9. ArcEngine拓扑

    空间拓扑描述的是自然界地理对象的空间位置关系-相邻,重合,连通等,是地理对象空间属性的一部分.目前ESRI提供的数据存储方式中,Coverage和GeoDatabase能够建立拓扑,Shape格式的数 ...

随机推荐

  1. Catch Me If You ... Can't Do Otherwise--转载

    原文地址:https://dzone.com/articles/catch-me-if-you-cant-do-otherwise I don't know whether it's an anti- ...

  2. 6.在单机上实现ZooKeeper伪机群/伪集群部署

    转自:https://blog.csdn.net/poechant/article/details/6633923

  3. openGLES(二)

    顶点和着色器 ​ 我们使用独立的点集合构建物体,都是使用顶点,之后会使用着色绘制图性,以及告诉OpenGLES如何绘制的小程序. ​ 片段着色器,即每个小的像素的渲染, ​ 顶点着色器确定所绘制图像的 ...

  4. C# foreach 循环遍历数组

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cons ...

  5. python之经典猜数字

    题目:猜数字1.让用户输入1-20,猜数字,可以猜5次.2.每次有提示,大了,或者小了!3.如果超过5次,提示game over. # !/usr/bin/env python # -*- codin ...

  6. 【Codeforces Round #450 (Div. 2) A】Find Extra One

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 模拟. 看看Y左边或右边的点个数是否<=1 [代码] #include <bits/stdc++.h> using ...

  7. spring使用context:property-placeholder载不进属性问题 wangbiglei 发表于1年前 原 spring使用context:property-placeholder载不进属性问题

    https://my.oschina.net/wangbiglei/blog/489583 http://www.cnblogs.com/leftthen/p/5615066.html

  8. [Angular] Http Custom Headers and RequestOptions

    updatePassenger(passenger: Passenger): Observable<Passenger> { let headers = new Headers({ 'Co ...

  9. [Angular] Style HTML elements in Angular using ngStyle

    We will learn how to make use of the ngStyle directive to directly add multiple style attributes to ...

  10. Javascript和jquery事件--滚动条事件和自定义滚动条事件样式

    很想把滚动条事件跟鼠标滚轮事件放在一起,那就直接写在这一篇了.除了事件以外,对滚动条样式的调整也记在这里吧. 滚动条是浏览器的默认事件,使用overflow:auto/scroll都有可能出现,它的默 ...