"Seegrid will be due for a migration to confluence on the 1st of August. Any update on or after the 1st of August will NOT be migrated"

BoM Observational Data GeoServer Deployment Guide

Overview

This deployment guide has been created to help BoM publish the time series observational data via GeoServer Web Feature Service (WFS) as Simple Feature Level 1 (SF1) / complex feature.

GeoServer Installation

Please refer to SISS GeoServer deployments procedure for a fresh new installation. If an upgrade is required for the existing GeoServer instance, backup/disabled the existing GeoServer folder/webapp and create a new one. Do a fresh installation using the new GeoServer build. For publishing time series observational data via GeoServer, a more recent build is required that comes with important fixes for time series mapping. All the fixes required are available starting from the following GeoServer version:
  • Version : 2.2-SNAPSHOT
  • Subversion Revision : 17010
  • Build Date : 03-May-2012 21:23
  • GeoTools Version : 8-SNAPSHOT (rev 38701)

Create Functions, Views and Materialized Views

  1. Download the db script from https://www.seegrid.csiro.au/subversion/ASRDC/BOM/SLAKE/dbScript/SLAKEDBScript_V2.sql
  2. Successfully running the SLAKEDBScript_V2.sql db script against SLAKE database will create the following functions, views and materialized views in the public schema:
    • Functions : create_matview(name,name), drop_matview(name), refresh_matview(name), get_result(bigint, text, "get_uom_ML"(bigint, text, get_uom_m(bigint, text, get_phenomenon_time_start(bigint, bigint), get_phenomenon_time_end(bigint, bigint and strip_tags(text)
    • Views : surface_reservoir, provider_details, storage_details, om_observation and om_phenom_time
    • Materialized Views : mv_surface_reservoir, mv_provider_details, mv_storage_details and mv_om_observation
  3. Note : For easier deployment, the SLAKE db dump with all the above functions, views and materialized views will be provided to BoM (via an FTP web site).

GeoServer Configuration Files

  1. Download the GeoServer configuration files from https://twiki.auscope.org/projects/bom/bom-om-config-040518.zip
  2. Extract the zip file to the data folder you specify in %GEOSERVER_INSTANCE_HOME%/WEB-INF/web.xml. It is a good practice to keep the data directory separate from the GeoServer installation folder. This will make the future upgrade of GeoServer easier.

Configuration Steps

  1. Download https://www.seegrid.csiro.au/subversion/ASRDC/BOM/SLAKE/GeoServerConfig/app-schema.properties and place it in %GEOSERVER_INSTANCE_HOME%/WEB-INF/classes/ folder.
  2. JNDI connection will be used in this deployment guide, you need to move "postgresql-8.4-701.jdbc3.jar" from %GEOSERVER_INSTANCE_HOME%/WEB-INF/lib to the Tomcat share lib folder, e.g. %TOMCAT_HOME%/lib folder (please double check with your system adminstrator if you are not sure).
  3. Append the following JNDI connection to the end of %GEOSERVER_INSTANCE_HOME%/WEB-INF/web.xml(after welcome-file-list tag and before web-app closing tag):
     
    <resource-ref>
        <description>BOM (SLAKE) Datasource</description>
        <res-ref-name>jdbc/slake</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>
  4. Replace all %PLACEHOLDERS% with appropriate values and append the following text into the end of %TOMCAT_HOME%/conf/server.xml or %TOMCAT_HOME%/conf/context.xml: (please double check with your system administrator if different setup is required) :
    <Context
        path="/%GEOSERVER_INSTANCE_NAME%"
        docBase="%GEOSERVER_INSTANCE_HOME%"
        crossContext="false"
        reloadable="false">
       <Resource
            name="jdbc/slake"
            auth="Container"
            type="javax.sql.DataSource"
            url="jdbc:postgresql://%DB_HOSTNAME%:%DB_PORT%/%DB_NAME%"
            driverClassName="org.postgresql.Driver"
            username="%DB_USERNAME%"
            password="%DB_PASSWORD%"
            maxActive="-1"
            maxIdle="10"
            minIdle="0"
            maxWait="10000"
            minEvictableIdleTimeMillis="300000"
            timeBetweenEvictionRunsMillis="300000"
            numTestsPerEvictionRun="20"
            poolPreparedStatements="true"
            maxOpenPreparedStatements="100"
            testOnBorrow="true"
            validationQuery="select version();" />
    </Context>
  5. Before restarting Tomcat, you might need to reset the write permissions on the data directory.
      Example, setting up permissions for the geoserver data directory
      # sudo chown -R tomcat6:tomcat6 /usr/local/bom/data

Test

  1. To Ensure all the feature types are up and running, point your web browser to http://%SERVER_HOST_NAME%/%GEOSERVER_INSTANCE_NAME%/wfs?request=GetCapabilities (Note: GetCapabilities is not functioning well in IE) and check that you have the following feature type available :
    • slake:SurfaceReservoir
    • om:OM_Observation
  2. To test the slake:SurfaceReservoir feature type :
    • http://%SERVER_HOST_NAME%/%GEOSERVER_INSTANCE_NAME%/wfs?service=WFS&version=1.1.0&request=getFeature&typeName=slake:SurfaceReservoir&outputformat=gml32&maxFeatures=1
  3. To test the Observations and Measurements feature type :
    • http://%SERVER_HOST_NAME%/%GEOSERVER_INSTANCE_NAME%/wfs?service=WFS&version=1.1.0&request=getFeature&typeName=om:OM_Observation&outputformat=gml32&maxFeatures=1

Enter WFS Metadata

  1. It is important to maintain correct metadata for each feature type available for GeoNetwork to auto harvest the correct information.
  2. You can refer to the following links for more information :
Topic revision: r11 - 13 Aug 2014, BenCaradocDavies