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

Reply via email to