毕业论文(设计)基于ArcIMS Java Connector 与Ajax 技术构建林业WebGIS00651.doc
基于ArcIMS Java Connector与Ajax技术构建林业WebGIS冯仲科1 李亚东1 王佳1(1北京林业大测绘与3S技术中心)摘要:在林业WebGIS开发中由于传统Web系统的响应机制下客户端与服务器的交互必须以提交页面的方式进行,这造成服务器不仅无法对单项数据进行及时处理,而且在系统资源与效率上造成了不必要的浪费。Ajax(Asynchronous JavaScript and XML)技术的运用能从根本上解决这一问题。本文从ArcIMS Java Connector(ESRI公司的ArcGIS系列产品的WebGIS开发包)、Ajax技术和林业WebGIS三者的特性出发阐述了基于ArcIMS Java Connector与Ajax技术构建林业WebGIS的先进性与合理性,给出了将ArcIMS Java Connector、Ajax技术、林业业务逻辑三者相结合开发林业WebGIS的组织模型及实现方法。实现了林业WebGIS的字段的时时服务器验证记录的无刷新分页显示无刷新调取GIS数据实现桌面式GUI可拖拽界面等传统方式所无法实现的功能。在林业WebGIS上实现了将两种技术成功的集成的例子。关键词:ArcIMS Java Connector;Ajax;林业;WebGISFeng Zhongke Li Yadong.Building Forestry WebGIS with ArcIMS Java Connector and Ajax. Institute of GIS, RS & GPS, Beijing Forestry University, 100083, P. R. China.Abstract: Due to the response mechanism of the tradition Web system in the development of the forestry WebGIS, the interaction between the client and server must be submitted to the page, this has lead to the server not only could not make a process to the single data timely, but also brought a unnecessary waste to the system resources and efficient. The application of the Ajax (Asynchronous JavaScript and XML) technology could resolve the problem fundamentally. This paper is based on the feature of ArcIMS Java Connector (The WebGIS developed kit of ESRI companys ArcGIS series), Ajax technology and Forestry WebGIS, and explained the rationality and the advancement of constructing forestry WebGIS which based on the ArcIMS Java Connector and Ajax technology. It also posed the model and the way of accomplishment to the development of forestry WebGIS which based on the combination of ArcIMS Java Connector, Ajax technology and forestry business logic.This paper also accomplished the following function that we could not finish by the tradition way: real-time server field test pagination show no record set acquire the GIS data with no refreshing accomplished the dragging GUI desktop. Have achieved the example, which the combination of the two technologies, in the forestry WebGIS.Key Words: ArcIMS Java Connector; Ajax; forestry; WebGIS 第一作者:冯仲科 单位:北京林业大学测绘与3S技术中心 地址:北京市海淀区清华东路35号北京林业大学111信箱 邮编:100083 E-mail:fengzhongke 电话:010-62337963 1 ArcIMS Java Connector与Ajax 技术简介1.1 ArcIMS Java Connector简介ArcIMS Java Connector是ArcIMS的一个连接器,它是通过把ArcIMS 的各种arcXML请求操作用java对象封装起来以java API的方式提供给二次开发的用户的一种ArcIMS开发方式及java类库1。用户的GIS请求发送到Web服务器通过处理JSP、Servlet的请求调用ArcIMS Java Connector的JavaBeans或JSP标签来组合arcXML,通过封装好java对象发送请求arcXML给ArcIMS应用服务器,应用服务器负责组织分布式空间服务器处理arcXML请求并通过ArcIMS应用服务器返回arcXML响应结果给ArcIMS Java Connector的JavaBeans或JSP标签。最后arcXML响应结果经ArcIMS Java Connector的JavaBeans(或JSP标签)组织返回给Web服务器处理后显示结果与客户端。1. 2 Ajax 技术简介Ajax(Asynchronous JavaScript and XML)是使用XHTML 和 CSS 标准化呈现,使用DOM实现动态显示和交互,使用XML 和XSTL 进行数据交换与处理,使用 XMLHttpRequest 对象进行异步数据读取,使用Javascript 绑定和处理所有数据的一种技术综合体2。3基于ArcIMS Java Connector与Ajax技术构建林业WebGIS应用实例F-star林业WebGIS3.1 F-star林业WebGIS结构林业WebGIS 系统采用浏览器/ 服务器(B/ S) 模式,结合MVC的三层架构设计充分发挥了Web 技术优势, 林业各个部门通过运行在标准Web中的html/DHTML页面发出各种交互请求,请求经业务逻辑层发送到服务器,服务器根据请求处理数据库中的数据,返回事物逻辑层处理后返回给客户端 (如图1) 。3.2 功能模块(1) 造林决策GIS辅助功能人工造林一直是林业生产经营活动的主体,造林工作各环节中首要问题是适地适树问题,即造林决策。如何科学、合理的选择造林地块和造林方式,提供植树造林所需要的各种背景资料等,使经验主导转为科学决策。这一工作对森林资源管理、生态环境建设和实现林业可持续发展具有重大的意义,迫切需要用新的技术手段来提高工作效率和质量,减少盲目性3。F-star林业WebGIS实现的更新造林生产GIS辅助决策功的主要能有:按给定的立地条件查询到适合该立地的树种;按给定树种查询到适合该树种的地块;指定树种在指定类型立地条件上的生长状况查询;历史造林图层、影象图层的叠加显示与查询等。(2) 病虫害防治管理。森林作为生态系统的主体及林业产业的基础,在改善环境、促进可持续发展中起到越来越重要的作用,因此,森林病虫害的防治与管理就显得尤为重要。森林病虫害的管理与防治工作始于20 世纪50年代,多年来各基层部门积累了大量的信息资料。这些资料以手工绘制及记录的图表居多,因此给信息汇总、统计、分析及信息的共享带来许多不便。引进和开发高技术项目是我国21 世纪林业行动计划中的重要内容,是实现科技兴林、促进林业现代化、确保21 世纪林业战略目标实现的重要保证;因此,研制开发适合森林病虫害管理及防治需要的信息系统,对于我国林业资源的有效保护及利用具有重大意义4。F-star林业WebGIS实现的森林病虫害管理的主要功能有:对病虫害监测点辐射范围,检测虫种,变动趋势等实现WebGIS管理;对飞机防治的航线确定,不同参数(航高、风速等)条件下有效防治区域等的模拟;对有害生物疫区管理。(3)林业工程WebGIS发布与查询。林业作为生态环境建设的主体, 在整个国民经济和社会可持续发展全局中的战略地位和重要作用已得到广泛认同。随着林业六大重点工程的相继启动和实施, 国家对林业的资金投入近年来大幅度增加, 林业工程的管理情况也引起了林业管理的重视。F-star林业WebGIS实现的林业工程管理的主要功能有:调查设计审批与信息发布;各项工程的分布图;各项工程历史资料的查询;各项工程进度查询管理等。(4)苗圃与果园管理。F-star林业WebGIS实现的苗圃与果园管理的主要功能有:苗圃与果园区划图;圃区(园区)属性查询;历史资料的查询等。义务植树管理。F-star林业WebGIS实现的义务植树管理的主要功能有:义务植树GIS辅助选址功能;义务植树分布图发布;花园式绿化先进单位查询与管理等。3.3 F-star林业WebGIS的实现原理林业WebGIS总体逻辑为林业GIS数据通过ArcCatalog导入到SDE存储到关系数据库中,再通过Author配置地图文件,Administrator 中发布地图服务。由ArcIMS Java Connector调用处理地图服务(如图2)。(1) 林业业务与ArcIMS Java Connector的集成。JavaBean 是一种JAVA语言写成的可重用组件。用户可以使用JavaBean将功能、处理、值、数据库访问和其他任何可以用java代码创造的对象进行打包,并且其他的开发者可以通过内部的JSP页面、Servlet、其他JavaBean、applet程序或者应用来使用这些对象5。林业业务通过封装在运行在服务器端JavaBeans里,用户通过JSP、 Servlet调用业务逻辑层JavaBeans6,业务逻辑层再调用Java Connector实现各种GIS处理。(2) Ajax技术与ArcIMS Java Connector的集成。AJAX 框架DWR(Direct Web Remoting)是在Apache许可下的一个开源的解决方案7,它向供给使用AJAX和XMLHttpRequest的开发者一套Javascript功能集,实现了从HTML页面调用应用服务器上的Java对象的方法。借助于DWR,可以针对ArcIMS Java Connector的某一对象来实现异步取数据。ArcIMS Java Connector、Ajax技术与林业业务的具体结合原理如图3。4 结果(1) 字段的时时服务器验证林业WebGIS系统的属性数据中有大量诸如:45兴安落叶松中龄林林龄60年, 0疏林地郁闭度0.3,0二类小班面积20公顷8等业务逻辑需要即时得到验证;由于根据地区,树种,立地条件等因素不同上述数据的验证逻辑经常变化,采取客户端验证代码烦琐切维护十分困难。此外诸如材积计算等功能必须时时与器端交互。在Ajax之前,Web站点强制用户进入提交/等待/重新显示范例,用户的动作总是与服务器的“思考时间”同步,页面必须整页面提交无法实现每项录入内容的即时的服务器验证,大量的等待响应又造成了系统资源和时间的浪费9。借助于Ajax技术,可以在用户单击按钮时,使用JavaScript和DHTML立即更新UI,并向服务器发出异步请求,在不提交页面的情况下即时验证数据。(2) 记录的无刷新分页显示由于林业数据量大,往往一页难显示,然而在Ajax之前,多条记录的分页显示的实现是以整页提交的方式实现,这将造成不必要的内容(如按钮及页面内其数据)也不必要地提交,造成了大量的系统资源及时间的浪费。(3) 无刷新调取GIS数据AJAX 框架DWR(Direct Web Remoting)是在Apache许可下的一个开源的解决方案。借助于DWR,可以针对ArcIMS Java Connector的某一对象来实现局部的异步取数据。这可以实现页面内地理数据与属性数据、工具按钮等进行有效分类,只提交页面中需要提交的数据从而实现更有效地处理提交数据和保证用户对页面不间断操作。(4) 实现桌面式GUI可拖拽界面用来描述一组技术,它使浏览器可以为用户提供更为自然的浏览体验。借助于Ajax,可以在用户单击按钮时,使用JavaScript和DHTML立即更新UI10,并向服务器发出异步请求,以执行更新或查询数据库。当请求返回时,就可以使用JavaScript和CSS来相应地更新UI,而不是刷新整个页面。最重要的是,用户甚至不知道浏览器正在与服务器通信:Web站点看起来是即时响应的(如图4)。 5 结束语Ajax技术的诸多特性决定它是提高Web应用程序性能的有效方法11,ArcIMS Java Connector是ArcIMS几种开发模式能可扩展能力最强的开发方式之一12,将两中技术结合开发林业WebGIS是提高解决林业WebGIS性能,促进林业地理信息系统走向Web应用的有效途径。作为现代林业的重要组成部分的数字林业建设有其广阔的应用前景,林业WebGIS必将成为现代林业的有力工具和必然选择,并将为林业更大、更好地发挥生态、资源、环境效益做出重要的贡献13。 参考文献:1ArcIMSUsingthe JavaConnectorEB/OL.ArcIMS9 Customizing 2金灵译.Ajax基础教程M.人民邮电出版社,2006:152-163.3黄晓全,欧阳勋志.地理信息系统在森林资源管理与监测中的应用J.森林工程,2004,20(6):9114詹新武,周世健.基于GIS 技术的森林病虫害防治管理信息系统J. 中国森林病虫2005 01.24275Bruce W. Perry著.佩里,朱涛江,邹红霞,林琪 等译.JavaTM Servlet & JspTM经典实例M.北京:中国电力出版社,2005 6Damon Hougland,Aaron Tavistock著.霍兰德 译.JSP 核心技术M.北京:机械工业出版社,2001.8.7java开源网站EB/OL.http:/www.open-8冯仲科 著.精准林业M.北京:中国林业版社,2004.9游丽贞,郭宇春,李纯喜.Ajax引擎的原理和应用J. 微计算机信息 , 2006.10克拉恩 帕斯卡雷洛 杰姆斯 著.ajaxcn.org 译.Ajax实战M.人民邮电出版社,200611中国Ajax网站EB/OL.12ESRI. Getting_Started_with_ArcIMSCD.13 冯仲科 姚山 郝星耀 李亚东等.F-star林场地理信息系统平台设计思想、功能及应用前景J.北京林业大学学报,2005 27(S2).24. Feng Zhongke,Yao Shan,Hao Xingyao,Li Yadong.Designing thinking, function and applied foreground of F-starGIS platform for forestry center.Journal of Beijing Forestry University 27(S2) .24更多测绘论文请登录测绘网论文频道查询:http:/ Editor's note: Judson Jones is a meteorologist, journalist and photographer. He has freelanced with CNN for four years, covering severe weather from tornadoes to typhoons. Follow him on Twitter: jnjonesjr (CNN) - I will always wonder what it was like to huddle around a shortwave radio and through the crackling static from space hear the faint beeps of the world's first satellite - Sputnik. I also missed watching Neil Armstrong step foot on the moon and the first space shuttle take off for the stars. Those events were way before my time.As a kid, I was fascinated with what goes on in the sky, and when NASA pulled the plug on the shuttle program I was heartbroken. Yet the privatized space race has renewed my childhood dreams to reach for the stars.待添加的隐藏文字内容3As a meteorologist, I've still seen many important weather and space events, but right now, if you were sitting next to me, you'd hear my foot tapping rapidly under my desk. I'm anxious for the next one: a space capsule hanging from a crane in the New Mexico desert.It's like the set for a George Lucas movie floating to the edge of space.You and I will have the chance to watch a man take a leap into an unimaginable free fall from the edge of space - live.The (lack of) air up there Watch man jump from 96,000 feet Tuesday, I sat at work glued to the live stream of the Red Bull Stratos Mission. I watched the balloons positioned at different altitudes in the sky to test the winds, knowing that if they would just line up in a vertical straight line "we" would be go for launch.I feel this mission was created for me because I am also a journalist and a photographer, but above all I live for taking a leap of faith - the feeling of pushing the envelope into uncharted territory.The guy who is going to do this, Felix Baumgartner, must have that same feeling, at a level I will never reach. However, it did not stop me from feeling his pain when a gust of swirling wind kicked up and twisted the partially filled balloon that would take him to the upper end of our atmosphere. As soon as the 40-acre balloon, with skin no thicker than a dry cleaning bag, scraped the ground I knew it was over.How claustrophobia almost grounded supersonic skydiverWith each twist, you could see the wrinkles of disappointment on the face of the current record holder and "capcom" (capsule communications), Col. Joe Kittinger. He hung his head low in mission control as he told Baumgartner the disappointing news: Mission aborted.The supersonic descent could happen as early as Sunday.The weather plays an important role in this mission. Starting at the ground, conditions have to be very calm - winds less than 2 mph, with no precipitation or humidity and limited cloud cover. The balloon, with capsule attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. It will climb higher than the tip of Mount Everest (5.5 miles/8.85 kilometers), drifting even higher than the cruising altitude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. As he crosses the boundary layer (called the tropopause), he can expect a lot of turbulence.The balloon will slowly drift to the edge of space at 120,000 feet (22.7 miles/36.53 kilometers). Here, "Fearless Felix" will unclip. He will roll back the door.Then, I would assume, he will slowly step out onto something resembling an Olympic diving platform.Below, the Earth becomes the concrete bottom of a swimming pool that he wants to land on, but not too hard. Still, he'll be traveling fast, so despite the distance, it will not be like diving into the deep end of a pool. It will be like he is diving into the shallow end.Skydiver preps for the big jumpWhen he jumps, he is expected to reach the speed of sound - 690 mph (1,110 kph) - in less than 40 seconds. Like hitting the top of the water, he will begin to slow as he approaches the more dense air closer to Earth. But this will not be enough to stop him completely.If he goes too fast or spins out of control, he has a stabilization parachute that can be deployed to slow him down. His team hopes it's not needed. Instead, he plans to deploy his 270-square-foot (25-square-meter) main chute at an altitude of around 5,000 feet (1,524 meters).In order to deploy this chute successfully, he will have to slow to 172 mph (277 kph). He will have a reserve parachute that will open automatically if he loses consciousness at mach speeds.Even if everything goes as planned, it won't. Baumgartner still will free fall at a speed that would cause you and me to pass out, and no parachute is guaranteed to work higher than 25,000 feet (7,620 meters).It might not be the moon, but Kittinger free fell from 102,800 feet in 1960 - at the dawn of an infamous space race that captured the hearts of many. Baumgartner will attempt to break that record, a feat that boggles the mind. This is one of those monumental moments I will always remember, because there is no way I'd miss this.