<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="http://feeds.qzone.qq.com/rss.xsl" version="1.0"?>
<rss version="2.0" xmlns:qz="http://qzone.qq.com">
<channel>
<title><![CDATA[╰醉意人间╮]]></title>
<description><![CDATA[悟空人生，人生一场即兴]]></description>
<link>http://271718002.qzone.qq.com</link>
<lastBuildDate>Wed, 25 Nov 2009 18:28:39 GMT</lastBuildDate>
<generator>Qzone</generator>
<language>zh-cn</language>
<copyright>Copyright (C), 2005-2008, Tencent Tech. Co., Ltd.</copyright>
<pubDate>Wed, 25 Nov 2009 13:01:42 GMT</pubDate>

<item>
<title><![CDATA[[转]操作XML的asp类]]></title>
<link>http://271718002.qzone.qq.com/blog/1259154102</link>
<description><![CDATA[1.XML<br>===========================================================================<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;gb2312&quot;?&gt;<br>&lt;data&gt;<br>&lt;tomcat&gt;<br>&lt;ID&gt;1&lt;/ID&gt;<br>&lt;username&gt;张辉&lt;/username&gt;<br>&lt;password&gt;123456&lt;/password&gt;<br>&lt;/tomcat&gt;<br>&lt;/data&gt;<br>============================================================================<br><br>aspXML.asp<br>============================================================================<br>&lt;% <br>Class ASPXML<br>Private objDom,objnodes,objTable,Xml_Array,XMLnodes,ID,brstr,NewXMLnode,NewXMLcooky<br>Public Path,Data,Xml_Eof,Xml_Bof,Xml_Item,Xml_Count<br><br>'打开文档<br>Public Sub open()<br>set objDom=server.CreateObject(&quot;Microsoft.XMLDOM&quot;)<br>objDom.load Path<br>set objnodes=objdom.documentElement.SelectSingleNode(&quot;//&quot;+Data+&quot;&quot;).ChildNodes<br>set XMLnodes=objdom.documentElement.SelectSingleNode(&quot;//&quot;+Data+&quot;&quot;)<br>end sub<br><br>'选择表<br>Public Function SelectTable(Table)<br>objTable=Table<br>Xml_Count=-1<br>Xml_Eof=false<br>Xml_Bof=false<br>'Xml_Item=2<br>if Xml_Item=&quot;&quot; then<br>Xml_Item=0<br>end if<br>GETCount()<br>ChkCount()<br>end Function<br><br><br>'下移一行<br>Public Sub MoveNext()<br>Xml_Item=Xml_Item+1<br>ChkCount()<br>end sub<br>'上移一行<br>Public Sub MoveLast()<br>Xml_Item=Xml_Item-1<br>ChkCount()<br>end sub<br><br>'读出值<br>Public Function Read(key)<br>Read=objnodes(int(Xml_Array(Xml_Item))).selectSingleNode(key).text<br>end Function<br>'写入<br>Public Function Write(key,viold)<br>objnodes(int(Xml_Array(Xml_Item))).selectSingleNode(key).text=viold<br>end Function<br>'查询字段<br>Public Function SelectItem(key,viold)<br>Xml_AllTableWords=&quot;&quot;<br>for i=0 to Xml_Count<br>xml_viold=objnodes(int(Xml_Array(i))).selectSingleNode(key).text<br>if xml_viold=viold then<br>Xml_AllTableWords=Xml_AllTableWords+&quot;|&quot;+Xml_Array(i)<br>end if<br>next<br>StrPtr = instr(Xml_AllTableWords, &quot;|&quot;)<br>Xml_AllTableWords = mid(Xml_AllTableWords, StrPtr+1)<br>Xml_Array=split(Xml_AllTableWords , &quot;|&quot;) <br>Xml_Count=UBound(Xml_Array)<br>ChkCount()<br>end Function<br><br>'新加记录<br>Public sub addnew()<br>NewXMLnode=&quot;&quot;<br>if XMLnodes.hasChildNodes then<br>ID = XMLnodes.lastchild.firstchild.text+1<br>else<br>'如是没有字子节点则是第一次留言ＩＤ号设为１<br>ID=1<br>end if<br>brstr=chr(13)&amp;chr(10)&amp;chr(9)<br>NewXMLcooky=brstr&amp;&quot;&lt;&quot;&amp;objTable&amp;&quot;&gt;&quot;&amp;brstr &amp;&quot;&lt;ID&gt;&quot;&amp;ID&amp;&quot;&lt;/ID&gt;&quot;&amp;brstr<br>end sub<br>'添加数值<br>Public Function add(key,viold)<br>NewXMLcooky=NewXMLcooky&amp;&quot;&lt;&quot;&amp;key&amp;&quot;&gt;&quot;&amp;viold&amp;&quot;&lt;/&quot;&amp;key&amp;&quot;&gt;&quot;&amp;brstr<br>NewXMLnode=NewXMLcooky&amp;&quot;&lt;/&quot;&amp;objTable&amp;&quot;&gt;&quot;&amp;chr(13)<br>end Function<br>'删除记录<br>Public Function delect(key,viold)<br>for i=0 to Xml_Count<br>if ISkeyOk(key,viold) then<br>XMLnodes.removechild(objDom.selectsinglenode(&quot;//&quot;&amp;objTable&amp;&quot;[&quot;&amp;key&amp;&quot;='&quot;&amp;viold&amp;&quot;']&quot;))<br>end if<br>next<br>objDom.save(Path)<br>end Function<br><br>'删除表<br>Public Function delectTable()<br>for i=0 to Xml_Count<br>XMLnodes.removechild(objDom.selectsinglenode(&quot;//&quot;&amp;objTable))<br>next<br>objDom.save(Path)<br>end Function<br><br><br>'更新修改表<br>Public Sub update()<br>if NewXMLnode&lt;&gt;&quot;&quot; then<br>set objXML2=Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)<br>'建立一个新XML对像<br>objXML2.loadXML(NewXMLnode)<br>'把XML版片段读入内存中<br>set rootNewNode=objXML2.documentElement<br>'获得objXML2的根节点<br>XMLnodes.appendChild(rootNewNode)<br>end if<br>objDom.Save(Path)<br>end sub<br>'关闭<br>Public Sub CLOSE()<br>set objnodes=nothing<br>set objDom=nothing<br>' Response.Write(objTable)<br>end sub<br><br><br>'=====================================================================<br>Private Function GETCount()<br>Xml_AllTableWords=&quot;&quot;<br>Xml_AllCount=-1<br>for each element in objnodes<br>Xml_AllCount=Xml_AllCount+1<br>If element.nodename =objTable then<br>Xml_AllTableWords=Xml_AllTableWords+&quot;|&quot;+cstr(Xml_AllCount)<br>end if<br>next<br>StrPtr = instr(Xml_AllTableWords, &quot;|&quot;)<br>Xml_AllTableWords = mid(Xml_AllTableWords, StrPtr+1)<br>Xml_Array=split(Xml_AllTableWords , &quot;|&quot;) <br>Xml_Count=UBound(Xml_Array)<br>end Function<br><br>Private Function ChkCount()<br>if Xml_Count&lt;0 then<br>Xml_Bof=true<br>end if<br>if Xml_Item&gt;Xml_Count then<br>Xml_Eof=true<br>end if<br>end Function<br><br>Private Function ISkeyOk(key,viold)<br>ISkeyOk=false<br>if not(XMLnodes.hasChildNodes) then<br>exit Function<br>end if<br><br>for each timent in objnodes<br>If timent.nodename =objTable then<br>set pobjnodes=timent.ChildNodes<br>for each yyment in pobjnodes<br>if yyment.nodename=key and yyment.text=viold then<br>ISkeyOk=true<br>exit Function<br>end if<br>next<br>end if<br>next<br>end Function<br>End Class<br>%&gt;<br> <br>=======================================================================<br><br>使用这个类的例子<br>test.asp<br>=======================================================================<br>&lt;!--#include file=&quot;aspXML.asp&quot;--&gt;<br>&lt;%<br><br>set tt=new ASPXML<br>tt.Path=server.MapPath(&quot;1.xml&quot;)'第一步先选择文件路径<br>tt.Data=&quot;data&quot; '第二步选择数据库<br>tt.open '打开<br>tt.SelectTable(&quot;tomcat&quot;) '选择表<br>'tt.delect &quot;username&quot;,&quot;张辉&quot; '这里表示删除 username字段里是 张辉 的所有值<br>'tt.delectTable() '删除这个表<br>tt.SelectItem &quot;ID&quot;,&quot;2&quot; '这里是查询ID为2的记录<br>'tt.Xml_Item=tt.Xml_Count 'tt.Xml_Item 是第几条记录 tt.Xml_Count是记录总数<br>tt.addnew ' 添加记录<br>tt.add &quot;username&quot;,&quot;张辉&quot; '写入值<br>tt.add &quot;password&quot;,&quot;123456&quot; '写入值<br>tt.update '保存记录<br>GG=tt.read(&quot;username&quot;) '读出记录<br>tt.close '关闭<br>Response.Write(GG) <br>Response.Write(&quot;&lt;br/&gt;&quot;)<br>Response.Write(&quot;&lt;br/&gt;&quot;)<br>'再写个循环读出记录<br><br>set HH=new ASPXML<br>HH.Path=server.MapPath(&quot;1.xml&quot;) '第一步先选择文件路径<br>HH.Data=&quot;data&quot; '第二步选择数据库<br>HH.open '打开<br>HH.SelectTable(&quot;tomcat&quot;) '选择表<br>HH.SelectItem &quot;username&quot;,&quot;张辉&quot; '查询条件 如果读出所有 这里不要<br>do while not(HH.Xml_Bof or HH.Xml_Eof)<br><br>Response.Write HH.read(&quot;username&quot;) <br>Response.Write(&quot;|&quot;)<br>Response.Write HH.read(&quot;password&quot;) <br>Response.Write(&quot;&lt;br/&gt;&quot;)<br><br>HH.MoveNext()<br>loop'写一个添加数据的例子<br>username=Request.Form(&quot;username&quot;)<br>password=Request.Form(&quot;password&quot;)set HH=new ASPXML<br>HH.Path=server.MapPath(&quot;1.xml&quot;) '第一步先选择文件路径<br>HH.Data=&quot;data&quot; '第二步选择数据库<br>HH.open '打开<br>HH.SelectTable(&quot;tomcat&quot;) '选择表<br>hh.Addnew<br>hh.add &quot;username&quot;,username<br>hh.add &quot;password&quot;,password<br>HH.Update<br>HH.CLOSE'写一个删除的例子<br>ID=Request.QueryString(&quot;ID&quot;)<br>set HH=new ASPXML<br>HH.Path=server.MapPath(&quot;1.xml&quot;) '第一步先选择文件路径<br>HH.Data=&quot;data&quot; '第二步选择数据库<br>HH.open '打开<br>HH.SelectTable(&quot;tomcat&quot;) '选择表HH.delect &quot;ID&quot;, ID <br>HH.CLOSE<br><br>%&gt; <!--v:3.2--> ]]></description>
<category><![CDATA[个人日记]]></category>
<author><![CDATA[271718002@qq.com(╰醉意人间╮)]]></author>
<comments>http://271718002.qzone.qq.com/blog/1259154102#comment</comments>
<qz:effect>134218248</qz:effect>
<pubDate>Wed, 25 Nov 2009 13:01:42 GMT</pubDate>
<guid>http://271718002.qzone.qq.com/blog/1259154102</guid>
</item>

<item>
<title><![CDATA[XML登陆]]></title>
<link>http://271718002.qzone.qq.com/blog/1259152852</link>
<description><![CDATA[<br><br>C# xml 实现登陆<br>现在有一个XML文件：   <br>  &lt;LoginList&gt;<br>  &lt;user&gt;<br>    &lt;Username&gt;liujia&lt;/Username&gt;<br>    &lt;assword&gt;liujia&lt;/Password&gt;<br>  &lt;/user&gt;<br>  &lt;user&gt;<br>    &lt;Username&gt;lilu&lt;/Username&gt;<br>    &lt;assword&gt;lilu&lt;/Password&gt;<br>  &lt;/user&gt;<br>  &lt;user&gt;<br>    &lt;Username&gt;zhangsan&lt;/Username&gt;<br>    &lt;assword&gt;zhangsan&lt;/Password&gt;<br>  &lt;/user&gt;<br>  &lt;user&gt;<br>    &lt;Username&gt;lisi&lt;/Username&gt;<br>    &lt;Password&gt;lisi&lt;/Password&gt;<br>  &lt;/user&gt;<br> &lt;/LoginList&gt; <br>用户名 Textbox1<br>密码   Textbox2  <br>using System.Xml;<br><br>XmlDocument xmlDoc = new XmlDocument();<br>        xmlDoc.Load(&quot;xml的路径&quot;);<br>        XmlNodeList usersList = xmlDoc.SelectNodes(&quot;/LoginList/user&quot;);<br>        bool NoofYes=false;<br>        for (int i = 0; i &lt; usersList.Count; i++)<br>        {<br>            if (&quot;用户名&quot;.Equals(usersList.SelectSingleNode(&quot;Username&quot;).InnerText) &amp;&amp; &quot;密码&quot;.Equals(usersList.SelectSingleNode(&quot;Password&quot;).InnerText))<br>{<br>                NoofYes = true;<br>                break;<br>}<br>        }<br>        if (NoofYes == true)<br>        {<br>            //转到你要的界面<br>        }<br>        else { <br>            //转到错误页面<br>        } 这是一篇来自百度知道的问题<br> <br> <br> <!--v:3.2--> ]]></description>
<category><![CDATA[个人日记]]></category>
<author><![CDATA[271718002@qq.com(╰醉意人间╮)]]></author>
<comments>http://271718002.qzone.qq.com/blog/1259152852#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Wed, 25 Nov 2009 12:40:52 GMT</pubDate>
<guid>http://271718002.qzone.qq.com/blog/1259152852</guid>
</item>

<item>
<title><![CDATA[Compressing与Compacting]]></title>
<link>http://271718002.qzone.qq.com/blog/1259138027</link>
<description><![CDATA[Compressing与Compacting所表示的含义与操作是不同的。<br>对于File Geodatabase来说，Compressing与Smart DataCompression（SDC）采用相同的技术，并且提供更多的优越之处。为了减小存储空间，可以将FileGeodatabase的矢量要素和Table压缩成Read-Only格式。Compress以后的数据在ArcMap和ArcCatalog中显示时与未压缩的数据一样，只是不能编辑。<br>FileGeodatabase的Compress不是在物理上将数据压缩得更小，而是将数据组织得更加紧凑，例如重复的完全相同的多点会用一行记录加上点的个数来表示。ArcGIS对不同的字段采取不同的压缩方法，压缩比例由要素的类型以及属性数据的冗余程度来决定。右键单击File Geodatabase，选择Compress File Geodatabase实现该功能。<br>Compress和Uncompress也可以通过Geoprocessing的工具来实现。除了可以通过Compress FileGeodatabase功能来实现文件的压缩以外，如果原始数据的Resolution很精细，而在实际应用中不需要很高的分辨率，则可以将原始数据导入到一个新的粗分辨率的数据库。不能够单独Compress和Uncompress一个Feature Dataset中的Feature Class，如果希望对该Feature Class压缩，则需要将该FeatureDataset中的所有的Feature Class都压缩。对于Rsater Dataset和RasterCatalog的压缩只能由File Geodatabase Geoprocessing工具来实现。<br><br>一旦Feature Class和Table被压缩，则不能够对数据进行编辑，并且不能够修改Coordinate System Information、Subtypes、Attribute Domains、Default Value、Filed and their Properties、Representations。唯一能够修改的就是Feature Class和Table的Alias以及Attribute Indexes。<br><br>一个Feature Dataset中可以添加Uncompressed Feature Class，如果一个Feature Dataset中同时包含Compressed和Uncompressed的数据，则Uncompressed的数据也不能够被编辑或修改。“附件二”为File Geodatabase对Compress功能的支持程度。<br>用户能够压缩Relationship、Topology、Geometric Networks、Network Datasets 、Terrains中的要素类，但局限是：不能够针对已经Compressed的FeatureClass创建Topology或者Geometric Network，如果压缩elationshipClass的一边的数据，则另一边的数据也不能编辑。如果Topology的FeatureClass已经Compressed，则Topology的属性也不能修改。“附件三”为高级要素对Compress功能的支持程度。<br><br>Compacting是将文件记录整理、重新归类，以减少存储空间。如果经常添加或者删除数据，就必须定期对File 或者Personal Geodatabase实现Compact，这能够减少文件大小，提高访问速度。<br>FileGeodatabase是将数据存在硬盘的文件夹中，每个Dataset是一个文件，该文件可以达到TB级，而Personal Geodatabase是将数据存储在MDB文件中。当第一次将数据加载到File Geodatabase或者Personal Geodatabase中时，文件中的记录是顺序排列的，但是如果以后删除或者添加要素，则文件中的记录就没有顺序了，会存在很多没有利用的空间，这将加大文件存储的空间，使得数据访问起来速度很慢。<br><br>在ArcCatalog中右键单击数据源，选择Compact Database，则可以实现数据库的Compact。如果某个Database正在ArcMap中编辑，则不能够被Compact。<br><br>本篇文章来源于 GIS空间站 转载请以链接形式注明出处 网址：<a href="http://www.gissky.net/Article/1136.htm" target="_blank">http://www.gissky.net/Article/1136.htm</a><wbr /> <!--v:3.2--> ]]></description>
<category><![CDATA[GIS专题]]></category>
<author><![CDATA[271718002@qq.com(╰醉意人间╮)]]></author>
<comments>http://271718002.qzone.qq.com/blog/1259138027#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Wed, 25 Nov 2009 08:33:47 GMT</pubDate>
<guid>http://271718002.qzone.qq.com/blog/1259138027</guid>
</item>

<item>
<title><![CDATA[[转]DEM的生成和沟壑密度的提取]]></title>
<link>http://271718002.qzone.qq.com/blog/1258906450</link>
<description><![CDATA[<br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"><span style="font-family:'Times';line-height:1.8em;">1.DEM</span><wbr />的生成</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">①在<span style="font-family:'Times';line-height:1.8em;">ArcMap</span><wbr />中加载矢量后的等高线数据。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">②创建<span style="font-family:'Times';line-height:1.8em;">Tin</span><wbr />：在<span style="font-family:'Times';line-height:1.8em;">3D Analyst</span><wbr />模块下，<span style="font-family:'Times';line-height:1.8em;">Create/Modify Tin</span><wbr />→<span style="font-family:'Times';line-height:1.8em;">Create Tin From Features</span><wbr />→选择高程字段和存储路径→<span style="font-family:'Times';line-height:1.8em;">OK</span><wbr />。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">③生成<span style="font-family:'Times';line-height:1.8em;">Tingrid</span><wbr />：在<span style="font-family:'Times';line-height:1.8em;">3D Analyst</span><wbr />模块下，<span style="font-family:'Times';line-height:1.8em;">Convert</span><wbr />→<span style="font-family:'Times';line-height:1.8em;">Tin To Raster</span><wbr />→选择<span style="font-family:'Times';line-height:1.8em;">Elevation</span><wbr />和<span style="font-family:'Times';line-height:1.8em;">cell size</span><wbr />→<span style="font-family:'Times';line-height:1.8em;">OK</span><wbr />，<span style="font-family:'Times';line-height:1.8em;">DEM</span><wbr />即生成。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">在<span style="font-family:'Times';line-height:1.8em;">DEM</span><wbr />的基础上，<span style="font-family:'Times';line-height:1.8em;">Spatial Analyst</span><wbr />模块下，可以提取坡度、坡向、阴影、曲率、地形起伏度等地形信息。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"><span style="font-family:'Times';line-height:1.8em;">2.</span><wbr />沟壑密度的提取</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">沟壑密度是描述地面被沟壑切割破碎程度的一个指标，是气候、地形、岩性、植被等因素综合影响的反应。沟壑密度越大，地面越破碎，平均坡度增大，地表物质稳定性降低，且易形成地表径流，土壤侵蚀加剧。因此，沟壑密度的测定，对于了解区域地形发育特征，水土流失监测和水土保持规划有着重要的意义。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">①在<span style="font-family:'Times';line-height:1.8em;">ArcMap</span><wbr />中加载<span style="font-family:'Times';line-height:1.8em;">DEM</span><wbr />数据。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">②提取水流方向：启动<span style="font-family:'Times';line-height:1.8em;">ArcToolbox</span><wbr />，展开<span style="font-family:'Times';line-height:1.8em;">Spatial Analyst Tools</span><wbr />工具箱，打开<span style="font-family:'Times';line-height:1.8em;">Hydrology</span><wbr />工具集，双击<span style="font-family:'Times';line-height:1.8em;">Hydrology</span><wbr />工具集中的<span style="font-family:'Times';line-height:1.8em;">Flow Direction</span><wbr />工具，将<span style="font-family:'Times';line-height:1.8em;">DEM</span><wbr />数据作为输入数据，指定输出数据为<span style="font-family:'Times';line-height:1.8em;">flowdir</span><wbr />，<span style="font-family:'Times';line-height:1.8em;">OK</span><wbr />。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">③洼地计算：双击<span style="font-family:'Times';line-height:1.8em;">Hydrology</span><wbr />工具集中的<span style="font-family:'Times';line-height:1.8em;">Sink</span><wbr />工具，选择上一步计算的水流方向数据<span style="font-family:'Times';line-height:1.8em;">flowdir</span><wbr />作为输入数据，指定输出数据为<span style="font-family:'Times';line-height:1.8em;">sink</span><wbr />，<span style="font-family:'Times';line-height:1.8em;">OK</span><wbr />。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">④洼地填充：经计算，发现<span style="font-family:'Times';line-height:1.8em;">DEM</span><wbr />中有洼地，需要进行洼地填充，双击<span style="font-family:'Times';line-height:1.8em;">Hydrology</span><wbr />工具集中的<span style="font-family:'Times';line-height:1.8em;">Fill</span><wbr />工具，输入<span style="font-family:'Times';line-height:1.8em;">DEM</span><wbr />数据，指定输出数据为<span style="font-family:'Times';line-height:1.8em;">filldem</span><wbr />，<span style="font-family:'Times';line-height:1.8em;">OK</span><wbr />。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">⑤基于无洼地的水流方向计算：同步骤③一样，双击<span style="font-family:'Times';line-height:1.8em;">Hydrology</span><wbr />工具集中的<span style="font-family:'Times';line-height:1.8em;">Flow Direction</span><wbr />工具，<span style="font-family:'Times';line-height:1.8em;">Input surface data</span><wbr />中输入无洼地<span style="font-family:'Times';line-height:1.8em;">DEM</span><wbr />数据<span style="font-family:'Times';line-height:1.8em;">filldem</span><wbr />，<span style="font-family:'Times';line-height:1.8em;">Out flow direction raster</span><wbr />中输入<span style="font-family:'Times';line-height:1.8em;">flowdirfill</span><wbr />，<span style="font-family:'Times';line-height:1.8em;">OK</span><wbr />。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">⑥汇流累积数据计算：双击<span style="font-family:'Times';line-height:1.8em;">Hydrology</span><wbr />工具集中的<span style="font-family:'Times';line-height:1.8em;">Flow Accumulation</span><wbr />工具，将上一步计算的<span style="font-family:'Times';line-height:1.8em;">flowdirfill</span><wbr />数据作为输入数据，指定输出数据为<span style="font-family:'Times';line-height:1.8em;">flowacc</span><wbr />，<span style="font-family:'Times';line-height:1.8em;">OK</span><wbr />。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">⑦栅格河网生成：在栅格河网生成时，需要设置一个汇流累积阈值，在这里设置的是<span style="font-family:'Times';line-height:1.8em;">100</span><wbr />，可以根据数据需要进行设置。<span style="font-family:'Times';line-height:1.8em;">Spatial Analyst Tools</span><wbr />→<span style="font-family:'Times';line-height:1.8em;">Map Algebra</span><wbr />→<span style="font-family:'Times';line-height:1.8em;">Multi Output Map</span><wbr />，在文本框中输入<span style="font-family:'Times';line-height:1.8em;">F</span><wbr />：\ streamnet = con ( <span style="font-family:'Times';line-height:1.8em;">F</span><wbr />：\ flowacc &gt; 100 ，1 )，得到streamnet数据。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">⑧栅格河网矢量化：双击<span style="font-family:'Times';line-height:1.8em;">Hydrology</span><wbr />工具集中的<span style="font-family:'Times';line-height:1.8em;">Stream To Feature</span><wbr />工具，选择<span style="font-family:'Times';line-height:1.8em;">streamnet</span><wbr />作为河网输入数据，<span style="font-family:'Times';line-height:1.8em;">flowdirfill</span><wbr />作为水流方向输入数据，指定输出数据位<span style="font-family:'Times';line-height:1.8em;">stream1</span><wbr />，也就是矢量形式的沟谷河网。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">⑨伪沟谷删除：由于基于<span style="font-family:'Times';line-height:1.8em;">DEM</span><wbr />的河网的提取是采用最大坡降的方法，在平地区域，如沟谷等地区，其水流方向是随机的，容易产生平行状河流，这种平行状的沟谷称为伪沟谷，需手工删除，在<span style="font-family:'Times';line-height:1.8em;">Editor</span><wbr />模块下，<span style="font-family:'Times';line-height:1.8em;">Star Editing</span><wbr />→<span style="font-family:'Times';line-height:1.8em;">Save Edits</span><wbr />→<span style="font-family:'Times';line-height:1.8em;">StopEditing</span><wbr />。</span><wbr /></span><wbr /><br><span style="color:#0000ff;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;">⑩沟壑密度计算：打开矢量河网<span style="font-family:'Times';line-height:1.8em;">stream1</span><wbr />数据表，添加<span style="font-family:'Times';line-height:1.8em;">length</span><wbr />字段，计算长度，然后求和，得出沟壑总长度，除以研究区面积，即可得到研究区沟壑密度。</span><wbr /></span><wbr /> <!--v:3.2--> ]]></description>
<category><![CDATA[学无止境]]></category>
<author><![CDATA[271718002@qq.com(╰醉意人间╮)]]></author>
<comments>http://271718002.qzone.qq.com/blog/1258906450#comment</comments>
<qz:effect>134218248</qz:effect>
<pubDate>Sun, 22 Nov 2009 16:14:10 GMT</pubDate>
<guid>http://271718002.qzone.qq.com/blog/1258906450</guid>
</item>

<item>
<title><![CDATA[我看过的最好的关于无刷回调的文章]]></title>
<link>http://271718002.qzone.qq.com/blog/1258343974</link>
<description><![CDATA[<span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">先不说象ADF和AO这样的东西，要做ArcServer开发，首先要明白地图怎样无刷的，怎么回调的。在说之前先介绍一个.net Framwork里面的一个接口。</span><wbr /><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">System.Web.UI.</span><wbr /><span style="color:teal;line-height:1.8em;">ICallbackEventHandler</span><wbr /></span><wbr /><span style="color:#000000;line-height:1.8em;">，这是.net中实现页面无刷的接口，而ArcServer就是靠这个接口来实现的无刷。</span><wbr /><br></span><wbr /><span style="color:#000000;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">这个接口主要有两个方法要我们实现：</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">1.<br></span><wbr /><span style="color:blue;line-height:1.8em;"><span style="line-height:1.8em;">string</span><wbr /></span><wbr /><span style="line-height:1.8em;"><span style="color:teal;line-height:1.8em;">ICallbackEventHandler</span><wbr /><span style="color:#000000;line-height:1.8em;">.GetCallbackResult()</span><wbr /></span><wbr /><span style="color:#000000;line-height:1.8em;">这个方法可以返回我们将要发送到客户端解析的字符串，返回的字符串要靠前台的JavaScript解析，才能反应到前台页面上。</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">2.<br></span><wbr /><span style="color:blue;line-height:1.8em;"><span style="line-height:1.8em;">void</span><wbr /></span><wbr /><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"> </span><wbr /><span style="color:teal;line-height:1.8em;">ICallbackEventHandler</span><wbr /><span style="color:#000000;line-height:1.8em;">.RaiseCallbackEvent(</span><wbr /><span style="color:blue;line-height:1.8em;">string</span><wbr /><span style="color:#000000;line-height:1.8em;"> eventArgument)</span><wbr /></span><wbr /><span style="color:#000000;line-height:1.8em;">这个方法主要是后台逻辑程序，即在服务器端运行的主要的逻辑代码所在地。也就是在此方法内获得要返回到客户端的字符串，然后把这些字符串赋值给一个全局变量，返回到上一个方法中，通过上一个方法返回到客户端。其中eventArgument参数就是前台传过来的message参数，也是字符串格式，然后再在服务器端把字符串解析，执行相应的方法。</span><wbr /><br><span style="color:#000000;line-height:1.8em;">以上主要是说的服务器端，下面再来解释一下客户端。在客户端主要就是javaScript脚本代码，这个曾经每人冷落的技术正是今天的ajax无刷技术的主角。</span><wbr /><br><span style="color:#000000;line-height:1.8em;">主要包括三个方法：</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">1.<br></span><wbr /><span style="color:blue;line-height:1.8em;"><span style="line-height:1.8em;">function</span><wbr /></span><wbr /><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"> getServerTime()</span><wbr /></span><wbr /></span><wbr /><br><br><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><br><span style="font-size:18px;line-height:1.8em;">{</span><wbr /></span><wbr /></span><wbr /><br><br><span style="line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">           </span><wbr /><span style="color:blue;line-height:1.8em;">var</span><wbr /><span style="color:#000000;line-height:1.8em;"> message = </span><wbr /><span style="color:maroon;line-height:1.8em;">'getservertime'</span><wbr /><span style="color:#000000;line-height:1.8em;">;</span><wbr /></span><wbr /></span><wbr /><br><br><span style="line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">           </span><wbr /><span style="color:blue;line-height:1.8em;">var</span><wbr /><span style="color:#000000;line-height:1.8em;"> context = </span><wbr /><span style="color:maroon;line-height:1.8em;">'Page1'</span><wbr /><span style="color:#000000;line-height:1.8em;">;</span><wbr /></span><wbr /></span><wbr /><br><br><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><br><span style="font-size:18px;line-height:1.8em;">&lt;%=sCallBackFunctionInvocation%&gt;<br></span><wbr /></span><wbr /></span><wbr /><br><br><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><br><span style="font-size:18px;line-height:1.8em;">}</span><wbr /></span><wbr /></span><wbr /><br><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">脚本执行的入口方法，例如，可以在一个button click事件中执行该方法。其中message就是我们在服务器端解析的eventArgument参数。Context就是我们要刷新的控件。而第三行就把我们的执行行转移到了服务器端。</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">2.<br></span><wbr /><span style="color:blue;line-height:1.8em;"><span style="line-height:1.8em;">function</span><wbr /></span><wbr /><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"> processMyResult(returnmessage, context)</span><wbr /></span><wbr /><br></span><wbr /><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><br><span style="font-size:18px;line-height:1.8em;">{</span><wbr /></span><wbr /></span><wbr /><br><br><span style="line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">             </span><wbr /><span style="color:blue;line-height:1.8em;">var</span><wbr /><span style="color:#000000;line-height:1.8em;"> timediv = document.getElementById(</span><wbr /><span style="color:maroon;line-height:1.8em;">'timelabel'</span><wbr /></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">);<br></span><wbr /></span><wbr /></span><wbr /><br><br><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><br><br><span style="font-size:18px;line-height:1.8em;">timediv.innerHTML = returnmessage;<br></span><wbr /></span><wbr /></span><wbr /><br><br><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><br><span style="font-size:18px;line-height:1.8em;">}</span><wbr /></span><wbr /></span><wbr /><br><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">这个方法主要就是执行完服务器代码以后，用来解析服务器返回的字符串。<span style="line-height:1.8em;">Returnmessage</span><wbr />就是服务器return的字符串，context就是上个字符串传入的要刷新的控件。</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">3.<br></span><wbr /><span style="color:blue;line-height:1.8em;"><span style="line-height:1.8em;">function</span><wbr /></span><wbr /><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"> postMyError(returnmessage, context)</span><wbr /></span><wbr /></span><wbr /><br><br><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><br><span style="font-size:18px;line-height:1.8em;">{</span><wbr /></span><wbr /></span><wbr /><br><br><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><br><span style="font-size:18px;line-height:1.8em;">alert(</span><wbr /></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:maroon;line-height:1.8em;">&quot;Callback Error: &quot;</span><wbr /><span style="color:#000000;line-height:1.8em;"> + returnmessage + </span><wbr /><span style="color:maroon;line-height:1.8em;">&quot;, &quot;</span><wbr /><span style="color:#000000;line-height:1.8em;"> + context);</span><wbr /></span><wbr /></span><wbr /><br><br><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><br><span style="font-size:18px;line-height:1.8em;">}<br></span><wbr /></span><wbr /></span><wbr /><br><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">当服务器执行回调失败执行的客户端方法</span><wbr /><br><br><span style="color:#000000;line-height:1.8em;">到目前为止，我们的回调客户端和服务器端都有了，那是什么把客户端和服务器端联系起来的呢？是<span style="line-height:1.8em;">sCallBackFunctionInvocation</span><wbr />这个全局变量<span style="line-height:1.8em;">。</span><wbr />这是服务器端的一个全局变量，其定义为</span><wbr /><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">sCallBackFunctionInvocation = Page.ClientScript.GetCallbackEventReference(</span><wbr /><span style="color:blue;line-height:1.8em;">this</span><wbr /><span style="color:#000000;line-height:1.8em;">, </span><wbr /><span style="color:maroon;line-height:1.8em;">&quot;message&quot;</span><wbr /><span style="color:#000000;line-height:1.8em;">, </span><wbr /><span style="color:maroon;line-height:1.8em;">&quot;processMyResult&quot;</span><wbr /><span style="color:#000000;line-height:1.8em;">, </span><wbr /><span style="color:maroon;line-height:1.8em;">&quot;context&quot;</span><wbr /><span style="color:#000000;line-height:1.8em;">, </span><wbr /><span style="color:maroon;line-height:1.8em;">&quot;postMyError&quot;</span><wbr /><span style="color:#000000;line-height:1.8em;">, </span><wbr /><span style="color:blue;line-height:1.8em;">true</span><wbr /><span style="color:#000000;line-height:1.8em;">);</span><wbr /></span><wbr /><br><span style="color:#000000;line-height:1.8em;">第一个参数就是处理客户端回调的服务器 Control。该控件必须实现 ICallbackEventHandler 接口并提供 RaiseCallbackEvent 方法。 </span><wbr /><br><span style="color:#000000;line-height:1.8em;">第二个参数从客户端传递到服务器端的参数，服务器端对此参数进行解析，得到可用的信息。</span><wbr /><br><span style="color:#000000;line-height:1.8em;">第三个参数是客户端的一个脚本方法，用来接受服务器处理完传回的结果，解析该结果，并作出相应的动作。</span><wbr /><br><span style="color:#000000;line-height:1.8em;">第四个参数是启动回调之前在客户端的客户端脚本信息。脚本的结果传回给客户端事件处理程序。</span><wbr /></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"> <br><br>第五个参数是回调任务执行失败后执行的脚本方法。</span><wbr /><br></span><wbr /><span style="line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">介绍完无刷之后，我们怎么在ArcServer中使用这些无刷呢？</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">1.<br>在工具中。</span><wbr /><br><span style="color:#000000;line-height:1.8em;">这是最简单的，也是最好理解（好理解并不等于理解透彻了）。在定制工具时除了名称，显示文本，各种状态下的图片已经toolTip等属性外，还有ClinetAction和ServerAction。这两个东西是这个工具的关键。顾名思义，clientAction就是客户端触发的动作，ServerAction就是服务器端触发的动作。例如画线，ClinetAction就要选择polyLine。服务器端也会选择继承ToolServerAction接口的类，在此类的serverAction中编写服务器要执行的方法。当用户执行此工具时，就会调用javaScript画线，等画完以后，系统就会带着客户端执行画线操作所产生的结果作为参数执行服务器端的代码。最后执行完以后callback一下，客户端脚本就会去自动的去解析服务器端执行完返回的字符串。接着刷新相应的界面。</span><wbr /><br><br><span style="color:#000000;line-height:1.8em;">但至始至终，在这个过程中，我们似乎没有写一句javaScript代码，那客户端执行的代码，传递的参数以及服务器返回的字符串的解析又是由谁来完成的呢？原来ArcServer预先给我们定义了一些JavaScript代码。C:\Inetpub\wwwroot\aspnet_client\ESRI\WebADF\JavaScript，一般会保存在这个文件夹里面，这里面既有客户端画线代码，又有解析服务器端返回的字符串的代码。要只要，googleMap局部刷新的实现也用了近万行javaScript代码，可见JavaScript在WebGIS中的重要性。</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">2.<br>点击按钮等普通命令回调刷新</span><wbr /><br><span style="color:#000000;line-height:1.8em;">这种方式和上面方式的区别就是要自己要写解析处理服务器返回字符串，自己去解析，去到客户端去执行，当然这里的自己去解析不是让我们非得去解析所有的字符串，象返回的html代码或是javaSript脚本，本身浏览器就可以解析，我们自己把这些东西交给浏览器就行了。</span><wbr /><br><br></span><wbr /></span><wbr /></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">下面就就介绍一下如何构造返回的字符串，要想在客户端把这些字符串解析出来，肯定得有构造的规则，产生字符串的服务器端以及解析字符串的客户端都遵循这个字符串构造规则，这样的话才能达到两端的同步工作。</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">1.<br>首先第一种构造方式是刷新ADF自身带的控件，如TOC等，这些控件都有自己的返回字符串构造规则，ESRI已经为我们封装好了。所以只要调用一下控件的CallBack.toString （）方法，然后添加到Map的CallBack中就可以了。客户端就会自动解析，刷新要刷新的控件。</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">2.<br>第二种就是刷新其他的Asp.net控件。这个就较复杂一点，要让这些控件和ADF中的同步刷新，而其本身又不是ADF中的东西，这种情况下，字符串就靠我们自己去构造。不过构造的客户端能够解析才行。下面就是ADF帮助中的返回的字符串构造规则。</span><wbr /><br></span><wbr /><span style="color:#000000;line-height:1.8em;"><br></span><wbr /><br><br><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">“content&quot;</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">Used to set the outerHTML property of an html element. The html element on the client defined by the CallbackResult controlType and controlID is completely replaced by the html content provided as a parameter in the object array (object[]). </span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">&quot;innercontent&quot;</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">Used to set the innerHTML property of an html element. The content inside the html element on the client defined by the CallbackResult抯 controlType and controlID is completely replaced by the html content provided as a parameter in the object array (object[]).</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">&quot;image&quot;</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">Used to set the src property of an image element. The source of the image element on the client defined by the CallbackResult抯 controlType and controlID is changed to the url string provided as a parameter in the object array (object[]). </span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">&quot;javascript&quot;</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">Used to execute JavaScript on the client. The CallbackResult抯 controlType and controlID and set to null. The JavaScript code is provided as a parameter in the object array (object[]).</span><wbr /><br><br></span><wbr /></span><wbr /><br><span style="color:#000000;line-height:1.8em;"><br><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">解释如下：</span><wbr /><br><br></span><wbr /><br><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">“content&quot;</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">用于设置一个HTML元素的outerHTML属性。在CallbackResult 定义了要操作的控件的类型，id号放到刷新的方法参数中。</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">&quot;innercontent&quot;</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">用来定义一个html的innerHTML属性。定义好html元素中要显示的内容，以及将要被替换的内容的元素类型，元素的id号作为参数，放到CallbackResult中。</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">&quot;image&quot;</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">用来定义一个image元素的src（资源）属性.定义好图片资源，以及要改变资源的图片元素类型，元素id号，然后作为参数添加到CallbackResult中。</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">&quot;javascript&quot;</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">用于在客户端执行JavaScript，参数元素类型以及元素编号都设置为null。javaScript代码就作为参数添加到CallbackResult中。</span><wbr /><br><br></span><wbr /><br><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">下面就是各种刷新的例子：</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">1.<br>刷新ADF自身的控件TOC：</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">ESRI.ArcGIS.ADF.Web.UI.WebControls.Toc<br>toc1 = (ESRI.ArcGIS.ADF.Web.UI.WebControls.Toc)map.Page.FindControl(&quot;Toc1&quot;);<br>//toc</span><wbr /><span style="color:#000000;line-height:1.8em;">变化代码</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">toc1.Refresh();<br>string myTocString= toc1.CallbackResults.ToString();<br>CallbackResult myTocCallBackString = new CallbackResult(&quot;TOC&quot;, &quot;Toc1&quot;, &quot;content&quot;, myTocString);<br>map.CallbackResults.Add(myTocCallBackString);</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">2.<br>刷新asp.net控件</span><wbr /><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">ESRI.ArcGIS.ADF.Web.UI.WebControls.Toc<br>toc1 = (ESRI.ArcGIS.ADF.Web.UI.WebControls.Toc)map.Page.FindControl(&quot;Toc1&quot;);<br>toc1.Nodes.Clear();<br>toc1.Refresh();<br>string aaa = toc1.CallbackResults.ToString();<br>CallbackResult tocstring = new CallbackResult(&quot;TOC&quot;, &quot;Toc1&quot;, &quot;content&quot;, aaa);<br>map.CallbackResults.Add(tocstring);</span><wbr /><br><span style="color:#000000;line-height:1.8em;">2 在map刷新的同时也刷新其他的asp.net的控件，下面是一段例子代码，刷新的是一个div控件</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">DataTableCollection dtc = dataset.Tables;<br>string returnstring = string.Empty;<br>foreach (DataTable dt in dtc)<br>{<br>if (dt.Rows.Count == 0)<br>continue;<br>GridView gd = new GridView();<br>gd.ToolTip = dt.TableName;<br>gd.Caption = dt.TableName;<br>gd.DataSource = dt;<br>gd.DataBind();<br>gd.Visible = true;</span><wbr /><br><br><span style="color:#000000;line-height:1.8em;">gd.BorderWidth = 10;</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">using (System.IO.StringWriter sw = new System.IO.StringWriter())<br>{<br>HtmlTextWriter htw = new HtmlTextWriter(sw);<br>gd.RenderControl(htw);<br>htw.Flush();<br>returnstring = returnstring + sw.ToString();</span><wbr /><br><br></span><wbr /><span style="font-size:18px;line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">}<br>}<br>CallbackResult cr = new CallbackResult(&quot;div&quot;, &quot;datadiv&quot;, &quot;innercontent&quot;, returnstring);</span><wbr /><br><br><span style="color:#000000;line-height:1.8em;">map.CallbackResults.Add(cr)；</span><wbr /><br><br><span style="color:#000000;line-height:1.8em;">其实以上所说的并不是真正的Ajax，他只是局部刷新实现方式的一种。回调技术。这是微软.net特有的。</span><wbr /></span><wbr /></span><wbr /><br><span style="color:#000000;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"><a href="http://bbs.esrichina-bj.cn/ESRI/thread-55413-1-2.html" target="_blank">http://bbs.esrichina-bj.cn/ESRI/thread-55413-1-2.html</a><wbr /><br></span><wbr /></span><wbr /><br><span style="color:#000000;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"></span><wbr /></span><wbr /> <br><span style="color:#000000;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"><span style="font-size:16px;line-height:1.8em;">　　首先，执行<span style="font-family:'Times';line-height:1.8em;">callback</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的类要实现</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ICallbackEventHandler</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">。这个类有两个函数需要我们实现：</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">　　public string GetCallbackResult( )</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">和</span><wbr /><span style="font-family:'Times';line-height:1.8em;">public void RaiseCallbackEvent(string eventArgument)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">。</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　其中：</span><wbr /><span style="font-family:'Times';line-height:1.8em;">RaiseCallbackEvent(string eventArgument)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">eventArgument</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">是客户端传到服务器上的变量。</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　先来看看客户端的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">js</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">代码：</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">function changelayer()</span><wbr /><br></span><wbr /><span style="font-family:'Times';line-height:1.8em;"><br><span style="font-size:16px;line-height:1.8em;">{</span><wbr /></span><wbr /><br><span style="font-family:'Times';line-height:1.8em;"><br><span style="font-size:16px;line-height:1.8em;">var strcallback = &quot;</span><wbr /></span><wbr /><span style="font-size:16px;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">回调</span><wbr /><span style="font-family:'Times';line-height:1.8em;">&quot;;</span><wbr /><br></span><wbr /><span style="font-family:'Times';line-height:1.8em;"><br><span style="font-size:16px;line-height:1.8em;">&lt;%=usecallback%&gt;</span><wbr /></span><wbr /><br><span style="font-size:16px;line-height:1.8em;"><span style="font-family:'Times';line-height:1.8em;">}</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　这个就是执行回调的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">js</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数，</span><wbr /><span style="font-family:'Times';line-height:1.8em;">&lt;%= %&gt;</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">这个是预编译句子。就是说，这里面的东西会在服务器端执行。</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">　　&lt;%=usecallback%&gt;</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">，而我这里面是</span><wbr /><span style="font-family:'Times';line-height:1.8em;">usecallback</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">，这在服务器端的声明是这样的：</span><wbr /><span style="font-family:'Times';line-height:1.8em;">public string usecallback;</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　然后在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">Page_Load</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">事件中：</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">usecallback = Page.ClientScript.GetCallbackEventReference(this, &quot;strcallback&quot;, &quot;showresult&quot;, null, true);</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　这句话是必须的，</span><wbr /><span style="font-family:'Times';line-height:1.8em;">GetCallbackEventReference(this, &quot; strcallback &quot;, &quot;showresult&quot;, null, true);</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">这个函数名的就说明这函数的意思，你可以理解为：注册回调。</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　该函数里面的参数“</span><wbr /><span style="font-family:'Times';line-height:1.8em;">strcallback</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">”也就是</span><wbr /><span style="font-family:'Times';line-height:1.8em;">RaiseCallbackEvent(string eventArgument)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数中的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">eventArgument</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的值！而</span><wbr /><span style="font-family:'Times';line-height:1.8em;">strcallback</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">也就是</span><wbr /><span style="font-family:'Times';line-height:1.8em;">js</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">代码中能触发回调的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">changelayer()</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数中声明的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">strcallback</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">变量。这个</span><wbr /><span style="font-family:'Times';line-height:1.8em;">strcallback</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的值，通过</span><wbr /><span style="font-family:'Times';line-height:1.8em;">GetCallbackEventReference(this, &quot;strcallback&quot;, &quot;showresult&quot;, null, true)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数就传到了</span><wbr /><span style="font-family:'Times';line-height:1.8em;">RaiseCallbackEvent(string eventArgument)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">eventArgument</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">里面。那么，服务器端就得到了从客户端传来的值了：</span><wbr /><span style="font-family:'Times';line-height:1.8em;">strcallback</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">，也就是</span><wbr /><span style="font-family:'Times';line-height:1.8em;">eventArgumen</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">。回调也就完成了一半了，这时我们通过</span><wbr /><span style="font-family:'Times';line-height:1.8em;">eventArgumen </span><wbr /><span style="font-family:'宋体';line-height:1.8em;">也就能知道服务器传了什么参数过来，我们要在服务器端怎么处理。</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　只要你的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">js</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数里面有</span><wbr /><span style="font-family:'Times';line-height:1.8em;">&lt;%=usecallback%&gt;</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">，其实也可以写成</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">&lt;%=ClientScript.GetCallbackEventReference(this, &quot;strcallback&quot;, &quot;showresult&quot;, null, true)%&gt;</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">，写成这样的话，在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">Page_Load</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数里面就不需要再用了。</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">就说明这个</span><wbr /><span style="font-family:'Times';line-height:1.8em;">js</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数要执行回调。</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　同样，处理完之后，我们就要把处理完的信息传回给客户端啊，这时</span><wbr /><span style="font-family:'Times';line-height:1.8em;">public string GetCallbackResult( )</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数就派上用场了。</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　操作得到的结果就通过</span><wbr /><span style="font-family:'Times';line-height:1.8em;">public string GetCallbackResult()</span><wbr /><br></span><wbr /><span style="font-family:'Times';line-height:1.8em;"><br><span style="font-size:16px;line-height:1.8em;">{</span><wbr /></span><wbr /><br><span style="font-family:'Times';line-height:1.8em;"><br><span style="font-size:16px;line-height:1.8em;">return </span><wbr /></span><wbr /><span style="font-size:16px;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">“你操作得到的结果”</span><wbr /><span style="font-family:'Times';line-height:1.8em;">;</span><wbr /><br></span><wbr /><span style="font-family:'Times';line-height:1.8em;"><br><span style="font-size:16px;line-height:1.8em;">}</span><wbr /></span><wbr /><br><span style="font-size:16px;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">返回到</span><wbr /><span style="font-family:'Times';line-height:1.8em;">js</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">端的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">showresult</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数中。</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　再看看这个函数：</span><wbr /><span style="font-family:'Times';line-height:1.8em;">GetCallbackEventReference(this, &quot;strcallback&quot;, &quot;showresult&quot;, null, true );</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">&quot;strcallback&quot;</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">是要开始执行回调的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">js</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数，</span><wbr /><span style="font-family:'Times';line-height:1.8em;">showresult</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">是服务器完成回调后把</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">public string GetCallbackResult()</span><wbr /><br></span><wbr /><span style="font-family:'Times';line-height:1.8em;"><br><span style="font-size:16px;line-height:1.8em;">{</span><wbr /></span><wbr /><br><span style="font-family:'Times';line-height:1.8em;"><br><span style="font-size:16px;line-height:1.8em;">return </span><wbr /></span><wbr /><span style="font-size:16px;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">“你操作得到的结果”</span><wbr /><span style="font-family:'Times';line-height:1.8em;">;</span><wbr /><br></span><wbr /><span style="font-family:'Times';line-height:1.8em;"><br><span style="font-size:16px;line-height:1.8em;">}</span><wbr /></span><wbr /><br><span style="font-size:16px;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">　　中的</span><wbr /><span style="font-family:'Times';line-height:1.8em;"> return </span><wbr /><span style="font-family:'宋体';line-height:1.8em;">“你操作得到的结果”的“你操作得到的结果”这个字符串所返回到的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">js</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的函数中，在这里也就是</span><wbr /><span style="font-family:'Times';line-height:1.8em;">showresult( )</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数：</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　我们可以写：</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">function showresult(rValue)</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">{</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">window.alert(rValue);</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">}</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　那么这时在浏览器就会弹出对话框，内容是</span><wbr /><span style="font-family:'Times';line-height:1.8em;">&quot;</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">你操作得到的结果</span><wbr /><span style="font-family:'Times';line-height:1.8em;">&quot;</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">。可知，</span><wbr /><span style="font-family:'Times';line-height:1.8em;">GetCallbackResult()</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数返回的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">string</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">也就到了</span><wbr /><span style="font-family:'Times';line-height:1.8em;">showresult</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">（）中的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">rvalue</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中了。</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;"></span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">整理一下：</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">　　GetCallbackEventReference(this, &quot;strcallback&quot;, &quot;showresult&quot;, null, true );</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数是整个回调机制中的桥梁，里面参数的意思我就不说了，网上多的是。</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　我们理一下刚刚的这个简单的回调：</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">(1)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">客户端</span><wbr /><span style="font-family:'Times';line-height:1.8em;">function changelayer()</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">引发回调，同时把</span><wbr /><span style="font-family:'Times';line-height:1.8em;">strcallback</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中的“回调”传给了服务器。</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">(2)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">服务器端</span><wbr /><span style="font-family:'Times';line-height:1.8em;">RaiseCallbackEvent(string eventArgument)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">函数得到</span><wbr /><span style="font-family:'Times';line-height:1.8em;">strcallback</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">值，保存在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">eventArgument</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中。</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">(3)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">利用</span><wbr /><span style="font-family:'Times';line-height:1.8em;">eventArgument</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">开始处理</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">(4)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">处理好后交给</span><wbr /><span style="font-family:'Times';line-height:1.8em;">public string GetCallbackResult( )</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">，由它把处理结果返回客户端。我们上面没有处理，所以我就返回了“你操作得到的结果”这个字符串。这个字符串就传回了客户端。</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">(5)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">客户端函数</span><wbr /><span style="font-family:'Times';line-height:1.8em;">function showresult(rValue)</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">rValue</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">得到了这个字符串，所以就在浏览器弹出了消息框：你操作得到的结果。</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">　　Ok</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">整个过程完成了，其实非常简单，只要理解好就行了，同时注意客户端和服务器端之间传递的只是</span><wbr /><span style="font-family:'Times';line-height:1.8em;">string</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">类型的值！</span><wbr /><br><span style="font-family:'宋体';line-height:1.8em;">　　下面还附加了一个我做的很简单的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">callback</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的程序，上面的注释很详细，希望对大家有用。理解了</span><wbr /><span style="font-family:'Times';line-height:1.8em;">callback</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">机制，对于</span><wbr /><span style="font-family:'Times';line-height:1.8em;">CallbackResult</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">类的使用就很快就上手了，这个看看帮助里面的例子就能理解了。</span><wbr /></span><wbr /></span><wbr /></span><wbr /><br><span style="color:#000000;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"><span style="font-size:16px;font-family:'宋体';line-height:1.8em;"></span><wbr /></span><wbr /></span><wbr /> <br><span style="color:#000000;line-height:1.8em;"><span style="font-size:18px;line-height:1.8em;"><a href="http://bbs.esrichina-bj.cn/ESRI/thread-51048-1-10.html" target="_blank">http://bbs.esrichina-bj.cn/ESRI/thread-51048-1-10.html</a><wbr /><br></span><wbr /></span><wbr /> <!--v:3.2--> ]]></description>
<category><![CDATA[GIS 开发]]></category>
<author><![CDATA[271718002@qq.com(╰醉意人间╮)]]></author>
<comments>http://271718002.qzone.qq.com/blog/1258343974#comment</comments>
<qz:effect>134218256</qz:effect>
<pubDate>Mon, 16 Nov 2009 03:59:34 GMT</pubDate>
<guid>http://271718002.qzone.qq.com/blog/1258343974</guid>
</item>

<item>
<title><![CDATA[[转]GeoProcessing --地理处理]]></title>
<link>http://271718002.qzone.qq.com/blog/1258335675</link>
<description><![CDATA[GeoProcessing --地理处理<br>2008-08-21 11:57<br><span style="font-family:'Times';line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">所谓的</span><wbr /><span style="color:#0000ff;line-height:1.8em;">地理处理</span><wbr />，<span style="color:#000000;line-height:1.8em;">实际上是对空间数据的处理，也就是我们通常意义上所知道的空间分析。当然，地理处理不仅仅是我们常用所理解的空间分析那么简单功能，例如做一些缓冲区，做一些</span><wbr /></span><wbr /><span style="color:#000000;line-height:1.8em;"><span style="font-family:'Times';line-height:1.8em;">clip</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">或</span><wbr /><span style="font-family:'Times';line-height:1.8em;">merge</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">操作了。</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS</span><wbr /></span><wbr /><span style="font-family:'宋体';line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">的地理处理包括了所有的空间分析的结合，利用地理处理，我们能够做非常复杂的模型建立，例如我们做一个最佳选址分析，做一个森林火的扩散模型分析等，都需要用到大量的空间分析步骤和数据，这整个过程都可称为地理处理。<br></span><wbr />    <span style="color:#ff6600;line-height:1.8em;">实际上地理处理并不是一个新的概念。伴随<span style="font-family:'Times';line-height:1.8em;">GIS</span><wbr /></span><wbr /><span style="font-family:'宋体';line-height:1.8em;"><span style="color:#ff6600;line-height:1.8em;">平台的开始，地理处理就已经存在了。</span><wbr /><span style="color:#000000;line-height:1.8em;">在</span><wbr /></span><wbr /><span style="color:#000000;line-height:1.8em;"><span style="font-family:'Times';line-height:1.8em;">ESRI</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的产品线发展过程中，地理处理一直在桌面产品中应用比较深入，开发组件从最早的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">MapObjects</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">到后来的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">Engine,</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">再到</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS Server</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">一开始并不能很好的运用地理处理的功能，我们需要一个地图分析工具，就需要读懂</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcObjects</span><wbr /></span><wbr /><span style="font-family:'宋体';line-height:1.8em;"><span style="color:#000000;line-height:1.8em;">的模型，写许多的代码最终达到这个功能。</span><wbr /><span style="color:#000000;line-height:1.8em;">在</span><wbr /></span><wbr /><span style="color:#000000;line-height:1.8em;"><span style="font-family:'Times';line-height:1.8em;">ArcGIS9.2</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">系列里，地理处理结合在这些</span><wbr /><span style="font-family:'Times';line-height:1.8em;">AO</span><wbr /></span><wbr /><span style="color:#000000;font-family:'宋体';line-height:1.8em;">的产品框架体系当中，为我们带来了极大的方便。<br></span><wbr /><br>    <span style="color:#000000;line-height:1.8em;">下面主要从三个方面去了解GeoProcessing:<br></span><wbr /></span><wbr /></span><wbr /><span style="font-family:'Times';line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><br><span style="color:#0000ff;line-height:1.8em;">1).</span><wbr />Desktop: 在桌面应用中，GP直观的表现为ArcToolbox里面的工具集，每一个工具都可以是一个地理处理。光有此理解还是不够的。我们还必须知道</span><wbr /><span style="color:#0000ff;line-height:1.8em;">Model Builder；</span><wbr /><span style="color:#000000;line-height:1.8em;">Model Builder可以按流程处理多个地理操作操作，其主要特点是<span style="color:#ff6600;line-height:1.8em;">自定义，流程化，所见即所得</span><wbr />。符合现在的SOA思想。如图：</span><wbr /></span><wbr /></span><wbr /><wbr /><a href="http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_14/clip_image002_C4xLWPZVS6bb.jpg" target="_blank"><img style="border:0;" src="http://bbs.esrichina-bj.cn/ESRI/attachments/forumid_14/clip_image002_C4xLWPZVS6bb.jpg" /></a><wbr /> <br><br>     <span style="color:#000000;line-height:1.8em;">此外，地理处理也可以通脚本，命令窗口来实现。因为接触不多所以没去深入研究。</span><wbr /><span style="color:#000000;line-height:1.8em;"><span style="color:#0000ff;font-family:'宋体';line-height:1.8em;">2).</span><wbr />AO: <br><span style="font-family:'宋体';line-height:1.8em;">    在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中，地理处理可以通过脚本语言如</span><wbr /><span style="font-family:'Times';line-height:1.8em;">Python,JScript</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">来运行工具，同样的也可以通过系统语言，如</span><wbr /><span style="font-family:'Times';line-height:1.8em;">C++,Java, DOTNET</span><wbr /></span><wbr /><span style="color:#000000;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">等来执行。<br>    在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">9.2</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcObjects</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">对象模型图中提供了</span><wbr /><span style="font-family:'Times';line-height:1.8em;">Geoprocessor</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">对象模型。这里主要用来调用</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ESRI</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">地理处理对象库，包括了许多</span><wbr /><span style="font-family:'Times';line-height:1.8em;">IGeoProcessor</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">接口和</span><wbr /><span style="font-family:'Times';line-height:1.8em;">GeoProcessor</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的对象类。</span><wbr /><span style="font-family:'Times';line-height:1.8em;">GeoProcessor</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">类是在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS</span><wbr /></span><wbr /><span style="color:#000000;font-family:'宋体';line-height:1.8em;">中执行任何地理处理工具的简单访问节点，包括扩展模块。GP通过客户化的ArcGIS Engine 应用程序来执行已经存在的GP工具(models, scripts, custom tools). <br>     GP其实也是通过AO接口来实现地理处理，等于把整个处理代码段封装起来，进而提高了组件的粒度；用户只要写出工具执行所需的几个参数就可以实现其功能。（只需告诉它做什么而不用告诉它怎么做）。这也是ArcEngine9.2的新特征。如下，做一个Clip指需要4行代码(9.2之前可能需要30多行^_^）：<br></span><wbr /><span style="font-family:'宋体';line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><span style="color:#ff6600;line-height:1.8em;"><span style="font-family:'Times';line-height:1.8em;">      Dim GP as Object<br>      Set GP = CreateObject(“esriGeoprocessing.GPDispatch”)</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">      GP.CreateFeatureClass &quot;D:\DATA&quot;,”MyShapefile.shp”, “polygon”</span><wbr /><br><span style="font-family:'Times';line-height:1.8em;">      GP.AddField “MiscText”, “Text”, 30</span><wbr /></span><wbr /><span style="color:#008080;line-height:1.8em;"><br><br></span><wbr /><span style="color:#0000ff;line-height:1.8em;">3).</span><wbr />地理处理(GP)的共享<br><br>    （<span style="font-family:'Times';line-height:1.8em;">1</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">）、文件方式共享</span><wbr /><br><span style="color:#000000;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS Desktop</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">当中，工具可以独立运行，可以把多个处理工具与数据结合在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">Model Builder</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中，这些工具都可以保存在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">.tbx</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">文件中，这样可以通过邮件，光盘，或其它存储介质为别人提供共享。使用起来很简单，只需要在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcToolbox</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中把这个工具箱加进来就可以用了。</span><wbr /></span><wbr /><br><span style="color:#000000;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">   （</span><wbr /><span style="font-family:'Times';line-height:1.8em;">2</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">）、数据库共享</span><wbr /></span><wbr /><br><span style="color:#000000;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS Server 9.2</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的产品级别中，提供了两种技术，一种是数据库管理技术，就是</span><wbr /><span style="font-family:'Times';line-height:1.8em;">9.2</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">以前级别产品的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcSDE</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">产品技术。在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcSDE</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">Geodatabase</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">里，可以支持对</span><wbr /><span style="font-family:'Times';line-height:1.8em;">Toolbox</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的保存，我们可以把工具箱的工具或</span><wbr /><span style="font-family:'Times';line-height:1.8em;">Model Builder</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">保存在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcSDE</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">数据库当中，这样其他人只要通过连接</span><wbr /><span style="font-family:'Times';line-height:1.8em;">SDE</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的数据库就可以访问这些地理处理工具。并且象在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcToolbox</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中一样，运行该工具或模型。如图</span><wbr /><span style="font-family:'Times';line-height:1.8em;">6-3</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">所示</span><wbr /></span><wbr /><br><span style="color:#000000;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">    对于地理处理工具的入库方法与操作</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcToolbox</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中一样，通过创建新的工具，或添加新的工具，在系统工具中选择需要保存在数据库的工具，就完成了入库的工作。</span><wbr /></span><wbr /><br><span style="color:#000000;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">   （</span><wbr /><span style="font-family:'Times';line-height:1.8em;">3</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">）、</span><wbr /><span style="font-family:'Times';line-height:1.8em;">Web Service</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">共享</span><wbr /></span><wbr /><br><span style="color:#000000;line-height:1.8em;"><span style="font-family:'Times';line-height:1.8em;">    ArcGIS Server 9.2</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的功能强大，可以发布多种服务，其中一种就是地理处理服务。你可以把</span><wbr /><span style="font-family:'Times';line-height:1.8em;">toolbox</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">通过</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS Server</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">象发布数据服务一样发布出去，这就称为地理处理服务。通过发布</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">服务，任何人只要可以访问</span><wbr /><span style="font-family:'Times';line-height:1.8em;">Internet</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">和</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ESRI</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">产品，就可以使用该服务。服务在服务器上执行，使用服务器计算机的资源，让客户端运行该服务，并显示结果。另外，</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS Server</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">可能有一些或安装了全部的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的扩展产品（如空间分析或网络分析），而客户端如果需要运行这些功能，也不需要在他们的本机上安装这些扩展。<br></span><wbr /></span><wbr /><br>    以上就是ArcGIS中地理处理（GP）的一套完整的体系。在<span style="font-family:'Times';line-height:1.8em;">ESRI</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的发展技术上，一直推崇地理处理，特别是在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">9.2</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">的体系框架里边，更是把地理处理作为一种核心的技术来推广。<br>    在<span style="font-family:'Times';line-height:1.8em;">ArcGIS9.2</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">与以前版本地理处理方面的最大的一个区别地方在于，它把地理处理纳入到了桌面，</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS Engine,ArcGIS Server</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中。也就是说，我们可以在</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS Engine</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">当中使用地理处理工具，我们同样的也可以在同样基础的</span><wbr /><span style="font-family:'Times';line-height:1.8em;">AO</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">体系结构</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS Server</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">中来使用地理处理。从这方面体现</span><wbr /><span style="font-family:'Times';line-height:1.8em;">ArcGIS</span><wbr /><span style="font-family:'宋体';line-height:1.8em;">结构一体化，功能一体化的强大优势。<br></span><wbr /></span><wbr /></span><wbr /></span><wbr /><span style="font-family:'宋体';line-height:1.8em;"><span style="color:#000000;line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;"><span style="font-family:'宋体';line-height:1.8em;">==========<br>参考：<br><a href="http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=6210&amp;extra=page%3D1" target="_blank">http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=6210&amp;extra=page%3D1</a><wbr /><br>arcgis地理处理</span><wbr /></span><wbr /></span><wbr /></span><wbr /> <!--v:3.2--> ]]></description>
<category><![CDATA[学术论坛]]></category>
<author><![CDATA[271718002@qq.com(╰醉意人间╮)]]></author>
<comments>http://271718002.qzone.qq.com/blog/1258335675#comment</comments>
<qz:effect>134218249</qz:effect>
<pubDate>Mon, 16 Nov 2009 01:41:15 GMT</pubDate>
<guid>http://271718002.qzone.qq.com/blog/1258335675</guid>
</item>

<item>
<title><![CDATA[Python]]></title>
<link>http://271718002.qzone.qq.com/blog/1258335636</link>
<description><![CDATA[Description: Clips one or more shapefiles from a folder and places the<br>clipped feature classes into a Geodatabase.<br><br>Requirements: Python and the Python for Windows extention (win32 Extension) to be installed.<br>This tool has 3 required arguments, and one optional:<br> 1) an input workspace<br> 2) a clip feature class<br> 3) an output workspace (where the results will be written to), must be different than the input workspace<br> 4) a cluster tolerance<br><br>Author: ESRI, Redlands<br><br>Date: 11/18/2003<br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &quot;&quot;&quot;<br>#Create the Geoprocessor object<br>import arcgisscripting, sys, os<br>gp = arcgisscripting.create()<br><br>#Set the input workspace<br>gp.workspace = sys.argv[1]<br><br>#Set the clip feature class<br>clipFeatures = sys.argv[2]<br><br>#Set the output workspace<br>out_Workspace = sys.argv[3]<br><br>#Set the cluster tolerance<br>xyTolerance = sys.argv[4]<br><br>try:<br>    #Get a list of the feature classes in the input folder<br>    fcs = gp.ListFeatureClasses()<br>    #Loop through the list of feature classes<br>    fcs.Reset()<br>    fc = fcs.Next()<br>    while fc:<br>        #GDB's don't support &quot;.&quot; in the fc name, so replace these with &quot;_&quot;.<br>        #For example &quot;climate.shp&quot; will be converted to &quot;climate_shp&quot;.<br>        outFeatureClass = out_Workspace + &quot;/&quot; + gp.ValidateTableName(fc, out_Workspace)<br>  <br>        #Clip each feature class in the list with the clip feature class<br>        #Do not clip the clipFeatures, it may be in the same workspace<br>        if str(fc) != str(os.path.split(clipFeatures)[1]):<br>            gp.clip_analysis(fc, clipFeatures, outFeatureClass, xyTolerance)<br>        fc = fcs.Next()<br>except:<br>    gp.AddMessage(gp.GetMessages(2))<br>    print gp.GetMessages(2)<br> <!--v:3.2--> ]]></description>
<category><![CDATA[GIS专题]]></category>
<author><![CDATA[271718002@qq.com(╰醉意人间╮)]]></author>
<comments>http://271718002.qzone.qq.com/blog/1258335636#comment</comments>
<qz:effect>134218256</qz:effect>
<pubDate>Mon, 16 Nov 2009 01:40:36 GMT</pubDate>
<guid>http://271718002.qzone.qq.com/blog/1258335636</guid>
</item>

<item>
<title><![CDATA[GDB内部结构]]></title>
<link>http://271718002.qzone.qq.com/blog/1256972665</link>
<description><![CDATA[好久没这么认真的研究过一个东西，也许是上了年纪，精力不够的缘故.<br> 说明下下面的很多部分都来自网络，由于QQ空间贴图不方便，图片全部略了，其实大家可以自己建立对象类，要素集和数据集，在MDB中看一下他们之间的相关关系的。用了一个早上的时间做了几个小实验，结合网络整理了下。<br>Geodatabase的体系结构 <br>我觉得Geodatabase模型结构是在所谓的对象类（Object class）上扩展起来的，在Geodatabase中，对象类是一种特殊的类，它没有空间特征，也就是我们在关系型数据库中看到的表但是和表还不太一样（应该是表-对象类-要素类的顺序），地理信息系统是和空间信息打交道的，在空间信息的表中（要素类）可以看到，有一个Shape字段。以Access的方式打开GDB，可以看到两个表GDB_ObjectClasses，和GDB_FeatureClasses，前者存有对象类，而后者存在前面和后面两个表里面，对于后面的还有有一个要素类名称_SHAPE_Index的表，这也许就是书上说的，<span style="color:#660099;font-family:'宋体';line-height:1.8em;">空间数据与属性数据关联。空间数据放在建立了索引的二进制文件中，属性数据则放在DBMS表（TABLES）里面，二者以公共的标识编码关连。我们还会发现GDB_GeomColumns这个表，这个表里存了要素类空间信息吧。</span><wbr /><br>* 要素类（Feature class） <br>同类空间要素的集合即为要素类。如：河流、道路、植被、用地、电缆等。要素类之间可以独立存在，也可具有某种关系。当不同的要素类之间存在关系时，我们将其组织到一个要素数据集（Feature dataset）中。 <br><br>* 要素数据集（Feature dataset） <br>要素数据集由一组具有相同空间参考（Spatial Reference）的要素类组成。 <br>将不同的要素类放到一个要素数据集下的理由可能很多，但一般而言，在以下三种情况下，我们考虑将不同的要素类组织到一个要素数据集中： <br><br>专题归类表示——当不同的要素类属于同一范畴。如：全国范围内某种比例尺的水系数据，其点、线、面类型的要素类可组织为同一个要素数据集。 <br>创建几何网络——在同一几何网络中充当连接点和边的各种要素类，须组织到同一要素数据集中。如：配电网络中，有各种开关、变压器、电缆等，它们分别对应点或线类型的要素类，在配电网络建模时，我们要将其全部考虑到配电网络对应的几何网络模型中去。此时，这些要素类就必须放在同一要素数据集下。 <br>考虑平面拓扑（Planar topologies）——共享公共几何特征的要素类，如：用地、水系、行政区界等。当移动其中的一个要素时，其公共的部分也要求一起移动，并保持这种公共边关系不变。此种情况下，我们得将这些要素类放到同一个要素数据集下。 <br><br>* 关系类（Relationship class） <br>定义两个不同的要素类或对象类之间的关联关系。例如：我们可以定义房主和房子之间的关系，房子和地块之间的关系等。 <br><br>* 几何网络（Geometric network） <br>几何网络是在若干要素类的基础上建立的一种新的类。定义几何网络时，我们指定哪些要素类加入其中，同时指定其在几何网络中扮演什么角色。如：定义一个供水网络，我们指定同属一个要素数据集的“阀门”、“泵站”、“接头”对应的要素类加入其中，并扮演“连接（junction）”的角色；同时，我们指定同属一个要素数据集的“供水干管”、“供水支管”和“入户管”等对应的要素类加入供水网络，由其扮演“边（edge）”的角色。 <br><br>* Domains <br>定义属性的有效取值范围。可以是连续的变化区间，也可以是离散的取值集合。 <br><br>* Validation rules <br>对要素类的行为和取值加以约束的规则。如：规定不同管径的水管要连接，必须通过一个合适的转接头。规定一块地可以有一到三个主人。 <br><br>* Raster Datasets <br>用于存放栅格数据。可以支持海量栅格数据，支持影像镶嵌，可通过建立“金字塔”索引，并在使用时指定可视范围提高检索和显示效率。 <br><br><br>* Locators <br>定位器（Locator）是定位参考和定位方法的组合，对不同的定位参考，用不同的定位方法进行定位操作。所谓定位参考，不同的定位信息有不同的表达方法，在geodatabase中，有四中定位信息：地址编码、&lt;X,Y&gt;、地名及邮编、路径定位。定位参考数据放在数据库表中，定位器根据该定位参考数据在地图上生成空间定位点。详细的阐述，请参见《Modeling Our World》之第11章：Finding Locations。 <br> <br>Topology<br>GDB_TopoClasses，GDB_Topologies，GDB_TopoRules这三个表和其他的相互协作。<br><br>长事务处理和版本管理 <br>长期以来，在GIS的应用中一直存在两个困扰我们的问题：1、GIS空间数据编辑过程相关的长事务处理；2、空间数据的时序变化如何记录。ArcSDE提供了一种全新的空间数据版本管理方法（Versioning），为彻底解决这些问题提供了一条有效途径。 <br><br>基于空间数据的编辑工作很少向在银行存取一笔钱或在股市上完成一笔交易那么快捷，往往需要较长的时间（数小时、数天、甚至数月）才能结束。例如：城市国土规划部门的批地过程，电信资源管理部门的数据更新维护过程等。对于这种长事务处理过程，ArcSDE的版本管理机制允许用户在事务处理的任何阶段创建自己的数据“版本”。值得注意的是，这些“版本”并非空间数据的完整拷贝，而是一些反映版本间数据变化的增量信息。针对相同的空间范围，甚至对同一空间要素，不同的用户可以同时进行各自的修改操作，而不必将其事先锁定起来。在版本提交或合并时，系统将自动检测到可能的冲突并给出警示，结合ArcInfo或ArcEditor，系统提供对话框帮助用户解决该冲突。这种机制对于需要多人、多部门协同完成的工作流而言，非常有效。 <br><br>类似于“宗地”、“规划方案”这样的空间数据，随时间而发生变化，同时又必须记录并能随时检索到每次的变化，是其突出的特征。ArcSDE通过对不同的数据变化生成不同的“版本”来完成对数据变化的跟踪。只要指定某一版本（名称），就可得到当时的空间数据，并可在此基础上进一步进行操作。从而达到对历史数据进行记录和管理的目的。 <br><br>有一个pdf的文件，里面介绍了以GDB开头的表，和这些表内部的字段，上述的都可以在PGB中找到相依相应的表。<br> 在这里似乎还解决了一个问题，我们知道用9.3建立的数据库，9.2是无法打开的，如果把9.2里面的gdb—releaseinfo那些数值改成9.3的应该就可以了吧。<br>要详细资料和我联系。 <!--v:3.2--> ]]></description>
<category><![CDATA[个人日记]]></category>
<author><![CDATA[271718002@qq.com(╰醉意人间╮)]]></author>
<comments>http://271718002.qzone.qq.com/blog/1256972665#comment</comments>
<qz:effect>134218256</qz:effect>
<pubDate>Sat, 31 Oct 2009 07:04:25 GMT</pubDate>
<guid>http://271718002.qzone.qq.com/blog/1256972665</guid>
</item>

<item>
<title><![CDATA[[转]SOAP和HTTP 两种基本传输协议]]></title>
<link>http://271718002.qzone.qq.com/blog/1256636913</link>
<description><![CDATA[1．SOAP：Simple Object Access Protocol ^{Symbolic Optimal Assembly Program}.<br>2.1．HTTP-GET <br>2.2．HTTP-POSTSoap<br>定义:<br>SOAP 是一种轻量级协议，用于在分散型、分布式环境中交换结构化信息。 SOAP 利用 XML 技术定义一种可扩展的消息处理框架，它提供了一种可通过多种底层协议进行交换的消息结构。 这种框架的设计思想是要独立于任何一种特定的编程模型和其他特定实现的语义。<br> <br><br>特性:<br>这个定义确实体现了 SOAP 现在的主旨。 SOAP 定义了一种方法以便将 XML 消息从 A 点传送到 B 点（参见图 1）。 为此，它提供了一种基于 XML 且具有以下特性的消息处理框架：<br>1) 可扩展，<br>2) 可通过多种底层网络协议使用<br>3) 独立于编程模型。 以下将分别详细讨论这三种特性。<br><br>简单的 SOAP 消息处理1:SOAP 可扩展性是关键所在。 在这个缩写词还代表某些含义时，&quot;S&quot; 意味着“简单”。 如果我们从 Web 中学到了一样东西，那就是，简单性总是比效率和纯技术更重要，因而互操作性成败的关键，就在于必须绝对要求简单性。 简单性仍然是 SOAP 的主要设计目标之一，这一点的例证就是 SOAP 缺少分布式系统的很多特性（如安全性、路由和可靠性等）。 SOAP 定义了一种通信框架，允许以分层扩展的形式随着时间推移而加入这些特性。 Microsoft、IBM 和其他软件厂商正在积极开发一个 SOAP 扩展的通用套件，该套件将加入大多数开发人员期待的特性。 这一计划被称为全局 XML Web 服务结构 (GXA)Microsoft 已经发布了针对若干 GXA 规范的一个参考实现，并将其命名为 Web Services Enhancements 1.0 SP1 for Microsoft .NET (WSE)。 <br><br>2:SOAP 可在任何传输协议（诸如 TCP、HTTP、SMTP，甚至是 MSMQ）上使用（参见图 1）。 然而，为了保持互操作性，需要定义一些标准协议绑定以便草拟用于每种环境的规则。 SOAP 规范提供了一种用于定义任意协议绑定的灵活框架，并且由于 HTTP 的使用极为广泛，它现已为 HTTP 提供了一种显式绑定。3:SOAP 允许任何编程模型，并且不依赖于 RPC。 大多数开发人员立刻将 SOAP 与对分布式对象进行的 RPC 调用等效起来（因为 SOAP 最初就是关于“访问对象”的），但实际上，基本的 SOAP 模型更接近于传统的消息处理系统，如 MSMQ。 SOAP 定义了一种模型以便处理个别的单向消息。 你可以将多条消息组合成一条整体的消息交换。 图 1 说明了一种简单的单向消息，其中发送方不会收到响应。 但是，接收方可以向发送方发回一条响应（参见图 2）。 SOAP 允许使用任何数量的消息交换模式 (MEP)，请求/响应只是其中一种。 其他示例包括要求/响应（与请求/响应相对）、通知和长期运行的点对点对话等。<br><br>请求/响应消息交换模式开发人员经常将请求/响应与 RPC 混为一谈，而实际上二者之间的差别很大。 RPC 使用请求/响应，但请求/响应不一定就是 RPC。 RPC 是 一种允许开发人员进行方法调用的编程模型。 RPC 需要将方法签名转换成 SOAP 消息。 鉴于 RPC 的广泛应用，SOAP 草拟了一项协议，以便将 RPC 用于 SOAP。<br>具备这三种主要特性，SOAP 消息处理框架就促进了在异构环境中交换 XML 消息，而在这类环境中，互操作性长久以来都是极大的挑战。<br> <br>HTTP<br><br>HTTP-GET<br>定义:HTTP-GET是超文本传输协议的一种,依靠唯一的URI把数据传输.<br>特点:<br>。将数据添加到URL <br>。利用一个问号（”?”）代表URL地址的结尾与数据的开端。 <br>。每一个数据的元素以 名称/值 (name/value)　的形式出现(以&amp;分割)。<br>。利用一个分号(“;”)来区分多个数据元素。 <br>HTTP-POST<br>定义:HTTP-POST是超文本传输协议的一种,依靠用户发送的数据头获取数据.<br> <br>特点:<br><br>。将数据包括在HTTP主体中。 <br>。同样的，数据的元素以 名称/值 (name/value)　的形式出现(以&amp;分割)。 <br>。但是每一个数据元素分别占用主体的一行<br>HTTP和SOAPHTTP的优势(参考资料):<br>。 能够非常容易的创建正确的HTTP-GET 和 HTTP-POST消息，当面向的客户是不能使用SOAP的客户时，HTTP-GET 和 HTTP-POST是最好的选择。 。响应HTTP-GET 和 HTTP-POST的消息，并不需要复杂的XML处理。响应之中包括了XML，但它有一个简单的框架并能够轻易的利用一般的技术处理响应。这些特点使HTTP-GET 和 HTTP-POST对于不支持XML的平台来说，变的异常的有用。 <br>。HTTP-GET 和 HTTP-POST消息比起SOAP消息来说，更为简单。这有利于提高整体的性能。<br><br>缺点(参考资料):<br>。不能够利用HTML调用XML Web Service中的以复杂数据类型为参数的方法。 。你可以调用XML Web Service中返回值为复杂数据类型的方法，但是响应将仅包括复杂数据类型中各个区域中的名字/值，并且返回的值并没有结构可言。你必须手动的将数据解压缩到WSDL文件。 <br>。在HTTP中，你不能使用reference进行参数的传输。 <br>。使用HTTP与XML Web Service进行交流，不是一个agreed-to工业标准技术。虽然HTTP会在ASP.NET Web Application中与XML Web Service正常工作，但不保证它在其它的环境下正常工作。 <br>注意事项:<br> Cookie是依赖于Http传输协议的,如果说Soap可以读取Http产生的Cookie的话这是不可能的,Soap只能每次发送Cookie的库,获取才可以处理.<br>  Soap相比HTtp协议较慢,如果不是非常有必要,不要其传输大数据块.<br>  soap必定是符合W3C的XML文件,在C#中,发送的HttpWebRequest中:<br><br>Stream stm = req.GetRequestStream();<br>doc.Save(stm);即可实现发送,如果需要获取:<br>        <br>WebResponse resp = req.GetResponse();<br>stm = resp.GetResponseStream();<br>StreamReader r = new StreamReader(stm); <br>  发送一个Soap,在Web编程中,都是依靠于HTTP-POST的方式,Php中发送一个POST请求如下函数:<br><br>&lt;?phpfunction httpPostRequest($host, $path, $arrPostvars, $port=80, $referer=&quot;&quot;){ <br>  $arrEncodedPairs = array(); <br>  $res = &quot;&quot;; <br>  foreach ($arrPostvars as $var =&gt; $value) <br>      $arrEncodedPairs[] = rawurlencode($var).&quot;=&quot;.rawurlencode($value); <br>  $postData = implode(&quot;&amp;&quot;, $arrEncodedPairs); <br>  $request = &quot;POST $path HTTP/1.1\n&quot;. <br>  &quot;Host: $host\n&quot;. <br>  (($referer) ? &quot;Referer: $referer\n&quot; : &quot;&quot;). <br>  &quot;Content-type: application/x-www-form-urlencoded\n&quot;. <br>  &quot;Content-length: &quot;.strlen($postData).&quot;\n&quot;. <br>  &quot;Connection: close\n\n&quot;. <br>  $postData.&quot;\n&quot;; <br>  if ($fp = fsockopen($host, $port)) { <br>    if (fputs($fp, $request)){ <br>      while(! feof($fp)){ <br>       $res .= fgets($fp, 128); <br>      } <br>      fclose($fp); <br>      return $res; <br>    } <br>  } <br>}<br>?&gt;使用的时候:<br>echo(httpPostRequest('s','/myps/webs.asmx/IsLogin',array(&quot;Input&quot;=&gt;&quot;my Input&quot;),81));<br><br>  Http是无状态的协议,比如: <br>private string MyName;<br>[WebMethod]<br>public void SetMyName(string Input){<br>  this.MyName=Input;<br>}<br>[WebMethod]<br>public string GetMyName(){<br> return  this.MyName;<br>}<br>如果你使用    <br>Ws_App.SetMyName(&quot;cookies&quot;);<br>returnint.Text = Ws_App.GetMyName(); <br>这是不能获取值的.可以参考:<br><br>    <br>[WebMethod (EnableSession=true,MessageName=&quot;SetSession&quot;)]<br>public void SetSession(string Input){<br> Context.Session[&quot;oop&quot;]=Input;<br>}<br>[WebMethod (EnableSession=true,Description =&quot;GetSession&quot;,MessageName=&quot;GetSession&quot;)]<br>public string GetSession(){<br> return Context.Session[&quot;oop&quot;].ToString();<br>} <!--v:3.2--> ]]></description>
<category><![CDATA[个人日记]]></category>
<author><![CDATA[271718002@qq.com(╰醉意人间╮)]]></author>
<comments>http://271718002.qzone.qq.com/blog/1256636913#comment</comments>
<qz:effect>134218248</qz:effect>
<pubDate>Tue, 27 Oct 2009 09:48:33 GMT</pubDate>
<guid>http://271718002.qzone.qq.com/blog/1256636913</guid>
</item>

<item>
<title><![CDATA[又是几个概念]]></title>
<link>http://271718002.qzone.qq.com/blog/1256636370</link>
<description><![CDATA[<br>SOAP简单的理解，就是这样的一个开放协议SOAP=RPC+HTTP+XML：采用HTTP作为底层通讯协议；RPC作为一致性的调用途径，ＸＭＬ作为数据传送的格式，允许服务提供者和服务客户经过防火墙在INTERNET进行通讯交互。RPC的描叙可能不大准确，因为SOAP一开始构思就是要实现平台与环境的无关性和独立性，每一个通过网络的远程调用都可以通过SOAP封装起来，包括DCE（Distributed Computing Environment ）　RPC CALLS，COM/DCOM CALLS, CORBA CALLS, JAVA CALLS，etc。 <br><br>SOAP 使用 HTTP 传送 XML，尽管HTTP 不是有效率的通讯协议，而且 XML 还需要额外的文件解析（parse），两者使得交易的速度大大低于其它方案。但是XML 是一个开放、健全、有语义的讯息机制，而 HTTP 是一个广泛又能避免许多关于防火墙的问题，从而使SOAP得到了广泛的应用。但是如果效率对你来说很重要，那么你应该多考虑其它的方式，而不要用 SOAP。 <br><br>为了更好的理解SOAP,HTTP,XML如何工作的，不妨先考虑一下COM/DCOM的运行机制，DCOM处理网络协议的低层次的细节问题，如PROXY/STUB间的通讯，生命周期的管理，对象的标识。在客户端与服务器端进行交互的时候，DCOM采用NDR（Network Data Representation）作为数据表示，它是低层次的与平台无关的数据表现形式。<br> <br>Web service一般就是用SOAP协议通过HTTP来调用它，其实他就是一个WSDL文档，客户都可以阅读WSDL文档来用这个Web service。客户根据WSDL描述文档，会生成一个SOAP请求消息。Web service都是放在Web服务器 (如IIS) 后面的，客户生成的SOAP请求会被嵌入在一个HTTP POST请求中，发送到Web服务器来。Web服务器再把这些请求转发给Web service请求处理器。请求处理器的作用在于，解析收到的SOAP请求，调用Web service，然后再生成相应的SOAP应答。Web服务器得到SOAP应答后，会再通过HTTP应答的方式把它送回到客户端。 <br>  个人以为就把webservice当成是Http这种请求和响应方式就可以处理大部分问题了。<br> <br>我现在的理解是： <br>webService协议主要包括两个方面：传输协议和数据表示，关于传输协议可以是http或其他，数据表示也可以是键值对、xml或其他，只不过现在通用的是http+soap，当然其他的也可以，不知道这样理解对不对？<br> <br><a href="http://topic.csdn.net/u/20090217/14/030e240b-337f-4fb3-998a-b0efefb409c7.html" target="_blank">http://topic.csdn.net/u/20090217/14/030e240b-337f-4fb3-998a-b0efefb409c7.html</a><wbr /> <!--v:3.2--> ]]></description>
<category><![CDATA[个人日记]]></category>
<author><![CDATA[271718002@qq.com(╰醉意人间╮)]]></author>
<comments>http://271718002.qzone.qq.com/blog/1256636370#comment</comments>
<qz:effect>134218240</qz:effect>
<pubDate>Tue, 27 Oct 2009 09:39:30 GMT</pubDate>
<guid>http://271718002.qzone.qq.com/blog/1256636370</guid>
</item>

</channel>
</rss>

