Hi there,

 

I was wondering if there is an easy way to exclude a rule from the
GetLegendGraphic request?

 

In this particular case I have two rules with different scale
denominators - one for the actual data and one for the labels - and I'd
like to totally exclude the labels from the result of GetLegendGraphic.

 

SLD as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>

<StyledLayerDescriptor xmlns:xlink='http://www.w3.org/1999/xlink'
xmlns:gml='http://www.opengis.net/gml'
xmlns:ogc='http://www.opengis.net/ogc'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' version='1.0.0'
xsi:schemaLocation='http://www.opengis.net/sld
StyledLayerDescriptor.xsd' xmlns='http://www.opengis.net/sld' >

  <NamedLayer>

    <Name>Name</Name>

    <UserStyle>

      <FeatureTypeStyle>

        <Rule>

          <Title>Title</Title>

          <MaxScaleDenominator>3466752</MaxScaleDenominator>

          <PolygonSymbolizer>

            <Stroke>

              <CssParameter name="stroke" >#686868</CssParameter>

              <CssParameter name="stroke-width" >1</CssParameter>

              <CssParameter name="stroke-opacity" >0.5</CssParameter>

            </Stroke>

          </PolygonSymbolizer>

        </Rule>

        <Rule>

          <Title>Label</Title>

          <MinScaleDenominator>110000</MinScaleDenominator>

          <MaxScaleDenominator>3466752</MaxScaleDenominator>

          <TextSymbolizer>

            <Label>

              <ogc:PropertyName>label</ogc:PropertyName>

            </Label>

            <Font>

              <CssParameter name="font-family">Arimo</CssParameter>

              <CssParameter name="font-size">8</CssParameter>

              <CssParameter name="font-style">normal</CssParameter>

              <CssParameter name="font-weight">bold</CssParameter>

            </Font>

            <LabelPlacement>

              <PointPlacement>

                <AnchorPoint>

                  <AnchorPointX>0.5</AnchorPointX>

                  <AnchorPointY>0.5</AnchorPointY>

                </AnchorPoint>

                <Displacement>

                  <DisplacementX>0</DisplacementX>

                  <DisplacementY>0</DisplacementY>

                </Displacement>

              </PointPlacement>

            </LabelPlacement>

            <Halo>

              <Radius>1</Radius>

              <Fill>

                <CssParameter name="fill">#FFFFFF</CssParameter>

                <CssParameter name="fill-opacity">1</CssParameter>

              </Fill>

            </Halo>

            <Fill>

              <CssParameter name="fill">#404040</CssParameter>

            </Fill>

          </TextSymbolizer>

        </Rule>

      </FeatureTypeStyle>

    </UserStyle>

  </NamedLayer>

</StyledLayerDescriptor>

 

Cheers,

Attila

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to