Skip to content

Commit 2c471cc

Browse files
authored
Merge pull request Unidata#554 from lesserwhirls/g3
Support godiva3 configuration
2 parents e82f719 + 50ee560 commit 2c471cc

File tree

7 files changed

+89
-6
lines changed

7 files changed

+89
-6
lines changed

docs/adminguide/src/site/pages/thredds/WmsRef.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: TDS Web Map Service (WMS)
3-
last_updated: 2021-08-06
3+
last_updated: 2024-12-20
44
sidebar: admin_sidebar
55
toc: false
66
permalink: adding_wms.html
@@ -52,12 +52,18 @@ WMS clients may not be able to directly use the THREDDS catalogs to find the WMS
5252
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).
5353
Further WMS configuration properties are set in the wmsConfig.xml file.
5454
These properties are mainly related with styling of WMS images.
55-
Similar to the `threddsConfig.xml file`, the WMS configuration file (wmsConfig.xml) is found in the `${tds.content.root.path}/thredds` directory.
55+
Similar to the `threddsConfig.xml` file, the WMS configuration file (wmsConfig.xml) is found in the `${tds.content.root.path}/thredds` directory.
5656
A detailed description of the wmsConfig.xml file can be on the [Customizing WMS](customizing_wms.html) reference page.
5757

5858
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.
5959
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`.
6060

61+
## Godiva3 configuration
62+
63+
Godiva3 has a few configuration options that may be useful, such as changing the map size or adding new base layers.
64+
Similar to the `wmsConfig.xml` file, the Godiva3 configuration file (`godiva3.properties`) is found in the `${tds.content.root.path}/thredds` directory.
65+
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"}.
66+
6167
## Change to CRS List in WMS GetCapabilities Documents
6268

6369
The number of CRS listed in the WMS GetCapabilities documents has been reduced between TDS 4.1 and 4.2.

docs/quickstart/src/site/pages/thredds/WmsRef.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: TDS Web Map Service (WMS)
3-
last_updated: 2020-11-26
3+
last_updated: 2024-12-20
44
sidebar: quickstart_sidebar
55
toc: false
66
permalink: adding_wms.html
@@ -42,12 +42,18 @@ Additional WMS configuration options can be set in the `threddsConfig.xml` file.
4242

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

4848
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.
4949
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`.
5050

51+
## Godiva3 configuration
52+
53+
Godiva3 has a few configuration options that may be useful, such as changing the map size or adding new base layers.
54+
Similar to the `wmsConfig.xml` file, the Godiva3 configuration file (`godiva3.properties`) is found in the `${tds.content.root.path}/thredds` directory.
55+
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"}.
56+
5157
## Change to CRS List in WMS GetCapabilities Documents
5258

5359
The number of CRS listed in the WMS GetCapabilities documents has been reduced between TDS 4.1 and 4.2.

docs/userguide/src/site/pages/thredds/WmsRef.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: TDS Web Map Service (WMS)
3-
last_updated: 2020-08-24
3+
last_updated: 2024-12-20
44
sidebar: user_sidebar
55
toc: false
66
permalink: adding_wms.html
@@ -42,12 +42,18 @@ Additional WMS configuration options can be set in the `threddsConfig.xml` file.
4242

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

4848
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.
4949
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`.
5050

51+
## Godiva3 configuration
52+
53+
Godiva3 has a few configuration options that may be useful, such as changing the map size or adding new base layers.
54+
Similar to the `wmsConfig.xml` file, the Godiva3 configuration file (`godiva3.properties`) is found in the `${tds.content.root.path}/thredds` directory.
55+
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"}.
56+
5157
## Change to CRS List in WMS GetCapabilities Documents
5258

5359
The number of CRS listed in the WMS GetCapabilities documents has been reduced between TDS 4.1 and 4.2.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 1998-2024 University Corporation for Atmospheric Research/Unidata
3+
* See LICENSE.txt for license information.
4+
*/
5+
6+
package thredds.server.wms;
7+
8+
import static com.google.common.truth.Truth.assertThat;
9+
10+
import jakarta.servlet.http.HttpServletResponse;
11+
import java.nio.charset.StandardCharsets;
12+
import org.junit.Test;
13+
import thredds.test.util.TestOnLocalServer;
14+
15+
16+
public class TestGodiva3 {
17+
18+
@Test
19+
public void testGodiva3GetConfig() {
20+
String endpoint = TestOnLocalServer.withHttpPath("/getconfig");
21+
byte[] result =
22+
TestOnLocalServer.getContent(endpoint, HttpServletResponse.SC_OK, "application/json;charset=iso-8859-1");
23+
String jsonStr = new String(result, StandardCharsets.ISO_8859_1);
24+
assertThat(jsonStr).isEqualTo("{\"mapWidth\":1024,\"mapHeight\":512}");
25+
}
26+
}

tds/src/main/java/thredds/server/config/TdsContext.java

+3
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ public void afterPropertiesSet() {
224224
}
225225
}
226226

227+
// set configDir for use by the godiva3 config servlet
228+
servletContext.setAttribute("configDir", this.threddsDirectory.getAbsolutePath());
229+
227230
/*
228231
* places to look for catalogs ??
229232
* List<DescendantFileSource> chain = new ArrayList<>();

tds/src/main/webapp/WEB-INF/web.xml

+15
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,21 @@
132132

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

135+
<!-- godiva3 config servlet -->
136+
137+
<servlet>
138+
<servlet-name>godiva3config</servlet-name>
139+
<servlet-class>uk.ac.rdg.resc.godiva.server.ConfigServlet</servlet-class>
140+
<load-on-startup>2</load-on-startup>
141+
</servlet>
142+
143+
<servlet-mapping>
144+
<servlet-name>godiva3config</servlet-name>
145+
<url-pattern>/getconfig</url-pattern>
146+
</servlet-mapping>
147+
148+
<!-- end godiva3 config servlet -->
149+
135150
<!-- ++++++++++ Setup security restrictions ++++++++++ -->
136151
<!-- Following does not appear to work, so commented out -->
137152
<!--
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
mapHeight=512
2+
mapWidth=1024
3+
#proxy=http://proxyUrlGoesHere/
4+
# Definition of user layers
5+
# First we define a layer with ID "user"
6+
# The URL of the WMS. MANDATORY
7+
#userURL=http://wmsurl.com/with/query/separator/wms?
8+
# The Title for the layer switcher. Defaults to the ID (i.e. "user" in this case)
9+
#userTitle=My WMS Layer
10+
# The layer(s) to plot. MANDATORY
11+
#userLayers=wmslayer1,wmslayer2
12+
# The projection to use. Defaults to "CRS:84"
13+
#userProjection=EPSG:4326
14+
# The WMS version to use. Defaults to "1.1.1"
15+
#userVersion=1.3.0
16+
# The image format to use. Defaults to "image/png"
17+
#userFormat=image/png
18+
# Whether a layer should be switched on at load. Can be defined for multiple overlays, but only for one base layer
19+
#userOnByDefault=true
20+
# Whether to use as an overlay (as opposed to a base map). Defaults to false
21+
#userIsOverlay=true

0 commit comments

Comments
 (0)