??xml version="1.0" encoding="utf-8" standalone="yes"?>日韩精品一区二区三区中文字幕,国产精品扒开腿做爽爽爽视频软件,av日韩国产http://www.aygfsteel.com/mycolby/category/29279.htmlhomezh-cnFri, 01 Jan 2010 07:40:38 GMTFri, 01 Jan 2010 07:40:38 GMT60Arcgis server 9.2 无法dArcGIS Manager 提示Incorrect Login Information http://www.aygfsteel.com/mycolby/articles/307946.html剑秋剑秋Thu, 31 Dec 2009 13:28:00 GMThttp://www.aygfsteel.com/mycolby/articles/307946.htmlhttp://www.aygfsteel.com/mycolby/comments/307946.htmlhttp://www.aygfsteel.com/mycolby/articles/307946.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/307946.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/307946.html解决办法Q?/p>

打开资源理器,工具菜单Q?gt;文g多w项Q?gt;查看Q去掉里面的单文件共?

如果q不行就从控刉板关闭window防火?/p>

剑秋 2009-12-31 21:28 发表评论
]]>
从ArcIMS ?ArcGIS Server Javascript API 开?/title><link>http://www.aygfsteel.com/mycolby/articles/303664.html</link><dc:creator>剑秋</dc:creator><author>剑秋</author><pubDate>Wed, 25 Nov 2009 09:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/mycolby/articles/303664.html</guid><wfw:comment>http://www.aygfsteel.com/mycolby/comments/303664.html</wfw:comment><comments>http://www.aygfsteel.com/mycolby/articles/303664.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mycolby/comments/commentRss/303664.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mycolby/services/trackbacks/303664.html</trackback:ping><description><![CDATA[<p>1、ؓ什么是ArcGIS server REST</p> <p>  下面的两q图分别描述了ArcIMS 和ArcGIS server REST的是h机制</p> <p>  ArcIMS </p> <p> <img class="" id="aimg_85160" onclick="zoom(this, this.src)" alt="image001.png" src="http://www.gissky.net/Article/UploadFiles/200909/20090910215115522.png" width="600" unselectable="true" h="399" w="600" outfunc="null" initialized="true" status="2" file="attachments/forumid_14/090803115342c7a5f2a5c4b13f.png" x="415" y="928" /></p> <p>  ArcGIS server REST</p> <p><img class="" id="aimg_85161" onclick="zoom(this, this.src)" alt="image003.png" src="http://www.gissky.net/Article/UploadFiles/200909/20090910215115855.png" width="600" unselectable="true" h="387" w="600" outfunc="null" initialized="true" status="2" file="attachments/forumid_14/09080311538dfb36e7d46a1793.png" x="415" y="1432" />   <br />       从图中的我们可以清晰地看出,如果把黄色虚U内看成是黑q话,其两U服务采用完全一Ll构QWebservice) ?不同之处在于ArcIMS 应用发送的是ArcXML 接收的是 ArcXML ,而ArcGIS server REST 应用发送的是GET (POST)h 接收的是 JSON。在之前 我们pq?ArcIMS之所以广受用L好评Q就是因为其架构优秀Q逻辑清晰Q开发方便,而ArcGIS server REST 也秉承了q个优点Q其架构也是q种发送请?接受l果的模式,不但l构清晰也利于开发者的开发调试。通过对其发送接受请求的分析能我们更清楚地认识q点?/p> <p>应用向ArcIMS的发送请?nbsp;  QgetFeatures)</p> <p><img class="" id="aimg_85162" onclick="zoom(this, this.src)" alt="image005.png" src="http://www.gissky.net/Article/UploadFiles/200909/20090910215116629.png" width="600" unselectable="true" h="201" w="600" outfunc="null" initialized="true" status="2" file="attachments/forumid_14/0908031153a11599ee2bea2bee.png" x="415" y="2056" /> </p> <p>   上面一个就是在ArcIMS里发送的查询hQ请求是在cities囑ֱ中查询名U是San diego的地图要素。而下面的Axl是ArcIMS接受到请求返回的查询l果?/p> <p><img class="" id="aimg_85163" onclick="zoom(this, this.src)" alt="image007.png" src="http://www.gissky.net/Article/UploadFiles/200909/20090910215116376.png" width="600" unselectable="true" h="270" w="600" outfunc="null" initialized="true" status="2" file="attachments/forumid_14/0908031153c3ab6a618210c373.png" x="415" y="2364" /> </p> <p>     从中我们可以看出San Diego地图要素的一些信?/p> <p>     下面q个h是应用向ArcGIS server REST的发送请?QgetFeatures)</p> <p><img class="" id="aimg_85164" onclick="zoom(this, this.src)" alt="image009.png" src="http://www.gissky.net/Article/UploadFiles/200909/20090910215116609.png" width="600" unselectable="true" h="115" w="600" outfunc="null" initialized="true" status="2" file="attachments/forumid_14/09080311535a1545454214e6b3.png" x="415" y="2743" /></p> <p>       不同于向ArcIMS发送的ArcXML 的POST方式Q这个请求是通过GET方式发送的字符Ԍ从字W串的参C我们可以看出Q其是向地图服务为USA的第0囑ֱ Qcities囑ֱQ发送一个请求,查询?city_NAME=San Diego 的地图要?br />        下面是ArcGIS server REST接受到请求后q回的查询结果?/p> <p> <img class="" id="aimg_85165" onclick="zoom(this, this.src)" alt="image011.png" src="http://www.gissky.net/Article/UploadFiles/200909/20090910215117294.png" width="600" unselectable="true" h="199" w="600" outfunc="null" initialized="true" status="2" file="attachments/forumid_14/09080311536350524a74d64c1d.png" x="415" y="3021" /><br />      从上面可以看出,ArcGIS server REST 和ArcIMS 是如此的怼Q都是请求应{模式,而相对于ArcIMS ?AXL而言ArcGIS server REST的JSON更适于脚本语言的解析(xml在不同浏览器下解析方法有很大区别Q,而且相同内容JSON比AXL更小Q这个在大数据结果返回中是很重要的,不仅仅如?ArcGIS server REST对于ArcIMS开发h?而言q具有不需要额外学习AO知识 Q入门迅速,{诸多方面优ѝ?/p> <p>Z么是 JavaScript Q?/p> <p>   在ArcIMS中用最多的是JavaScript开发(其次是java connector~Q,在很多项目中都是JavaScript做GIS 应用QDotNet或javaQJ2EEQ?作业务逻辑Q我怿大多数ArcIMS开发h员对JavaScript开发ƈ不陌生?/p> <p>JavaScript 的WebGIS 开发大致分Z下的三类Q?/p> <p>1、地囄展示Q?DIV ?IMG的抽?/p> <p>2、信息的查询 发送AJAXh</p> <p>3、动态信息的地图展示 <br />          对于marker  pop 是DIV<br />          对于Graphic 是 VML/SVG </p> <p><br />    下面q个是利用JavaScript向ArcIMS h地图的全q程Q其?url为ArcIMS服务器servlet connector的地址Qaxl 为发送的getmap h?/p> <p><img class="" id="aimg_85166" onclick="zoom(this, this.src)" alt="image013.png" src="http://www.gissky.net/Article/UploadFiles/200909/20090910215117163.png" width="600" unselectable="true" h="404" w="600" outfunc="null" initialized="true" status="2" file="attachments/forumid_14/0908031153d63f4931614774ee.png" x="415" y="3751" /> </p> <p>  其步骤:<br />        1、客LJavaScript建立xmlhttprequest 通道Q向ArcIMS的servlet connector 发送axlhQ黑色JavaScript代码Q?br />        2、ArcIMS 接受到请求生成图?br />        3、通过刚才客户端发起徏立的xmlhttprequest 通道QArcIMS发送AXLl客LQ告知生成的地图囄的url<br />        4、客LJavaScript解析收到的AXLQƈ告知面html抽换DIV中的囄指向urlQ色代码)<br />        5、页面通过新的url地址取到ArcIMS刚才生成的地囑֛片,展示l客戗?/p> <p>          <br />    相对于ArcIMS而言 ArcGIS server REST地图h更ؓ单,如下?/p> <p><img class="" id="aimg_85159" onclick="zoom(this, this.src)" alt="image015.png" src="http://www.gissky.net/Article/UploadFiles/200909/20090910215118602.png" width="600" unselectable="true" h="436" w="600" outfunc="null" initialized="true" status="2" file="attachments/forumid_14/0908031153db950495df7ee0f2.png" x="415" y="4466" /><br />   其步骤:<br />          1、利用JavaScript拼接h的urlԌ传给html<br />          2、页面请求url<br />          3、ArcGIS server REST 接受q个URL 生成地图囄以流的方式传l页?br />          4、页面展C地囑֛片给用户<br /> ?br />       以上的Javascript代码没有用到MAPIQ其主要目的是向大家说明,在有强大的服务端支持QArcIMS/ArcGIS server RESTQ下利用JavaScript开发WebGIS 应用是一件多么惬意的事情。而且 不要忘了,我们q有装大量要素的Javascript API ! <br /> 本篇文章来源?GISI间?转蝲请以链接形式注明出处 |址Qhttp://www.gissky.net/Article/1701.htm</p> <img src ="http://www.aygfsteel.com/mycolby/aggbug/303664.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mycolby/" target="_blank">剑秋</a> 2009-11-25 17:30 <a href="http://www.aygfsteel.com/mycolby/articles/303664.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ArcGis server 调用Javascript API实现与后台的参数传?/title><link>http://www.aygfsteel.com/mycolby/articles/303647.html</link><dc:creator>剑秋</dc:creator><author>剑秋</author><pubDate>Wed, 25 Nov 2009 07:58:00 GMT</pubDate><guid>http://www.aygfsteel.com/mycolby/articles/303647.html</guid><wfw:comment>http://www.aygfsteel.com/mycolby/comments/303647.html</wfw:comment><comments>http://www.aygfsteel.com/mycolby/articles/303647.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mycolby/comments/commentRss/303647.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mycolby/services/trackbacks/303647.html</trackback:ping><description><![CDATA[<p> </p> 1.在页面端Q首先撰写自定义的javascriptҎ(gu)Q有了这个方法,可以在前端面的Q何地方去触发地图事g了:<br /> <br /> function test(str){<br /> <br />     //需要传递到后台的自定义参数<br /> <br />     var str1=encodeURI(encodeURI(str));<br /> <br /> <br />     //“mapForm”是地N面上的表单名Q从该表单获取向后台提交的URL<br /> <br />     var url = EsriUtils.getServerUrl("mapForm");<br /> <br /> <br /> <br />     //“map1”是地N面上的地图ID<br /> <br />     var map = EsriControls.maps["map1"];<br /> <br /> <br />       //定义需要传递的参数列表Q最后的“EsriUtils.buildRequestParams(map.formId)”为固定写?br /> <br />     var params = "addpointInt=addpointInt";//q个参数用来在后台判断当前应该做什么操作,从而决定调用哪个处理类Q参数名和值都是自定义?br /> <br />     params += " &mapId=map1 ";//地图的ID<br /> <br />     params += " &str="+str1;//自定义的参数<br /> <br />     params += " &"+EsriUtils.buildRequestParams(map.formId);//固定写法<br /> <br />    <br /> <br />     //调用sendAjaxRequestҎ(gu)Q发送请求,其中的function(){testCallBack(xmlHttp);}为回调方?br /> <br />     var xmlHttp = EsriUtils.sendAjaxRequest(url,params,true,function(){testCallBack(xmlHttp);}); <br /> <br /> }<br /> <br /> <br /> 2.然后是相关的回调Ҏ(gu)Q回调方法就可以Ҏ(gu)自己的需要随意进行操作了Q这只是非常普通的AJAX回调Ҏ(gu)<br /> <br /> function testCallBack(xmlHttp){<br /> <br />     if (xmlHttp != null && xmlHttp.readyState == 4 && xmlHttp.status == 200) {<br /> <br />         var xml = xmlHttp.responseXML;<br /> <br />         var map = EsriControls.maps["map1"];<br /> <br />         // map.refresh();<br /> <br />         // alert("run here");<br /> <br />         map.resize(map.bounds.width, map.bounds.height);<br /> <br />     }<br /> <br /> }<br /> <br /> <br /> 3.然后是撰写后台程序,用以捕捉前台所触发的AJAX事g。这是一个listenerQ需要实现接口javax.faces.event.PhaseListenerQ?br /> <br />  <br /> <br /> import java.util.Map;<br /> <br />  <br /> <br /> import javax.faces.context.ExternalContext;<br /> <br /> import javax.faces.context.FacesContext;<br /> <br /> import javax.faces.event.PhaseEvent;<br /> <br /> import javax.faces.event.PhaseId;<br /> <br /> import javax.faces.event.PhaseListener;<br /> <br />  <br /> <br /> public class SelfPhaseListener implements PhaseListener {<br /> <br />         //////////////////////////////ajax处理代码<br /> <br />     public PhaseId getPhaseId() {<br /> <br />         // TODO Auto-generated method stub<br /> <br />  <br /> <br />         //q里表示在应用请求值阶D进行处?br /> <br />         return PhaseId.APPLY_REQUEST_VALUES;//.APPLY_REQUEST_VALUES;//选择action的回调处理过E?br /> <br />     }<br /> <br />      <br /> <br />      <br /> <br />     public void afterPhase(PhaseEvent phaseEvent) {<br /> <br />         //从FacesContext中获得由前端javascriptҎ(gu)传递来的参数列?br /> <br />         FacesContext facesContext = phaseEvent.getFacesContext();<br /> <br />         ExternalContext externalContext = facesContext.getExternalContext();<br /> <br />         Map paramMap = externalContext.getRequestParameterMap();<br /> <br />        <br /> <br /> <br />         //q里判断是不是我们需要的h,如果不是直接q回。这?#8220;addpointInt”x先前所定义的javasctiptҎ(gu)中的一个参?br /> <br />         if("addpointInt".equals((String) paramMap.get("addpointInt"))){<br /> <br />                     //q个AddPointPhaseListenercd是自定义的用来进行后台处理的c?br /> <br />             AddPointPhaseListener addpoint=new AddPointPhaseListener();<br /> <br />             addpoint.excute(paramMap, facesContext);<br /> <br />         }<br /> <br />      }<br /> <br />  <br /> <br />  <br /> <br />     @Override<br /> <br />     public void beforePhase(PhaseEvent arg0) {<br /> <br />        // TODO Auto-generated method stub<br /> <br />       <br /> <br />     }<br /> <br /> }<br /> <br /> <br /> 4.接下来写一个用来处理具体业务的c:<br /> <br /> import java.util.Map;<br /> <br />  <br /> <br /> import javax.faces.component.UIComponent;<br /> <br /> import javax.faces.context.FacesContext;<br /> <br />  <br /> <br /> import org.w3c.dom.Document;<br /> <br /> import org.w3c.dom.Element;<br /> <br />  <br /> <br /> import com.esri.adf.web.data.TocFunctionality;<br /> <br /> import com.esri.adf.web.data.WebContext;<br /> <br /> import com.esri.adf.web.data.WebMap;<br /> <br /> import com.esri.adf.web.faces.component.MapControl;<br /> <br /> import com.esri.adf.web.faces.renderkit.xml.ajax.AJAXUtil;<br /> <br /> import com.esri.adf.web.util.XMLUtil;<br /> <br />  <br /> <br /> public class AddPointPhaseListener {<br /> <br />     @SuppressWarnings("deprecation")<br /> <br />     public void excute(Map paramMap,FacesContext facesContext) {<br /> <br />         try {<br /> <br />             //get form element from view。获得页面上的表单对?br /> <br />             UIComponent form = facesContext.getViewRoot().findComponent((String) paramMap.get("mapForm"));<br /> <br />             if(form == null){<br /> <br />                 return;<br /> <br />             }<br /> <br />  <br /> <br />             //get map control。获得mapControl<br /> <br />             MapControl mc = (MapControl) form.findComponent((String) paramMap.get("mapId"));<br /> <br />             if(mc == null){<br /> <br />                 return;<br /> <br />             }<br /> <br />  <br /> <br />  <br /> <br />             //get web map, web context & clear graphics。获得WebMap,WebContextQ就可以q行地图操作?br /> <br />             WebMap wm = mc.getWebMap();<br /> <br />             WebContext wc = wm.getWebContext();<br /> <br />             wc.getWebQuery().clearGraphics();<br /> <br />             <br /> <br />             // read information form string of js function<br /> <br />             //获得从页面javasctiptҎ(gu)传递来的参数列?br /> <br />             String str=java.net.URLDecoder.decode((String) paramMap.get("str"), "UTF-8");<br /> <br />             ///////////////////////<br /> <br />             //如果需要返回的话,像这LXML的Ş式返回数?br /> <br />             //create and populate xml response document<br /> <br />             Document doc = XMLUtil.newDocument();<br /> <br />             Element responseTag = XMLUtil.createElement(doc, "response", null, null);<br /> <br />             responseTag.setAttribute("test", "hello");<br /> <br />             //write response<br /> <br />             AJAXUtil.writeResponse(facesContext, doc);<br /> <br />             <br /> <br />         }<br /> <br />         catch (Exception e) {<br /> <br />         }<br /> <br />         finally {<br /> <br />             facesContext.responseComplete();<br /> <br />         }<br /> <br />     }<br /> <br /> }<br /> <br /> <br /> <br /> 5.最后,需要在faces-context.xml文g中通过注册生命周期的方式,来以上q些代码生效Q?br /> <br /> <!-- MapViewer Phase Listener --><br /> <br /> <lifecycle><br /> <br />     <!-- q是默认的listener --><br /> <br />     <phase-listener><br /> <br />         com.esri.adf.web.templates.MapViewerPhaseListener<br /> <br />     </phase-listener><br /> <br /> <br />     <!-- q是先前自定义的Listener --><br /> <br />     <phase-listener><br /> <br />         com.megait.gis.listener.SelfPhaseListener<br /> <br />     </phase-listener><br /> <br /> </lifecycle><br /> <img src ="http://www.aygfsteel.com/mycolby/aggbug/303647.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mycolby/" target="_blank">剑秋</a> 2009-11-25 15:58 <a href="http://www.aygfsteel.com/mycolby/articles/303647.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ArcGis Server for JAVA 前台JS帮助http://www.aygfsteel.com/mycolby/articles/302250.html剑秋剑秋Fri, 13 Nov 2009 08:18:00 GMThttp://www.aygfsteel.com/mycolby/articles/302250.htmlhttp://www.aygfsteel.com/mycolby/comments/302250.htmlhttp://www.aygfsteel.com/mycolby/articles/302250.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/302250.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/302250.htmlhttp://edndoc.esri.com/arcobjects/9.2/Java/java/server/web_adf/javascript/clientside_js.html

剑秋 2009-11-13 16:18 发表评论
]]>
ArcGis Server 自定义Tools开?-获得所有前台参?/title><link>http://www.aygfsteel.com/mycolby/articles/302249.html</link><dc:creator>剑秋</dc:creator><author>剑秋</author><pubDate>Fri, 13 Nov 2009 08:15:00 GMT</pubDate><guid>http://www.aygfsteel.com/mycolby/articles/302249.html</guid><wfw:comment>http://www.aygfsteel.com/mycolby/comments/302249.html</wfw:comment><comments>http://www.aygfsteel.com/mycolby/articles/302249.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mycolby/comments/commentRss/302249.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mycolby/services/trackbacks/302249.html</trackback:ping><description><![CDATA[<p>package com.Myclass;</p> <p>import com.esri.adf.web.faces.event.ClientActionArgs;<br /> import com.esri.adf.web.faces.event.MapEvent;<br /> import com.esri.adf.web.faces.event.MapToolAction;<br /> import com.esri.adf.web.data.WebContext;<br /> import com.esri.adf.web.data.query.WebQuery;<br /> import com.esri.adf.web.data.geometry.WebGeometry;<br /> import com.esri.adf.web.ags.data.AGSMapResource;<br /> import com.esri.adf.web.ags.data.AGSMapFunctionality;<br /> import com.esri.arcgisws.MapServerPort;<br /> import com.esri.arcgisws.SpatialFilter;<br /> import com.esri.arcgisws.EsriSearchOrder;<br /> import com.esri.arcgisws.QueryFilter;<br /> import com.esri.arcgisws.EsriSpatialRelEnum;<br /> import com.esri.arcgisws.LayerDescription;<br /> import com.esri.arcgisws.RecordSet;<br /> import com.esri.arcgisws.Record;<br /> import com.esri.adf.web.ags.util.AGSUtil;<br /> import com.esri.arcgisws.PolygonN;</p> <p><br /> public class QueryPolygon implements MapToolAction //һK�ӿK?br /> {<br />  private WebContext webContext = null;<br />  private String pMsg ;<br />  public QueryPolygon(){}<br />  <br />  <br />  private void QueryFeature(WebGeometry pWebGeometry)<br />  {<br />   AGSMapResource pAGSMap = (AGSMapResource)webContext.getResources().get("ags1");<br />   MapServerPort pMapServer = pAGSMap.getMapServer();</p> <p>  PolygonN pPolygonN = (PolygonN)AGSUtil.toAGSGeometry(pWebGeometry);<br />         <br />   SpatialFilter spatialFilter = new SpatialFilter();<br />         spatialFilter.setSpatialRel(EsriSpatialRelEnum.esriSpatialRelIntersects);<br />         spatialFilter.setWhereClause("");//where<br />         spatialFilter.setSearchOrder(EsriSearchOrder.esriSearchOrderSpatial);<br />         spatialFilter.setSpatialRelDescription("");<br />         spatialFilter.setGeometryFieldName("");//<br />         spatialFilter.setFilterGeometry(pPolygonN);<br />         <br />         AGSMapFunctionality pMapFunc = (AGSMapFunctionality)pAGSMap.getFunctionality("map");<br />         LayerDescription[] pLayerDescs = pMapFunc.getLayerDescriptions();<br />         QueryFilter pFilter = (QueryFilter)spatialFilter;<br />         <br />         RecordSet pRSet = null;<br />         Record[] pRs = null;<br />         //WebQuery pWebQuery = this.webContext.getWebQuery();<br />         WebQuery pWebQuery = (WebQuery)this.webContext.getAttribute("query");<br />         pWebQuery.clearGraphics();</p> <p>        int pLayerCount = pLayerDescs.length;<br />         for(int i=0; i<pLayerCount;i++)<br />         {<br />          LayerDescription pLayerDesc = pLayerDescs[i];<br />    <br />          if(pLayerDesc.isVisible())<br />          {<br />           try<br />           { <br />             pRSet = pMapServer.queryFeatureData(pMapServer.getDefaultMapName(), i,pFilter);<br />           }<br />           catch(Exception pE)<br />           {<br />            return;<br />           }<br />           pRs = pRSet.getRecords();<br />           <br />           int TheLayerQueryCount = pRs.length;<br />           for(int j=0;j < TheLayerQueryCount;j++)<br />           {<br />            Record pItem = pRs[j];<br />            <br />            int TheItemValuesCount = pItem.getValues().length;<br />            for(int k=0; k<TheItemValuesCount;k++)<br />            {<br />             Object pOjb = pItem.getValues()[k];<br />             if(pOjb instanceof com.esri.arcgisws.Geometry)<br />             {<br />              WebGeometry pGeo = null;<br />              try<br />              {<br />               pGeo = AGSUtil.fromAGSGeometry((com.esri.arcgisws.Geometry)pOjb);<br />              }<br />              catch(Exception pE)<br />              {<br />               System.out.println(pE.getMessage());<br />               break;<br />              }<br />              pWebQuery.addDisplayGeometry(pGeo);<br />              break;<br />             }<br />            }<br />           }<br />          }<br />         }<br />         this.webContext.refresh();<br />  }<br />  <br />  public void execute(MapEvent arg0) throws Exception <br />  {  <br /> <font color="#ff0000">  ClientActionArgs clientarg = arg0.getClientActionArgs();<br />      System.out.println( "---所有参?--" + clientarg.getRequestParameters());<br /> </font>     <br />   this.webContext = arg0.getWebContext();<br />   WebGeometry pWebGeometry = arg0.getWebGeometry();<br />   pWebGeometry = pWebGeometry.toMapGeometry(arg0.getWebContext().getWebMap());<br />   this.QueryFeature(pWebGeometry);<br />  }<br />  <br /> }<br /> <br /> <br /> 转蝲? http://leo43.blog.hexun.com/p9/default.aspx</p> <img src ="http://www.aygfsteel.com/mycolby/aggbug/302249.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mycolby/" target="_blank">剑秋</a> 2009-11-13 16:15 <a href="http://www.aygfsteel.com/mycolby/articles/302249.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ArcGis Server JAVA ADF 实现地图中心Ҏ(gu)C?js实现).http://www.aygfsteel.com/mycolby/articles/302248.html剑秋剑秋Fri, 13 Nov 2009 08:13:00 GMThttp://www.aygfsteel.com/mycolby/articles/302248.htmlhttp://www.aygfsteel.com/mycolby/comments/302248.htmlhttp://www.aygfsteel.com/mycolby/articles/302248.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/302248.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/302248.html function leo(){
  var map = EsriControls.maps["map1"];
  var formId = map.formId;
  var serverUrl = EsriUtils.getServerUrl(formId);
  map.centerAt(210,200);//地图控件区域的210,200作ؓ中心Ҏ(gu)C?相当于让地图左移10个单?br />   map.resize(map.width,map.height);//map对象没有h地图的方?通过q种方式来刷新地?
}
</script>

<a:context value="#{mapContext}" id="c1" />
<a:map value="#{mapContext.webMap}" id="map1" width='400' height='400'/>
<input type="button" value="按我" onclick="leo()" />

转蝲? http://leo43.blog.hexun.com/p9/default.aspx

剑秋 2009-11-13 16:13 发表评论
]]>
ArcGis Server 使用TextCriteriaq行文本查询http://www.aygfsteel.com/mycolby/articles/302246.html剑秋剑秋Fri, 13 Nov 2009 08:12:00 GMThttp://www.aygfsteel.com/mycolby/articles/302246.htmlhttp://www.aygfsteel.com/mycolby/comments/302246.htmlhttp://www.aygfsteel.com/mycolby/articles/302246.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/302246.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/302246.html    
   //定义U类型的高亮样式
   WebSimpleLineSymbol markers1 = new WebSimpleLineSymbol();
   markers1.setAntialiasing(true);
   markers1.setColor("255,0,0");
   webQuery.setLineGraphicSymbol(markers1);
   
   //定义点类型的高亮样式
   WebSimpleMarkerSymbol markers2 = new WebSimpleMarkerSymbol();
   markers2.setAntialiasing(true);
   markers2.setColor("0,255,0");
   webQuery.setPointGraphicSymbol(markers2);
   
   //定义面类型的高亮样式
   WebSimplePolygonSymbol  markers3 = new WebSimplePolygonSymbol();
   markers3.setAntialiasing(true);
   markers3.setColor("0,0,255");
   webQuery.setPolygonGraphicSymbol(markers3);
   
   List<SelectItem> layers= new ArrayList();

   List<WebLayerInfo> layerList = webQuery.getQueryLayers();//获得所有图层信?br />    WebLayerInfo layerInfo = null;
   for(Iterator iter = layerList.iterator(); iter.hasNext(); ) {
   Object item = (Object) iter.next();
        if(item instanceof WebLayerInfo){
           layerInfo = (WebLayerInfo)item;
           layers.add(new SelectItem(layerInfo, layerInfo.getName()));
           System.out.println(layerInfo.getName());//囑ֱ名字,可以Ҏ(gu)它指定查询某?br />      }
   }

   TextCriteria tc = new TextCriteria();
   List<String> searchFields = new ArrayList<String>();
   searchFields.add("type");
   searchFields.add("sun");
   tc.setSearchFields(searchFields);//d需要查询的字段?br />    tc.setSearchText("1");//模糊查询的关键字
   
   List results=webQuery.query(tc,layerList);//执行查询
   System.out.println(results.size());//查询l果数量
   for(int ii=0;ii<results.size();ii++){
    QueryResult result = (QueryResult) results.get(ii);
    result.highlight();//执行高亮操作
    System.out.println(result.getDetails());//result.getDetails()可以获得所有字D?br />    }
   
   webMap.getWebContext().refresh();//h所有控?/p>

转蝲? http://leo43.blog.hexun.com/p9/default.aspx

 

 



剑秋 2009-11-13 16:12 发表评论
]]>
ArcGis Server 处理点层高亮不能清除的问?/title><link>http://www.aygfsteel.com/mycolby/articles/302245.html</link><dc:creator>剑秋</dc:creator><author>剑秋</author><pubDate>Fri, 13 Nov 2009 08:11:00 GMT</pubDate><guid>http://www.aygfsteel.com/mycolby/articles/302245.html</guid><wfw:comment>http://www.aygfsteel.com/mycolby/comments/302245.html</wfw:comment><comments>http://www.aygfsteel.com/mycolby/articles/302245.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mycolby/comments/commentRss/302245.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mycolby/services/trackbacks/302245.html</trackback:ping><description><![CDATA[ 通常使用的下面代码不能够清除高亮的点层图?br />   WebQuery pWebQuery = (WebQuery)webMap.getWebContext().getAttribute("query");<br />   pWebQuery.clearGraphics();<br /> <br /> <br /> <br />   因ؓ实际上高亮的处理ADF是通过新添加一个图层来实现?WebGraphics实际上就是控制这个图?<br />   WebGraphics graphics = webMap.getWebContext().getWebGraphics();<br />   graphics.clearGraphics();//q样p够正清除所有高亮的元素?br /> <br /> <br /> 转蝲? http://leo43.blog.hexun.com/p9/default.aspx <img src ="http://www.aygfsteel.com/mycolby/aggbug/302245.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mycolby/" target="_blank">剑秋</a> 2009-11-13 16:11 <a href="http://www.aygfsteel.com/mycolby/articles/302245.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ArcGis Server 自定义command按钮http://www.aygfsteel.com/mycolby/articles/302244.html剑秋剑秋Fri, 13 Nov 2009 08:10:00 GMThttp://www.aygfsteel.com/mycolby/articles/302244.htmlhttp://www.aygfsteel.com/mycolby/comments/302244.htmlhttp://www.aygfsteel.com/mycolby/articles/302244.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/302244.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/302244.htmlpackage com.demo;
import javax.faces.event.ActionEvent;
import com.esri.adf.web.data.WebContext;
import com.esri.adf.web.data.geometry.WebExtent;
import com.esri.adf.web.faces.event.MapEvent;
import com.esri.adf.web.faces.event.MapToolAction;
public class MyFullExtent {
WebContext context;
public WebContext getContext() {
return context;
}
public void setContext(WebContext context) {
this.context = context;
}                                                                                   
public void setFullExtent(){
try{
WebExtent ex=context.getWebMap().getFullExtent();
context.getWebMap().setCurrentExtent(ex);
context.refresh();
}catch(Exception ex){
ex.printStackTrace();
}
}
}


转蝲? http://leo43.blog.hexun.com/p9/default.aspx 
<managed-bean>
        <managed-bean-name>myFullExtent</managed-bean-name>
        <managed-bean-class>com.demo. MyFullExtent </managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        <managed-property>
          <property-name>context</property-name>
          <value>#{mapContext}</value>
        </managed-property>
  </managed-bean>


 <a:command id="fullExtent" action="#{myFullExtent.setFullExtent}" toolText="全图昄" />



剑秋 2009-11-13 16:10 发表评论
]]>
ArcGis Server 认识MapServerPort接口http://www.aygfsteel.com/mycolby/articles/302243.html剑秋剑秋Fri, 13 Nov 2009 08:09:00 GMThttp://www.aygfsteel.com/mycolby/articles/302243.htmlhttp://www.aygfsteel.com/mycolby/comments/302243.htmlhttp://www.aygfsteel.com/mycolby/articles/302243.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/302243.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/302243.htmlAGSMapResource agsMap = ((AGSMapResource)webContext.getResources().get("ags1"));//获得数据?配置文g中有声明
MapServerPort mapServer = agsMap.getMapServer();

//生成查询对象
EnvelopeN env = new EnvelopeN(extent.getMinX(), extent.getMinY(), extent.getMaxX(), extent.getMaxY(),null, null, null, null, null);
SpatialFilter spatialFilter = new SpatialFilter();
spatialFilter.setSpatialRel(EsriSpatialRelEnum.esriSpatialRelIntersects);
spatialFilter.setWhereClause("");
spatialFilter.setSearchOrder(EsriSearchOrder.esriSearchOrderSpatial);
spatialFilter.setSpatialRelDescription("");
spatialFilter.setGeometryFieldName("");
spatialFilter.setFilterGeometry(env);


try{
    int layerId = 1;//查询的土?ID号配|文件中有声?br />     this.countedFeatures = mapServer.queryFeatureCount(mapServer.getDefaultMapName(), layerId, spatialFilter);
    System.out.println("你选择?"+countedFeatures+" 要素");
                     
    }catch(RemoteException rme){
     throw new ADFAGSException("Could not execute MapServer::queryFeatureCount()",rme);
     }


Interface MapServerPort常用的方法:
mapServer.getDefaultMapName() 获得默认地图?br /> mapServer.queryFeatureCount(String mapName , int layerId ,SpatialFilter sf) return int 获得指定囑ֱ查询到的要素L
mapServer.queryFeatureData(String mapName , int layerId ,SpatialFilter sf) return RecordSet 获得指定囑ֱ查询到的要素?包含所有属性字D?
mapServer.getDefaultMapName() return String q回默认地图名称
mapServer.hasLayerCache(String mapName, int layerID) return bool q回指定囑ֱ是否是缓存图?/p>

转蝲? http://leo43.blog.hexun.com/p9/default.aspx

剑秋 2009-11-13 16:09 发表评论
]]>
ArcGis Server 实现动态图片标?/title><link>http://www.aygfsteel.com/mycolby/articles/302242.html</link><dc:creator>剑秋</dc:creator><author>剑秋</author><pubDate>Fri, 13 Nov 2009 08:08:00 GMT</pubDate><guid>http://www.aygfsteel.com/mycolby/articles/302242.html</guid><wfw:comment>http://www.aygfsteel.com/mycolby/comments/302242.html</wfw:comment><comments>http://www.aygfsteel.com/mycolby/articles/302242.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mycolby/comments/commentRss/302242.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mycolby/services/trackbacks/302242.html</trackback:ping><description><![CDATA[<p>//获得的标?br /> WebPoint pt=(WebPoint)arg0.getWebGeometry().toMapGeometry(arg0.getWebContext().getWebMap());<br />                               </p> <p>//获得囄的二q制 可以在application启动时进行读取,攑֜context的某个attribute里面?br /> String picPath= FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath()+"\\images\\angle.gif";<br /> File myFile = new File(picPath);        <br /> FileInputStream myStream= newFileInputStream(myFile);    <br /> BufferedInputStream buf = newBufferedInputStream(myStream);<br /> byte[] bytInput = newbyte[(int)myFile.length()];<br /> buf.read(bytInput, 0, (int) myFile.length());<br /> buf.close();<br /> myStream.close();</p> <p><br /> //在地图上标注<br /> WebPictureMarkerSymbol markers=newWebPictureMarkerSymbol(); <br /> markers.setPicture(bytInput);<br /> GraphicElement ge=new GraphicElement();<br /> ge.setGeometry(pt);<br /> ge.setSymbol(markers);<br /> WebGraphics graphics=arg0.getWebContext().getWebGraphics();<br /> graphics.addGraphics(ge);<br /> arg0.getWebContext().refresh();</p> <br /> 转蝲? http://leo43.blog.hexun.com/p9/default.aspx <img src ="http://www.aygfsteel.com/mycolby/aggbug/302242.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mycolby/" target="_blank">剑秋</a> 2009-11-13 16:08 <a href="http://www.aygfsteel.com/mycolby/articles/302242.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ArcGis Server 实现动态文字标?/title><link>http://www.aygfsteel.com/mycolby/articles/302241.html</link><dc:creator>剑秋</dc:creator><author>剑秋</author><pubDate>Fri, 13 Nov 2009 08:07:00 GMT</pubDate><guid>http://www.aygfsteel.com/mycolby/articles/302241.html</guid><wfw:comment>http://www.aygfsteel.com/mycolby/comments/302241.html</wfw:comment><comments>http://www.aygfsteel.com/mycolby/articles/302241.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mycolby/comments/commentRss/302241.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mycolby/services/trackbacks/302241.html</trackback:ping><description><![CDATA[<p>webMap=arg0.getWebContext().getWebMap(); <br /> WebPoint pt=(WebPoint)arg0.getWebGeometry().toMapGeometry(webMap); </p> <p><br /> WebTrueTypeMarkerSymbol trueMarkerSymbol=new WebTrueTypeMarkerSymbol(); //注意使用pȝ里面已经安装的字?<br /> trueMarkerSymbol.setFontName("ESRITransportation & Civic");//讄索引 <br /> trueMarkerSymbol.setCharacterIndex(8);<br /> trueMarkerSymbol.setFontColor("255,0,0");<br /> trueMarkerSymbol.setFontSize(20);<br /> trueMarkerSymbol.addTextValue("chongqing");//标注的文?br /> trueMarkerSymbol.setFontStyle(WebTrueTypeMarkerSymbol.BOLD);</p> <p><br /> GraphicElement ge=new GraphicElement(); <br /> ge.setGeometry(pt);<br /> ge.setSymbol(trueMarkerSymbol);<br /> WebGraphics graphics=arg0.getWebContext().getWebGraphics();<br /> graphics.addGraphics(ge);<br /> arg0.getWebContext().refresh();<br /> <br /> 转蝲? http://leo43.blog.hexun.com/p9/default.aspx</p> <img src ="http://www.aygfsteel.com/mycolby/aggbug/302241.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mycolby/" target="_blank">剑秋</a> 2009-11-13 16:07 <a href="http://www.aygfsteel.com/mycolby/articles/302241.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>认识ArcGis Server ADF中的UIComponenthttp://www.aygfsteel.com/mycolby/articles/302240.html剑秋剑秋Fri, 13 Nov 2009 08:06:00 GMThttp://www.aygfsteel.com/mycolby/articles/302240.htmlhttp://www.aygfsteel.com/mycolby/comments/302240.htmlhttp://www.aygfsteel.com/mycolby/articles/302240.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/302240.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/302240.htmljavax.faces.component.UIComponent

两种Ҏ(gu)获得WebMap

//Ҏ(gu)一
MapControl mapControl = (MapControl) component;
WebMap webMap = mapControl.getWebMap();

//Ҏ(gu)?br /> WebContext wctx = WebUtil.getWebContext(component);
WebMap webMap = wctx.getWebMap();

转蝲?http://leo43.blog.hexun.com/p9/default.aspx

剑秋 2009-11-13 16:06 发表评论
]]>
知名度较高的?sh)子地?/title><link>http://www.aygfsteel.com/mycolby/articles/271575.html</link><dc:creator>剑秋</dc:creator><author>剑秋</author><pubDate>Tue, 19 May 2009 10:47:00 GMT</pubDate><guid>http://www.aygfsteel.com/mycolby/articles/271575.html</guid><wfw:comment>http://www.aygfsteel.com/mycolby/comments/271575.html</wfw:comment><comments>http://www.aygfsteel.com/mycolby/articles/271575.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mycolby/comments/commentRss/271575.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mycolby/services/trackbacks/271575.html</trackback:ping><description><![CDATA[Live Search(<a target="_blank"><font size="2">比尔·盖次的地?/font></a>)Q?a >http://ditu.live.com/</a>?<br /> sogouQ?a >http://map.sogou.com/</a><br /> googleQhttp://ditu.google.cn/<br /> 我要地图Qhttp://maps.51ditu.com/<br /> 城市实景地图Qhttp://www.city8.com/<br /> 囑֐Qhttp://www.mapbar.com/<br /> E龙:http://map.elong.com/<br /> baiduQhttp://map.baidu.com/#<br /> 一图览天下Qhttp://www.ppmap.com/<br /> 华夏囄Qhttp://map2china.com/<br /> <br /> <img src ="http://www.aygfsteel.com/mycolby/aggbug/271575.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mycolby/" target="_blank">剑秋</a> 2009-05-19 18:47 <a href="http://www.aygfsteel.com/mycolby/articles/271575.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>地理(投媄)坐标与屏q坐标的转换!http://www.aygfsteel.com/mycolby/articles/268261.html剑秋剑秋Wed, 29 Apr 2009 16:41:00 GMThttp://www.aygfsteel.com/mycolby/articles/268261.htmlhttp://www.aygfsteel.com/mycolby/comments/268261.htmlhttp://www.aygfsteel.com/mycolby/articles/268261.html#Feedback3http://www.aygfsteel.com/mycolby/comments/commentRss/268261.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/268261.html     地理坐标定义规则:X?代表l度)向右递增,Y?U度)向上递增,好比小学学q的q面坐标(貌似又忘?要重d学了)?向左,向下的规?q个不用我再阐述了吧,如果你还不明?那我劝你q是真要去重d学了....比我更?zhn)哀,嘿嘿,ȝ扑ֈ一个知已啊....不容易啊...
    屏幕坐标定义规则:X轴向右递增,Y轴向下递增..
    可以看出,地理坐标和屏q坐标的区别仅仅只是在于Y轴递增方向是相反的...(q就是不?.
    好了,现在我们开始{换他们吧.  q里一点的是Z保证_ֺ,地理坐标的度*3600换算成秒,所有的取值用double来计?最后的l果再{换成int
    1.已知道屏q的?y)和宽(h),地理坐标区域的范?maxLon,minLon,maxLat,minLat)..q里我们知道了这些已知的参数...
    2.我们可以出每像素所代表的经度和U度(有hU这个ؓ比例因子):
        公式:scaleX = h/((maxLon-minLon)*3600)  ----------X轴上每像素代表的l度U数;
        公式:scaleY = y/((maxLat-minLat)*3600)  -----------Y轴上每像素代表的U度U数;
        q两个比例因子就是两个坐标系之间的关p?.
    3.很简单的一步了,那就是算地理坐标区域中的M一?lon,lat)在屏q上的坐标了,怎么?下面来讲:
       公式:screenX = lon*3600/scaleX;  ---------屏幕坐标X轴坐?br />        公式:screenY = lat*3600/scaleY; ----------屏幕坐标Y轴坐?        怎么?很简单吧?q里我们q出地理坐标上M一点{到屏q上的坐标是多少?.....
        q有最后一?那就是我们要把该地理区域占满占个屏幕该怎么办呢?
   4. 接着我们需要该地理区域占满占个屏幕该怎么办呢
        公式:minX = minLon*3600/scaleX;    区域左边|最左端
        公式:minY = minLat*3600/scaleY;     区域上面|最上端
   5. 当地地理范围区域占满整个屏幕?我们需要用到第三步计算出来?nbsp;screenX和screenY两个参数
,该区域中的Q何一点的公式如下:   
       公式:X = screenX - minX = (lon - minLon)*3600/scaleX;     
       ׃U度的方向和屏幕Y轴是相反? 
       公式:screenMaxLat = (maxLat - minLat)*3600/scaleY;
       公式:screenLat = (lat - minLat)*3600/scaleY;
       公式:Y = screenMaxLat - screenLat = (maxLat - lat)*3600/scaleY;     至于Z么是q个公式,我想大家仔细x明白了..
  6.ȝ:
        l纬度{屏幕坐标的最l公式如?
        公式: X = (lon - minLon)*3600/scaleX;  
        公式: Y =  (maxLat - lat)*3600/scaleY;
  接着我们׃面的公式可以推出屏幕坐标转经U度坐标公式如下Q?br />   公式Qlon = X * scaleX/3600 + minLon;
        公式Qlat = maxLat - y* scaleY/3600;

  呼呼......l于写完?׃要赶着睡觉,因ؓ明天q要早v上班,可能写的q不够清?大家再仔l研I一下就能够明白?   

剑秋 2009-04-30 00:41 发表评论
]]>
地理坐标pd大地坐标p?转蝲)http://www.aygfsteel.com/mycolby/articles/248449.html剑秋剑秋Fri, 26 Dec 2008 06:33:00 GMThttp://www.aygfsteel.com/mycolby/articles/248449.htmlhttp://www.aygfsteel.com/mycolby/comments/248449.htmlhttp://www.aygfsteel.com/mycolby/articles/248449.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/248449.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/248449.html地理坐标Qؓ球面坐标?参考^面地?椭球面。坐标单?l纬?/p>

大地坐标Qؓq面坐标。参考^面地?水^?nbsp;     坐标单位Q米、千c等?br />

地理坐标转换到大地坐标的q程可理解ؓ投媄?nbsp;  Q投影:不规则的地球曲面{换ؓq面Q?/p>

在ArcGIS中预定义了两套坐标系Q地理坐标系QGeographic coordinate systemQ投影坐标系QProjected coordinate systemQ,

1、首先理解地理坐标系QGeographic coordinate systemQ,Geographic coordinate system直译?
地理坐标pȝQ是以经U度为地囄存储单位的。很明显QGeographic coordinate syst
em是球面坐标系l。我们要地球上的数字化信息存放到球面坐标系l上Q如何进行操?
呢?地球是一个不规则的椭球,如何数据信息以U学的方法存攑ֈ椭球上?q必然要?
我们扑ֈq样的一个椭球体。这L椭球体具有特点:可以量化计算的。具有长半uQ短
半uQ偏心率。以下几行便是Krasovsky_1940椭球及其相应参数?
Spheroid: Krasovsky_1940
Semimajor Axis: 6378245.000000000000000000
Semiminor Axis: 6356863.018773047300000000
Inverse FlatteningQ扁率): 298.300000000000010000
然而有了这个椭球体以后q不够,q需要一个大地基准面这个椭球定位。在坐标pȝ?
qCQ可以看到有q么一行:
Datum: D_Beijing_1954
表示Q大地基准面是D_Beijing_1954?
--------------------------------------------------------------------------------
有了Spheroid和Datum两个基本条gQ地理坐标系l便可以使用?
完整参数Q?
Alias:
Abbreviation:
Remarks:
Angular Unit: Degree (0.017453292519943299)
Prime MeridianQv始经度): Greenwich (0.000000000000000000)
DatumQ大地基准面Q? D_Beijing_1954
SpheroidQ参考椭球体Q? Krasovsky_1940
Semimajor Axis: 6378245.000000000000000000
Semiminor Axis: 6356863.018773047300000000
Inverse Flattening: 298.300000000000010000


2、接下来便是Projection coordinate systemQ投影坐标系l)Q首先看看投影坐
标系l中的一些参数?
Projection: Gauss_Kruger
Parameters:
False_Easting: 500000.000000
False_Northing: 0.000000
Central_Meridian: 117.000000
Scale_Factor: 1.000000
Latitude_Of_Origin: 0.000000
Linear Unit: Meter (1.000000)
Geographic Coordinate System:
Name: GCS_Beijing_1954
Alias:
Abbreviation:
Remarks:
Angular Unit: Degree (0.017453292519943299)
Prime Meridian: Greenwich (0.000000000000000000)
Datum: D_Beijing_1954
Spheroid: Krasovsky_1940
Semimajor Axis: 6378245.000000000000000000
Semiminor Axis: 6356863.018773047300000000
Inverse Flattening: 298.300000000000010000
从参C可以看出Q每一个投影坐标系l都必定会有Geographic Coordinate System?
投媄坐标pȝQ实质上便是q面坐标pȝQ其地图单位通常为米?
那么Z么投影坐标系l中要存在坐标系l的参数呢?
q时候,又要说明一下投q意义Q将球面坐标转化为^面坐标的q程便称为投影?
好了Q投q条g出来了Q?
a、球面坐?
b、{化过E(也就是算法)
也就是说Q要得到投媄坐标必d有一?#8220;拿来”投媄的球面坐标,然后才能使用法
L影!
x一个投影坐标系l都必须要求有Geographic Coordinate System参数?br />

关于北京54和西?0是我们用最多的坐标p?br />         先简单介l高?克吕格投q基本知识Q了解就直接跌Q我国大中比例尺地图均采用高?克吕格投影,光常是按6度和3度分带投影,1:2.5万-1:50万比例尺地ŞN用经?度分带,1:1万比例尺的地形图采用l差3度分带。具体分带法是:6度分带从本初子午U开始,按经?度ؓ一个投影带自西向东划分Q全球共?0个投影带Q带号分别ؓ1Q?0Q?度投影带是从东经1?0U经U开始,按经?度ؓ一个投影带自西向东划分Q全球共?20个投影带。ؓ了便于地形图的测量作业,在高?克吕格投影带内布|了q面直角坐标pȝQ具体方法是Q规定中央经UؓX_赤道为Y_中央l线与赤道交点ؓ坐标原点Qx值在北半球ؓ正,南半球ؓ负,y值在中央l线以东为正Q中央经U以西ؓ负。由于我国疆域均在北半球Qx值均为正|Z避免y值出现负|规定各投影带的坐标纵轴均西移500kmQ中央经U上原横坐标值由0变ؓ500km。ؓ了方便带间点位的区分Q可以在每个点位横坐标y值的癑֍c位数前加上所在带P?0带内A点的坐标可以表示为YA=20 745 921.8m?/p>

    在Coordinate Systems\Projected Coordinate Systems\Gauss Kruger\Beijing 1954目录中,我们可以看到四种不同的命名方式:
    Beijing 1954 3 Degree GK CM 75E.prj
    Beijing 1954 3 Degree GK Zone 25.prj
    Beijing 1954 GK Zone 13.prj
    Beijing 1954 GK Zone 13N.prj
    对它们的说明分别如下Q?/div>
    三度分带法的北京54坐标p,中央l线在东75度的分带坐标Q横坐标前不加带?br />     三度分带法的北京54坐标p,中央l线在东75度的分带坐标Q横坐标前加带号
    六度分带法的北京54坐标p,分带号ؓ13Q横坐标前加带号
    六度分带法的北京54坐标p,分带号ؓ13Q横坐标前不加带?/div>
    在Coordinate Systems\Projected Coordinate Systems\Gauss Kruger\Xian 1980目录中,文g命名方式又有所变化Q?/div>
    Xian 1980 3 Degree GK CM 75E.prj
    Xian 1980 3 Degree GK Zone 25.prj
    Xian 1980 GK CM 75E.prj
    Xian 1980 GK Zone 13.prj
    西安80坐标文g的命名方式、含义和北京54前两个坐标相同,但没有出?#8220;带号+N”q种形式Qؓ什么没有采用统一的命名方式?让h看了有些费解?/div>

剑秋 2008-12-26 14:33 发表评论
]]>转蝲:数据~辑问题http://www.aygfsteel.com/mycolby/articles/247074.html剑秋剑秋Thu, 18 Dec 2008 04:41:00 GMThttp://www.aygfsteel.com/mycolby/articles/247074.htmlhttp://www.aygfsteel.com/mycolby/comments/247074.htmlhttp://www.aygfsteel.com/mycolby/articles/247074.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/247074.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/247074.html ?font style="line-height: 1.3em" face="Times" size="3">AE中数据的~辑是一个重点,也是一个难炏V它包括的东襉K常多Q如Q地物的dQ地物的修改Q地物查询,节点捕捉Q地物的W号化等一pd的问题。熟l的使用地物~辑的功能,是开发一个系l必d备的条g。数据编辑问题解军_好坏直接军_着软g是否操作方便。在q我只是写一些相应的功能函数Q至于Y件开发中的架构,我不考虑?


1?d地物
什么是地物Q这?font style="line-height: 1.3em" face="Times" size="3"> GIS的基本概念,我在q不惛__我只惌明一点,地物可以表现在地图上Q如房子、铁路、水等{。我们把房子的ȝUCؓ一个地物类Q在AE中对应一个地物类Q?font style="line-height: 1.3em" face="Times" size="3">IFeatureClassQ,一个地物类在地图上表示Z个地物层Q?font style="line-height: 1.3em" face="Times" size="3">IFeatureLayerQ,单独的一栋房子或一条管道我们称为地物(IFeatureQ,Arcgis中一cd物只能放在一个层Q通过囑ֱ的叠加组成一q地图?


熟?zhn)面向对象的编E语a的h都知道,其实上边的地物类Q地物的概念是cd实体的概c房子、铁路、水等是一cd物的抽象Q而具体的某一房子是对象了。大家了解了q一炏V接下来的开发就Ҏ(gu)理解一些了。当Ӟq有一些其他的概念也必M解一下:如长事务、短事务、编辑空间等。请大家查找一些相兌料,了解q方面的内容?


我们先开始最基本的编辑功能:d点线面的操作。它包括输入d点线面和通过鼠标拖动d点线面。下边讨Z下添加点UK的基本的实现Ҏ(gu)Q?


一?/font>d?/strong>
我们可以有多U方法添加点Q但基本的思\一P只是有少量的接口有变化。下Ҏ(gu)通过FeatrueClass?font style="line-height: 1.3em" face="Times" size="3">CreateFeature
Q)函数d地物?


public void AddPointByStore() 
      { 
              //得到要添加地物的囑ֱ 
              IFeatureLayer l = MapCtr.Map.get_Layer(0) as IFeatureLayer; 

              //定义一个地物类,把要~辑的图层{化ؓ定义的地物类 

              IFeatureClass fc = l.FeatureClass ; 

             //先定义一个编辑的工作I间,然后把{化ؓ数据?最后{化ؓ~辑工作I间, 

              IWorkspaceEdit w = (fc as IDataset).Workspace as IWorkspaceEdit; 

              IFeature f ; 

              IPoint p; 

              //开始事务操?nbsp;

              w.StartEditing (false); 

              //开始编?nbsp;

              w.StartEditOperation() ; 

              for (int i = 0 ; i< 100 ; i++ ) 
              { 
                   //创徏一个地?nbsp;
                   f= fc.CreateFeature(); 

                   p = new PointClass(); 

                   //讄点的坐标 

                   p.PutCoords (i,i); 

                   //定囑Şcd 

                   f.Shape = p; 

                   //保存地物 

                   f.Store();     

              } 

              //l束~辑 

              w.StopEditOperation(); 

              //l束事务操作 

              w.StopEditing(true);
}


上边的代码能d点地物,但不能作为最l的代码使用Q细心的Z看到。这D代码只是把W一层加q来Q然后在W一层上Ҏ(gu)加点地物Q如果第一层不是点层,该怎么办,那就要判断了。怎么判断我们以后再说。通过上边的代码,我们已经清楚C解到Q编辑地物的基本框架Q这也是我们所说的事务Q如果想操作能返回和重做Q就必须把代码写?font style="line-height: 1.3em" face="Times" size="3">IWorkspaceEdit?font style="line-height: 1.3em" face="Times" size="3">StartEditing()?font style="line-height: 1.3em" face="Times" size="3">StopEditing()函数之间Q把相关的操作写?font style="line-height: 1.3em" face="Times" size="3">IWorkspaceEdit?font style="line-height: 1.3em" face="Times" size="3">StartEditOperation()?font style="line-height: 1.3em" face="Times" size="3">StopEditOperation()之间。ƈ且操作是利用IWorkspaceEdit接口完成的,所以要仔细理会IWorkspaceEdit接口的用处,如何工作I间都可以{化ؓIWorkspaceEdit的对象,当{化ؓIWorkspaceEdit定义的对象后Q我们定义一?font style="line-height: 1.3em" face="Times" size="3">IFeature的对象,然后利用IFeatureClass?font style="line-height: 1.3em" face="Times" size="3">CreateFeature()函数创徏一个地物,q赋值给定义?font style="line-height: 1.3em" face="Times" size="3">IFeature对象。接着讄IFeature对象的一些属性,如:坐标|坐标p,地物cd{,最后是调用IFeature对象?font style="line-height: 1.3em" face="Times" size="3">Store()保存d的地物?


上边的方法可以添加点地物Q接着看看下边的代码。看有什么不同:


public void AddPointByWrite()


     {


         IFeatureLayer l = MapCtr.Map.get_Layer(0) as IFeatureLayer;


         IFeatureClass fc = l.FeatureClass ;


         IFeatureClassWrite fr = fc as IFeatureClassWrite ;


         IWorkspaceEdit w = (fc as IDataset).Workspace as IWorkspaceEdit;


         IFeature f ;  


         IPoint p;


         w.StartEditing (true);


         w.StartEditOperation() ;


         for (int i = 0 ; i< 100 ; i++ )


         {


              f= fc.CreateFeature();


              p = new PointClass();


              p.PutCoords (i,i);


              f.Shape = p;


              fr.WriteFeature (f);


         }


              w.StopEditOperation();


              w.StopEditing(true);


     }


代码中用U色标记的两行就是不同的代码Q其实他是保存方式的不同而已。在q利用了IFeatureClassWrite 接口来保存数据。再看看下边的代码:


         public void AddPointByBuffer()


         {


              IFeatureLayer l = MapCtr.Map.get_Layer(0) as IFeatureLayer;


              IFeatureClass fc = l.FeatureClass ;


              IWorkspaceEdit w = (fc as IDataset).Workspace as IWorkspaceEdit;


              w.StartEditing (true);


              w.StartEditOperation() ;


              IPoint p;


              IFeatureBuffer f;


              IFeatureCursor cur = fc.Insert(true);


              for (int i = 0 ; i< 100 ; i++ )


              {


                   f= fc.CreateFeatureBuffer();


                   p = new PointClass();


                   p.PutCoords (i,i);


                   f.Shape = p;


                   cur.InsertFeature (f);


              }


              w.StopEditOperation();


              w.StopEditing(true);


     }
其实不同的地方就两句代码Q红色表C的。在q没有再定义地物接口了(IFeatureQ,而是使用IFeatureBuffer 接口Q保存的时候是使用InsertFeature()保存Q这对大数据量处理的非常有好处。他是先把要d的保存到~冲区里。最后一ơ性保存?
二?/font>dU?/strong>
dU的Ҏ(gu)跟添加点一P不同的只是地物类型不一栯已Q我把代码脓(chung)出来Q大家跟d点的方式q行Ҏ(gu)。这样便于记忆。也有利于理解?


     public void AddLineByWrite()


     {


         IFeatureLayer l = MapCtr.Map.get_Layer(0) as IFeatureLayer;


         IFeatureClass fc = l.FeatureClass ;


         IFeatureClassWrite fr = fc as IFeatureClassWrite ;


         IWorkspaceEdit w = (fc as IDataset).Workspace as IWorkspaceEdit;


         IFeature f ;  


//可选参数的讄


object Missing = Type.Missing;


         IPoint p=new PointClass();


         w.StartEditing (true);


         w.StartEditOperation() ;


         for (int i = 0 ; i< 100 ; i++ )


         {


              f = fc.CreateFeature();


              //定义一个多义线对象


              IPolyline PlyLine=new PolylineClass();


              //定义一个点的集?


              IPointCollection ptclo = PlyLine as IPointCollection;


              //定义一pd要添加到多义U上的点对象Qƈ赋初始?


              for(int j=0;j<4;j++)


              {  


                   p.PutCoords(j,j);


                   ptclo.AddPoint(p,ref Missing,ref Missing);


              }


                   f.Shape = PlyLine;


                   fr.WriteFeature (f);


         }


              w.StopEditOperation();


              w.StopEditing(true);


}


至于dU的其他两种Ҏ(gu)Q通过修改d点的代码Q就可以得到。可以自己想想然后测试,q样便于记忆和理解?


剑秋 2008-12-18 12:41 发表评论
]]>
ArcGis server9.2发布http://www.aygfsteel.com/mycolby/articles/237167.html剑秋剑秋Tue, 28 Oct 2008 09:23:00 GMThttp://www.aygfsteel.com/mycolby/articles/237167.htmlhttp://www.aygfsteel.com/mycolby/comments/237167.htmlhttp://www.aygfsteel.com/mycolby/articles/237167.html#Feedback2http://www.aygfsteel.com/mycolby/comments/commentRss/237167.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/237167.html     q一接着讲ArcGis server9.2的例子发?
    q里我是用eclipse IDEq行开?针对eclipse配置来进行讲q?
   1. 拯插g到eclipse中,q入\Program Files\ArcGIS\java\tools\eclipse_plugin\arcgis_update_site\server文g下把features和plugins插g拯到eclipse文g夹下?br />    2. 删除eclipse下configuration文g多wconfig.ini配置外的所有文件?br />    3. 打开eclipseQ这时候eclipse会重新更新一ơ?br />    4. 打开windows -> preferences,弹出H口Q?br />       
       q里gis server填写server服务器名Q我在这里就是本机的机器名?br />        usename填写当前pȝ用户名?br />        password填写当前pȝ用户d密码?br />        domain填写本机的机器名?br />         点击test ,弹出如下H口Q?br />       
       看该提示表明q接成功?br />        5. 打开arcgismanager面Q点击servicesQ点?a onclick="document.forms['frmServices']['frmServices:_idcl'].value='frmServices:_id75'; document.forms['frmServices'].submit(); return false;" href="http://localhost:8099/arcgismanager/services/services.jsf#">Add New Service q行服务的添加?br />        6. 服务d成功后,点击startQ打开该项服务?br />        7. 此时回到eclipseQ打开dprojectQ弹出窗口:
            
            选择ArcGis Web Samples选项Q给该项目名Uͼq择要发布该项目的容器Q进行到最后一步的时候会弹出H口Q?br />               
             q里的map是我在arcgismanager里面d的新服务Q我们接着把map服务Ud左边Q点击finishQ就O(jin)K了?br />         8. 例子q行发布后就出现错误如下Q?nbsp;           

        2008-7-27 1:51:43 com.esri.adf.web.data.GISResource init
        严重: Unable to initialize functionality : toc. This functionality will be removed from this resource:map

        java.lang.NullPointerException: Unable to initialize AGSTocFunctionality. Invalid parameters.

        l过修改WEB-INF/faces-config.xml和WebContent/WEB-INF/context-attributes.xml两个JSF的配|文件解决问?br />         9. 此时重新发布该项目,OKQ一切搞定!
    
        写到q里Qarcgis server大家可以入门开始研I了Q暂时先写到q里Q?br />        

剑秋 2008-10-28 17:23 发表评论
]]>
ArcGis server9.2配置http://www.aygfsteel.com/mycolby/articles/237028.html剑秋剑秋Tue, 28 Oct 2008 02:17:00 GMThttp://www.aygfsteel.com/mycolby/articles/237028.htmlhttp://www.aygfsteel.com/mycolby/comments/237028.htmlhttp://www.aygfsteel.com/mycolby/articles/237028.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/237028.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/237028.html    1. 在当前的用户下进行安装ArcGis server9.2E序.
   2. 安装部分QArcGIS Server post installationQ??#8220;开?E序-ArcGIS Server-AS post installation”中启动。在提示下,讄理员̎P密码Q容器̎P密码。在QNQQ_提示下一步步赎ͼ其中一步是要连接到授权文gQArcGIS Server.ecpQ?点击Q浏览"扑ֈq个文g可以了Q这样就完成了该部分的安?
   3. 安装完成后,首先要做的是通过当前系l用h加到agsadmin用户l,完成创徏理gis服务帐户的创建.通过右键单击Q我的电(sh)脑-理Q本地用户和l-l"在列表中扑ֈagsadmin用户l,右键单击它,选择Q添加到l"便可操作完成Q?br />   4. d用户l,也是cM?中的步骤Q找到agsusers用户l,q行d?br />   5. 打开ArcGIS CatalogQ在左侧的GIS Server节点中的“Add GIS Server”双击Q在弹出的窗口中Q?#8220;Manager gis services ”,输入Sever URL ?nbsp;服务器的机器名,完成GIS服务器的q接,q里用到ArcGis Catalog是ؓ了能够连接数据库来读取地图数?也可以用ArcSde来连接?br />   q样完成了整个的安?
   接着打开ArcGIS Server Manager面Q出现登录窗口。这里我们在User Name中填写用户名Q格式ؓQ机器名\ 用户名;密码为当前系l用Ld密码?br />    如果此时提示"d信息有误",试着把windows防火墙关?如果能打开ArcGis Server Manager,我们需要对windows防火墙进行一下设|调?

  1. Navigate to Windows Firewall.
    Start > Settings > Control Panel > Windows Firewall

    The firewall is 'On' by default, the 'Recommended' setting.
  2. Click on the Exceptions tab.
  3. Click 'Add Port'.
  4. Add the following information:
    Name: Web Port (http)
    Port Number: 80
    Type: TCP

    Click OK.
  5. To add port 135, click 'Add Port'.
  6. Add the following information:

    Name: DCOM (ArcGIS Server)
    Port Number: 135
    Type: TCP

    Click OK.
  7. Click 'Add Program' to add an exception for ArcSOM.exe.
  8. Click 'Browse' and navigate to:
    <ArcGIS Install Directory>\bin\ArcSOM.exe for example:
    C:\Program Files\ArcGIS\bin\ArcSOM.exe
    Click OK.
  9. Click Add Program to add an exception for ArcSOC.exe.
  10. Click 'Browse' and navigate to:
    <ArcGIS Install Directory>\bin\ArcSOC.exe for example:
    C:\Program Files\ArcGIS\bin\ArcSOC.exe
    Click OK.
  11. The ports and programs entered should now appear in the list of Programs and Services. Verify check marks appear next to each component.
  12. Close Windows Firewall.

   dq去后,卛_q行ArcGis server的配|了.
  

剑秋 2008-10-28 10:17 发表评论
]]>
在axGlobeControl里面ȝ的一点体?转蝲)http://www.aygfsteel.com/mycolby/articles/224271.html剑秋剑秋Mon, 25 Aug 2008 12:43:00 GMThttp://www.aygfsteel.com/mycolby/articles/224271.htmlhttp://www.aygfsteel.com/mycolby/comments/224271.htmlhttp://www.aygfsteel.com/mycolby/articles/224271.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/224271.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/224271.html

?span lang="EN-US">axGlobeControl里面ȝQ整个代码如下,
'
d新的囑ֱ,先把囑ֱ属性改?span lang="EN-US">
Dim pG As IGraphicsLayer = New GlobeGraphicsLayer
axGlobeControl1.Globe.AddLayerType(pG, esriGlobeLayerType.esriGlobeLayerTypeUnknown) '?span lang="EN-US">pGq个layer加到Globe?span lang="EN-US">

Dim pGEP As IGlobeGraphicsElementProperties = New GlobeGraphicsElementProperties
        pGEP.DrapeElement = True '属性改?span lang="EN-US">drape
        Dim pGL As IGlobeGraphicsLayer = New GlobeGraphicsLayer
        pGL = pG

        'ȝU定?span lang="EN-US">symbol,调用drawline
        Dim pSymbol As ISimpleLineSymbol = New SimpleLineSymbol
        pSymbol.Width = 2
        Dim pcolor As IColor = New RgbColor
        pcolor.RGB = RGB(230, 0, 0)
        pSymbol.Color = pcolor

        Dim pGC3D As IGraphicsContainer3D = New GlobeGraphicsLayer
        pGC3D = pG '
?span lang="EN-US">pG获得Container

        Dim nCount As Integer

        For nCount = -90 To 90 Step 30
            Dim pElement As IElement
            '
U线
            pElement = drawline(0, nCount, 0, 359.5, nCount, 0, pSymbol)
            pGL.AddElement(pElement, pGEP, 0) '
修改后的属性加入到dU的element里面
            pGC3D.AddElement(pElement) '
把画好的囑Ş加到layer里面
            '
l线
            pElement = drawline(nCount, 0, 0, nCount, 359.5, 0, pSymbol)
            pGL.AddElement(pElement, pGEP, 0) '
修改后的属性加入到dU的element里面
            pGC3D.AddElement(pElement) '
把画好的囑Ş加到layer里面
        Next nCount
        axGlobeControl1.Refresh()

Public drawline(ByVal x1 As Double, ByVal y1 As Double, ByVal Z1 As Double, ByVal X2 As Double, ByVal Y2 As Double, ByVal Z2 As Double, ByVal symbol As ISimpleLineSymbol) As IElement
        Dim pElement As IElement
        pElement = New LineElement

        Dim pLineEle As ILineElement
        pLineEle = pElement
        pLineEle.Symbol = symbol

        Dim tmpline As IPolyline = New Polyline
        '
l要ȝU定义v始点
        Dim StartPoint As IPoint, EndPoint As IPoint
        StartPoint = New Point
        StartPoint.X = x1
        StartPoint.Y = y1
        StartPoint.Z = Z1
        EndPoint = New Point
        EndPoint.X = X2
        EndPoint.Y = Y2
        EndPoint.Z = Z2
        
        tmpline.FromPoint = StartPoint
        tmpline.ToPoint = EndPoint
        pElement.Geometry = tmpline
        drawline = pElement
    End
整个q程关键是要?span lang="EN-US">element的属性改?span lang="EN-US">drapeQ这L出来的线是贴着地球表面的,而不会穿q地心,

在把囑ֱ改ؓDrapeӞ加上_附高度讄可以将ȝU升高,而不被背景图覆盖掉。把代码修改一下,如下Q?span lang="EN-US">
pGEP.DrapeElement = True '
属性改?span lang="EN-US">drape
pGEP.DrapeZOffset=1000000 '
加上q一句,后面的DC高度,单位是米



剑秋 2008-08-25 20:43 发表评论
]]>
挂在arcmap 上的一个小插g实现 mxd转axl(转蝲)http://www.aygfsteel.com/mycolby/articles/211884.html剑秋剑秋Tue, 01 Jul 2008 06:14:00 GMThttp://www.aygfsteel.com/mycolby/articles/211884.htmlhttp://www.aygfsteel.com/mycolby/comments/211884.htmlhttp://www.aygfsteel.com/mycolby/articles/211884.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/211884.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/211884.html挂在arcmap 上的一个小插g实现 mxd转axlQ在发布地图时候可以在ARCMAP上配丰富颜色和样式,q是在ARCIMS配置E序里没的,但是转出来的代码Q只能理由其中的颜色或者样式的段Q?a onclick="javascript:tagshow(event, '%C6%E4%CB%FB');" href="javascript:;" target="_self">其他的还要h工修正一下!Q喜Ƣ的话大家下一个玩玩!Q?br /> http://arcscripts.esri.com/details.asp?dbid=12766


剑秋 2008-07-01 14:14 发表评论
]]>同一坐标pMQ由L两点计算地图旋{角度(转蝲)http://www.aygfsteel.com/mycolby/articles/210458.html剑秋剑秋Wed, 25 Jun 2008 02:13:00 GMThttp://www.aygfsteel.com/mycolby/articles/210458.htmlhttp://www.aygfsteel.com/mycolby/comments/210458.htmlhttp://www.aygfsteel.com/mycolby/articles/210458.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/210458.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/210458.html一、引a

在各U?/span>GIS/GPS应用中,地图旋{是不可或~的一部分Q尤其明昄是用在实时导航,对象跟踪{应用方面。用来计地图旋转时偏{角的坐标Ҏ(gu)动态和静态两U之分。动态在q里指的是在已知当前点的情况下,下一点的具体位置是不定的;而静态指的是下一点的具体位置是确定的。动态的应用我们常见到的?/span>GPSD、游戏中的赛?/span>(多赛道、可转弯{?/span>)以及调度{中的实时地图旋转,而静态更常见的是作ؓ一U功能的演示Q如模拟DQ模拟赛车等。地图旋转只有在同一坐标pMq行才有意义Q地图旋转角度的计算才有依据Q本文主要着重点在于如何由前后两点计地图旋转角度,同时主要考虑动态的方式Q静态方式的旋{地图原理是一LQ就不分开介绍了?/span>

二、约定和术语

²      参考坐标系Q本文所依据的坐标系为北?/span>54下的依据高斯克吕格投影所建立的坐标系Q即高斯q面坐标p,它的囑փ如图Q?/span>


X
代表为正北方向,Y代表正东方向Qؓ了y值都为正Q将U坐标u西移500km?/span>

²      正切函数是直角三角Ş中,对边与邻边的比倹{放在直角坐标系中(如图Q即 tanθ=y/x

其中tanθ的定义域为(-∏/2Q?∏/2Q,值域?/span>(-,+)

²         偏{角:U定偏{角ؓ北偏东的角度Q将地图按照偏{角进行旋转后始l朝着q动方向行驶。在高斯q面坐标pMQ正北即?/span>X_正东即ؓY_所?/span>tanθq是?/span>y/xQ只是角度的位置有了变化Q如图所C?br />

²         反正?/span>Q函?/span>y=tanx的反函数叫做反正切函?/span>,记做:y=arctanx.
定义?/span>:RQ值域:(-π/2,π/2)
三、计偏转角

假设存在一起始?/span>pntBeginQƈ且存在一个原点ؓpntBegin的^面坐标系Q同时约定要旋{的角度ؓrotateAngle,则下一?/span>pntDestҎ(gu)方位有几U情况,其示意图如下Q我们可以分c进行讨论:


l       ?/span>pntDest.x1>=pntBegin.x0,则该点在W一和第四象限,具体对应点ؓpntDest(1)?/span>pntDest(4),分别对应的北偏东角度?/span>α(1)?#945;Q?Q,Ҏ(gu)Y值的不同Q我们又可以分两U情况,

n       若pntDest.y>=pntBegin.y://在第一象限
rotateAngle=arctan2(fabs(p0.x-p1.x),fabs(p0.y-p1.y));

n       若pntDest.y<pntBegin.y://在第四象?br /> rotateAngle=arctan2(fabs(p0.x-p1.x),fabs(p0.y-p1.y));
rotateAngle=∏-rotateAngle;

l       ?/span>pntDest.x1<pntBegin.x0,则该点在W二和第三象限,具体对应点ؓpntDest(2)?/span>pntDest(3),分别对应的北偏东角度?/span>α(2)?#945;Q?Q,Ҏ(gu)Y值的不同Q分两种情况q行讨论Q?/span>

n       若pntDest.y>=pntBegin.y://在第二象?br /> rotateAngle=arctan2(fabs(p0.x-p1.x),fabs(p0.y-p1.y));
rotateAngle= 2*∏-rotateAngle;

n       若pntDest.y<pntBegin.y://在第三象?br /> rotateAngle=arctan2(fabs(p0.x-p1.x),fabs(p0.y-p1.y));
rotateAngle=∏+rotateAngle;

四、在图q_中实?/span>
?/span>Q开发语a?/span>VC6,q_?/span>eSuperMap;

代码如下Q?br />

 1
 2void CCarNaviView::RotateMap(CPoint pntBegin,CPoint pntNext)
 3{    
 4    //计算旋{角度
 5    double dAngle=CalculateRotateAngle(pntBegin,pntNext);
 6    //地图旋{
 7    m_MapWnd.GetDrawParam()->SetMapRotationAngle( dAngle );
 8    m_MapWnd.Refresh();
 9}

10
11/// \brief 由前后两点计当前地囑ց转角q进行地图旋?br /> 12/// \param pntbegin 起始?br /> 13/// \param pntbegin 下一?br /> 14/// \return 地图要旋转的角度(北偏?
15/// \remark 为适应习惯用法Q点坐标的表C方法ؓcpoint(x,y)Q如pntbegin(x,y)代表的含义ؓQ?br /> 16///          x->正东Q即为高斯投׃的YQy->正北Q代表高斯投׃的x

17double CCarNaviView::CalculateRotateAngle(CPoint pntBegin,CPoint pntNext)
18{
19    CPoint pntFirst(pntBegin);
20    CPoint pntSecond(pntNext);
21    
22    double dRotateAngle = atan2(fabs(pntBegin.x-pntNext.x),fabs(pntBegin.y-pntNext.y));
23    
24    //如果下一点的横坐标大于前一?在第一和第四象?
25    if (pntNext.x>=pntFirst.x)
26    {
27        //在第一象限(0<=dRotateAngle<=90)
28        if (pntNext.y>=pntFirst.y)
29        {
30            //不做M处理
31            dRotateAngle=dRotateAngle;
32        }

33        else
34        {
35            dRotateAngle=PI-dRotateAngle;
36        }

37    }

38    else//(在第二和W三象限)
39    {
40        //W二象限
41        if (pntNext.y>=pntFirst.y)
42        {
43            dRotateAngle=2*PI-dRotateAngle;
44        }

45        else//W三象限
46        {
47            dRotateAngle=PI+dRotateAngle;
48        }

49    }

50    return dRotateAngle;
51}




剑秋 2008-06-25 10:13 发表评论
]]>
GIS|站http://www.aygfsteel.com/mycolby/articles/210443.html剑秋剑秋Wed, 25 Jun 2008 01:35:00 GMThttp://www.aygfsteel.com/mycolby/articles/210443.htmlhttp://www.aygfsteel.com/mycolby/comments/210443.htmlhttp://www.aygfsteel.com/mycolby/articles/210443.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/210443.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/210443.html http://www.gisforum.net
http://www.gisempire.com
http://share.gissky.net
http://www.gisbbs.net
http://www.gisuniversity.net
http://gis.cnblogs.com/archive/2005/06/13/173622.aspx?page=1

剑秋 2008-06-25 09:35 发表评论
]]>
三维动画轨迹http://www.aygfsteel.com/mycolby/articles/210376.html剑秋剑秋Tue, 24 Jun 2008 11:50:00 GMThttp://www.aygfsteel.com/mycolby/articles/210376.htmlhttp://www.aygfsteel.com/mycolby/comments/210376.htmlhttp://www.aygfsteel.com/mycolby/articles/210376.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/210376.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/210376.html在ArcGIS的接口里Q提供了IAnimationTracksQ通过它我们可以实Cl动画轨q的创徏Q删除或在播攑ֽ前轨q的三维场景效果Q进而可以生成三l场景的录像输出处理Ҏ(gu)Q?font color="#ff0000">q个我在下一再l大家介l?/font>Q,q是看看具体实现代码吧-Q?/font>

   /// <summary>
   /// 创徏动画轨迹
   /// </summary>
   public void CreateAnimationTrack( string trackName )
   {
          IAnimationTrack pAnimationTrack = new AnimationTrackClass();
          IAnimationType pAnimationType = new AnimationTypeCameraClass();
          pAnimationTrack.AnimationType = pAnimationType;

          pAnimationTrack.Name = trackName;
          pAnimationTrack.AttachObject( pSceneGraph.ActiveViewer.Camera );
          pAnimationTrack.ApplyToAllViewers = true;
          pAnimationTrack.EvenTimeStamps = false;

          pAnimationTracks.AddTrack( pAnimationTrack );
   }

   /// <summary>
   /// 删除动画轨迹
   /// </summary>
   public void RemoveAnimationTrack( string trackName )
   {
          IAnimationTrack pAnimationTrack;
          pAnimationTracks.FindTrack( trackName, out pAnimationTrack );
          pAnimationTracks.RemoveTrack( pAnimationTrack );
   }

   /// <summary>
   /// 播放当前动画轨迹
   /// </summary>
   public void PlayAnimationTrack( string trackName )
   {
          Hashtable htKeyTime = null;

          bool[] TracksEnable = new Boolean[pAnimationTracks.TrackCount];
          IAnimationTrack pAnimationTrack;
          for( int index = 0; index < pAnimationTracks.TrackCount; index++ )
          {
                 pAnimationTrack = pAnimationTracks.Tracks.get_Element( index ) as IAnimationTrack;
                 TracksEnable[index] = pAnimationTrack.IsEnabled;
                 if( pAnimationTrack.Name == trackName )
                 {
                        pAnimationTrack.IsEnabled = true;
                        htKeyTime = ClsAnimationTracks.GetKeyTimeTable( pAnimationTrack.Name );
                 }
                 else
                        pAnimationTrack.IsEnabled = false;

          }

   
          int sumTime = 0;
          foreach( object obj in htKeyTime.Values )
          {
                 sumTime += Convert.ToInt32( obj );
          }

          double duration = (double)sumTime / 1000;

          TimeSpan timeSpan;
          double elapsedTime;

   
          DateTime startTime = DateTime.Now;
          int j = 0;
          do
          {
                 timeSpan = (DateTime.Now).Subtract(startTime);
                 elapsedTime = timeSpan.TotalSeconds;
                 if (elapsedTime > duration) elapsedTime = duration;
                 pAnimationTracks.ApplyTracks(pSceneGraph.ActiveViewer, elapsedTime, duration);
                 pSceneGraph.RefreshViewers();
                 j = j + 1;
         }

          for( int index = 0; index < pAnimationTracks.TrackCount; index++ )
          {
                 pAnimationTrack = pAnimationTracks.Tracks.get_Element( index ) as IAnimationTrack;
                 pAnimationTrack.IsEnabled = TracksEnable[index];
          }
   }

是不是很?/strong>呢?C?img src="http://img.baidu.com/hi/face/i_f15.gif" alt="" />Q在播放轨迹的时候,有个旉的处理方法,具体在程序调试时Q多试几ơ就知道是怎么回事了,我就不多说了。。?/font>

当然Q还有动d的处理方法,ArcGIS也提供了一个很方便的接口IKeyframe来实现的Q再通过动画轨迹接口IAnimationTrack来实现动d的创建,删除{功能,代码实现如下Q?/p>

   /// <summary>
   /// 创徏动画?br />    /// </summary>
   public void CreateKeyFrame( IAnimationTrack pAnimationTrack, string keyName, int timeSpan )
   {
         IKeyframe pKeyframe = new Bookmark3DClass();
         pKeyframe.Name = keyName;
         pKeyframe.CaptureProperties( pScene, pSceneGraph.ActiveViewer.Camera );

         pAnimationTrack.InsertKeyframe( pKeyframe, pAnimationTrack.KeyframeCount );

         Hashtable htKeyTime = ClsAnimationTracks.GetKeyTimeTable( pAnimationTrack.Name );
         int sumTime = 0;
         foreach( object obj in htKeyTime.Values )
         {
               sumTime += Convert.ToInt32( obj );
          }

         double dblTime = 0;
         for( int index = 0; index < pAnimationTrack.KeyframeCount; index++ )
         {
               pKeyframe = pAnimationTrack.get_Keyframe( index );
               dblTime += Convert.ToDouble( htKeyTime[pKeyframe.Name] ) / sumTime;
               pKeyframe.TimeStamp = dblTime;
         }
   }

   /// <summary>
   /// 删除动画?br />    /// </summary>
   public void RemoveKeyFrame( IAnimationTrack pAnimationTrack, string keyName )
   {
         for( int index = 0; index < pAnimationTrack.KeyframeCount; index++ )
         {
               if( pAnimationTrack.get_Keyframe( index ).Name == keyName )
               {
                     pAnimationTrack.RemoveKeyframe( index );
                     break;
               }
         }   
   }

   /// <summary>
   /// 删除当前轨迹的所有
   /// </summary>
   public void RemoveAllKeyFrame( IAnimationTrack pAnimationTrack )
   {
         pAnimationTrack.RemoveAllKeyframes();  
   }



剑秋 2008-06-24 19:50 发表评论
]]>
ArcEngine三维http://www.aygfsteel.com/mycolby/articles/210372.html剑秋剑秋Tue, 24 Jun 2008 11:35:00 GMThttp://www.aygfsteel.com/mycolby/articles/210372.htmlhttp://www.aygfsteel.com/mycolby/comments/210372.htmlhttp://www.aygfsteel.com/mycolby/articles/210372.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/210372.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/210372.html  Copyright 1995-2004 ESRI

 All rights reserved under the copyright laws of the United States.

 You may freely redistribute and use this sample code, with or without modification.

 Disclaimer: THE SAMPLE CODE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
 WARRANTIES, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ESRI OR
 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 INTERRUPTION) SUSTAINED BY YOU OR A THIRD PARTY, HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ARISING IN ANY
 WAY OUT OF THE USE OF THIS SAMPLE CODE, EVEN IF ADVISED OF THE POSSIBILITY OF
 SUCH DAMAGE.

 For additional information contact: Environmental Systems Research Institute, Inc.

 Attn: Contracts Dept.

 380 New York Street

 Redlands, California, U.S.A. 92373

 Email: contracts@esri.com
*/
using System;
using System.Windows.Forms;
using ESRI.ArcGIS.Analyst3D;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.GlobeCore;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.SystemUI;

namespace GlobeNavigation
{
 /// <summary>
 /// Summary description for Form1.
 /// </summary>
 public class Form1 : System.Windows.Forms.Form
 {
  private ESRI.ArcGIS.GlobeControl.AxGlobeControl axGlobeControl1;
  internal System.Windows.Forms.TrackBar TrackBar1;
  public System.Windows.Forms.CheckBox chkSpin;
  public System.Windows.Forms.RadioButton optTools1;
  public System.Windows.Forms.RadioButton optTools0;
  public System.Windows.Forms.Button cmdLoadDocument;
  public System.Windows.Forms.Button cmdZoomOut;
  public System.Windows.Forms.Button cmdZoomIn;
  public System.Windows.Forms.Button cmdFullExtent;
  public System.Windows.Forms.Label Label1;
  public System.Windows.Forms.Label lblNavigate;
  public System.Windows.Forms.Label lblZoom;
  public System.Windows.Forms.Label lblLoad;
  private System.Windows.Forms.OpenFileDialog openFileDialog1;
  
  private IAoInitialize m_AoInitialize = new AoInitializeClass();
  private ISceneViewer m_ActiveView;
  private ICamera m_Camera;
  private IPoint m_pMousePos = new PointClass();
  private bool m_bMouseDown;
  private bool m_bZooming = false;
  private double m_dSpinSpeed = 0;
  private double m_dZoom;
  
  const double cMinZoom = 1.00002;
  const double cMaxZoom = 1.1;
  const double cDistanceZoomLimit = 200.0;

  /// <summary>
  /// Required designer variable.
  /// </summary>
  private System.ComponentModel.Container components = null;

  public Form1()
  {
   //
   // Required for Windows Form Designer support
   //
   InitializeComponent();

   //
   // TODO: Add any constructor code after InitializeComponent call
   //
  }

  /// <summary>
  /// Clean up any resources being used.
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if (components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region Windows Form Designer generated code
  /// <summary>
  /// Required method for Designer support - do not modify
  /// the contents of this method with the code editor.
  /// </summary>
  private void InitializeComponent()
  {
   System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
   this.axGlobeControl1 = new ESRI.ArcGIS.GlobeControl.AxGlobeControl();
   this.TrackBar1 = new System.Windows.Forms.TrackBar();
   this.chkSpin = new System.Windows.Forms.CheckBox();
   this.optTools1 = new System.Windows.Forms.RadioButton();
   this.optTools0 = new System.Windows.Forms.RadioButton();
   this.cmdLoadDocument = new System.Windows.Forms.Button();
   this.cmdZoomOut = new System.Windows.Forms.Button();
   this.cmdZoomIn = new System.Windows.Forms.Button();
   this.cmdFullExtent = new System.Windows.Forms.Button();
   this.Label1 = new System.Windows.Forms.Label();
   this.lblNavigate = new System.Windows.Forms.Label();
   this.lblZoom = new System.Windows.Forms.Label();
   this.lblLoad = new System.Windows.Forms.Label();
   this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
   ((System.ComponentModel.ISupportInitialize)(this.axGlobeControl1)).BeginInit();
   ((System.ComponentModel.ISupportInitialize)(this.TrackBar1)).BeginInit();
   this.SuspendLayout();
   //
   // axGlobeControl1
   //
   this.axGlobeControl1.Location = new System.Drawing.Point(10, 9);
   this.axGlobeControl1.Name = "axGlobeControl1";
   this.axGlobeControl1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axGlobeControl1.OcxState")));
   this.axGlobeControl1.Size = new System.Drawing.Size(508, 499);
   this.axGlobeControl1.TabIndex = 0;
   this.axGlobeControl1.OnMouseDown += new ESRI.ArcGIS.GlobeControl.IGlobeControlEvents_OnMouseDownEventHandler(this.axGlobeControl1_OnMouseDown);
   this.axGlobeControl1.OnMouseMove += new ESRI.ArcGIS.GlobeControl.IGlobeControlEvents_OnMouseMoveEventHandler(this.axGlobeControl1_OnMouseMove);
   this.axGlobeControl1.OnMouseUp += new ESRI.ArcGIS.GlobeControl.IGlobeControlEvents_OnMouseUpEventHandler(this.axGlobeControl1_OnMouseUp);
   //
   // TrackBar1
   //
   this.TrackBar1.Location = new System.Drawing.Point(528, 465);
   this.TrackBar1.Name = "TrackBar1";
   this.TrackBar1.Size = new System.Drawing.Size(125, 45);
   this.TrackBar1.TabIndex = 26;
   this.TrackBar1.Scroll += new System.EventHandler(this.TrackBar1_Scroll);
   //
   // chkSpin
   //
   this.chkSpin.BackColor = System.Drawing.SystemColors.Control;
   this.chkSpin.Cursor = System.Windows.Forms.Cursors.Default;
   this.chkSpin.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.chkSpin.ForeColor = System.Drawing.SystemColors.ControlText;
   this.chkSpin.Location = new System.Drawing.Point(547, 439);
   this.chkSpin.Name = "chkSpin";
   this.chkSpin.RightToLeft = System.Windows.Forms.RightToLeft.No;
   this.chkSpin.Size = new System.Drawing.Size(69, 19);
   this.chkSpin.TabIndex = 25;
   this.chkSpin.Text = "Spin";
   this.chkSpin.Click += new System.EventHandler(this.chkSpin_Click);
   this.chkSpin.CheckedChanged += new System.EventHandler(this.chkSpin_CheckedChanged);
   //
   // optTools1
   //
   this.optTools1.Appearance = System.Windows.Forms.Appearance.Button;
   this.optTools1.BackColor = System.Drawing.SystemColors.Control;
   this.optTools1.Cursor = System.Windows.Forms.Cursors.Default;
   this.optTools1.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.optTools1.ForeColor = System.Drawing.SystemColors.ControlText;
   this.optTools1.Location = new System.Drawing.Point(538, 353);
   this.optTools1.Name = "optTools1";
   this.optTools1.RightToLeft = System.Windows.Forms.RightToLeft.No;
   this.optTools1.Size = new System.Drawing.Size(97, 27);
   this.optTools1.TabIndex = 20;
   this.optTools1.TabStop = true;
   this.optTools1.Text = "Zoom In/Out";
   this.optTools1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   this.optTools1.Click += new System.EventHandler(this.MixedControls_Click);
   //
   // optTools0
   //
   this.optTools0.Appearance = System.Windows.Forms.Appearance.Button;
   this.optTools0.BackColor = System.Drawing.SystemColors.Control;
   this.optTools0.Cursor = System.Windows.Forms.Cursors.Default;
   this.optTools0.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.optTools0.ForeColor = System.Drawing.SystemColors.ControlText;
   this.optTools0.Location = new System.Drawing.Point(538, 310);
   this.optTools0.Name = "optTools0";
   this.optTools0.RightToLeft = System.Windows.Forms.RightToLeft.No;
   this.optTools0.Size = new System.Drawing.Size(97, 27);
   this.optTools0.TabIndex = 19;
   this.optTools0.TabStop = true;
   this.optTools0.Text = "Navigate";
   this.optTools0.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
   this.optTools0.Click += new System.EventHandler(this.MixedControls_Click);
   this.optTools0.CheckedChanged += new System.EventHandler(this.optTools0_CheckedChanged);
   //
   // cmdLoadDocument
   //
   this.cmdLoadDocument.BackColor = System.Drawing.SystemColors.Control;
   this.cmdLoadDocument.Cursor = System.Windows.Forms.Cursors.Default;
   this.cmdLoadDocument.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.cmdLoadDocument.ForeColor = System.Drawing.SystemColors.ControlText;
   this.cmdLoadDocument.Location = new System.Drawing.Point(547, 52);
   this.cmdLoadDocument.Name = "cmdLoadDocument";
   this.cmdLoadDocument.RightToLeft = System.Windows.Forms.RightToLeft.No;
   this.cmdLoadDocument.Size = new System.Drawing.Size(81, 27);
   this.cmdLoadDocument.TabIndex = 18;
   this.cmdLoadDocument.Text = "Load ...";
   this.cmdLoadDocument.Click += new System.EventHandler(this.cmdLoadDocument_Click);
   //
   // cmdZoomOut
   //
   this.cmdZoomOut.BackColor = System.Drawing.SystemColors.Control;
   this.cmdZoomOut.Cursor = System.Windows.Forms.Cursors.Default;
   this.cmdZoomOut.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.cmdZoomOut.ForeColor = System.Drawing.SystemColors.ControlText;
   this.cmdZoomOut.Location = new System.Drawing.Point(528, 181);
   this.cmdZoomOut.Name = "cmdZoomOut";
   this.cmdZoomOut.RightToLeft = System.Windows.Forms.RightToLeft.No;
   this.cmdZoomOut.Size = new System.Drawing.Size(119, 27);
   this.cmdZoomOut.TabIndex = 17;
   this.cmdZoomOut.Text = "Fixed Zoom Out";
   this.cmdZoomOut.Click += new System.EventHandler(this.cmdZoomOut_Click);
   //
   // cmdZoomIn
   //
   this.cmdZoomIn.BackColor = System.Drawing.SystemColors.Control;
   this.cmdZoomIn.Cursor = System.Windows.Forms.Cursors.Default;
   this.cmdZoomIn.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.cmdZoomIn.ForeColor = System.Drawing.SystemColors.ControlText;
   this.cmdZoomIn.Location = new System.Drawing.Point(528, 146);
   this.cmdZoomIn.Name = "cmdZoomIn";
   this.cmdZoomIn.RightToLeft = System.Windows.Forms.RightToLeft.No;
   this.cmdZoomIn.Size = new System.Drawing.Size(119, 27);
   this.cmdZoomIn.TabIndex = 16;
   this.cmdZoomIn.Text = "Fixed Zoom In";
   this.cmdZoomIn.Click += new System.EventHandler(this.cmdZoomIn_Click);
   //
   // cmdFullExtent
   //
   this.cmdFullExtent.BackColor = System.Drawing.SystemColors.Control;
   this.cmdFullExtent.Cursor = System.Windows.Forms.Cursors.Default;
   this.cmdFullExtent.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.cmdFullExtent.ForeColor = System.Drawing.SystemColors.ControlText;
   this.cmdFullExtent.Location = new System.Drawing.Point(528, 215);
   this.cmdFullExtent.Name = "cmdFullExtent";
   this.cmdFullExtent.RightToLeft = System.Windows.Forms.RightToLeft.No;
   this.cmdFullExtent.Size = new System.Drawing.Size(119, 27);
   this.cmdFullExtent.TabIndex = 15;
   this.cmdFullExtent.Text = "Full Extent";
   this.cmdFullExtent.Click += new System.EventHandler(this.cmdFullExtent_Click);
   //
   // Label1
   //
   this.Label1.BackColor = System.Drawing.SystemColors.Control;
   this.Label1.Cursor = System.Windows.Forms.Cursors.Default;
   this.Label1.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.Label1.ForeColor = System.Drawing.SystemColors.Highlight;
   this.Label1.Location = new System.Drawing.Point(528, 388);
   this.Label1.Name = "Label1";
   this.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No;
   this.Label1.Size = new System.Drawing.Size(116, 52);
   this.Label1.TabIndex = 24;
   this.Label1.Text = "Control the spin speed with the slider.";
   //
   // lblNavigate
   //
   this.lblNavigate.BackColor = System.Drawing.SystemColors.Control;
   this.lblNavigate.Cursor = System.Windows.Forms.Cursors.Default;
   this.lblNavigate.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.lblNavigate.ForeColor = System.Drawing.SystemColors.Highlight;
   this.lblNavigate.Location = new System.Drawing.Point(528, 250);
   this.lblNavigate.Name = "lblNavigate";
   this.lblNavigate.RightToLeft = System.Windows.Forms.RightToLeft.No;
   this.lblNavigate.Size = new System.Drawing.Size(126, 53);
   this.lblNavigate.TabIndex = 23;
   this.lblNavigate.Text = "Use the option buttons to select a navigation tool. ";
   //
   // lblZoom
   //
   this.lblZoom.BackColor = System.Drawing.SystemColors.Control;
   this.lblZoom.Cursor = System.Windows.Forms.Cursors.Default;
   this.lblZoom.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.lblZoom.ForeColor = System.Drawing.SystemColors.Highlight;
   this.lblZoom.Location = new System.Drawing.Point(528, 86);
   this.lblZoom.Name = "lblZoom";
   this.lblZoom.RightToLeft = System.Windows.Forms.RightToLeft.No;
   this.lblZoom.Size = new System.Drawing.Size(125, 53);
   this.lblZoom.TabIndex = 22;
   this.lblZoom.Text = "Use the buttons to naviagte the Globe data.";
   //
   // lblLoad
   //
   this.lblLoad.BackColor = System.Drawing.SystemColors.Control;
   this.lblLoad.Cursor = System.Windows.Forms.Cursors.Default;
   this.lblLoad.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
   this.lblLoad.ForeColor = System.Drawing.SystemColors.Highlight;
   this.lblLoad.Location = new System.Drawing.Point(528, 9);
   this.lblLoad.Name = "lblLoad";
   this.lblLoad.RightToLeft = System.Windows.Forms.RightToLeft.No;
   this.lblLoad.Size = new System.Drawing.Size(116, 35);
   this.lblLoad.TabIndex = 21;
   this.lblLoad.Text = "Browse to a 3dd file to load.";
   //
   // Form1
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.ClientSize = new System.Drawing.Size(662, 514);
   this.Controls.Add(this.TrackBar1);
   this.Controls.Add(this.chkSpin);
   this.Controls.Add(this.optTools1);
   this.Controls.Add(this.optTools0);
   this.Controls.Add(this.cmdLoadDocument);
   this.Controls.Add(this.cmdZoomOut);
   this.Controls.Add(this.cmdZoomIn);
   this.Controls.Add(this.cmdFullExtent);
   this.Controls.Add(this.Label1);
   this.Controls.Add(this.lblNavigate);
   this.Controls.Add(this.lblZoom);
   this.Controls.Add(this.lblLoad);
   this.Controls.Add(this.axGlobeControl1);
   this.Name = "Form1";
   this.Text = "Form1";
   this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);
   this.Load += new System.EventHandler(this.Form1_Load);
   ((System.ComponentModel.ISupportInitialize)(this.axGlobeControl1)).EndInit();
   ((System.ComponentModel.ISupportInitialize)(this.TrackBar1)).EndInit();
   this.ResumeLayout(false);

  }
  #endregion

  /// <summary>
  /// The main entry point for the application.
  /// </summary>
  [STAThread]
  static void Main()
  {
   Application.Run(new Form1());
  }

  private void Form1_Load(object sender, System.EventArgs e)
  {
   //Create a new AoInitialize object
   if (m_AoInitialize == null)
   {
    //System.Windows.Forms.MessageBox.Show("Unable to initialize. This application cannot run!");
    this.Close();
   }
   //Determine if the product and 3D extension are available
   esriLicenseStatus licenseStatus = (esriLicenseStatus) m_AoInitialize.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeEngine);
   if (licenseStatus == esriLicenseStatus.esriLicenseAvailable)
   {
    licenseStatus = (esriLicenseStatus) m_AoInitialize.IsExtensionCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeEngine, esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst);
    if (licenseStatus == esriLicenseStatus.esriLicenseAvailable)
    {
     licenseStatus = (esriLicenseStatus) m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);
     if (licenseStatus != esriLicenseStatus.esriLicenseCheckedOut)
     {
      //System.Windows.Forms.MessageBox.Show("The initialization failed. This application cannot run!");
      this.Close();
     }
     else
     {
      licenseStatus = (esriLicenseStatus) m_AoInitialize.CheckOutExtension(esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst);
      if (licenseStatus != esriLicenseStatus.esriLicenseCheckedOut)
      {
       System.Windows.Forms.MessageBox.Show("Unable to check out the 3D Analyst extension. This application cannot run!");
       this.Close();
      }
     }
    }
   }
   else 
   {    
    System.Windows.Forms.MessageBox.Show("The ArcGIS Engine product is unavailable. This application cannot run!");
    this.Close();
   }

   //Initialize member variables
   m_ActiveView = axGlobeControl1.GlobeDisplay.ActiveViewer;
   m_Camera = m_ActiveView.Camera;
  }

  private void cmdLoadDocument_Click(object sender, System.EventArgs e)
  {
   //Open a file dialog for selecting map documents
   openFileDialog1.Title = "Globe Documents";
   openFileDialog1.DefaultExt = ".3dd";
   openFileDialog1.Filter = "Globe Document(*.3dd)|*.3dd";
   openFileDialog1.ShowDialog();

   //Check a file is selected and that it's a valid Globe document
   //before attempting to load it
   if (openFileDialog1.FileName != "")
   {
    if (axGlobeControl1.Check3dFile(openFileDialog1.FileName) == true)
    {
     axGlobeControl1.Load3dFile(openFileDialog1.FileName);
    }
    else
    {
     MessageBox.Show("Cannot load " + openFileDialog1.FileName);
    }
   }
  }

  private void cmdFullExtent_Click(object sender, System.EventArgs e)
  {
   IGlobeCamera camera = (IGlobeCamera) m_Camera;

   //Make sure that the camera is using global coordinates
   camera.OrientationMode = esriGlobeCameraOrientationMode.esriGlobeCameraOrientationGlobal;

   //Point the camera at 0,0 in lat,long - this is the default target
   IPoint target = new PointClass();
   target.PutCoords(0.0,0.0);
   target.Z = 0.0;
   m_Camera.Target = target;

   //Reset the camera to its default values
   m_Camera.Azimuth = 140;
   m_Camera.Inclination = 45;
   m_Camera.ViewingDistance = 4.0;
   m_Camera.ViewFieldAngle = 30.0;
   m_Camera.RollAngle = 0.0;
   m_Camera.RecalcUp();
   m_ActiveView.Redraw(false);
  }

  private void cmdZoomIn_Click(object sender, System.EventArgs e)
  {
   //Reset the camera field of view angle to 0.9 of its previous value
   double vfa = m_Camera.ViewFieldAngle;
   m_Camera.ViewFieldAngle = vfa * 0.9;
   m_ActiveView.Redraw(false);
  }

  private void cmdZoomOut_Click(object sender, System.EventArgs e)
  {
   //Reset the camera field of view angle to 1.1 times its previous value
   double vfa = m_Camera.ViewFieldAngle;
   m_Camera.ViewFieldAngle = vfa * 1.1;
   m_ActiveView.Redraw(false);
  }

  private void CalculateMoveFactors(double dist)
  {
   bool bIsAtCenter;
   int indexGlobe;

   //See if the camera is pointing at the center of the globe.
   IGlobeViewer globeViewer = (IGlobeViewer) m_ActiveView;
   globeViewer.GetIsTargetAtCenter(out bIsAtCenter, out indexGlobe);

   //If the camera is pointing at the center of the globe then the zoom speed
   //depends on how far away it is, otherwise the zoom factor is fixed. As the
   //camera approaches the globe surface (where dist = 1) the zoom speed slows
   //down. The other factors were worked out by trial and error.
   if (bIsAtCenter == true)
   {
    m_dZoom = cMinZoom + (cMaxZoom - cMinZoom) * (dist - 1.0 / 3.0);
   }
   else
   {
    m_dZoom = 1.1;
   }
  }

  private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
  {
   //Release COM objects, check in extension and shutdown
   ESRI.ArcGIS.Utility.COMSupport.AOUninitialize.Shutdown();
   m_AoInitialize.CheckInExtension(esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst);
   m_AoInitialize.Shutdown();
  }

  private void axGlobeControl1_OnMouseDown(object sender, ESRI.ArcGIS.GlobeControl.IGlobeControlEvents_OnMouseDownEvent e)
  {
   //Mouse down should initiate a zoom only if the Zoom check box is checked
   if (m_bZooming == false)
   {
    return;
   }

   if (e.button == 1)
   {
    m_bMouseDown = true;
    m_pMousePos.X = e.x;
    m_pMousePos.Y = e.y;
   }
  }

  private void axGlobeControl1_OnMouseUp(object sender, ESRI.ArcGIS.GlobeControl.IGlobeControlEvents_OnMouseUpEvent e)
  {
   //Cancel the zoom operation
   m_bMouseDown = false;
   //Navigate can cancel spin - make sure it starts again
   if (m_dSpinSpeed > 0)
   {
    axGlobeControl1.GlobeViewer.StartSpinning(esriGlobeSpinDirection.esriCounterClockwise);
   }
  }

  private void axGlobeControl1_OnMouseMove(object sender, ESRI.ArcGIS.GlobeControl.IGlobeControlEvents_OnMouseMoveEvent e)
  {
   if (m_bMouseDown == false)
   {
    return;
   }

   //If we're in a zoom operation then
   //Get the difference in mouse position between this and the last one
   double dx = e.x - m_pMousePos.X;
   double dy = e.y - m_pMousePos.Y;
   if ((dx == 0) & (dy == 0))
   {
    return;       
   }

   //Work out how far the observer is currently from the globe and use this
   //distance to determine how far to move
   IPoint observer = m_Camera.Observer;
   double zObs;
   double xObs;
   double yObs;
   double dist;
   observer.QueryCoords(out xObs, out yObs);
   zObs = observer.Z;
   dist = System.Math.Sqrt(xObs * xObs + yObs * yObs + zObs * zObs);
   CalculateMoveFactors(dist);

   //Zoom out and in as the mouse moves up and down the screen respectively
   if ((dy < 0) & (dist < cDistanceZoomLimit))
   {
    m_Camera.Zoom(m_dZoom);
   }
   else if (dy > 0)
   {
    m_Camera.Zoom((1 / m_dZoom));
   }

   m_pMousePos.X = e.x;
   m_pMousePos.Y = e.y;
   m_ActiveView.Redraw(false);
  }

  private void chkSpin_Click(object sender, System.EventArgs e)
  {
   if (chkSpin.CheckState == CheckState.Checked)
            {
    axGlobeControl1.GlobeViewer.StartSpinning(esriGlobeSpinDirection.esriCounterClockwise);
    axGlobeControl1.GlobeViewer.SpinSpeed = 3;
    TrackBar1.Enabled = true;
    m_dSpinSpeed = 3;
   }
   else
   {
    axGlobeControl1.GlobeViewer.StopSpinning();
    TrackBar1.Enabled = false;
    m_dSpinSpeed = 0;
   }
  }

  private void TrackBar1_Scroll(object sender, System.EventArgs e)
  {
   //The globe should increase its spin speed with every increment greater than
   //5 and decrease it for every increment less.
   int sliderPos = (TrackBar1.Value - 5);
   if (sliderPos == 0)
   {
    m_dSpinSpeed = 3;
   }
   else if (sliderPos > 0)
   {
    m_dSpinSpeed = 3 * (sliderPos + 1);
   }
   else
   {
    m_dSpinSpeed = 3 / (1 - sliderPos);
   }

   axGlobeControl1.GlobeViewer.SpinSpeed = m_dSpinSpeed;
  }

  private void MixedControls_Click(object sender, System.EventArgs e)
  {
   RadioButton b = (RadioButton) sender;
   //Set current tool
   switch (b.Name)
   {
    case "optTools0":
     m_bZooming = false;
     axGlobeControl1.Navigate = true;
     axGlobeControl1.MousePointer = esriControlsMousePointer.esriPointerDefault;
     break;
    case "optTools1":
     m_bZooming = true;
     axGlobeControl1.Navigate = false;
     axGlobeControl1.MousePointer = esriControlsMousePointer.esriPointerZoom;
     break;
   }
  }

  private void optTools0_CheckedChanged(object sender, System.EventArgs e)
  {
  
  }

  private void chkSpin_CheckedChanged(object sender, System.EventArgs e)
  {
  
  }
 }
}



剑秋 2008-06-24 19:35 发表评论
]]>
arcIMS如何实现多边形选择http://www.aygfsteel.com/mycolby/articles/205570.html剑秋剑秋Tue, 03 Jun 2008 07:30:00 GMThttp://www.aygfsteel.com/mycolby/articles/205570.htmlhttp://www.aygfsteel.com/mycolby/comments/205570.htmlhttp://www.aygfsteel.com/mycolby/articles/205570.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/205570.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/205570.htmlpublic class RectSelectAction extends Action {

    
// --------------------------------------------------------- Instance
    
// Variables

    
// --------------------------------------------------------- Methods

    
/**
     * Method execute
     * 
     * 
@param mapping
     * 
@param form
     * 
@param request
     * 
@param response
     * 
@return ActionForward
     
*/

    
public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response) 
{
        DynaActionForm rectSelectForm 
= (DynaActionForm) form;
        String startx 
= rectSelectForm.getString("startx");
        String starty 
= rectSelectForm.getString("starty");
        String endx 
= rectSelectForm.getString("endx");
        String endy 
= rectSelectForm.getString("endy");
        Map map 
= (Map) request.getSession().getAttribute("THEMAP");
        Polygon polygon 
= this.creatPolygon(map, startx, starty, endx, endy);
        
if (polygon == null{
            ActionMessages msgs 
= new ActionMessages();
            msgs.add(ActionMessages.GLOBAL_MESSAGE, 
new ActionMessage(
                    
"com.suzhou.message.createPolygonFail"));
            
this.saveMessages(request, msgs);
            
return mapping.findForward("resultPage");
        }

        FeatureLayer menpaiLayer 
= null;
        
for (int i = 0; i < map.getLayers().getCount(); i++{
            
if (map.getLayers().item(i).getName().equals("地物?/span>")) {
                menpaiLayer 
= (FeatureLayer) map.getLayers().item(i);
                System.out.println(menpaiLayer.getName());
                System.out.println(menpaiLayer.getID());
            }

        }

        
if (menpaiLayer == null{
            ActionMessages msgs 
= new ActionMessages();
            msgs.add(ActionMessages.GLOBAL_MESSAGE, 
new ActionMessage(
                    
"com.suzhou.message.layerNotExsist""地物?/span>"));
            
this.saveMessages(request, msgs);
            
return mapping.findForward("resultPage");
        }

        map.getLayers().setGeometry(
true);// 讄q回I间信息
        menpaiLayer.getRecordset().clearRecordset();
        menpaiLayer.getRecordset().clearEnvelope();
        menpaiLayer.getRecordset().clearGeometry();
        map.getLayers().setOrder(
false);
        menpaiLayer.setFilterObject(
null);
        Filter filter2 
= new Filter();
//        filter2.addSubField("BLOCKNAME");
//        filter2.addSubField("MPNUM");
//        filter2.addSubField("MPABNAME");
//        filter2.addSubField("MPSUBNUM");
        
//filter2.setWhereExpression("");
        filter2.setGlobalEnvelope(true);
        filter2.setSpatialShape(polygon);
        filter2.setRelation(Filter.AREA_INTERSECTION);
        menpaiLayer.setFilterObject(filter2);
        map.refresh();
        menpaiLayer.setFilterObject(
null);
        
if (menpaiLayer.getRecordset() == null
                
|| menpaiLayer.getRecordset().getCount() < 1{
            ActionMessages msgs 
= new ActionMessages();
            msgs.add(ActionMessages.GLOBAL_MESSAGE, 
new ActionMessage(
                    
"com.suzhou.message.objectNotFound"));
            
this.saveMessages(request, msgs);
            
return mapping.findForward("resultPage");
        }
else{
            request.setAttribute(
"result",menpaiLayer.getRecordset());
            
return mapping.findForward("resultPage");
        }

    }


    
/**
     * 建立矩Ş
     * 
     * 
@param map
     * 
@param startx:L屏幕X坐标
     * 
@param starty:L屏幕Y坐标
     * 
@param endx:l点屏幕X坐标
     * 
@param endyQ终点屏qY坐标
     * 
@return
     
*/

    
public Polygon creatPolygon(Map map, String startx, String starty,
            String endx, String endy) 
{
        
try {
            Point pnt1 
= map.toMapPoint(new Double(startx).doubleValue(),
                    
new Double(starty).doubleValue());
            Point pnt2 
= map.toMapPoint(new Double(endx).doubleValue(),
                    
new Double(endy).doubleValue());
            Point pnt11 
= new Point();
            Point pnt22 
= new Point();
            pnt11.setX(pnt1.getX());
            pnt11.setY(pnt2.getY());
            pnt22.setX(pnt2.getX());
            pnt22.setY(pnt1.getY());
            Points points 
= new Points();
            points.addPointObject(pnt1);
            points.addPointObject(pnt11);
            points.addPointObject(pnt2);
            points.addPointObject(pnt22);
            Ring ring 
= new Ring();
            ring.setPoints(points);
            Polygon polygon 
= new Polygon();
            polygon.addRing(ring);
            
return polygon;
        }
 catch (Exception ex) {
            
return null;
        }

    }

}



剑秋 2008-06-03 15:30 发表评论
]]>
查询ArcIMS中的动态图?/title><link>http://www.aygfsteel.com/mycolby/articles/186493.html</link><dc:creator>剑秋</dc:creator><author>剑秋</author><pubDate>Sat, 15 Mar 2008 07:33:00 GMT</pubDate><guid>http://www.aygfsteel.com/mycolby/articles/186493.html</guid><wfw:comment>http://www.aygfsteel.com/mycolby/comments/186493.html</wfw:comment><comments>http://www.aygfsteel.com/mycolby/articles/186493.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mycolby/comments/commentRss/186493.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mycolby/services/trackbacks/186493.html</trackback:ping><description><![CDATA[<span id="wmqeeuq" class="bold">查询ArcIMS中的动态图?引自ESRI北京论坛)</span><br /> <br /> <div id="wmqeeuq" class="t_msgfont" id="message18144">Z解决客户的问? 捣鼓了一下arcims的动态图?因ؓ前后׃我十来个时,所以还是想写下来和大家分n,有不同意见欢q广泛交?<br /> <strong><font size="2">一.关于d动态图?/font></strong><br /> q是个很不值得一提的问题,看到q个标题,估计很多老师和资׃h士都x砖头q来.大家q是耐心点儿,古典长篇名著q要从滚滚长江东逝水开始呢.我们也先弄个引子,Z充实一下篇q?<br /> <br /> <strong>1.修改AXL文g<br /> </strong>d动态图层有个前?是必须在AXL?为MAP元素,ddynamic属??<br /> <MAP dynamic="true"><br /> q个步骤在Author中无法完?只能通过文本~辑器手工编辑了.使用EmEditor或者VS.<br /> <br /> <strong>2.动态添?/strong><br /> 通过发送ArcXML或者调用连接器中封装的对象,我们可以动态添加指定的囑ֱ,下面是用ArcIMS Java Connector的例?<br /> <br /> (1)动态添加SHAPE囑ֱ<br /> .....<br /> ShapeWorkspace shpw = new ShapeWorkspace();<br /> shpw.setDirectory("D:\\WorkSpace\\sd");<br /> shpw.setName("sde_ws-1");<br />                         <br /> map.addWorkspace(shpw);<br /> Dataset data = new Dataset();<br /> data.setName("地区边界");<br /> data.setWorkspaceName(shpw.getName());<br />                         <br /> data.setType("polygon");<br /> FeatureLayer fl = new FeatureLayer("2", null, null);<br /> fl.setDataset(data);   <br /> fl.setName("地区边界");<br /> fl.setVisible(true);   <br /> SimpleRenderer sr = new SimpleRenderer();<br /> SimplePolygonSymbol sm=new SimplePolygonSymbol();<br /> sm.setFillColor("255,0,0");<br /> sm.setBoundaryColor("0,0,255");<br /> sm.setFillType(SimplePolygonSymbol.SOLID);<br /> sr.setSymbol(sm);      <br />                         <br /> fl.setRenderer(sr);     <br /> map.getLayers().add(fl);<br /> (2)SDE囑ֱ<br /> ......<br /> SDEWorkspace sdeWSP = new SDEWorkspace();<br /> sdeWSP.setName("sde_ws-4");<br /> sdeWSP.setInstance("port:5151");<br /> sdeWSP.setServer("jerry");<br /> sdeWSP.setPassword("sde");<br /> sdeWSP.setUser("sde");<br /> map.addWorkspace(sdeWSP);<br /> Dataset data = new Dataset();<br /> data.setName("SDE.地区边界");<br /> data.setWorkspaceName(sdeWSP.getName());<br />            <br /> data.setType("polygon");<br /> FeatureLayer fl = new FeatureLayer("2", null, null);<br /> fl.setDataset(data);<br /> fl.setName("地区边界");<br /> fl.setVisible(true);<br /> SimpleRenderer sr = new SimpleRenderer();<br /> SimplePolygonSymbol sm=new SimplePolygonSymbol();<br /> sm.setFillColor("255,0,0");<br /> sm.setBoundaryColor("0,0,255");<br /> sm.setFillType(SimplePolygonSymbol.SOLID);<br /> sr.setSymbol(sm);<br /> fl.setRenderer(sr);<br /> map.getLayers().add(fl);<br /> <br /> <strong><font size="2">?动态图层的查询</font></strong><br /> <br /> <strong>1.q是从修改AXL文g开?/strong><br /> <br /> 如果要d的动态图层可以被查询,比如Identify, ~冲区查询等{?必须具备一个前?必须在AXL?为MAP元素,ddynamicfeature="true">属??<br /> <MAP dynamic="true" dynamicfeature="true"><br /> <br /> <strong>2.两个注意事项</strong><br /> <br /> l过反复试,发现必须注意两点:<br /> <strong>(1)执行查询?必须d对于LAYER的DATASET的定?而且,DATASET的workspace属性必L已经包含在AXL文g?</strong><br /> <strong>(2)如果不是直接发送ArcXML,那么查询之前需要Remove掉动态添加上ȝ所有workspace</strong><br /> <br /> <strong>3.执行查询的例?/strong><br /> 查询的应用类型很?包括点击地图的Identify,q有图上的框?圈?多边形选择,甚至~冲区查询等{? 有时候还需要结合属性where条g的筛?对于ArcIMS而言,都是<br /> SPATIALQUERY. 下面׃Identify的点L询ؓ?<br /> <br /> (1)直接发送ArcXML:<br /> <?xml version="1.0" encoding="UTF-8"?><ARCXML version="1.1"><br /> <ARCXML><br />   <REQUEST><br />     <GET_FEATURES envelope="true" geometry="true" outputmode="newxml"><br />     <LAYER id="2" type="featureclass"><br />       <DATASET name="SDE.地区边界" type="polygon" workspace="sde_ws-4" /><br />     </LAYER><br />     <SPATIALQUERY searchorder="optimize" subfields="DIST_CODE NAME #SHAPE#"><br />       <SPATIALFILTER relation="area_intersection"><br />         <ENVELOPE maxx="120.9610390189751" maxy="37.32400679575094" minx="120.9608390189751" miny="37.32380679575093"/><br />       </SPATIALFILTER><br />     </SPATIALQUERY><br />    </GET_FEATURES><br />   </REQUEST><br /> </ARCXML><br /> <br /> 注意在LAYER的元素中d的DATASET的定?其中,DATASET的workspace属性必L已经包含在AXL文g的WORKSPACE?什?br /> 意思呢?拿q个例子中而言,其中?sde_ws-4"必须是在q个地图服务的AXL文g中定义过的SDEWORKSPACE.<br /> (2)使用Java ConnectorE序q行查询:<br /> ......<br /> //注意在这里需要获取当前map中的workspace,赋给一个时变?然后从map中去?br /> SDEWorkspace sdeWSP = new SDEWorkspace();<br /> sdeWSP=(SDEWorkspace)map.getWorkspace(0);<br /> map.removeWorkspace(0);<br /> FeatureLayer fLayer=(FeatureLayer)map.getLayers().item(0);<br /> <br /> //注意在这里必d明Dataset,q且赋予相应的Name, workspace,type{属?其中workspace名称很重?必须也是定义在AXL?<br /> //然后把Dataset对象赋给FeatureLayer对象<br /> Dataset data = new Dataset();<br /> data.setName("SDE.地区边界");<br /> data.setWorkspaceName("sde_ws-4");<br /> data.setType("polygon");<br /> fLayer.setDataset(data);<br /> <br /> com.esri.aims.mtier.model.map.layer.query.Filter filter= new com.esri.aims.mtier.model.map.layer.query.Filter();   <br /> Point pnt = map.toMapPoint(Double.parseDouble(x), Double.parseDouble(y));<br /> double maxx = pnt.getX() + 0.0001;<br /> double maxy = pnt.getY() + 0.0001;<br /> double minx = pnt.getX() - 0.0001;<br /> double miny = pnt.getY() - 0.0001;<br /> Envelope envelope = new Envelope();<br /> envelope.setMinX(minx);<br /> envelope.setMinY(miny);<br /> envelope.setMaxX(maxx);<br /> envelope.setMaxY(maxy);<br /> filter.setSpatialShape(envelope);<br /> filter.setGlobalEnvelope(true);<br /> filter.setBoundingEnvelope(true);<br /> filter.addSubField("DIST_CODE");<br /> filter.addSubField("NAME");<br /> filter.setRelation(com.esri.aims.mtier.model.map.layer.query.Filter.AREA_INTERSECTION);<br /> fLayer.getRecordset().clearRecordset();<br /> fLayer.setFilterObject(filter);<br /> map.refresh();<br /> //执行完查询之?如果有必?之前去除的workspaced到map?<br /> map.addWorkspace(sdeWSP);<br /> ......<br /> <strong>4.常见错误信息</strong><br /> (1) Underlying input stream returned zero bytes<br /> 表明没有指定Layer的Dataset,或者Dataset中的workspace没有定义在AXL文g?<br /> 对于仅仅d动态图层而言,workspace的名字可以是L?而且可以不用定义在AXL文g?但是如果涉及到对于动态图层的查询,必L意这一?<br /> <br /> (2) map.refresh()时?提交到后台的h是GET_IMAGE而不是想要执行的GET_FEATURE<br /> q个问题的原因是因ؓ没有在查询之前去除map中包含的workspace<br /> <br /> (3) d了动态图层以?无法查询其他固有的图?br /> q个问题的原因同2,也是因ؓ没有在查询之前去除map中包含的workspace.<br /> q是个很奇怪的问题,毕竟没有涉及到对动态图层的查询,但是其他囑ֱ昄受到了动态图层的影响, anyway, q样做了以后O(jin)K?</div> <img src ="http://www.aygfsteel.com/mycolby/aggbug/186493.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mycolby/" target="_blank">剑秋</a> 2008-03-15 15:33 <a href="http://www.aygfsteel.com/mycolby/articles/186493.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ArcIMS中如何在同一囑ֱ中做~冲选择http://www.aygfsteel.com/mycolby/articles/186490.html剑秋剑秋Sat, 15 Mar 2008 07:15:00 GMThttp://www.aygfsteel.com/mycolby/articles/186490.htmlhttp://www.aygfsteel.com/mycolby/comments/186490.htmlhttp://www.aygfsteel.com/mycolby/articles/186490.html#Feedback0http://www.aygfsteel.com/mycolby/comments/commentRss/186490.htmlhttp://www.aygfsteel.com/mycolby/services/trackbacks/186490.htmlArcIMS中如何在同一囑ֱ中做~冲选择Q?/p>

在javaConnector中如何在同个囑ֱ中缓冲ƈ选择要素。在同一囑ֱ中选择出缓冲分析结果需要额外的步骤才能完成Q但是当选择囑ֱ和做~冲的不是同一层时Q则不需要额外的步骤。一个典型的查询例子是这LQ在San Jose市周?公里内有多少城市Q?
q程描述
步骤Q?br /> 额外的步骤如下,需要创Z个新的层来用作buffer层。在filter选择中,如果buffer层和选择目标层是同一层时Q将D错误l果产生?br /> 1.创徏一个连接ƈ初始化一个Map对象。在Map.initMap()中LaodRecordset属性必设|ؓtrue?br /> map.initMap(connection,0,false,false,true,false);
2.创徏buffer层的引用?br /> FeatureLayer fLayer = (FeatureLayer)map.getLayers().item(5); //buffer layer
3.创徏一个buffer层的复制层来作ؓ选择的目标层。该新的复制层和原来的图层具有相同的LayerID,MaxScale,MinScale, 和Recordset
FeatureLayer tLayer = new FeatureLayer(fLayer.getID(),fLayer.getMaxScale(),fLayer.getMinScale());
tLayer.setRecordset(fLayer.getRecordset()); //tLayer is the target layer
4.创徏FiltercdBuffer对象Qƈ讄他们的属性应用到buffer层上?字串9
Filter filter = new Filter();
filter.setWhereExpression("NAME='San Jose'");
Buffer buffer=new Buffer();
buffer.setBufferUnits(Buffer.MILES);
buffer.setBufferDistance(8);
buffer.setPerformBuffer(true);
buffer.setBufferRegionSymbol(ps);
buffer.setBufferSelectionSymbol(ms);
buffer.setBufferTargetLayer(tLayer);
filter.setBufferObject(buffer);
fLayer.setFilterObject(filter);
5.查询l果被保存在一个名UCؓ'bufferLayer'的层中?br /> FeatureLayer resultLayer=null;
Recordset recordset = null;
for (int i=0;i<map.getLayers().getCount();i++){
if (map.getLayers().item(i).getName().equalsIgnoreCase("bufferLayer")){
resultLayer = (FeatureLayer)map.getLayers().item(i);
break;
}
}



剑秋 2008-03-15 15:15 发表评论
]]>
如何定制ArcGIS Server Java ADF 应用模版(一)--定制工具?/title><link>http://www.aygfsteel.com/mycolby/articles/183726.html</link><dc:creator>剑秋</dc:creator><author>剑秋</author><pubDate>Tue, 04 Mar 2008 08:17:00 GMT</pubDate><guid>http://www.aygfsteel.com/mycolby/articles/183726.html</guid><wfw:comment>http://www.aygfsteel.com/mycolby/comments/183726.html</wfw:comment><comments>http://www.aygfsteel.com/mycolby/articles/183726.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mycolby/comments/commentRss/183726.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mycolby/services/trackbacks/183726.html</trackback:ping><description><![CDATA[使用ArcGIS Server Java ADF  Manager创徏的Web Application中提供一个通用的工hQ包含默认的8个地囑ַ?包括4个Tool?个Command).<br /> 打开模版产生的mapviewer.jsp文gQ在W?7行我们可以看到这个工h的定义: <p><a:task id="mapToolsTask" value="#{mapToolsTask}" taskInfo="#{mapToolsTask.taskInfo}" mapId="map1" windowingSupport="false" style="padding:0px;margin:0px;" <br /> xslFile="maptoolstask.xsl"/></p> <p>我们发现Q它q不是由a:toolbar和a:tool定义的,而是一个封装好的mapToolsTask对象?br /> 通过查看faces-config.xml,我们看到mapToolsTask的定义如下:</p> <p><br /> <managed-bean><br /> <managed-bean-name>mapToolsTask</managed-bean-name><br /> <managed-bean-class>com.esri.adf.web.tasks.MapToolsTask</managed-bean-class><br /> <managed-bean-scope>session</managed-bean-scope><br /> <managed-property><br /> <property-name>webContext</property-name><br /> <value>#{mapContext}</value><br /> </managed-property><br /> </managed-bean></p> <p>事实上,mapToolsTask是在ArcGIS Server Java ADF 中已l封装好的com.esri.adf.web.tasks.MapToolsTask的一个实例?br /> cM于自定义Task的过E中实现TaskInfo的方法,我们可以也可以通过个mapToolsTask实现一个TaskInfo来达到定制的目的。倍感方便的是Q在ArcGIS Server Java ADF 也同样封装好了一?br /> com.esri.adf.web.tasks.MapToolsTaskInfo的类Q我们只需l承q个cd修改其中的配|即可,举个最单的例子Q?br /> 1.新徏一个类MyToolsTaskInfoQ承自com.esri.adf.web.tasks.MapToolsTaskInfoQ?/p> <p> <p>package com.jerry.ags;<br /> import com.esri.adf.web.tasks.MapToolsTaskInfo;<br /> import com.esri.adf.web.tasks.MapToolsTaskConfig;<br /> public class MyToolsTaskInfo extends MapToolsTaskInfo{<br /> public MyToolsTaskInfo(){<br />   MapToolsTaskConfig tc=new MapToolsTaskConfig();<br />   tc.setTools("IDENTIFY,ZOOMIN,ZOOMOUT,");<br />   super.setTaskConfig(tc);<br /> } <br /> }</p> <p>在这个简单的例子中只包含一个构造函敎ͼ在构造函C我们首先创徏一个import com.esri.adf.web.tasks.MapToolsTaskConfig的实例,q调用它的setToolsҎ(gu)Q意为在工具条中只包<br /> ?IDENTIFY,ZOOMIN,ZOOMOUT"三个工具。最后通过调用基类的setTaskConfigҎ(gu)这个com.esri.adf.web.tasks.MapToolsTaskConfig实例生效?br /> 2.在face-config.xml文g中添加如下配|:</p> <p> <p><managed-bean><br /> <managed-bean-name>myToolsTaskInfo</managed-bean-name><br /> <managed-bean-class>com.jerry.ags.MyToolsTaskInfo</managed-bean-class><br /> <managed-bean-scope>session</managed-bean-scope><br /> </managed-bean></p> <p>3.修改mapviewer.jsp文gW?7行工h的定义中taskInfo属性的?/p> <p> <p><a:task id="mapToolsTask" value="#{mapToolsTask}" taskInfo="#{myToolsTaskInfo}" mapId="map1" windowingSupport="false" style="padding:0px;margin0px;" <br /> xslFile="maptoolstask.xsl"/></p> <p>4.重新部vq启动应用,我们看到工具条中只出现三个工具Q依ơ是IDENTIFY-ZOOMIN-ZOOMOUT</p> <p>补充<br /> 1.怿定制模版应用的工hq有更ؓ灉|的方法,比如直接自定义Tool,CommandQƈ通过a:toolbar,a:tool,a:command{标{֮义来替代a:task。可以参考与q部分内容相关的资料?/p> <p>2.MapToolsTaskInfol承自com.esri.adf.web.data.tasks.SimpleTaskInfoQ因而可以通过实现TaskInfo接口中定义的getActionDescriptors()QgetToolDescriptors(){方法进行更复杂的定制?br /> 比如Q我们希望修改点L询ؓ拉框查询Q可以修改MyToolsTaskInfo 的实现程序如下:</p> <p> <p>package com.jerry.ags;<br /> import com.esri.adf.web.tasks.MapToolsTaskInfo;<br /> import com.esri.adf.web.tasks.MapToolsTaskConfig;<br /> import com.esri.adf.web.data.tasks.TaskToolDescriptorModel;<br /> import com.esri.adf.web.data.tasks.TaskToolDescriptor;<br /> import com.esri.adf.web.faces.event.ClientActions;<br /> import com.esri.adf.web.tasks.MapToolsTask;<br /> public class MyToolsTaskInfo extends MapToolsTaskInfo{<br /> private TaskToolDescriptor[] taskTools=new TaskToolDescriptor[3];<br /> public MyToolsTaskInfo(){<br />   MapToolsTaskConfig tc=new MapToolsTaskConfig();<br />   tc.setTools("IDENTIFY,ZOOMIN,ZOOMOUT,");<br />   super.setTaskConfig(tc);<br />   <br />   taskTools[0]=new TaskToolDescriptor(MapToolsTask.class,"identify","拉框查询",ClientActions.MAP_RECTANGLE);<br />   taskTools[0].setRendererType(TaskToolDescriptor.IMAGE_RENDERER_TYPE);<br />   taskTools[0].setDefaultImage("<a href="http://jerry:8000/gs/images/tasks/maptools/identify.png">http://jerry:8000/gs/images/tasks/maptools/identify.png</a>");<br />   taskTools[0].setSelectedImage("<a href="http://jerry:8000/gs/images/tasks/maptools/identifyD.png">http://jerry:8000/gs/images/tasks/maptools/identifyD.png</a>");<br />   taskTools[0].setHoverImage("<a href="http://jerry:8000/gs/images/tasks/maptools/identifyU.png">http://jerry:8000/gs/images/tasks/maptools/identifyU.png</a>");</p> <p><br />   taskTools[1]=new TaskToolDescriptor(MapToolsTask.class,"zoomIn","攑֤",ClientActions.MAP_RECTANGLE);<br />   taskTools[1].setRendererType(TaskToolDescriptor.IMAGE_RENDERER_TYPE);<br />   taskTools[1].setDefaultImage("<a href="http://jerry:8000/gs/images/tasks/maptools/zoomin.png">http://jerry:8000/gs/images/tasks/maptools/zoomin.png</a>");<br />   taskTools[1].setSelectedImage("<a href="http://jerry:8000/gs/images/tasks/maptools/zoominD.png">http://jerry:8000/gs/images/tasks/maptools/zoominD.png</a>");<br />   taskTools[1].setHoverImage("<a href="http://jerry:8000/gs/images/tasks/maptools/zoominU.png">http://jerry:8000/gs/images/tasks/maptools/zoominU.png</a>");<br />   </p> <p>  taskTools[2]=new TaskToolDescriptor(MapToolsTask.class,"zoomOut","~小",ClientActions.MAP_RECTANGLE);<br />   taskTools[2].setRendererType(TaskToolDescriptor.IMAGE_RENDERER_TYPE);<br />   taskTools[2].setDefaultImage("<a href="http://jerry:8000/gs/images/tasks/maptools/zoomout.png">http://jerry:8000/gs/images/tasks/maptools/zoomout.png</a>");<br />   taskTools[2].setSelectedImage("<a href="http://jerry:8000/gs/images/tasks/maptools/zoomoutD.png">http://jerry:8000/gs/images/tasks/maptools/zoomoutD.png</a>");<br />   taskTools[2].setHoverImage("<a href="http://jerry:8000/gs/images/tasks/maptools/zoomoutU.png">http://jerry:8000/gs/images/tasks/maptools/zoomoutU.png</a>");<br /> }</p> <p>public TaskToolDescriptorModel[] getToolDescriptors(){<br />   return taskTools;<br /> }</p> <p>}</p> <p>注意其中的taskTools[0]=new TaskToolDescriptor(MapToolsTask.class,"identify","拉框查询",ClientActions.MAP_RECTANGLE); <br /> </p> <img src ="http://www.aygfsteel.com/mycolby/aggbug/183726.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mycolby/" target="_blank">剑秋</a> 2008-03-04 16:17 <a href="http://www.aygfsteel.com/mycolby/articles/183726.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在ArcIMS9.2中用JAVA ADF实现囑ֱ要素的查?/title><link>http://www.aygfsteel.com/mycolby/articles/183708.html</link><dc:creator>剑秋</dc:creator><author>剑秋</author><pubDate>Tue, 04 Mar 2008 07:25:00 GMT</pubDate><guid>http://www.aygfsteel.com/mycolby/articles/183708.html</guid><wfw:comment>http://www.aygfsteel.com/mycolby/comments/183708.html</wfw:comment><comments>http://www.aygfsteel.com/mycolby/articles/183708.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/mycolby/comments/commentRss/183708.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/mycolby/services/trackbacks/183708.html</trackback:ping><description><![CDATA[<table width="100%"> <tbody> <tr> <td colspan="6">内容摘要</td> </tr> <tr> <td colspan="6">在ArcIMS9.2中,l用h供了Java ADF开发框架。习惯了Java Connector开发的用户可能会问QJava Connector是否q有用武之地Q如何与Java ADFl合h呢?下面׃囑ֱ要素属性查询ؓ例子Q说明如何用Java ADF与Java Connectorl合开发实现要素查询功能。在使用ADF开发中Q有许多需要注意的技巧。本例子也用粗体的注释q行了标识?/td> </tr> <tr> <td colspan="6">q程描述</td> </tr> <tr> <td colspan="6"> <p style="margin: 0cm 0cm 0pt"><span style="font-family: 宋体" Times??> <p></span><span style="font-family: 宋体"><span style="font-family: 宋体">开发环境:</span>Eclipse3.2</span></span></p> <p style="margin: 0cm 0cm 0pt">开发步骤:</span><span> <p></span></p> <p style="margin: 0cm 0cm 0pt 36pt; text-indent: -24pt; tab-stops: list 36.0pt">一?nbsp;<span style="font-family: 宋体" Times??>Administrator</span><span style="font-family: 宋体" Times??>ArcIMS</span><span style="font-family: 宋体" Times??> <p></span></p> <p style="margin: 0cm 0cm 0pt 36pt; text-indent: -24pt; tab-stops: list 36.0pt">二?nbsp;<span style="font-family: 宋体" Times??>Eclipse</span><span style="font-family: 宋体" Times??> ArcGIS Web Project <p></span></p> <p style="margin: 0cm 0cm 0pt 36pt; text-indent: -24pt; tab-stops: list 36.0pt">三?nbsp;<span style="font-family: 宋体" Times??>Java</span><span style="font-family: 宋体" Times??> FeatureQuery</span><span style="font-family: 宋体" Times??> queryFeaturesInRectangle</span><span style="font-family: 宋体" Times??> <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"> <p style="margin: 0cm 0cm 0pt 12pt"><span>package com.wudefu; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.adf.web.data.WebContext; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.adf.web.data.geometry.WebExtent; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.adf.web.data.geometry.WebPoint; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.adf.web.data.*; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.adf.web.faces.event.MapEvent; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.adf.web.aims.data.AIMSMapResource; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.adf.web.aims.data.AIMSMapFunctionality; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.adf.web.aims.data.AIMSTocFunctionality; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.adf.web.aims.data.query.AIMSQueryFunctionality; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.aims.mtier.model.envelope.Envelope; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.aims.mtier.model.map.layer.FeatureLayer; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.aims.mtier.model.map.layer.query.Buffer; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.aims.mtier.model.map.layer.query.Filter; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.aims.mtier.model.map.layer.query.Recordset; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.aims.mtier.model.map.layer.renderer.symbol.SimpleMarkerSymbol; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.aims.mtier.model.map.layer.renderer.symbol.SimplePolygonSymbol; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.aims.mtier.model.map.*; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import com.esri.aims.mtier.model.map.Map; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>import java.util.*; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"> <p style="margin: 0cm 0cm 0pt 12pt"><span>public class FeatureQuery { <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"> <p style="margin: 0cm 0cm 0pt 12pt"><span>    private WebContext context; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>     <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt">    //<span style="font-family: 宋体" Times??> <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>    public void queryFeaturesInRectangle(MapEvent event){ <p></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left" align="left">       <span style="font-family: ??"> </span><span style="font-family: ??">     <p></span></p> <p style="margin: 0cm 0cm 0pt; text-indent: 15.75pt; text-align: left" align="left"><span style="font-family: 宋体">//<strong>调用JAVA ADF里面的WebControl获取地图</strong> <p></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left" align="left"><span style="color: black; font-family: " 10.5pt;??>       </span> </span><span style="color: black; font-family: ??"> </span><span style="color: black; font-family: " span 10.5pt;?aims0?< ? font-family: #2a00ff; 10.5pt;?color: black; #0000c0;><span style="color: black; font-family: " span 10.5pt;<><span style="font-family: " 0pt; align="left" left;? text-align: 0cm 10.5pt;?margin:><span style="color: black; font-family: " 10.5pt;??>       </span> AIMSMapFunctionality imsMapFun=(AIMSMapFunctionality)aimsMap.getFunctionality(</span><span style="color: #2a00ff; font-family: " span 10.5pt;?map?<><span style="color: black; font-family: " span 10.5pt;<><span style="font-family: " 0pt; align="left" left;? text-align: 0cm 10.5pt;?margin:><span style="color: black; font-family: " 10.5pt;??>       </span> Map </span><u></p> <p style="margin: 0cm 0cm 0pt 12pt">       //<span style="font-family: 宋体" Times??> <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           FeatureLayer fLayer=(FeatureLayer)imsMap.getLayers().item(5); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>            <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt">       //<span style="font-family: 宋体" Times??> <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           WebMap webMap=context.getWebMap(); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           WebExtent chosenExent = (WebExtent) event.getWebGeometry().toMapGeometry(webMap); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>            <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt">       //<span style="font-family: 宋体" Times??> Java Connector</span><span style="font-family: 宋体" Times??> <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           Envelope env=new Envelope(); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           env.setMaxX(chosenExent.getMaxX()); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           env.setMaxY(chosenExent.getMaxY()); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           env.setMinX(chosenExent.getMinX()); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           env.setMinY(chosenExent.getMinY()); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>            <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt">           //<span style="font-family: 宋体" Times??> <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           SimpleMarkerSymbol sms = new SimpleMarkerSymbol();  <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           sms.setColor("0,0,255"); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           sms.setMarkerType(sms.STAR); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           sms.setWidth(20); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"> <p style="margin: 0cm 0cm 0pt 12pt"><span>           Filter filter=new Filter(); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           filter.setSpatialShape(env);          <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           filter.setGlobalEnvelope(true); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"> <p style="margin: 0cm 0cm 0pt 12pt"><span>           fLayer.setFilterObject(filter); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>          <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt">           //<strong><span style="font-family: 宋体" Times??>filter</strong><strong><span style="font-family: 宋体" Times??>update</strong><strong><span style="font-family: 宋体" Times??> Recordset </strong><strong><span style="font-family: 宋体" Times??> <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           webMap.update(context, null); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt">          //<span style="font-family: 宋体" Times??>Java Connector</span><span style="font-family: 宋体" Times??> <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>          int a=fLayer.getRecordset().getCount(); <p></span></p> <p style="margin: 0cm 0cm 0pt 11.95pt; text-indent: 52.5pt"><span>//int b=fLayer.getFeatureCount(); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>          System.out.println(a); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>                           <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>          String fieldNames[]=new String[fLayer.getRecordset().getTableDesc().getCount()]; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>          String fieldValues[]=new String[fLayer.getRecordset().getTableDesc().getCount()]; <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>          for(int i=0;i<fLayer.getRecordset().getCount();i++){ <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>                  for (int k=0; k<fLayer.getRecordset().getTableDesc().getCount(); k++) { <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>                      fieldNames[k]= fLayer.getRecordset().getTableDesc().getFieldName(k); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>                      fieldValues[k]=fLayer.getRecordset().getRecords(i).getFieldValue(k); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>                      System.out.println(fieldNames[k]); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>                      System.out.println(fieldValues[k]);                    <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>                  } <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>          } <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           imsMap.displayFeatures(fLayer,true,sms);        <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>           webMap.update(context, null); <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"> <p style="margin: 0cm 0cm 0pt 12pt">           //<strong><span style="font-family: 宋体" Times??>imsMap.refresh()</strong><strong><span style="font-family: 宋体" Times??><span> <p></span></strong></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>        imsMap.reset();             <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>    }         <p></span></p> <p style="margin: 0cm 0cm 0pt 12pt"><span>   } <p></span></p> <p style="margin: 0cm 0cm 0pt 36pt; text-indent: -24pt; tab-stops: list 36.0pt"><span style="color: black; font-family: " 10.5pt;>四?nbsp;</span><span style="color: black; font-family: 宋体" ? font-family: 10.5pt;?color: black; 0cm 10.5pt;?margin: 26.25pt;? text-indent: 11.95pt; 0pt 宋体;?><span style="color: black; font-family: 宋体" 10.5pt; span ? font-family: 10.5pt;?color: black; 宋体;? faces-config><><span style="color: black; font-family: " 10.5pt;??>    </span></span><span style="color: teal; font-family: " span 10.5pt;<><span style="color: #3f7f7f; font-family: " span ? font-family: 10.5pt;?color: 10.5pt;< teal;><span style="color: black; font-family: " 10.5pt;??>    </span> </span><span style="color: teal; font-family: " span 10.5pt;<><span style="color: #3f7f7f; font-family: " span ? font-family: 10.5pt;?color: 10.5pt;< teal;><span style="color: black; font-family: " 10.5pt;??>    </span></span><span style="color: teal; font-family: " span 10.5pt;<><span style="color: #3f7f7f; font-family: " span ? font-family: 10.5pt;?color: 10.5pt;< teal;><span style="color: black; font-family: " 10.5pt;??>    </span> </span><span style="color: teal; font-family: " span 10.5pt;<><span style="color: #3f7f7f; font-family: " span ? font-family: 10.5pt;?color: 10.5pt;< teal;><span style="color: black; font-family: " 10.5pt;??>    </span> </span><span style="color: teal; font-family: " span 10.5pt;<><span style="color: #3f7f7f; font-family: " span ? font-family: 10.5pt;?color: 10.5pt;< teal;><span style="color: black; font-family: " 10.5pt;??>    </span>  </span><span style="color: teal; font-family: " span 10.5pt;<><span style="color: #3f7f7f; font-family: " span ? font-family: 10.5pt;?color: 10.5pt;< teal;><span style="color: black; font-family: " 10.5pt;??>    </span>  </span><span style="color: teal; font-family: " span 10.5pt;<><span style="color: #3f7f7f; font-family: " span ? font-family: 10.5pt;?color: 10.5pt;< teal;><span style="color: black; font-family: " 10.5pt;??>    </span> </span><span style="color: teal; font-family: " 10.5pt; span <><span style="color: #3f7f7f; font-family: " span ? font-family: 10.5pt;?color: 10.5pt;< teal;> </span><span style="color: teal; font-family: " 10.5pt; span <><span style="color: #3f7f7f; font-family: " span ? font-family: 10.5pt;?color: 10.5pt;< teal;>五?nbsp;<span style="font-family: 宋体" Times??>mapviewer.jsp</span><span style="font-family: 宋体" Times??> <p></span></p> <p style="margin: 0cm 0cm 0pt; text-align: left" align="left"><span style="color: teal; font-family: " span 10.5pt;<><span style="color: #3f7f7f; font-family: " span ? font-family: #2a00ff; 10.5pt;?color: black; < 10.5pt;?Maptools? #7f007f;><span style="color: teal; font-family: " span 10.5pt;<><span style="font-family: " 0pt; align="left" left;? text-align: 0cm 10.5pt;?margin:><span style="color: black; font-family: " 10.5pt;??>   </span></span><span style="color: teal; font-family: " span 10.5pt;<><span style="color: #3f7f7f; font-family: " span ? font-family: #2a00ff; 10.5pt;?color: black; < #7f007f; 10.5pt;?Toolbar?><span style="color: #7f007f; font-family: " span ? font-family: #2a00ff; 10.5pt;?color: black; 10.5pt;?map1?<><span style="color: teal; font-family: " span 10.5pt;<><span style="font-family: " 0pt; align="left" left;? text-align: 0cm 10.5pt;?margin:><span style="color: black; font-family: " 10.5pt;??>      </span></span><span style="color: teal; font-family: " span 10.5pt;<><span style="color: #3f7f7f; font-family: " span ? font-family: #2a00ff; 10.5pt;?color: black; < #7f007f; 10.5pt;?queryFeatures?><span style="color: #7f007f; font-family: " span ? font-family: #2a00ff; 10.5pt;?color: black; select_rect_1.gif?< 10.5pt;?images><span style="font-family: " 0pt; align="left" left;? text-align: 0cm 10.5pt;?margin:><span style="color: #7f007f; font-family: " span ? font-family: #2a00ff; 10.5pt;?color: black; 10.5pt;?images select_rect_2.gif?<><span style="font-family: " 0pt; align="left" left;? text-align: 0cm 10.5pt;?margin:><span style="color: #7f007f; font-family: " span ? font-family: #2a00ff; 10.5pt;?color: black; < 10.5pt;?EsriMapRectangle?                            ><span style="color: #7f007f; font-family: " span ? font-family: #2a00ff; 10.5pt;?color: black; 10.5pt;?<> <span style="color: #7f007f">toolTip</span><span style="color: black">=</span><span style="color: #2a00ff">"</span></span><span style="color: #2a00ff; font-family: 宋体" span ? font-family: #2a00ff; 10.5pt;?color: 10.5pt;?<><span style="color: teal; font-family: " span 10.5pt;<><span style="font-family: " 10.5pt; 0pt; align="left" text-align: 0cm 10.5pt;?margin: text-indent: 415.3pt;? right tab-stops: left;><span style="color: teal; font-family: " 10.5pt; span <><span style="color: #3f7f7f; font-family: " span ? font-family: 10.5pt;?color: teal; < 10.5pt;                                                       ><span style="color: teal; font-family: " 10.5pt; span <><span style="color: #3f7f7f; font-family: " span ? font-family: 10.5pt;?color: 10.5pt;< teal;><span style="color: teal; font-family: " 10.5pt;??> <p></span></p> <p style="margin: 0cm 0cm 0pt"><span style="font-family: 宋体;" Times</p> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></strong></span></span></span></u></span></span></span></span> </tr> </tbody> </table> <img src ="http://www.aygfsteel.com/mycolby/aggbug/183708.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/mycolby/" target="_blank">剑秋</a> 2008-03-04 15:25 <a href="http://www.aygfsteel.com/mycolby/articles/183708.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">ǰ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʯɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ض</a>| <a href="http://" target="_blank">ֹ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ػ</a>| <a href="http://" target="_blank">ī</a>| <a href="http://" target="_blank">Ƹ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ĭ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ԭ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ϫ</a>| <a href="http://" target="_blank">½</a>| <a href="http://" target="_blank">ƫ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʯ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ؼ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¬</a>| <a href="http://" target="_blank">ԭ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>