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;
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
