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文档,最后终于在找到解决办法,所以贴出来,希望能够留个底,也能帮助有需要的人. -------- ...
随机推荐
- Java后端学习路线_备战
SpringCloud项目实战 Dubbo项目实战 项目实战应涵括哪些技术: 缓存.消息队列 WEB应用服务器(Weblogic.Jetty.JBoss.WebSphere) NoSQL(MongoD ...
- SSM框架删除/更新时返回影响条数
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> < ...
- python-水仙花数
>>> for a in range(1,10):... for b in range(0,10):... for c in range(0,10):... x=100*a+10*b ...
- 微信小程序:errcode=40029和invalid code, hints: [ req_id: VyLhYa0451hb31 ]
问题: 后台用小程序返回的code请求微信服务器换取session_key和openid,返回错误状态码40029 解决问题 当前小程序绑定的appid和请求微信服务器所带的appid参数不一致导致的 ...
- Navicat Premium 12试用期的破解方法
参考:https://blog.csdn.net/Jason_Julie/article/details/82864187 已测可用
- 区间DP入门
所为区间DP,主要是把一个大区间拆分成几个小区间,先求小区间的最优值,然后合并起来求大区间的最优值. 区间DP最关键的就是满足最优子结构以及无后效性!! 例如像是石子合并和括号匹配这两类比较经典的模型 ...
- Ubuntu14.04环境下Qt5.5以上版本无法输入中文的解决教程
1.前言 由于Qt5.4之后对之前的Qt5版本不再二进制兼容,所以网上很多简单的旧的办法已经失效了,所以本教程的办法是重新编译fcitx-qt5,生成最新的libfcitxplatforminputc ...
- c++_包子凑数
标题:包子凑数 小明几乎每天早晨都会在一家包子铺吃早餐.他发现这家包子铺有N种蒸笼,其中第i种蒸笼恰好能放Ai个包子.每种蒸笼都有非常多笼,可以认为是无限笼. 每当有顾客想买X个包子,卖包子的大叔就会 ...
- 条款6:若不想使用编译器自动生成的函数,就该明确拒绝(Explicity disallow the use of compiler-generated functions you do not want)
class uncopyable{ protected: uncopyable(){}; ...
- C语言 NULL 是什么鬼
NULL , 0 , '\0' 之间的区别与联系 1.NULL 结构体的使用中,都可以用NULL表示空,那么NULL是什么 #ifndef __cplusplus #define NULL ((vo ...