Hi everyone,

I have some NetCDFs of global gridded trends. The NetCDFs have both a trend
variable and a p-value variable, and for each NetCDF I've created a layer
for each of the variables, with the intention of styling each and creating
a layer group for them.

I've already created RasterSymbolizer-based styles for the trend layers
that use colour ramps. Now I'd like to create hatching-and-outline effect
for the p-value layers, only filling those areas where the p-value is <
0.05. I could just use another colour-ramp, but I'd rather not distort the
original colours too much.

I understand that . ahatching fill is not available with the
RasterSymbolizer, but it *is* doable with a PolygonSymbolizer. According to
the YSLD reference
<http://docs.geoserver.org/stable/en/user/styling/ysld/reference/symbolizers/index.html>,
the latter can actually be applied to a raster. Sure enough, when I create
a PolygonSymbolizer style and preview the p-value, I get a big, green
square the size of the map.

But introducing a filter to select only the grid cells < 0.05 isn't
working. Here's the SLD I'm trying to use:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd";
  xmlns="http://www.opengis.net/sld"; xmlns:ogc="http://www.opengis.net/ogc";
  xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";>

  <NamedLayer>
    <Name>Statistically significant trend (p lt 0.05)</Name>
    <UserStyle>
      <Title>Statistically significant trend (p lt 0.05)</Title>
      <FeatureTypeStyle>
        <Rule>
          <Name>Stat. sig. (p &lt; 0.05)</Name>
          <ogc:Filter>
            <ogc:PropertyIsLessThanOrEqualTo>
              <ogc:PropertyName>quantity</ogc:PropertyName>
              <ogc:Literal>0.05</ogc:Literal>
            </ogc:PropertyIsLessThanOrEqualTo>
          </ogc:Filter>
          <PolygonSymbolizer>
            <Fill>
              <CssParameter name="fill">#D3FFD3</CssParameter>
              <CssParameter name="fill-opacity">0.5</CssParameter>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#6DB26D</CssParameter>
            </Stroke>
          </PolygonSymbolizer>
        </Rule>

      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

One problem could be the PropertyName value: I'm not sure whether to just
use 'quantity', or the band name (which is 'pvalue' for all of the layers I
want to use this style with) or the layer name (which varies). Or maybe
it's another problem—there are no validation errors, but the Layer Preview
gives me a broken file.

Does anyone have any thoughts on whether this is possible?

Cheers,

James
-- 
=================================================
James Goldie: PhD Student, Climate Change Research Centre
Email: j.gol...@unsw.edu.au, m...@rensa.co
Tel: +61 421 747 208
Skype: james-goldie
Web: https://rensa.co
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to