Skip to content

Commit

Permalink
Update example wmsConfig files and extend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lesserwhirls committed Dec 16, 2024
1 parent f59056a commit 31d9c34
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
10 changes: 9 additions & 1 deletion tds/src/main/webapp/WEB-INF/altContent/startup/wmsConfig.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wmsConfig SYSTEM "https://schemas.unidata.ucar.edu/thredds/dtd/ncwms/wmsConfig.dtd">
<!DOCTYPE wmsConfig SYSTEM "https://schemas.unidata.ucar.edu/thredds/dtd/ncwms/wmsConfig_2_0.dtd">
<!--
Detailed configuration of the WMS service. This config file can be used to
set default styling parameters for each dataset/variable, and to enable or disable
Expand All @@ -12,6 +12,10 @@ the GetFeatureInfo operation.
<!-- The global defaults. All elements are mandatory -->
<allowFeatureInfo>true</allowFeatureInfo>
<defaultColorScaleRange>-50 50</defaultColorScaleRange>
<defaultAboveMaxColor>#000000</defaultAboveMaxColor>
<defaultBelowMinColor>#000000</defaultBelowMinColor>
<defaultNoDataColor>extend</defaultNoDataColor>
<defaultOpacity>100</defaultOpacity>
<defaultPaletteName>psu-viridis</defaultPaletteName>
<defaultNumColorBands>20</defaultNumColorBands>
<logScaling>false</logScaling>
Expand Down Expand Up @@ -46,6 +50,10 @@ the GetFeatureInfo operation.
This is the most specific setting and will override any others -->
<variable id="Z_sfc">
<defaultColorScaleRange>0 2920</defaultColorScaleRange>
<defaultAboveMaxColor>extend</defaultAboveMaxColor>
<defaultBelowMinColor>#0000ff</defaultBelowMinColor>
<defaultNoDataColor>transparent</defaultNoDataColor>
<defaultOpacity>95</defaultOpacity>
</variable>
</variables>
</datasetPath>
Expand Down
10 changes: 9 additions & 1 deletion tds/src/test/content/thredds/wmsConfig.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wmsConfig SYSTEM "https://schemas.unidata.ucar.edu/thredds/dtd/ncwms/wmsConfig.dtd">
<!DOCTYPE wmsConfig SYSTEM "https://schemas.unidata.ucar.edu/thredds/dtd/ncwms/wmsConfig_2_0.dtd">
<!--
Detailed configuration of the WMS service. This config file can be used to
set default styling parameters for each dataset/variable, and to enable or disable
Expand All @@ -12,6 +12,10 @@ the GetFeatureInfo operation.
<!-- The global defaults. All elements are mandatory -->
<allowFeatureInfo>true</allowFeatureInfo>
<defaultColorScaleRange>-50 50</defaultColorScaleRange>
<defaultAboveMaxColor>#000000</defaultAboveMaxColor>
<defaultBelowMinColor>#000000</defaultBelowMinColor>
<defaultNoDataColor>extend</defaultNoDataColor>
<defaultOpacity>100</defaultOpacity>
<defaultPaletteName>psu-viridis</defaultPaletteName>
<defaultNumColorBands>20</defaultNumColorBands>
<logScaling>false</logScaling>
Expand Down Expand Up @@ -45,6 +49,10 @@ the GetFeatureInfo operation.
This is the most specific setting and will override any others -->
<variable id="Z_sfc">
<defaultColorScaleRange>0 2920</defaultColorScaleRange>
<defaultAboveMaxColor>extend</defaultAboveMaxColor>
<defaultBelowMinColor>#0000ff</defaultBelowMinColor>
<defaultNoDataColor>transparent</defaultNoDataColor>
<defaultOpacity>95</defaultOpacity>
</variable>
</variables>
</datasetPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import uk.ac.rdg.resc.edal.metadata.VariableMetadata;
import uk.ac.rdg.resc.edal.util.Extents;

import java.awt.Color;
import java.io.IOException;

import static com.google.common.truth.Truth.assertThat;
Expand Down Expand Up @@ -156,6 +157,10 @@ public void testSettingsPathVarStandardNameMatch() throws IOException {
assertThat(settings.getDefaultPaletteName()).isEqualTo("x-Occam");
assertThat(settings.isAllowFeatureInfo()).isFalse();
assertThat(settings.getDefaultColorScaleRange()).isEqualTo(Extents.newExtent(0.0f, 2920.0f));
assertThat(settings.getDefaultAboveMaxColor()).isEqualTo(Color.BLACK);
assertThat(settings.getDefaultBelowMinColor()).isEqualTo(Color.BLUE);
assertThat(settings.getDefaultNoDataColor()).isEqualTo(new Color(0, 0, 0, 0));
assertThat(settings.getDefaultOpacity()).isWithin(0.01f).of(95.0f);
}

@AfterClass
Expand Down

0 comments on commit 31d9c34

Please sign in to comment.