Mark 创建路径(c#)-动态分段
http://bbs.esrichina-bj.cn/ESRI/viewthread.php?action=printable&tid=128564
public void CreateRoutesUsing2Fields(string sAccessWS, string sLineFC, string sOutRouteFC, string sWhereClause, string sRouteIDField, string sFromMeasureField, string sToMeasureField)
{
try
{
IWorkspaceFactory wsf = new AccessWorkspaceFactoryClass();
IWorkspace ws = wsf.OpenFromFile(sAccessWS, 0);
IFeatureWorkspace fws = (IFeatureWorkspace)ws;
IFeatureClass lineFC = fws.OpenFeatureClass(sLineFC);
// Create an output feature class name object. We'll write to a stand alone feature class in the
// the same workspace as the inputs
IDataset ds = (IDataset)ws;
IWorkspaceName outWSN = (IWorkspaceName)ds.FullName;
IFeatureClassName outFCN = new FeatureClassNameClass();
IDatasetName outDSN = (IDatasetName)outFCN;
outDSN.WorkspaceName = outWSN;
outDSN.Name = sOutRouteFC; //This name should not already exist
// Create a geometry definition for the new feature class. For the most part, we will copy the geometry
// definition from the input lines. We'll explicitly set the M Domain, however. You should always set an
// M Domain that is appropriate to your data. What is below is just a sample.
IFields flds = lineFC.Fields;
Int32 i = flds.FindField(lineFC.ShapeFieldName);
IField fld = flds.get_Field(i);
IClone GDefclone = (IClone)fld.GeometryDef;
IGeometryDef gDef = (IGeometryDef)GDefclone.Clone();
ISpatialReference2 srRef = (ISpatialReference2)gDef.SpatialReference;
srRef.SetMFalseOriginAndUnits(-1000, 10000);
// Create a selection set to limit the number of lines that will be used to create routes
IQueryFilter qFilt = new QueryFilterClass();
qFilt.WhereClause = sWhereClause;
ISelectionSet2 selSet = (ISelectionSet2)lineFC.Select(qFilt, esriSelectionType.esriSelectionTypeIDSet, esriSelectionOption.esriSelectionOptionNormal, ws);
// Create a new RouteMeasureCreator object. Note that below, we use the selection set and not the
// InputFeatureClass property
IRouteMeasureCreator routeCreator = new RouteMeasureCreatorClass();
routeCreator.InputFeatureSelection = selSet;
routeCreator.InputRouteIDFieldName = sRouteIDField;
IEnumBSTR errors = routeCreator.CreateUsing2Fields(sFromMeasureField, sToMeasureField, outFCN, gDef, "", null);
// The results of running CreatingUsing2Fields returns IEnumBSTR, which is a container
// for a list of error strings indicating why certain lines could not be used to create routes.
string sError = errors.Next();
do
{
System.Windows.Forms.MessageBox.Show(sError);
sError = errors.Next();
} while (sError.Length != 0);
}
catch(Exception e)
{
System.Windows.Forms.MessageBox.Show(e.Message);
}
}
这段代码能否实现创建路径功能???
CreateUsing2Fields(sFromMeasureField, sToMeasureField, outFCN, gDef, "", null);
上面一行代码各个参数是什么意思呀~~为什么运行的时候出现错误
Mark 创建路径(c#)-动态分段的更多相关文章
- eclipse 创建maven 项目 动态web工程报错
Eclipse 创建maven 项目 动态web工程 注:Eclipse版本为(Version: Mars.1 Release (4.5.1))maven版本为(apache-maven-3.3.9) ...
- eclipse 创建maven 项目 动态web工程完整示例
需求表均同springmvc案例 此处只是使用maven 注意,以下所有需要建立在你的eclipse等已经集成配置好了maven了,说白了就是新建项目的时候已经可以找到maven了 没有的话需要安装m ...
- eclipse 创建maven 项目 动态web工程完整示例 maven 整合springmvc整合mybatis
接上一篇: eclipse 创建maven 项目 动态web工程完整示例 eclipse maven工程自动添加依赖设置 maven工程可以在线搜索依赖的jar包,还是非常方便的 但是有的时候可能还需 ...
- Android 通过Java代码生成创建界面。动态生成View,动态设置View属性。addRules详解
废话不多说,本文将会层层深入给大家讲解如何动态的生成一个完整的界面. 本文内容: Java代码中动态生成View Java代码中动态设置View的位置,以及其他的属性 LayoutParams详解 一 ...
- # 2017-2018-2 20155228 《信息安全系统设计原理》 使用VirtualStudio2008创建和调用静态库和使用VirtualC++6.0创建和调用动态库
使用virtual c++ 6.0创建和调用动态库 不得不说一下关于环境的问题 只要我打一个响指,一半的安装在win7上的VC6.0都会因为兼容性问题直接崩掉 懒得研究怎么解决兼容性的问题了,直接开一 ...
- windows 创建和调用 动态库,静态库
windows创建和调用静态库 // MathFuncsLib.h namespace MathFuncs { class MyMathFuncs { public: // Returns a + b ...
- c++ 创建路径方法
linux.unix平台 #include "stdio.h" #include "stdlib.h" #include <sys/types.h> ...
- [Swift通天遁地]九、拔剑吧-(3)创建多种自定义Segment分段样式的控件
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...
- activiti 5.15.1 动态手动通过java编码方式,实现创建用户任务,动态指定个人,用户组,角色,指定监听的实现
因为我们的业务需要,最近一直在搞动态动过java程序实现为用户任务绑定监听程序.碰了很多壁,查看了API文档,最后终于在找到解决办法,所以贴出来,希望能够留个底,也能帮助有需要的人. -------- ...
随机推荐
- (一) Docker in Docker
一. 背景介绍 工作中,要实现在docker中运行docker,实现镜像的拉取,创建,修改,上传等操作. 尝试过在docker中,安装docker.行不通,服务起不来. 而且直接在 docker 容 ...
- 什么是WebSocket (经常听别人讲感觉很高大上其实不然)
WebSocket 协议在2008年诞生,2011年成为国际标准.现在所有浏览器都已经支持了.WebSocket 的最大特点就是,服务器可以主动向客户端推送信息,客户端也可以主动向服务器发送信息,是真 ...
- HTTP隧道代理
reGeorg的前身是2008年SensePost在BlackHat USA 2008 的 reDuh延伸与扩展.也是目 前安全从业人员使用最多,范围最广,支持多丰富的一款http隧道.从本质上讲,可 ...
- 服务器禁用ping
linux禁ping.这里操作的是centos6.5内核参数禁ping禁用ping #echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all启用ping ...
- HTML 5 <a> 标签
href 属性 定义和用法 href 属性规定链接的目标地址. 如果未使用 href 属性,则 <a> 标签不是链接,而是链接的占位符. HTML 4.01 与 HTML 5 之间的差异 ...
- 设计模式:命令模式(Command Pattern)
问题 某个类中需要定义一个方法,该方法要实现的功能不确定的,需要等到程序执行该方法的时候才确定下来. 例如:定义一个计算数组的方法,可能需要遍历输出数组,也有可能是需要对数组中元素求和. 解决方案 按 ...
- vs编译应用程序不依赖运行vs环境
控制台应用程序不依赖VS运行环境就可以运行的设置: 1,使用release模式编译 2,项目属性中,“C/C++”,“代码生成”中的运行库改为“多线程(/MT)” 3,项目属性中,“链接器”,“系统” ...
- 【struts2】学习笔记
常见问题及注意事项: 1.下载struts2时,要看清所下载的版本,不同版本web.xml配置路径不同! 2. 导入jar包时,导入的包要完全准确,缺少或过多的会导致缺失或冲突! 3. Registe ...
- Verilog仿真事件队列
1.分层的事件队列 2.执行事件的队列 3.仿真时间的计算 4.同一层事件,无先后顺序 这个点:觉得Verilog与systemVerilog比较,Verilog比较笼统,systemVerilog则 ...
- java线程总结--synchronized关键字,原理以及相关的锁
在多线程编程中,synchronized关键字非常常见,当我们需要进行“同步”操作时,我们很多时候需要该该关键字对代码块或者方法进行锁定.被synchronized锁定的代码块,只能同时有一条线程访问 ...