These Javadoc pages will serve as a Developers' Guide for those wishing to
understand how ncWMS works and for those wishing to make contributions to the code:
scroll down to get started.
Overview of ncWMS
ncWMS is an implementation of the OGC Web Map Service specification. It is designed
specifically for generating imagery of four-dimensional data that are stored
in NetCDF files or OPeNDAP servers, conforming to the Climate and Forecast metadata convention.
All the necessary metadata should be contained in the headers of the source
NetCDF files, therefore an ncWMS server requires minimal setup.
It is also possible to use ncWMS to display data from other file formats (TODO: link
to more info about this).
Architecture
ncWMS is a standard Java web application, which should run in any standard
web app container that supports version 2.4 of the Servlet specification and
version 2.0 of the JSP specification. It has been tested successfully in Tomcat
versions 5.5 and 6.0.
ncWMS uses the Spring framework,
for two main reasons:
- to allow components to be loosely coupled. Spring's
Inversion of Control
framework is used to handle the internal wiring of components, which can
be developed in isolation.
- to make a clean separation between internal logic and presentation code (i.e. the
"model-view-controller" or "MVC" paradigm: see the
Spring documentation on the subject). This is used mainly to help
in the generation of large XML documents such as the Capabilities document.
A major advantage of Spring is that it does not pollute the code base, therefore
most of the classes in ncWMS have no knowledge of Spring. The web application is set
up using the configuration file web/WEB-INF/WMS-servlet.xml. See the
Spring
reference documentation for more details.
System components
ncWMS is comprised of the following main components:
- Controllers,
which handle requests from clients. These
are the main entry points to the ncWMS system from the point of view of
the user and are a good place to start learning about ncWMS.
- Data readers,
which handle the tasks of reading data and metadata from source files.
- Imaging code, including image renderers,
which turn arrays of data into java.awt.BufferedImages, and
code to render
BufferedImages into various common image formats (e.g. PNG and GIF).
- Coordinate system handling classes,
which provide routines for converting between real-world coordinates
and indices in data arrays. (Doing these conversions efficiently
is important for the fast generation of map images.)
- Metadata classes,
which define data structures for the handling of metadata, stores for holding
metadata (in memory or in a database) and classes that ensure that ncWMS's
metadata remains synchronized with the source data.
- An Administration application (TODO: add link), which allows the server administrator to add and
remove datasets from the server and enter other configuration information.
- Configuration classes,
which define the datasets that are exposed by this server and other information
such as the contact details of the server administrator.
- Exception classes,
which define the exceptions that can be raised during operation; these include
representations of the standard WMS Exception types.
- Usage logging system,
which records all "hits" on the ncWMS server.
- Caching system,
which increases performance and reduces the load on the server by
caching recently-extracted arrays of data.
Development Environment
Developers can of course use any tools they like to develop for ncWMS, but
the majority of the current code was developed in NetBeans
The source code release includes an nbproject folder, which allows
the code to be imported directly into NetBeans 6.5 or later.
ncWMS requires at least Java 1.5 ("Java 5") as it uses generics and other constructs
that were not present in earlier versions of Java.
Third-party libraries
ncWMS makes use of many third-party libraries, but the main ones are:
- Unidata Java NetCDF libraries
- GeoTools
- Spring core and MVC libraries
- H2 database (for usage logging and possible future metadata holdings)
- EHCache for the cache of extracted data arrays
- Simple XML for serializing and deserializing XML config files