Thinking...

it might work if you use the sld:ChannelSelection.

Something like:

<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld";
xmlns:sld="http://www.opengis.net/sld";
xmlns:ogc="http://www.opengis.net/ogc";
xmlns:gml="http://www.opengis.net/gml"; version="1.0.0">
  <sld:NamedLayer>
    <sld:Name>ncep_air_temperature_current_month_forecast_average</sld:Name>
    <sld:UserStyle>
      <sld:Name>ncep_air_temperature_current_month_forecast_average</sld:Name>
      <sld:Title>ncep_air_temperature_current_month_forecast_average</sld:Title>
      <sld:FeatureTypeStyle>
        <sld:Name>name</sld:Name>
        <sld:Rule>
          <sld:RasterSymbolizer>
            <ChannelSelection>
              <GrayChannel>
                <SourceChannelName>1</SourceChannelName>
                  <ContrastEnhancement>
                     <Histogram/>
                  </ContrastEnhancement>
               </GrayChannel>
            </ChannelSelection>
            <ColorMap>
              <ColorMapEntry quantity='-50' label='-50 ºC' color='#3B4CC0' />
              <ColorMapEntry quantity="-30" label="-30 ºC" color="#3B4CC0" />
              <ColorMapEntry quantity="28.125" label="28.125 ºC"
color="#C0282F" />
              <ColorMapEntry quantity="30" label="30 ºC" color="#B4426" />
            </ColorMap>
          </sld:RasterSymbolizer>
        </sld:Rule>
      </sld:FeatureTypeStyle>
    </sld:UserStyle>
  </sld:NamedLayer>
</sld:StyledLayerDescriptor>

Mind you, I have not tried it.

Regards,
Simone Giannecchini
==
GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information.
==
Ing. Simone Giannecchini
@simogeo
Founder/Director

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:     +39 0584 1660272
mob:   +39  333 8128928

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate.
Il loro utilizzo è consentito esclusivamente al destinatario del
messaggio, per le finalità indicate nel messaggio stesso. Qualora
riceviate questo messaggio senza esserne il destinatario, Vi preghiamo
cortesemente di darcene notizia via e-mail e di procedere alla
distruzione del messaggio stesso, cancellandolo dal Vostro sistema.
Conservare il messaggio stesso, divulgarlo anche in parte,
distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità
diverse, costituisce comportamento contrario ai principi dettati dal
D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely
for the attention and use of the named addressee(s) and may be
confidential or proprietary in nature or covered by the provisions of
privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New
Data Protection Code).Any use not in accord with its purpose, any
disclosure, reproduction, copying, distribution, or either
dissemination, either whole or partial, is strictly forbidden except
previous formal approval of the named addressee(s). If you are not the
intended recipient, please contact immediately the sender by
telephone, fax or e-mail and delete the information in this message
that has been received in error. The sender does not give any warranty
or accept liability as the content, accuracy or completeness of sent
messages and accepts no responsibility  for changes made after they
were sent or for other risks which arise as a result of e-mail
transmission, viruses, etc.


On Thu, Jan 21, 2016 at 8:55 PM, Bruce Crevensten
<becrevens...@alaska.edu> wrote:
> Hi!  I've got a question about using the RasterSymbolizer in and SLD.  Is it
> possible to use both a ColorMap as well as the ContrastEnhancement feature
> at the same time?  When I try to combine both, I get a validation error (and
> no images are generated via WMS requests) but I'm unsure exactly what the
> error means.
>
> The underlying dataset in this case is a GeoTIFF where pixels contain
> temperature values.
>
> The SLD that is working is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld";
> xmlns:sld="http://www.opengis.net/sld";
> xmlns:ogc="http://www.opengis.net/ogc";
> xmlns:gml="http://www.opengis.net/gml"; version="1.0.0">
>   <sld:NamedLayer>
>     <sld:Name>ncep_air_temperature_current_month_forecast_average</sld:Name>
>     <sld:UserStyle>
>
> <sld:Name>ncep_air_temperature_current_month_forecast_average</sld:Name>
>
> <sld:Title>ncep_air_temperature_current_month_forecast_average</sld:Title>
>       <sld:FeatureTypeStyle>
>         <sld:Name>name</sld:Name>
>         <sld:Rule>
>           <sld:RasterSymbolizer>
>             <ColorMap>
>               <ColorMapEntry quantity='-50' label='-50 ºC' color='#3B4CC0'
> />
>               <ColorMapEntry quantity="-30" label="-30 ºC" color="#3B4CC0"
> />
>                (... snipping many other values ...)
>               <ColorMapEntry quantity="28.125" label="28.125 ºC"
> color="#C0282F" />
>               <ColorMapEntry quantity="30" label="30 ºC" color="#B4426" />
>             </ColorMap>
>           </sld:RasterSymbolizer>
>         </sld:Rule>
>       </sld:FeatureTypeStyle>
>     </sld:UserStyle>
>   </sld:NamedLayer>
> </sld:StyledLayerDescriptor>
>
> What I'd like to try out is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld";
> xmlns:sld="http://www.opengis.net/sld";
> xmlns:ogc="http://www.opengis.net/ogc";
> xmlns:gml="http://www.opengis.net/gml"; version="1.0.0">
>   <sld:NamedLayer>
>     <sld:Name>ncep_air_temperature_current_month_forecast_average</sld:Name>
>     <sld:UserStyle>
>
> <sld:Name>ncep_air_temperature_current_month_forecast_average</sld:Name>
>
> <sld:Title>ncep_air_temperature_current_month_forecast_average</sld:Title>
>       <sld:FeatureTypeStyle>
>         <sld:Name>name</sld:Name>
>         <sld:Rule>
>           <sld:RasterSymbolizer>
>             <ContrastEnhancement>
>               <Histogram/>
>             </ContrastEnhancement>
>             <ColorMap>
>               <ColorMapEntry quantity='-50' label='-50 ºC' color='#3B4CC0'
> />
>               <ColorMapEntry quantity="-30" label="-30 ºC" color="#3B4CC0"
> />
>               (... snip many other entries...)
>               <ColorMapEntry quantity="28.125" label="28.125 ºC"
> color="#C0282F" />
>               <ColorMapEntry quantity="30" label="30 ºC" color="#B4426" />
>             </ColorMap>
>           </sld:RasterSymbolizer>
>         </sld:Rule>
>       </sld:FeatureTypeStyle>
>     </sld:UserStyle>
>   </sld:NamedLayer>
> </sld:StyledLayerDescriptor>
>
> When I try this, I get this validation error:
>
> line 15: cvc-complex-type.2.4.a: Invalid content was found starting with
> element 'ColorMap'. One of '{"http://www.opengis.net/sld":ShadedRelief,
> "http://www.opengis.net/sld":ImageOutline}' is expected.
>
> I can understand that an explicit color map along with a histogram may not
> make sense, but wanted to give it a try and wasn't quite sure how to
> interpret this error message.
>
> Relevant version information:
>
> Geoserver Version - 2.7-SNAPSHOT
> Git Revision - 98c8cdc76eaca4d97043edbe2590927dd12fc4a8
> Build Date - 04-Oct-2015 13:52
> GeoTools Version - 13-SNAPSHOT (rev
> c93ba46e2f17bc598279d80722b66d14f7877fe7)
> GeoWebCache Version - 1.7-SNAPSHOT (rev
> 00c39227c0fb6d9a7d0b347ae4875dad457de69b/00c39227c0fb6d9a7d0b347ae4875dad457de69b)
>
> --
> Bruce Crevensten
>
> Senior Software Engineer
> (SNAP) Scenarios Network for Alaska & Arctic Planning
> www.snap.uaf.edu
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to