阅读:1864回复:6
一个简单得问题
<P>代码如下:</P>
<P> <BR> //GraphicList里面存放的是一个polyLINE里所有的图形<BR> private IGeometry getMulRect(GraphicList list) throws UnknownHostException, IOException<BR> {<BR> Polyline pg = null;<BR> pg = new Polyline();<BR> IGeometryCollection gcc =pg.getAsIGeometryCollection() ;<BR> int size = list.size();<BR> IPointCollection pcc = new IPointCollectionProxy( pg);<BR> for(int i = 0;i<size;i++)<BR> {<BR> Path seg = new Path();<BR> IPointCollection pc = new IPointCollectionProxy( seg);<BR> //自己的程序,可以得到里面的点的坐标<BR> Rect poly = (Rect)list.getGraphicAt(i);<BR> getPoly(poly,pc);<BR> pcc.addPointCollection(pc);</P> <P> }</P> <P> <BR> return pg.getAsIGeometry();</P> <P> }</P> <P><BR> // poly,基本图形为几个矩形<BR> public void getPoly(Graphic pp,IPointCollection pc) throws UnknownHostException,<BR> IOException<BR> {<BR> if(pp instanceof Rect)<BR> {<BR> Rect rect = ( Rect)pp;<BR> IPoint p1 = new Point();<BR> p1.setY( rect.getNorthLat());<BR> p1.setX( rect.getEastLon());<BR> IPoint p2 = new Point();<BR> p2.setY( rect.getNorthLat());<BR> p2.setX( rect.getWestLon());<BR> IPoint p3 = new Point();<BR> p3.setY( rect.getSouthLat());<BR> p3.setX( rect.getWestLon());<BR> IPoint p4 = new Point();<BR> p4.setY( rect.getSouthLat());<BR> p4.setX( rect.getEastLon());<BR> </P> <P> pc.addPoint( p2, null, null); <BR> pc.addPoint( p3, null, null); <BR> pc.addPoint( p4, null, null); <BR> pc.addPoint( p1, null, null); <BR> pc.addPoint( p2, null, null); </P> <P> }</P> <P> }<BR></P> <P>我传入得是四个不相连得矩形,为什么用这个程序执行起来,四个矩形都被连接起来了呢,哪位大侠帮忙看看</P> |
|
1楼#
发布于:2006-08-12 15:31
ding
|
|
2楼#
发布于:2006-08-12 15:35
四个矩形是怎么的连起来了呀? 我没有明白。
|
|
|
3楼#
发布于:2006-08-15 09:04
没有人知道?我再顶
|
|
4楼#
发布于:2006-08-16 09:38
我来顶你,兄弟
|
|
5楼#
发布于:2006-08-16 10:07
<P>原图形是这样的:</P>
<P> <P>用AE转换好成这样了:</P> <P> <P>有人知道为什么吗?</P> |
|
6楼#
发布于:2006-08-22 10:51
ging
|
|