Skip to content

Commit

Permalink
Merge pull request #554 from lesserwhirls/g3
Browse files Browse the repository at this point in the history
Support godiva3 configuration
  • Loading branch information
lesserwhirls authored Dec 21, 2024
2 parents e82f719 + 50ee560 commit 2c471cc
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 6 deletions.
10 changes: 8 additions & 2 deletions docs/adminguide/src/site/pages/thredds/WmsRef.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: TDS Web Map Service (WMS)
last_updated: 2021-08-06
last_updated: 2024-12-20
sidebar: admin_sidebar
toc: false
permalink: adding_wms.html
Expand Down Expand Up @@ -52,12 +52,18 @@ WMS clients may not be able to directly use the THREDDS catalogs to find the WMS
Additional server level WMS configuration options can be set in the `threddsConfig.xml` file (see the [WMS Service](../adminguide/tds_config_ref.html) section of the TDS Configuration File Reference documentation).
Further WMS configuration properties are set in the wmsConfig.xml file.
These properties are mainly related with styling of WMS images.
Similar to the `threddsConfig.xml file`, the WMS configuration file (wmsConfig.xml) is found in the `${tds.content.root.path}/thredds` directory.
Similar to the `threddsConfig.xml` file, the WMS configuration file (wmsConfig.xml) is found in the `${tds.content.root.path}/thredds` directory.
A detailed description of the wmsConfig.xml file can be on the [Customizing WMS](customizing_wms.html) reference page.

If you are installing a new TDS, you should find a default `wmsConfig.xml` file (along with other configuration files) in the `${tds.content.root.path}/thredds` directory after you first deploy the TDS.
If a copy of the file is missing in the expected location, you can obtain a fresh copy from `${tomcat_home}/webapps/thredds/WEB-INF/altContent/startup/wmsConfig.xml`.

## Godiva3 configuration

Godiva3 has a few configuration options that may be useful, such as changing the map size or adding new base layers.
Similar to the `wmsConfig.xml` file, the Godiva3 configuration file (`godiva3.properties`) is found in the `${tds.content.root.path}/thredds` directory.
Configuration options can be found in the [ncWMS documentation](https://reading-escience-centre.gitbooks.io/ncwms-user-guide/content/03-config.html#server){:target="_blank"}.

## Change to CRS List in WMS GetCapabilities Documents

The number of CRS listed in the WMS GetCapabilities documents has been reduced between TDS 4.1 and 4.2.
Expand Down
10 changes: 8 additions & 2 deletions docs/quickstart/src/site/pages/thredds/WmsRef.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: TDS Web Map Service (WMS)
last_updated: 2020-11-26
last_updated: 2024-12-20
sidebar: quickstart_sidebar
toc: false
permalink: adding_wms.html
Expand Down Expand Up @@ -42,12 +42,18 @@ Additional WMS configuration options can be set in the `threddsConfig.xml` file.

Further WMS configuration properties are set in the wmsConfig.xml file.
These properties are mainly related with styling of WMS images.
Similar to the `threddsConfig.xml file`, the WMS configuration file (wmsConfig.xml) is found in the `$tds.content.root.path{}/content/thredds` directory.
Similar to the `threddsConfig.xml` file, the WMS configuration file (wmsConfig.xml) is found in the `$tds.content.root.path{}/content/thredds` directory.
A detailed description of the wmsConfig.xml file can be on the [Customizing WMS](../adminguide/customizing_wms.html) reference page.

If you are installing a new TDS, you should find a default `wmsConfig.xml` file (along with other configuration files) in your content`/thredds` directory after you first deploy the TDS.
If you are upgrading from a TDS version before version `4.2.20100615.*`, you will have to copy the default file from `${tomcat_home}/webapps/thredds/WEB-INF/altContent/startup/wmsConfig.xml`.

## Godiva3 configuration

Godiva3 has a few configuration options that may be useful, such as changing the map size or adding new base layers.
Similar to the `wmsConfig.xml` file, the Godiva3 configuration file (`godiva3.properties`) is found in the `${tds.content.root.path}/thredds` directory.
Configuration options can be found in the [ncWMS documentation](https://reading-escience-centre.gitbooks.io/ncwms-user-guide/content/03-config.html#server){:target="_blank"}.

## Change to CRS List in WMS GetCapabilities Documents

The number of CRS listed in the WMS GetCapabilities documents has been reduced between TDS 4.1 and 4.2.
Expand Down
10 changes: 8 additions & 2 deletions docs/userguide/src/site/pages/thredds/WmsRef.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: TDS Web Map Service (WMS)
last_updated: 2020-08-24
last_updated: 2024-12-20
sidebar: user_sidebar
toc: false
permalink: adding_wms.html
Expand Down Expand Up @@ -42,12 +42,18 @@ Additional WMS configuration options can be set in the `threddsConfig.xml` file.

Further WMS configuration properties are set in the wmsConfig.xml file.
These properties are mainly related with styling of WMS images.
Similar to the `threddsConfig.xml file`, the WMS configuration file (wmsConfig.xml) is found in the `$tds.content.root.path{}/content/thredds` directory.
Similar to the `threddsConfig.xml` file, the WMS configuration file (wmsConfig.xml) is found in the `$tds.content.root.path{}/content/thredds` directory.
A detailed description of the wmsConfig.xml file can be found at the MyOcean "Detailed WMS Configuration" page.

If you are installing a new TDS, you should find a default `wmsConfig.xml` file (along with other configuration files) in your content`/thredds` directory after you first deploy the TDS.
If you are upgrading from a TDS version before version `4.2.20100615.*`, you will have to copy the default file from `${tomcat_home}/webapps/thredds/WEB-INF/altContent/startup/wmsConfig.xml`.

## Godiva3 configuration

Godiva3 has a few configuration options that may be useful, such as changing the map size or adding new base layers.
Similar to the `wmsConfig.xml` file, the Godiva3 configuration file (`godiva3.properties`) is found in the `${tds.content.root.path}/thredds` directory.
Configuration options can be found in the [ncWMS documentation](https://reading-escience-centre.gitbooks.io/ncwms-user-guide/content/03-config.html#server){:target="_blank"}.

## Change to CRS List in WMS GetCapabilities Documents

The number of CRS listed in the WMS GetCapabilities documents has been reduced between TDS 4.1 and 4.2.
Expand Down
26 changes: 26 additions & 0 deletions tds/src/integrationTests/java/thredds/server/wms/TestGodiva3.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 1998-2024 University Corporation for Atmospheric Research/Unidata
* See LICENSE.txt for license information.
*/

package thredds.server.wms;

import static com.google.common.truth.Truth.assertThat;

import jakarta.servlet.http.HttpServletResponse;
import java.nio.charset.StandardCharsets;
import org.junit.Test;
import thredds.test.util.TestOnLocalServer;


public class TestGodiva3 {

@Test
public void testGodiva3GetConfig() {
String endpoint = TestOnLocalServer.withHttpPath("/getconfig");
byte[] result =
TestOnLocalServer.getContent(endpoint, HttpServletResponse.SC_OK, "application/json;charset=iso-8859-1");
String jsonStr = new String(result, StandardCharsets.ISO_8859_1);
assertThat(jsonStr).isEqualTo("{\"mapWidth\":1024,\"mapHeight\":512}");
}
}
3 changes: 3 additions & 0 deletions tds/src/main/java/thredds/server/config/TdsContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ public void afterPropertiesSet() {
}
}

// set configDir for use by the godiva3 config servlet
servletContext.setAttribute("configDir", this.threddsDirectory.getAbsolutePath());

/*
* places to look for catalogs ??
* List<DescendantFileSource> chain = new ArrayList<>();
Expand Down
15 changes: 15 additions & 0 deletions tds/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,21 @@

<!-- end edal-wms screenshot servlet -->

<!-- godiva3 config servlet -->

<servlet>
<servlet-name>godiva3config</servlet-name>
<servlet-class>uk.ac.rdg.resc.godiva.server.ConfigServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>godiva3config</servlet-name>
<url-pattern>/getconfig</url-pattern>
</servlet-mapping>

<!-- end godiva3 config servlet -->

<!-- ++++++++++ Setup security restrictions ++++++++++ -->
<!-- Following does not appear to work, so commented out -->
<!--
Expand Down
21 changes: 21 additions & 0 deletions tds/src/test/content/thredds/godiva3.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
mapHeight=512
mapWidth=1024
#proxy=http://proxyUrlGoesHere/
# Definition of user layers
# First we define a layer with ID "user"
# The URL of the WMS. MANDATORY
#userURL=http://wmsurl.com/with/query/separator/wms?
# The Title for the layer switcher. Defaults to the ID (i.e. "user" in this case)
#userTitle=My WMS Layer
# The layer(s) to plot. MANDATORY
#userLayers=wmslayer1,wmslayer2
# The projection to use. Defaults to "CRS:84"
#userProjection=EPSG:4326
# The WMS version to use. Defaults to "1.1.1"
#userVersion=1.3.0
# The image format to use. Defaults to "image/png"
#userFormat=image/png
# Whether a layer should be switched on at load. Can be defined for multiple overlays, but only for one base layer
#userOnByDefault=true
# Whether to use as an overlay (as opposed to a base map). Defaults to false
#userIsOverlay=true

0 comments on commit 2c471cc

Please sign in to comment.