WebGIS 技术解决方案
The GeoServer Project - the open Internet gateway for geographic data
GeoServer 项目 — 地图数据开放接口平台
The GeoServer Project is a Java (J2EE) implementation of:
GeoServer 是用 java 实现的
- The OpenGIS Consortium's Web Feature Server specification. With full transactional support!
- The OpenGIS Consortium's Web Map Server Specification.
- ZServer
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.
用户可以通过互联网灵活地编辑他们的地图数据,遵守工业化标准。
1. 技术选型
结构 |
一级选项 |
二级选项 |
备注 |
选择 |
表现层 |
标准的 SVG |
|
|
□ |
IE 的 vml |
dojo |
选用 ajax 类库 |
■ |
|
Javascript+div+css |
采用自己写 |
□ |
||
控制层 |
MVC |
struts |
|
■ |
spring |
|
□ |
||
servlet |
|
|
□ |
|
服务应用层 |
开源 |
GeoServer |
Java 开源项目 |
■ |
SharpMap |
|
□ |
||
商用 |
ESRI 公司的 ArcGIS |
|
□ |
|
MapInfo MapXtrem |
|
□ |
||
数据层 |
普通数据库 |
oracle |
|
■ |
mysql |
|
□ |
||
专业数据库 |
PostGIS |
|
□ |
|
数据格式 |
|
|
|
|
2. 技术实现方案
2.1. GeoServer 架构设计
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 平台
2.2. GeoServer 分层结构实现
GeoServer 结构分为三层实现结构:表现层、控制层、数据访问层。
Ø 表现层:采用 Ajax 技术, javascript 、 CSS+DIV 等方式实现图片的放大、缩小、平移、选点等方式。
Ø 控制层:采用 spring 或 struts 实现 MVC 的控制。
Ø 数据层 : GeoTools2 访问数据库。
2.2.1. 表现层
表现层采用 AJAX 的技术;系统前端的一些工具绘图采用了 dojo 的框架来处理,现在浏览器前端的绘图分为两个流派: IE 的 vml ,标准的 SVG ,如果客户的系统只运行在 IE 的话,可以考虑使用 vml ,如果想用标准的 SVG 来绘图,那么 IE 必须安装插件才能运行。刚好 dojo 帮我们做了一件事情,内部封装了一些函数,根据客户使用的浏览器不同,而自动转换成不同的代码来执行。不能不说这是一个很方便的类库,而且封装过的类库无论是兼容性和使用方便性方面都是不错。现在 dojo 已经提供三维立体的函数库了,希望 dojo 地图处理这个模块越做越好。如果想在 gis 分析的同时给出一些统计图辅助分析是,可以考虑使用 dojo 的三维立体模块,那将是一个全新的体验。
2.2.2. 控制层和应用层
控制层的选择跟 B/S 结构的 J2EE 的 MVC 结构是一样的,这里就可以选用 Spring 或 struts 的 MVC 。
2.2.2.1. Geoserver+Spring
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.)
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
<beans>
<!-- declare the GeoServer component -->
<bean id=
"geoServer"
class=
"org.vfny.geoserver.global.GeoServer"
/>
font-family: Lucida Console;