machelchxw
路人甲
路人甲
  • 注册日期2003-07-28
  • 发帖数14
  • QQ
  • 铜币178枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2968回复:4

arcims 专题图制作问题请教

楼主#
更多 发布于:2004-11-12 12:10
<P>你好!
    
     我们单位现在有个项目,开发b/s系统,基于arcims技术实现.
     其中有个模块是,实现专题分析与统计</P>
<P>     我现在有个图层为县区界,面状信息,我想对该图层做饼图分析,同时又要保留以名称字段显示的label标示
     因为饼图和名称label都是利用render中的simplelabelrenderer绘制的,在我实际得到的返回图像,饼图和
     名称lable只能显示其中之一,不能两者兼得.</P>
<P>     而我通过手工编辑一个axl文件,将饼图和名称label两个simplelabelrenderer都放在了县区界面图层对应的grouprenderer中,
     在author中打开,可以同时显示县区界的饼图和名称label
    
     我不知道是不是向arcims app server发送同一图层包含两个simplelabelrenderer的arcxml请求,只能解析一个的缘故,还是我的程序本身
     存在缺陷.
     请求帮忙,非常感谢!</P>
<P>     the code sections are listed as below:
 
===============================================================
     1) the connector server method: java connector
 ===============================================================
     Map map=new Map();
      map.initMap(mapCon,750,true,true,true,true);
 
      FeatureLayer activelayer=null;
      activelayer = (FeatureLayer)map.getLayers().item(0);
      //县区界    
    
     GroupRenderer group = new GroupRenderer();
     String simpleLabelField="";
    
     SimpleLabelRenderer simpleLabel = new SimpleLabelRenderer();
    
     ChartSymbol chartSymbol = new ChartSymbol();
     ChartValue[] chartValue = new ChartValue[3];
     chartValue[0]=new ChartValue();
     chartValue[0].setLookUpField("BJMAP.XQJ_PY_10000.AREA");
     chartValue[0].setColor("220,20,60");
     chartSymbol.addChartValue(chartValue[0]);
     chartValue[1]=new ChartValue();
     chartValue[1].setLookUpField("BJMAP.XQJ_PY_10000.PERIMETER");
     chartValue[1].setColor("169,169,169");
     chartSymbol.addChartValue(chartValue[1]);
     chartValue[2]=new ChartValue();
     chartValue[2].setLookUpField("BJMAP.XQJ_PY_10000.BOU_");
     chartValue[2].setColor("72,61,139");
     chartSymbol.addChartValue(chartValue[2]);
     chartSymbol.setMode("PIE");
     chartSymbol.setSize(40);
  
     simpleLabelField="BJMAP.XQJ_PY_10000.AREA BJMAP.XQJ_PY_10000.PERIMETER BJMAP.XQJ_PY_10000.BOU_";         </P>
<P>     simpleLabel.setField(simpleLabelField);
     simpleLabel.setSymbol(chartSymbol);  
      
     group=(GroupRenderer)activelayer.getRenderer();
      
      
     for(int t=0;t<group.getRenderersCount();t++){
          
     System.out.println(group.item(t).getType());
          
     //if(group.item(t).getType().equals("SimpleLabel"))
     //group.removeRenderer(t);
     }
    
     group.addRenderer(simpleLabel);
     activelayer.setRenderer(group);
     map.refresh();</P>
<P>===============================================================
     2) the connector server method: servlet connector
===============================================================</P>
<P>   String serverUrl="<a href="http://chxw:8888/servlet/com.esri.esrimap.Esrimap?ServiceName" target="_blank" >http://chxw:8888/servlet/com.esri.esrimap.Esrimap?ServiceName</A>=";
   serverUrl+="bjmap";
   String arcxmlRequestStr="";
   String arcxmlResponseStr="";
  
   arcxmlRequestStr+="<ARCXML version=\"1.1\">";
   arcxmlRequestStr+="<REQUEST>";
   arcxmlRequestStr+="<GET_IMAGE autoresize=\"false\">";
   arcxmlRequestStr+="<ENVIRONMENT>";
   arcxmlRequestStr+="<SEPARATORS cs=\" \" ts=\";\"/>";
   arcxmlRequestStr+="</ENVIRONMENT>";
   arcxmlRequestStr+="<PROPERTIES>";
   arcxmlRequestStr+="<ENVELOPE maxx=\"117.495073821434\" maxy=\"41.0567666968429\" minx=\"115.416948897623\" miny=\"39.4379575859603\"/>";
   arcxmlRequestStr+="<IMAGESIZE dpi=\"750\" height=\"300\" scalesymbols=\"false\" width=\"400\"/>";
   arcxmlRequestStr+="<LEGEND antialiasing=\"true\" autoextend=\"false\" cansplit=\"false\" cellspacing=\"2\" columns=\"1\" display=\"true\" font=\"宋体\" height=\"300\" layerfontsize=\"10\" reverseorder=\"false\" splittext=\"(cont)\" swatchheight=\"14\" swatchwidth=\"18\" title=\"Legend\" titlefontsize=\"12\" valuefontsize=\"8\" width=\"125\"/>";
   arcxmlRequestStr+="<LAYERLIST dynamicfirst=\"false\" nodefault=\"false\" order=\"true\">";
   arcxmlRequestStr+="<LAYERDEF id=\"0\" name=\"县区界\" visible=\"true\">";
  
   arcxmlRequestStr+="<GROUPRENDERER>";
  
   arcxmlRequestStr+="<VALUEMAPRENDERER lookupfield=\"BJMAP.XQJ_PY_10000.NAME\">";
   arcxmlRequestStr+="<EXACT label=\"东城区\" method=\"IsExact\" value=\"东城区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"206,195,149\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"丰台区\" method=\"IsExact\" value=\"丰台区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"240,230,140\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"大兴区\" method=\"IsExact\" value=\"大兴区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"255,251,195\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"宣武区\" method=\"IsExact\" value=\"宣武区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"139,139,0\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"密云县\" method=\"IsExact\" value=\"密云县\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"139,69,19\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"崇文区\" method=\"IsExact\" value=\"崇文区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"220,206,219\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"平谷区\" method=\"IsExact\" value=\"平谷区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"189,176,86\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"延庆县\" method=\"IsExact\" value=\"延庆县\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"172,150,172\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"怀柔区\" method=\"IsExact\" value=\"怀柔区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"192,144,88\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"房山区\" method=\"IsExact\" value=\"房山区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"255,215,0\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"昌平区\" method=\"IsExact\" value=\"昌平区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"205,155,29\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"朝阳区\" method=\"IsExact\" value=\"朝阳区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"254,234,198\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"海淀区\" method=\"IsExact\" value=\"海淀区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"247,181,103\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"石景山区\" method=\"IsExact\" value=\"石景山区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"139,105,20\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"西城区\" method=\"IsExact\" value=\"西城区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"105,139,105\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"通州区\" method=\"IsExact\" value=\"通州区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"189,183,107\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"门头沟区\" method=\"IsExact\" value=\"门头沟区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"192,101,73\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="<EXACT label=\"顺义区\" method=\"IsExact\" value=\"顺义区\">";
   arcxmlRequestStr+="<SIMPLEPOLYGONSYMBOL boundarycaptype=\"round\" boundarycolor=\"0,0,0\" boundaryjointype=\"round\" boundarytype=\"solid\" boundarywidth=\"1\" fillcolor=\"167,175,94\" fillinterval=\"0\"/>";
   arcxmlRequestStr+="</EXACT>";
   arcxmlRequestStr+="</VALUEMAPRENDERER>";
  
   //名称render
   arcxmlRequestStr+="<SIMPLELABELRENDERER field=\"BJMAP.XQJ_PY_10000.NAME\">";
   arcxmlRequestStr+="<TEXTSYMBOL antialiasing=\"true\" font=\"黑体\" fontcolor=\"255,0,0\" fontsize=\"15\" fontstyle=\"regular\" glowing=\"255,255,0\" interval=\"0\" printmode=\"none\"/>";
   arcxmlRequestStr+="</SIMPLELABELRENDERER>";
  
   // theme pie
   //arcxmlRequestStr+="<SIMPLELABELRENDERER field=\"BJMAP.XQJ_PY_10000.AREA BJMAP.XQJ_PY_10000.PERIMETER BJMAP.XQJ_PY_10000.BOU_\">";
   arcxmlRequestStr+="<SIMPLELABELRENDERER featureweight=\"high_weight\" field=\"BJMAP.XQJ_PY_10000.AREA BJMAP.XQJ_PY_10000.PERIMETER BJMAP.XQJ_PY_10000.BOU_\" labelbufferratio=\"0.0\" labelpriorities=\"2,2,1,4,5,3,2,4\" labelweight=\"high_weight\" linelabelposition=\"PlaceAbove\">";
   arcxmlRequestStr+="<CHARTSYMBOL mode=\"PIE\" outline=\"none\" size=\"10\">";
   arcxmlRequestStr+="<CHARTVALUE color=\"220,20,60\" lookupfield=\"BJMAP.XQJ_PY_10000.AREA\"/>";
   arcxmlRequestStr+="<CHARTVALUE color=\"169,169,169\" lookupfield=\"BJMAP.XQJ_PY_10000.PERIMETER\"/>";
   arcxmlRequestStr+="<CHARTVALUE color=\"72,61,139\" lookupfield=\"BJMAP.XQJ_PY_10000.BOU_\"/>";
   arcxmlRequestStr+="</CHARTSYMBOL>";
   arcxmlRequestStr+="</SIMPLELABELRENDERER>";
  
  
   arcxmlRequestStr+="</GROUPRENDERER>";
  
   arcxmlRequestStr+="</LAYERDEF>";
   arcxmlRequestStr+="</LAYERLIST>";
   arcxmlRequestStr+="</PROPERTIES>";
   arcxmlRequestStr+="</GET_IMAGE>";
   arcxmlRequestStr+="</REQUEST>";
   arcxmlRequestStr+="</ARCXML>";
   ............................................
   url请求servlet connector得到arcxml response
   ............................................</P>
<P>
 再次感谢!</P>
喜欢0 评分0
cl991036
管理员
管理员
  • 注册日期2003-07-25
  • 发帖数5913
  • QQ14265545
  • 铜币29655枚
  • 威望213点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • GIS帝国铁杆
1楼#
发布于:2004-11-14 00:53
<P>ims的难点,看看有人没知道,帮up</P>
没钱又丑,农村户口。头可断,发型一定不能乱。 邮箱:gisempire@qq.com
举报 回复(0) 喜欢(0)     评分
machelchxw
路人甲
路人甲
  • 注册日期2003-07-28
  • 发帖数14
  • QQ
  • 铜币178枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2004-11-15 10:49
<P>我查了arcxml develope guide ,同一个图层,不支持两个simplelabelrender的,所以直接调用恐怕不行</P><P>可以做两次请求,一次得到name label和背景图,一次得到pie label和背景图,并设为透明,然后两图叠加实现</P><P>不过此方法显然不为最佳方案,欢迎大家讨论</P>
举报 回复(0) 喜欢(0)     评分
liu76xt
论坛版主
论坛版主
  • 注册日期2004-05-26
  • 发帖数262
  • QQ
  • 铜币499枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2004-11-15 20:53
<P>试了老半天,也没有结果。</P><P>不过记得以前在四川经济网上看到,就是一般的专题图(饼图、柱装图)的效果展现是</P><P>专题的名称,对应一张GIS效果图</P><P>比如:</P><P>-----</P><P>--全市GDP分布</P><P>--全市人口分布</P><P>--全市人均收入分布</P><P>没点击一个就直接刷新出现相应的GIS专题图,图上没有什么信息就是简单的区域和 饼图、柱装图;</P><P>当然可以使用其他的技术(如VML)结合实现,但这 又远离了楼主的意愿,并且不是很实用。</P><P>其实连续两次请求也未尝不可,可能会慢些而已。</P>
| ------------- | 白云悠悠矶头月涌千骏过, 往事渺渺江上风情一燕来。 | ------------- | [img]http://www.gisempire.com/bbs/showimg.asp?BoardID=3&filename=2004-9/200491972356282.gif[/img]
举报 回复(0) 喜欢(0)     评分
peter7529
路人甲
路人甲
  • 注册日期2004-10-10
  • 发帖数58
  • QQ
  • 铜币248枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2004-11-16 16:12
等待解答,我也有同样的问题
举报 回复(0) 喜欢(0)     评分
游客

返回顶部