阅读:2876回复:6
空间查找问题,里面的内容很详细!敬请各位大师给予帮助!
<P ><B>敬请各位大师给予帮助!<p></p></B></P>
<P >问题:(下面的问题至今还没有找到原因,望大师指点回复,不胜感激!)<p></p></P> <P ><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 ><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 ><FONT face="Times New Roman">Dim player As IFeatureLayer</FONT></P> <P ><FONT face="Times New Roman"> Dim pSelection As IFeatureSelection</FONT></P> <P ><FONT face="Times New Roman"> Dim pSelset As ISelectionSet</FONT></P> <P ><FONT face="Times New Roman"> Dim pfeatCls As IFeatureClass</FONT></P> <P ><FONT face="Times New Roman"> Dim pCursor As IFeatureCursor</FONT></P> <P ><FONT face="Times New Roman"> </FONT></P> <P ><FONT face="Times New Roman"> '</FONT>定义空间过滤接口</P> <P ><FONT face="Times New Roman"> Dim pFilter As ISpatialFilter</FONT></P> <P ><FONT face="Times New Roman"> Set pFilter = New SpatialFilter</FONT></P> <P ><FONT face="Times New Roman"> Dim pGeometry As IGeometry</FONT></P> <P ><FONT face="Times New Roman"> Set pGeometry = pPursfeat.Shape</FONT></P> <P ><FONT face="Times New Roman"> sbSearchLayer "SDE.PSSDEGHD", MapControl1</FONT></P> <P ><FONT face="Times New Roman"> Set player = pSearchLayer</FONT></P> <P ><FONT face="Times New Roman"> Set pfeatCls = player.FeatureClass</FONT></P> <P ><FONT face="Times New Roman"> Dim pMap As IMap</FONT></P> <P ><FONT face="Times New Roman"> Set pMap = MapControl1.Map</FONT></P> <P ><FONT face="Times New Roman"> Set pGeometry.SpatialReference = pMap.SpatialReference</FONT></P> <P ><FONT face="Times New Roman"> With pFilter<p></p></FONT></P> <P ><FONT face="Times New Roman"> Set .Geometry = pGeometry<p></p></FONT></P> <P ><FONT face="Times New Roman"> .GeometryField = "SHAPE"<p></p></FONT></P> <P ><FONT face="Times New Roman"> .SpatialRel = esriSpatialRelTouches<p></p></FONT></P> <P ><FONT face="Times New Roman"> End With</FONT></P> <P ><FONT face="Times New Roman"> Set pCursor = pfeatCls.Search(pFilter, False)</FONT></P> <P ><FONT face="Times New Roman"> Set pLastfeat = New Feature</FONT></P> <P ><FONT face="Times New Roman"> Set pLastfeat = pCursor.NextFeature</FONT></P> <P ><FONT face="Times New Roman"> <p></p></FONT></P> <P >我试过很多数据,也曾经新建图层画一些管线然后导入做实验,结果是在<FONT face="Times New Roman">shp</FONT>文件都可以判断出来,而导入<FONT face="Times New Roman">sde</FONT>后有些可以判断出来有些判断不出来,很奇怪!</P> <P ><FONT face="Times New Roman"> <p></p></FONT></P> <P ><B>说明:</B><B>①</B>在将数据导入<FONT face="Times New Roman">sde</FONT>中时,我没有做什么设置,导入过程如下:</P> <P ><v:shape><v:imagedata></v:imagedata></v:shape></P> <P ><v:shape><v:imagedata></v:imagedata></v:shape></P> <P ><FONT face="Times New Roman"> <p></p></FONT></P> <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><B>这个也不知道为什么出错,会对空间查找产生影响吗?<p></p></B></P> <P ><B>②我的开发环境是:ARCGIS9,ARCSDE9 FOR ORACLE,VB+ArcObject,IE6。0<p></p></B></P> <P ><B> </B><B><p></p></B></P> <P ><FONT face="Times New Roman"><B>2005-09-13</B><B><p></p></B></FONT></P> <P ><B><p><FONT face="Times New Roman"></FONT></p></B></P> <P ><FONT face="Times New Roman"> <p></p></FONT></P><img src="images/post/smile/dvbbs/em02.gif" /><img src="images/post/smile/dvbbs/em02.gif" /><img src="images/post/smile/dvbbs/em11.gif" /><img src="images/post/smile/dvbbs/em12.gif" /> |
|
1楼#
发布于:2005-09-13 17:02
<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>
|
|
2楼#
发布于:2005-09-13 17:05
<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:shapetype> </v:shapetype></v:imagedata></v:shape>
|
|
3楼#
发布于:2005-09-13 17:09
<P><STRONG>:①</STRONG>在将数据导入<FONT face="Times New Roman">sde</FONT>中时,我没有做什么设置,导入过程如下:</P>
<P><V:SHAPE><V:IMAGEDATA></V:IMAGEDATA></V:SHAPE></P> <P><V:SHAPE><V:IMAGEDATA></V:IMAGEDATA></V:SHAPE></P> <P><FONT face="Times New Roman"> <br></FONT> <p> <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><B>这个也不知道为什么出错,会对空间查找产生影响吗? <p></B> <P> |
|
4楼#
发布于:2005-09-13 18:11
<P>是因为“吴建华”引起的,换成英文名字,:)</P>
<P>就不会有上面的错误</P> |
|
|
5楼#
发布于:2005-09-13 21:14
晕倒,太搞笑了吧!开玩笑的吧
|
|
6楼#
发布于:2006-02-15 16:56
<P>那个 128 的错误是因为你导入的数据表列名中有中文字符或其它非法字符(空格,括号,下划线等)</P>
|
|