hi,

i'm using the Recode transformation function in SLDs w/ GeoServer 2.8.5
and GeoTools 14.5.

i was wondering though what would be the most elegant way for catering
for input values _other_ than those specified w/in the parameters of the
function?

i was able to achieve this by having 2 Rules like so:

<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld";
    xmlns:sld="http://www.opengis.net/sld";
    xmlns:gml="http://www.opengis.net/gml";
    xmlns:ogc="http://www.opengis.net/ogc"; version="1.0.0">
  <sld:NamedLayer>
    <sld:Name>P2307937L1T2</sld:Name>
    <sld:UserStyle>
      <sld:Name>P2307937L1T2</sld:Name>
      <sld:FeatureTypeStyle>
        <sld:Name>name</sld:Name>
        <sld:Rule>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:Function name="in">
                <ogc:PropertyName>C9</ogc:PropertyName>
                <ogc:Literal>4</ogc:Literal>
                <ogc:Literal>5</ogc:Literal>
...
                <ogc:Literal>10</ogc:Literal>
              </ogc:Function>
              <ogc:Literal>true</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>

          <sld:PointSymbolizer>
            <sld:Graphic>
              <sld:Mark>
                <sld:WellKnownName>triangle</sld:WellKnownName>
                <sld:Fill>
                  <sld:CssParameter name="fill">
                    <ogc:Function name="Recode">
                      <ogc:PropertyName>C9</ogc:PropertyName>
                      <ogc:Literal>4</ogc:Literal>
                      <ogc:Literal>#FF9900</ogc:Literal>
                      <ogc:Literal>5</ogc:Literal>
                      <ogc:Literal>#CC9933</ogc:Literal>
...
                      <ogc:Literal>10</ogc:Literal>
                      <ogc:Literal>#FFFF00</ogc:Literal>
                    </ogc:Function>
                  </sld:CssParameter>
                </sld:Fill>
                <sld:Stroke>...</sld:Stroke>
              </sld:Mark>
              <sld:Size>10.0</sld:Size>
            </sld:Graphic>
          </sld:PointSymbolizer>
        </sld:Rule>
        <sld:Rule>
          <ogc:ElseFilter/>
          <sld:PointSymbolizer>...</sld:PointSymbolizer>
        </sld:Rule>
      </sld:FeatureTypeStyle>
    </sld:UserStyle>
  </sld:NamedLayer>
</sld:StyledLayerDescriptor>

is there a better way to do this?


TIA + cheers;
rsn

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to