Hyrax WMS

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽

Hyrax now works with ncWMS

Overview

With the recent addition of the Dynamic Services feature in the ncWMS WMS Server from Reading e-Science Centre Hyrax can now provide WMS services for all of it's appropriate holdings.

Therory Of Operation

In an instance of the ncWMS, a Dynamic Service is configured that points to a Hyrax server. This allows the ncWMS instance to access all of the holdings of the DAP server. However, the ncWMS does not "crawl" or "discover" or in any other way catalog or inventory the DAP server. Instead the user configures the Hyarx instance to add the WMS service to it's catalogs and services content. Hyrax then directs WMS traffic to the ncWMS. The ncWMS in turn retrieves the data directly from Hyrax and services the request.

The ncWMS instance may be hosted anywhere, however for best the performance we suggest you host your own ncWMS running in the same Tomcat instance as Hyrax. With such a configuration the WMS response performance for datasets backed by the DAP service is nearly as fast as the ncWMS response performance using direct file access.

WMS Installation (suggested)

The ncWMS web application is easy to install.

Simply:

  • Go to the ncWMS web site and download the WAR (Web ARchive) file for the latest version of ncWMS.
  • Place in the WAR file in $CATALINA_HOME/webapps
  • Restart Tomcat

Configuration

The following sub sections assume that you have installed both Hyrax and the ncWMS on your server in a single Tomcat instance running on port 8080. If your arrangement is otherwise you will need to adjust accordingly...

For the following example sections we will use the following URLs:

ncWMS configuration

Go to the ncWMS administration page: http://servername.org:8080/ncWMS/admin

Scroll down to the Dynamic Services section: caption

Create a new Dynamic Service for Hyrax:

  • Choose and enter a unique ID. (Write it down, you'll need it later) The screen shot shows 'lds' for 'local dap service' which we will use for the rest of these examples.
  • The value of the Service URL field will be the URL for the top level of the Hyrax server.
    • If the Hyrax server and the ncWMS server are running together in a single Tomcat instance then this URL should be expressed as: http://localhost:8080/opendap
    • If the Hyrax server and the ncWMS server are running on separate systems this URL must be a DAP server top level URL, and not a localhost URL.
    • Best WMS response performance will be achieved by running ncWMS and Hyrax on the same server and providing the localhost URL here.
  • The Dataset Match Regex should be a regex that matches of all of the data files you have for which WMS can prove services. If that's a drag, then just do like the example and use '.*' which matches everything.
  • Scroll to the bottom of the page and save the configuration.

Summary

Unique ID Service URL Dataset Match Regex Disabled? Remove Data Reading Class Link to more info Copyright Statement
lds http://localhost:8080/opendap .*

Hyrax Configuration

The Hyrax WMS configuration is contained in the file $CATALINA_HOME/content/opendap/viewers.xml. This file identifies data viewers and Web Services that Hyrax can provide for datasets. There are two relevant sections, the first defines Hyrax's view of the WMS service and the second enables Hyrax to provide access to the Godiva service that is part of ncWMS.


Edit the file $CATALINA_HOME/content/opendap/viewers.xml


Uncomment the following sections:

<!--
    <WebServiceHandler className="opendap.viewers.NcWmsService" serviceId="ncWms" >
        <applicationName>Web Mapping Service</applicationName>
        <NcWmsService href="/ncWMS/wms" base="/ncWMS/wms" ncWmsDynamicServiceId="lds" />
    </WebServiceHandler>

    <WebServiceHandler className="opendap.viewers.GodivaWebService" serviceId="godiva" >
        <applicationName>Godiva WMS GUI</applicationName>
        <NcWmsService href="http://YourServersNameHere:8080/ncWMS/wms" base="/ncWMS/wms" ncWmsDynamicServiceId="lds"/>
        <Godiva href="/ncWMS/godiva2.html" base="/ncWMS/godiva2.html"/>
    </WebServiceHandler>
-->

NcWmsServce

In the first section:

<WebServiceHandler className="opendap.viewers.NcWmsService" serviceId="ncWms" >
    <applicationName>Web Mapping Service</applicationName>
    <NcWmsService href="/ncWMS/wms" base="/ncWMS/wms" ncWmsDynamicServiceId="lds" />
</WebServiceHandler>

Edit the NcWmsService element so that:

  • The value of the ncWmsDynamicServiceId matches the Unique ID of the Dynamic Service you defined in ncWMS.
  • NB: The href and base attributes both use relative URL paths to locate the ncWMS service. If the ncWMS instance is NOT running on the same host as Hyrax then the values of the href and base attributes must be converted to fully qualified URLs.


GodivaWebService

In the second section:

<WebServiceHandler className="opendap.viewers.GodivaWebService" serviceId="godiva" >
    <applicationName>Godiva WMS GUI</applicationName>
    <NcWmsService href="http://yourNcWMSserver:8080/ncWMS/wms" base="/ncWMS/wms" ncWmsDynamicServiceId="lds"/>
    <Godiva href="/ncWMS/godiva2.html" base="/ncWMS/godiva2.html"/>
</WebServiceHandler>

Edit the NcWmsService element so that:

  • The value of the href attribute is the fully qualified URL for public access to your WMS service. This server name in this href will never be localhost - Godiva won't work. (Well OK, if your browser is running on the same system as the ncWMS instance then it would but it won't work for anybody else)
  • The value of the ncWmsDynamicServiceId matches the Unique ID of the Dynamic Service you defined in ncWMS.


The Godiva element's href and base attributes both use relative URL paths to locate the Godiva service. If the ncWMS instance is NOT running on the same host as Hyrax then the values of the href and base attributes must be converted to fully qualified URLs.

Start and Test

  • Once the configuration steps are complete restart your Tomcat server.
  • Point your browser at the Hyrax sever and navigate to a WMS suitable dataset.
  • Clicking the dataset's viewers link should return a page with both WMS and Godiva links.
  • Try 'em.