wjhgis
路人甲
路人甲
  • 注册日期2005-03-11
  • 发帖数67
  • QQ
  • 铜币359枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:3019回复:10

SDE空间对象查找不出来呢,好奇怪啊!!!

楼主#
更多 发布于:2005-09-10 19:48
<P> 下面代码对shape文件中的对象可以检索到邻接的对象,为什么</P>
<P>针对sde中的同样的数据(shape导入sde库后),有的对象检索不出来呢,好奇怪啊!!!</P>

<P> Dim pFilter As ISpatialFilter<BR>    Set pFilter = New SpatialFilter<BR>    With pFilter<BR>        Set .Geometry = pFeat1.Shape<BR>        .GeometryField = "SHAPE"<BR>        .SpatialRel = esriSpatialRelTouches<BR>        .SearchOrder = esriSearchOrderSpatial<BR>    End With</P>
喜欢0 评分0
wjhgis
路人甲
路人甲
  • 注册日期2005-03-11
  • 发帖数67
  • QQ
  • 铜币359枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2005-09-11 10:21
<img src="images/post/smile/dvbbs/em01.gif" />
举报 回复(0) 喜欢(0)     评分
wjhgis
路人甲
路人甲
  • 注册日期2005-03-11
  • 发帖数67
  • QQ
  • 铜币359枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2005-09-11 21:44
<img src="images/post/smile/dvbbs/em02.gif" />
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
3楼#
发布于:2005-09-12 20:22
查询语句没错,可能是你查询的图层设置有问题
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
wjhgis
路人甲
路人甲
  • 注册日期2005-03-11
  • 发帖数67
  • QQ
  • 铜币359枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2005-09-13 13:22
<P>图层设置那些图层设置啊?我怎么不知道啊,导入sde的时候的精度设置?好像导入后没有损失啊</P><img src="images/post/smile/dvbbs/em02.gif" />
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
5楼#
发布于:2005-09-14 15:53
<P>你确定你获取到了你查询的图层吗?</P>
<P>查询的语句是什么样的?</P>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
wjhgis
路人甲
路人甲
  • 注册日期2005-03-11
  • 发帖数67
  • QQ
  • 铜币359枚
  • 威望0点
  • 贡献值0点
  • 银元0个
6楼#
发布于:2005-09-14 17:29
<P 0cm 0cm 0pt"><B>敬请各位工程师给予帮助!<p></p></B></P>
<P 0cm 0cm 0pt">问题:(下面的问题至今还没有找到原因,望大师指点回复,不胜感激!)<p></p></P>
<P 0cm 0cm 0pt; TEXT-INDENT: 21.1pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.55pt"><B>下面的代码如果图层中加载的是<FONT face="Times New Roman">shp</FONT></B><B>格式文件,则可以判断出<FONT face="Times New Roman">1</FONT></B><B>和<FONT face="Times New Roman">2</FONT></B><B>管线与<FONT face="Times New Roman">A</FONT></B><B>管线相邻接,如果将该图层导入<FONT face="Times New Roman">sde</FONT></B><B>中,则只能判断出管线<FONT face="Times New Roman">2</FONT></B><B>与它相邻。<p></p></B></P>
<P 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><v:shapetype><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path connecttype="rect" gradientshapeok="t" extrusionok="f"></v:path><lock aspectratio="t" v:ext="edit"></lock></v:shapetype><v:shape><v:imagedata></v:imagedata></v:shape><B><p></p></B></P>
<P 0cm 0cm 0pt; mso-outline-level: 1"><FONT face="Times New Roman">Dim player As IFeatureLayer</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Dim pSelection As IFeatureSelection</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Dim pSelset As ISelectionSet</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Dim pfeatCls As IFeatureClass</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Dim pCursor As IFeatureCursor</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman"> </FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    '</FONT>定义空间过滤接口</P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Dim pFilter As ISpatialFilter</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set pFilter = New SpatialFilter</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Dim pGeometry As IGeometry</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set pGeometry = pPursfeat.Shape</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    sbSearchLayer "SDE.PSSDEGHD", MapControl1</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set player = pSearchLayer</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set pfeatCls = player.FeatureClass</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Dim pMap As IMap</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set pMap = MapControl1.Map</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set pGeometry.SpatialReference = pMap.SpatialReference</FONT></P>
<P 0cm 0cm 0pt; mso-outline-level: 1"><FONT face="Times New Roman">    With pFilter<p></p></FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">        Set .Geometry = pGeometry<p></p></FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">        .GeometryField = "SHAPE"<p></p></FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">        .SpatialRel = esriSpatialRelTouches<p></p></FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    End With</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set pCursor = pfeatCls.Search(pFilter, False)</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set pLastfeat = New Feature</FONT></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman">    Set pLastfeat = pCursor.NextFeature</FONT></P>
<P 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT face="Times New Roman"> <p></p></FONT></P>
<P 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt">我试过很多数据,也曾经新建图层画一些管线然后导入做实验,结果是在<FONT face="Times New Roman">shp</FONT>文件都可以判断出来,而导入<FONT face="Times New Roman">sde</FONT>后有些可以判断出来有些判断不出来,很奇怪!</P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman"> <p></p></FONT></P>
<P 0cm 0cm 0pt"><B>说明:</B><B>①</B>在将数据导入<FONT face="Times New Roman">sde</FONT>中时,我没有做什么设置,导入过程如下:</P>
<P 0cm 0cm 0pt"><v:shape><v:imagedata></v:imagedata></v:shape></P>
<P 0cm 0cm 0pt"><v:shape><v:imagedata></v:imagedata></v:shape></P>
<P 0cm 0cm 0pt"><FONT face="Times New Roman"> <p></p></FONT></P>
<P 0cm 0cm 0pt">但是老有错误如上图绿色文字所示:<FONT face="Times New Roman">Failed to convert E:\</FONT>吴建华<FONT face="Times New Roman">\SDE_PS_ZT_GHD.shp. ASCII decoding error: ordinal not in range(128) </FONT><B>这个也不知道为什么出错,会对空间查找产生影响吗?<p></p></B></P>
<P 0cm 0cm 0pt"><B>②我的开发环境是:ARCGIS9,ARCSDE9 FOR ORACLE,VB+ArcObject,IE6。0<p></p></B></P>
举报 回复(0) 喜欢(0)     评分
wjhgis
路人甲
路人甲
  • 注册日期2005-03-11
  • 发帖数67
  • QQ
  • 铜币359枚
  • 威望0点
  • 贡献值0点
  • 银元0个
7楼#
发布于:2005-09-14 17:35
<P><a href="http://www.gisempire.com/bbs/dispbbs.asp?boardID=62;ID=45786;page=1" target="_blank" ><FONT color=#000000>空间查找问题,里面的内容很详细!敬请各位大师给予帮助!</FONT></A></P>
<P>请看上面那个例子,里面有详细介绍,谢谢你!</P>
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
8楼#
发布于:2005-09-15 11:42
<P><FONT face="Times New Roman">Failed to convert E:\</FONT>吴建华<FONT face="Times New Roman">\SDE_PS_ZT_GHD.shp. ASCII decoding error: ordinal not in range(128) </FONT></P>
<P><FONT face="Times New Roman">解决方法:不要有汉字</FONT></P>
<P><FONT face="Times New Roman"></FONT> </P>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
wjhgis
路人甲
路人甲
  • 注册日期2005-03-11
  • 发帖数67
  • QQ
  • 铜币359枚
  • 威望0点
  • 贡献值0点
  • 银元0个
9楼#
发布于:2005-09-18 13:54
谢谢,除了汉字导入不会出错了!但还是查找不出对象啊!
举报 回复(0) 喜欢(0)     评分
上一页
游客

返回顶部