chenmingjob
路人甲
路人甲
  • 注册日期2007-08-09
  • 发帖数1
  • QQ
  • 铜币112枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2135回复:1

[求助]gis网络分析求最短路径时添加stop点要素问题

楼主#
更多 发布于:2007-09-26 13:14
<P>刚刚了解gis的网络分析,使用的是arcengine的network analyst包(版本9.2),在arcgis的安装目录下java\samples\engine\NetworkAnalyst.RouteLayer\src\routing有一个network analyst的例子代码,是通过NAClassLoader来将bayarealocations FeatureClass读入NAClass中来做为其中的stop,所以我想在NAClass中直接添加feature来添加stop,下面是部分代码:</P>
<P>NAClass n=new NAClass(stopsNAClass);//stopsNAClass是一个INAClass,包含所有stops<BR>   cursor=new FeatureCursor(n.search(new QueryFilter(), false));<BR>   IFeature ifeature=cursor.nextFeature();<BR>   System.out.println(ifeature.getShape());<BR>  NALocationFeature i=(NALocationFeature)n.createFeature();</P>
<P>//直接获得NAClass中的要素的shape,进行修改获得一个point<BR>  Point p=(Point)ifeature.getShapeCopy();<BR> System.out.println(p.isZAware());//打印false<BR> System.out.println(p.isZSimple());//打印false<BR>   p.setX(-122.46);<BR>  p.setY(37.77);</P>
<P>//将point关联到feature并保存入NAClass中<BR>  i.setShapeByRef(p);<BR>  i.store();<BR>  cursor.insertFeature(i);</P>
<P>但是每次cursor.insertFeature(i)时就会出异常:</P>
<P>AutomationException: 0x80004005 - The geometry is not Z-aware in '"esri.Point"'</P>
<P>请各位赐教,在下不胜感激,另外可能有别的方法来实现添加stop的也请赐教,先谢了!</P>
喜欢0 评分0
long56
路人甲
路人甲
  • 注册日期2006-03-24
  • 发帖数57
  • QQ
  • 铜币246枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2007-12-23 22:56
不懂
举报 回复(0) 喜欢(0)     评分
游客

返回顶部