Re: [thredds] SLD for styling THREDDS Data Server WMS service [Ticket ID: WFQ-576355]

  • To: Ethan Davis <edavis@xxxxxxxx>
  • Subject: Re: [thredds] SLD for styling THREDDS Data Server WMS service [Ticket ID: WFQ-576355]
  • From: Suman Sanjel <Suman.Sanjel@xxxxxxxxxx>
  • Date: Fri, 17 Apr 2020 06:04:59 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=icimod.org; dmarc=pass action=none header.from=icimod.org; dkim=pass header.d=icimod.org; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=leMjA4P1yN4et5x/+9Ojh1wbuBOa2btcXi2GOzs6l14=; b=aNqU5/EgC4920jG/ufOImoSS2AE30DF8E1cGJoV+Abh2KtHpl7oXTRYvFIAVbbmCPQQVmSoUU+9x3nNVfof+N/1ZbeLJeU4w+iXCZmAs3onn1ixq2Kv7aGPY/ANZGfk2NAaKCLUaLxz8Iu/jdkDHRkVVujmrhkyLC9U2dIxTVR9YZPItKmqTwYDs6bsA/y34M/SjxT6Y2Y/36C2/gBUTcrmqpAheBEJLXLDS1hoB4uPHKdiFtwtb0Fr2Vq1s4Nblu4DtyE2cbG1vxnQ162FEypo2ZrGcGxunAnanbDORgILq3ewiLmx8V5Nab+zUq78ynIBa07uQys1rpZbTddWNZg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=adTxZuSSqU/9sjb4TYGhc8OBa0v3/TcGTVmko7LGcxfw+tqQ566WTt37xfu7i0Xn7+IDOdaNAuK2OQYrZier+t0E3YADkdT2HVNGnJCTZ6fWw5HH6oG+phby8Yf1bw5uG1nFjAJjkd4Al//vcwycyN2/o+uzDvTXC0lPPG1eurN2mVJT+jEWZfwjFDt8F4ocWn8TdLbE7UMIEEJz5Jme5X5PG8e+vmi2W9Bcy11ssohQaiq84QeuaW7UDPLS2g/LHcrePcC2AP59UHqMrlhc1a0ZYmigKLL+Z0T5p6lD2j1ggLXBU+uCA407VAkPA7OnYKyDH/MPZd0HdAM09e4V5Q==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Suman.Sanjel@xxxxxxxxxx;
Hello Ethan,

I would like to thank you so much for this kind support. Yes, It works when I 
used that .war file  and  strip ‘\n’ from SLD  before including it in WMS 
request.

Cheers,

Suman Sanjel

From: Ethan Davis [mailto:edavis@xxxxxxxx]
Sent: Tuesday, April 14, 2020 11:07 PM
To: Suman Sanjel
Cc: thredds@xxxxxxxxxxxxxxxx
Subject: Re: [thredds] SLD for styling THREDDS Data Server WMS service

[Image removed by sender.] 
tds-5.0.0-SNAPSHOT.war<https://drive.google.com/a/ucar.edu/file/d/1vsaDxcwVl3u3-3u4t1z96dVBZSDdtfE5/view?usp=drive_web>[Image
 removed by sender.]

Hello Suman,


I have a fix for TDS 5.0 (PR #73<https://github.com/Unidata/tds/pull/73>) to 
allow the SLD parameter for WMS GetLegendGraphic requests. It should get folded 
in soon and will then be in future releases and snapshots of TDS 5.0. In the 
meantime, if you want to test it out, I am including a .war file you can try. 
For now you will need to strip the content of the SLD parameter of all line 
feeds (‘\n’) before including it in the WMS request. Otherwise, it will get 
rejected.


Support for SLD was not added to ncWMS (the WMS implementation used in TDS) 
until version 2.x which we use in TDS 5.0. TDS 4.6 uses ncWMS 1.x which does 
not support SLD styling.


Let me know how that works for you.


Cheers,


Ethan


PS Don’t forget to rename the .war file to `thredds.war` so a standard install 
will be accessible at /thredds.


On Mon, Apr 6, 2020 at 11:03 PM Ethan Davis 
<edavis@xxxxxxxx<mailto:edavis@xxxxxxxx>> wrote:
Hi Suman,

It looks like a filter on request parameters is causing problems with the SLD 
parameter. I am digging into this and will get back to you in the next day or 
so.

Cheers,

Ethan

On Wed, Apr 1, 2020 at 6:28 AM Suman Sanjel 
<Suman.Sanjel@xxxxxxxxxx<mailto:Suman.Sanjel@xxxxxxxxxx>> wrote:
Dear THREDDS Data Server Team,



It's great to use THREDDS Data Server where we get lots of facilities.



My query is that i like to style WMS of TDS using SLD. I have tried different 
way but it did not work.

The version which i am using is 4.6 and 5 beta version.





http://localhost:8080/thredds/wms/testAll/2004050300_eta_211.nc?REQUEST=GetLegendGraphic&LAYER=Z_sfc&SLD=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22ISO-8859-1%22%3F%3E%0A%3CStyledLayerDescriptor%20version%3D%221.1.0%22%20xsi%3AschemaLocation%3D%22http%3A%2F%2Fwww.opengis.net%2Fsld%0AStyledLayerDescriptor.xsd%22%20xmlns%3D%22http%3A%2F%2Fwww.opengis.net%2Fsld%22%20xmlns%3Aogc%3D%22http%3A%2F%2Fwww.opengis.net%2Fogc%22%0Axmlns%3Ase%3D%22http%3A%2F%2Fwww.opengis.net%2Fse%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%0Axmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22%3E%0A%20%20%3CNamedLayer%3E%0A%20%20%20%20%3Cse%3AName%3EZ_sfc%3C%2Fse%3AName%3E%0A%20%20%20%20%3CUserStyle%3E%0A%20%20%20%20%20%20%3Cse%3AName%3EThesholded%20colour%20scheme%3C%2Fse%3AName%3E%0A%20%20%20%20%20%20%3Cse%3ACoverageStyle%3E%0A%20%20%20%20%20%20%20%20%3Cse%3ARule%3E%0A%20%20%20%20%20%20%20%20%20%20%3Cse%3ARasterSymbolizer%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AOpacity%3E1.0%3C%2Fse%3AOpacity%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AColorMap%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3ACategorize%20fallbackValue%3D%22%2300000000%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3ALookupValue%3ERasterdata%3C%2Fse%3ALookupValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AValue%3E%23FF0000FF%3C%2Fse%3AValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AThreshold%3E275.0%3C%2Fse%3AThreshold%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AValue%3E%23FF00FFFF%3C%2Fse%3AValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AThreshold%3E280.0%3C%2Fse%3AThreshold%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AValue%3E%23FF00FF00%3C%2Fse%3AValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AThreshold%3E285.0%3C%2Fse%3AThreshold%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AValue%3E%23FFFFFF00%3C%2Fse%3AValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AThreshold%3E290.0%3C%2Fse%3AThreshold%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AValue%3E%23FFFFC800%3C%2Fse%3AValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AThreshold%3E295.0%3C%2Fse%3AThreshold%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AValue%3E%23FFFFAFAF%3C%2Fse%3AValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AThreshold%3E300.0%3C%2Fse%3AThreshold%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AValue%3E%23FFFF0000%3C%2Fse%3AValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fse%3ACategorize%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fse%3AColorMap%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2Fse%3ARasterSymbolizer%3E%0A%20%20%20%20%20%20%20%20%3C%2Fse%3ARule%3E%0A%20%20%20%20%20%20%3C%2Fse%3ACoverageStyle%3E%0A%20%20%20%20%3C%2FUserStyle%3E%0A%20%20%3C%2FNamedLayer%3E%0A%3C%2FStyledLayerDescriptor%3E<http://localhost:8080/thredds/wms/testAll/2004050300_eta_211.nc?REQUEST=GetLegendGraphic&LAYER=Z_sfc&SLD=%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22ISO-8859-1%22%3F%3E%0A%3CStyledLayerDescriptor%20version%3D%221.1.0%22%20xsi%3AschemaLocation%3D%22http%3A%2F%2Fwww.opengis.net%2Fsld%0AStyledLayerDescriptor.xsd%22%20xmlns%3D%22http%3A%2F%2Fwww.opengis.net%2Fsld%22%20xmlns%3Aogc%3D%22http%3A%2F%2Fwww.opengis.net%2Fogc%22%0Axmlns%3Ase%3D%22http%3A%2F%2Fwww.opengis.net%2Fse%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%0Axmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance%22%3E%0A%20%20%3CNamedLayer%3E%0A%20%20%20%20%3Cse%3AName%3EZ_sfc%3C%2Fse%3AName%3E%0A%20%20%20%20%3CUserStyle%3E%0A%20%20%20%20%20%20%3Cse%3AName%3EThesholded%20colour%20scheme%3C%2Fse%3AName%3E%0A%20%20%20%20%20%20%3Cse%3ACoverageStyle%3E%0A%20%20%20%20%20%20%20%20%3Cse%3ARule%3E%0A%20%20%20%20%20%20%20%20%20%20%3Cse%3ARasterSymbolizer%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AOpacity%3E1.0%3C%2Fse%3AOpacity%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AColorMap%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3ACategorize%20fallbackValue%3D%22%2300000000%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3ALookupValue%3ERasterdata%3C%2Fse%3ALookupValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AValue%3E%23FF0000FF%3C%2Fse%3AValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AThreshold%3E275.0%3C%2Fse%3AThreshold%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AValue%3E%23FF00FFFF%3C%2Fse%3AValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AThreshold%3E280.0%3C%2Fse%3AThreshold%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AValue%3E%23FF00FF00%3C%2Fse%3AValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AThreshold%3E285.0%3C%2Fse%3AThreshold%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AValue%3E%23FFFFFF00%3C%2Fse%3AValue%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cse%3AThreshold%3E290.0%3C%2Fse%3AThresh>

when i pass this it response is


<!doctype html>
<html lang="en">

<head>
    <title>HTTP Status 400 – Bad Request</title>
    <style type="text/css">
        body {
            font-family: Tahoma, Arial, sans-serif;
        }

        h1,
        h2,
        h3,
        b {
            color: white;
            background-color: #525D76;
        }

        h1 {
            font-size: 22px;
        }

        h2 {
            font-size: 16px;
        }

        h3 {
            font-size: 14px;
        }

        p {
            font-size: 12px;
        }

        a {
            color: black;
        }

        .line {
            height: 1px;
            background-color: #525D76;
            border: none;
        }
    </style>
</head>

<body>
    <h1>HTTP Status 400 – Bad Request</h1>
    <hr class="line" />
    <p><b>Type</b> Status Report</p>
    <p><b>Message</b> Invalid query string </p>
    <p><b>Description</b> The server cannot or will not process the request due 
to something that is perceived to be a
        client error (e.g., malformed request syntax, invalid request message 
framing, or deceptive request routing).
    </p>
    <hr class="line" />
    <h3>Apache Tomcat/9.0.30</h3>
</body>
</html>


The version used in this is TDS 5 beta version

The plain SLD used is

<?xml version="1.0" encoding="ISO-8859-1"?> <StyledLayerDescriptor 
version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld 
StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld"; 
xmlns:ogc="http://www.opengis.net/ogc"; xmlns:se="http://www.opengis.net/se"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> <NamedLayer> 
<se:Name>Z_sfc</se:Name> <UserStyle> <se:Name>Thesholded colour 
scheme</se:Name> <se:CoverageStyle> <se:Rule> <se:RasterSymbolizer> 
<se:Opacity>1.0</se:Opacity> <se:ColorMap> <se:Categorize 
fallbackValue="#00000000"> <se:LookupValue>Rasterdata</se:LookupValue> 
<se:Value>#FF0000FF</se:Value> <se:Threshold>275.0</se:Threshold> 
<se:Value>#FF00FFFF</se:Value> <se:Threshold>280.0</se:Threshold> 
<se:Value>#FF00FF00</se:Value> <se:Threshold>285.0</se:Threshold> 
<se:Value>#FFFFFF00</se:Value> <se:Threshold>290.0</se:Threshold> 
<se:Value>#FFFFC800</se:Value> <se:Threshold>295.0</se:Threshold> 
<se:Value>#FFFFAFAF</se:Value> <se:Threshold>300.0</se:Threshold> 
<se:Value>#FFFF0000</se:Value> </se:Categorize> </se:ColorMap> 
</se:RasterSymbolizer> </se:Rule> </se:CoverageStyle> </UserStyle> 
</NamedLayer> </StyledLayerDescriptor>


I am getting this trouble from a long  time please help me how to use SLD in 
TDS.



Thank You.
Suman Sanjel

---------------------------------------------------------------------------
[icimod blue png logo]

Suman Sanjel
GIS Application Developer
Geospatial Solutions

International Centre for Integrated Mountain Development
GPO Box 3226, Kathmandu, Nepal.
T +977-1-5275222  ext 531   |   W www.icimod.org<http://www.icimod.org/>
Connect to ICIMOD:
[facebook-logo-button]<http://www.facebook.com/icimod>   [twitter-logo-button] 
<http://www.twitter.com/icimod>    [instagram] 
<http://www.instagram.com/_icimod>    [youtube-logotype] 
<http://www.youtube.com/icimod>    [linkedin] 
<https://www.linkedin.com/company/icimod>
---------------------------------------------------------------------------
Protect the pulse.



This email and any file(s) transmitted with it may be confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error please notify the sender immediately or 
delete it from the system. Please note that any views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of ICIMOD. ICIMOD has its own antivirus program which scans all the 
outgoing emails. However, ICIMOD accepts no liability and responsibility for 
any damage caused by this email.

_______________________________________________
NOTE: All exchanges posted to Unidata maintained email lists are
recorded in the Unidata inquiry tracking system and made publicly
available through the web.  Users who post to any of the lists we
maintain are reminded to remove any personal information that they
do not want to be made public.


thredds mailing list
thredds@xxxxxxxxxxxxxxxx<mailto:thredds@xxxxxxxxxxxxxxxx>
For list information or to unsubscribe,  visit: 
https://www.unidata.ucar.edu/mailing_lists/

This email and any file(s) transmitted with it may be confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this email in error please notify the sender immediately or 
delete it from the system. Please note that any views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of ICIMOD. ICIMOD has its own antivirus program which scans all the 
outgoing emails. However, ICIMOD accepts no liability and responsibility for 
any damage caused by this email.

JPEG image

PNG image

PNG image

PNG image

PNG image

PNG image

PNG image

  • 2020 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the thredds archives: