WebGIS技术解决方案
The GeoServer Project - the open Internet gateway for geographic data
GeoServer 项目—地图数据开放接口平台
The GeoServer Project is a Java (J2EE) implementation of:
GeoServer是用java实现的
GeoServer is free software, available under the GPL 2.0 license.
GeoServer是免费软件,GPL 2.0授权许可.
Users who would like to access and modify their geographic data over the Internet using flexible, industry-approved standards should take a look at GeoServer.
用户可以通过互联网灵活地编辑他们的地图数据,遵守工业化标准。
结构 |
一级选项 |
二级选项 |
备注 |
选择 |
表现层 |
标准的SVG |
|
|
□ |
IE的vml |
dojo |
选用ajax类库 |
■ |
|
Javascript+div+css |
采用自己写 |
□ |
||
控制层 |
MVC |
struts |
|
■ |
spring |
|
□ |
||
servlet |
|
|
□ |
|
服务应用层 |
开源 |
GeoServer |
Java开源项目 |
■ |
SharpMap |
|
□ |
||
商用 |
ESRI公司的ArcGIS |
|
□ |
|
MapInfo MapXtrem |
|
□ |
||
数据层 |
普通数据库 |
oracle |
|
■ |
mysql |
|
□ |
||
专业数据库 |
PostGIS |
|
□ |
|
数据格式 |
|
|
|
|
GeoServer 系统架构平面图
GeoServer is constructed using a Layered Design as outlined in the diagram below. There are two Layer systems in use - the classic J2EE Servlet/Handler/Request/Response and the STRUTS Framework.
采用二层结构,J2EE Servlet/Handler/Request/Response 和 Struts的MVC平台
GeoServer结构分为三层实现结构:表现层、控制层、数据访问层。
Ø 表现层:采用Ajax技术,javascript、CSS+DIV等方式实现图片的放大、缩小、平移、选点等方式。
Ø 控制层:采用spring或struts 实现MVC的控制。
Ø 数据层: GeoTools2访问数据库。
表现层采用AJAX的技术;系统前端的一些工具绘图采用了dojo的框架来处理,现在浏览器前端的绘图分为两个流派:IE的vml,标准的SVG,如果客户的系统只运行在IE的话,可以考虑使用vml,如果想用标准的SVG来绘图,那么IE必须安装插件才能运行。刚好dojo帮我们做了一件事情,内部封装了一些函数,根据客户使用的浏览器不同,而自动转换成不同的代码来执行。不能不说这是一个很方便的类库,而且封装过的类库无论是兼容性和使用方便性方面都是不错。现在dojo已经提供三维立体的函数库了,希望dojo地图处理这个模块越做越好。如果想在gis分析的同时给出一些统计图辅助分析是,可以考虑使用dojo的三维立体模块,那将是一个全新的体验。
控制层的选择跟B/S结构的J2EE的MVC结构是一样的,这里就可以选用Spring或struts的MVC。
2 GeoServer Platform
This section is a Short introduction to Spring, and its role in GeoServer.
Excerpt from the Spring Mission Statement.
Spring should be a pleasure to use
Your application code should not depend on Spring APIs
Spring should not compete with good existing solutions, but should foster integration. (For example, JDO, Toplink, and Hibernate are great O/R mapping solutions. We don't need to develop another one.)
Spring + GeoServer
In GeoServer Spring is a container, whose job is to house and manage components inside of the container. A component in Spring is referred to as a bean. Consider the following two GeoServer components / beans called GeoServer, and Data.
Spring is used as the glue which ties together GeoServer components managing the dependencies between them.
GeoServer.java
/**
* Represents the running server as a whole.
*/
class GeoServer {
GeoServer() {
...
}
}
Data.java
/**
* The GeoServer catalog.
*/
class Data {
/** reference to server facade */
GeoServer server;
Data(GeoServer server) {
this.server = server;
}
}
In the above, Data is dependent on GeoServer. This dependency is declared simply by adding a reference to a GeoServer to the constructor of Data. This form of dependency declaration is known as Inversion of Control (IOC).
In order for this dependency on GeoServer to be satisfied at runtime, we must describe the dependency to Spring. This is done with a Spring Context.
applicationContext.xml
"geoServer" class="org.vfny.geoserver.global.GeoServer"/>