nl.itc.RIMapper
Class WMS

java.lang.Object
  extended by HttpServlet
      extended by nl.itc.RIMapper.WMS

public class WMS
extends HttpServlet

OGC compatible Web Map Service. Converts SFS OGC geometry columns (eg from PostgreSQL/PostGIS) to Scalable Vector Graphics (SVG 1.1) map output, with a built-in SVG GUI (if getGUI=true in request).
Can transcode result to PNG/JPEG for WMS compatibility.
Uses Batik SVG toolkit for transcoding (http://xmlgraphics.apache.org/batik/)
Uses Java Topology Suite (JTS 1.11) (http://sourceforge.net/projects/jts-topo-suite/)

©2004-2010 International Institute for Geo-information Science and Earth Observation (ITC)
Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. see http://creativecommons.org/licenses/by-nc-sa/2.5/

Version:
2.0 [Sep 2010]
Author:
Barend Köbben - kobben@itc.nl

Constructor Summary
WMS()
          Just use constructor of superclass HttpServlet.
 
Method Summary
 void destroy()
          Destruction of the servlet.
 void doGet(HttpServletRequest request, HttpServletResponse response)
          The doGet method of the servlet.
 void doPost(HttpServletRequest request, HttpServletResponse response)
          doPost just redirects to doGet
 void init()
          Initialization of the servlet.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WMS

public WMS()
Just use constructor of superclass HttpServlet.

Method Detail

destroy

public void destroy()
Destruction of the servlet. Just puts "destroy" string in log.


doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws ServletException,
                  IOException
The doGet method of the servlet.
  1. Gets the WMS instance data from wms_instance.xml
  2. Opens a database connection for this instance (using the DBconn class).
  3. builds a Capabilities XML doc for this WMS instance (if needed).
    This uses a rather primitive way of finding if it's instantiated already. Eg. fails to detect changes in WMS config when "hotswapping" the DB.
  4. calls WMSRequest to parse parameters
  5. asks WMSGetMap or WMSGetCapabilities for further processing
  6. forwards output to servlet reponse object.

Parameters:
request - the request send by the client to the server
response - the response send by the server to the client
Throws:
ServletException - if an error occurred
IOException - if an error occurred

doPost

public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
            throws ServletException,
                   IOException
doPost just redirects to doGet

Throws:
ServletException
IOException

init

public void init()
          throws ServletException
Initialization of the servlet.

Throws:
ServletException - if an error occures