vonpower
外卖仔
外卖仔
  • 注册日期2005-07-19
  • 发帖数31
  • QQ
  • 铜币224枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1691回复:3

+---》ArcEngine坐标转换的问题《---+(page to map)

楼主#
更多 发布于:2005-08-05 21:22
<P>ArcEngine坐标转换的问题(page to map)<br>最近用java写程序需要把用在pagelayout上画的grid定位一些要素,<br>应此需要把pagelayout上的坐标转到map上,可是死活不成功,请大家帮忙想想办法~<br>先谢谢啦~</P>
<P><FONT color=#09f738>IDisplayTransformation pageTransformation = getPageLayout().getActiveView().getScreenDisplay().getDisplayTransformation();<br>IDisplayTransformation mapTransformation =getMapCtrl().getActiveView().getScreenDisplay().getDisplayTransformation();</FONT></P>
<P><FONT color=#09f738>  // IGeometry tempGeo=null;<br>  IEnvelope tempEnv = new Envelope();<br>  <br>  <br>  tagRECT tempRECT = new tagRECT();<br></FONT></P>
<P><FONT color=#09f738>  pageTransformation.transformRect(<br>        tempEnv,<br>        tempRECT,<br>        <br>        esriDisplayTransformationEnum.esriTransformToDevice+<br>        esriDisplayTransformationEnum.esriTransformPosition<br>          );<br>   <br>  mapTransformation<br>      .transformRect(<br>        tempEnv,<br>        tempRECT,<br>        esriDisplayTransformationEnum.esriTransformToMap+<br>        esriDisplayTransformationEnum.esriTransformPosition<br>         );<br></FONT>  <br>转换失败的表现:tempEnv最后被转成map坐标上的一个 点 (应该是一个矩形啊)<br>tempRECT始终没有用(top=0,bottom=0,left=0,right=0).<br>我的java也不熟,感觉是tempRECT没有被返回,在C++中可以传地址(;tempRECT),java<br>中因为tempRECT是class应该直觉就是传引用啊?想不通,会不会像c#一样有ref和out之类的keyword?<br>请gis高手和各位java达人帮忙想想~再次感谢~!</P>
[此贴子已经被作者于2005-8-5 21:39:50编辑过]
喜欢0 评分0
我的blog: http://my.opera.com/VonPower/ 欢迎对: GIS、智能交通、AE——AO开发、JAVA技术、。NET技术、设计模式、软件工程等感兴趣的同学 加入QQ群:10537919 一起努力吧~
vonpower
外卖仔
外卖仔
  • 注册日期2005-07-19
  • 发帖数31
  • QQ
  • 铜币224枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2005-08-05 21:38
<P><FONT color=#000000><STRONG>上面的代码颜色太亮,各位大侠可以看下面的:</STRONG></FONT></P>
<P><STRONG>我是看VB的例子写的java代码,下面蓝色的部分会不会有什么问题呢?</STRONG></P>
<P><FONT color=#000000><STRONG></STRONG></FONT> </P>
<P><STRONG><FONT color=#3300ff>IDisplayTransformation pageTransformation = getPageLayout().getActiveView().getScreenDisplay().getDisplayTransformation();<BR>IDisplayTransformation mapTransformation =getMapCtrl().getActiveView().getScreenDisplay().getDisplayTransformation();</FONT></STRONG></P>
<P><FONT color=#000000><STRONG>  // IGeometry tempGeo=null;<BR>  IEnvelope tempEnv = new Envelope();<BR>  <BR>  <BR>  tagRECT tempRECT = new tagRECT();<BR></STRONG></FONT></P>
<P><FONT color=#000000><STRONG>  pageTransformation.transformRect(<BR>        tempEnv,<BR>        <FONT color=#b34d61><EM>tempRECT</EM></FONT>,<BR>        <BR>        esriDisplayTransformationEnum.esriTransformToDevice+<BR>        esriDisplayTransformationEnum.esriTransformPosition<BR>          );<BR>   <BR>  mapTransformation<BR>      .transformRect(<BR>        tempEnv,<BR>        <FONT color=#c43c57><EM>tempRECT</EM></FONT>,<BR>        esriDisplayTransformationEnum.esriTransformToMap+<BR>        esriDisplayTransformationEnum.esriTransformPosition<BR>         );</STRONG></FONT></P>
<P><STRONG></STRONG> </P>
<P><STRONG></STRONG> </P>
我的blog: http://my.opera.com/VonPower/ 欢迎对: GIS、智能交通、AE——AO开发、JAVA技术、。NET技术、设计模式、软件工程等感兴趣的同学 加入QQ群:10537919 一起努力吧~
举报 回复(0) 喜欢(0)     评分
vonpower
外卖仔
外卖仔
  • 注册日期2005-07-19
  • 发帖数31
  • QQ
  • 铜币224枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2005-08-12 22:08
<P>还没有人回答吗~看来我只有想其他办法啦~</P>
我的blog: http://my.opera.com/VonPower/ 欢迎对: GIS、智能交通、AE——AO开发、JAVA技术、。NET技术、设计模式、软件工程等感兴趣的同学 加入QQ群:10537919 一起努力吧~
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15946
  • QQ554730525
  • 铜币25338枚
  • 威望15363点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
3楼#
发布于:2005-08-16 09:57
<P>你直接转换点坐标,再组成envelop,查询地图就可以</P>
<P>JH_ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y)</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部