1 votos

¿Cómo ocultar la etiqueta cuando "count" es igual a 1 en pointstacker?

¿Existe una manera de ocultar las etiquetas cuando el valor del "recuento" es 1 (uno), utilizando pointstacker?

"count" = <ogc:PropertyName>count</ogc:PropertyName>

enter image description here

Código SLD:

<?xml version="1.0" encoding="utf-8"?>
<StyledLayerDescriptor version="1.0.0"
 xsi:schemaLocation="http://www.opengis.net/sld 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>Pontos de Ônibus</Name>
    <UserStyle>
      <Title>Pontos Empilhados</Title>
      <FeatureTypeStyle>
        <Transformation>
          <ogc:Function name="vec:PointStacker">
            <ogc:Function name="parameter">
              <ogc:Literal>data</ogc:Literal>
            </ogc:Function>
            <ogc:Function name="parameter">
              <ogc:Literal>cellSize</ogc:Literal>
              <ogc:Literal>100</ogc:Literal>
            </ogc:Function>
            <ogc:Function name="parameter">
              <ogc:Literal>outputBBOX</ogc:Literal>
              <ogc:Function name="env">
                <ogc:Literal>wms_bbox</ogc:Literal>
              </ogc:Function>
            </ogc:Function>
            <ogc:Function name="parameter">
              <ogc:Literal>outputWidth</ogc:Literal>
              <ogc:Function name="env">
                <ogc:Literal>wms_width</ogc:Literal>
              </ogc:Function>
            </ogc:Function>
            <ogc:Function name="parameter">
              <ogc:Literal>outputHeight</ogc:Literal>
              <ogc:Function name="env">
                <ogc:Literal>wms_height</ogc:Literal>
              </ogc:Function>
            </ogc:Function>
          </ogc:Function>
        </Transformation>
        <Rule>
          <Name>Pontos de Ônibus</Name>
          <Title>Ícone SVG</Title>
          <PointSymbolizer>
            <Graphic>
             <ExternalGraphic>
              <OnlineResource xlink:type="simple" xlink:href="v1.1_pontos.svg" />
              <Format>image/svg</Format>
             </ExternalGraphic>
             <Size>
              <ogc:Literal>30</ogc:Literal>
             </Size>
           </Graphic>
          </PointSymbolizer>
          <TextSymbolizer>
            <Label>
             <ogc:PropertyName>count</ogc:PropertyName>
            </Label>
            <Font>
              <CssParameter name="font-family">Arial</CssParameter>
              <CssParameter name="font-size">12</CssParameter>
              <CssParameter name="font-weight">bold</CssParameter>
            </Font>
            <LabelPlacement>
              <PointPlacement>
                <AnchorPoint>
                  <AnchorPointX>0.5</AnchorPointX>
                  <AnchorPointY>0.8</AnchorPointY>
                </AnchorPoint>
              </PointPlacement>
            </LabelPlacement>
            <Stroke>
              <CssParameter name="stroke">#ffffff</CssParameter>
            </Stroke>
            <Halo>
               <Radius>1.5</Radius>
               <Fill>
                 <CssParameter name="fill">#000000</CssParameter>
               </Fill>
            </Halo>
             <Fill>
               <CssParameter name="fill">#ffffff</CssParameter>
             </Fill>
          </TextSymbolizer>   
         </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

3voto

user2831 Puntos 11

Utilice dos reglas, añada un filtro en el campo de recuento para la segunda.

No está probado, pero es algo así:

<?xml version="1.0" encoding="utf-8"?>
<StyledLayerDescriptor version="1.0.0"
 xsi:schemaLocation="http://www.opengis.net/sld 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>Pontos de Ônibus</Name>
    <UserStyle>
      <Title>Pontos Empilhados</Title>
      <FeatureTypeStyle>
        <Transformation>
          <ogc:Function name="vec:PointStacker">
            <ogc:Function name="parameter">
              <ogc:Literal>data</ogc:Literal>
            </ogc:Function>
            <ogc:Function name="parameter">
              <ogc:Literal>cellSize</ogc:Literal>
              <ogc:Literal>100</ogc:Literal>
            </ogc:Function>
            <ogc:Function name="parameter">
              <ogc:Literal>outputBBOX</ogc:Literal>
              <ogc:Function name="env">
                <ogc:Literal>wms_bbox</ogc:Literal>
              </ogc:Function>
            </ogc:Function>
            <ogc:Function name="parameter">
              <ogc:Literal>outputWidth</ogc:Literal>
              <ogc:Function name="env">
                <ogc:Literal>wms_width</ogc:Literal>
              </ogc:Function>
            </ogc:Function>
            <ogc:Function name="parameter">
              <ogc:Literal>outputHeight</ogc:Literal>
              <ogc:Function name="env">
                <ogc:Literal>wms_height</ogc:Literal>
              </ogc:Function>
            </ogc:Function>
          </ogc:Function>
        </Transformation>
        <Rule>
          <Name>Pontos de Ônibus</Name>
          <Title>Ícone SVG</Title>
          <PointSymbolizer>
            <Graphic>
             <ExternalGraphic>
              <OnlineResource xlink:type="simple" xlink:href="v1.1_pontos.svg" />
              <Format>image/svg</Format>
             </ExternalGraphic>
             <Size>
              <ogc:Literal>30</ogc:Literal>
             </Size>
           </Graphic>
          </PointSymbolizer>
        </Rule>
        <Rule>
          <ogc:Filter>
             <ogc:PropertyIsGreaterThan>
                <ogc:PropertyName>count</ogc:PropertyName>
                <ogc:Literal>1</ogc:Literal> 
             </ogc:PropertyIsGreaterThan>
          </ogc:Filter>

          <TextSymbolizer>
            <Label>
             <ogc:PropertyName>count</ogc:PropertyName>
            </Label>
            <Font>
              <CssParameter name="font-family">Arial</CssParameter>
              <CssParameter name="font-size">12</CssParameter>
              <CssParameter name="font-weight">bold</CssParameter>
            </Font>
            <LabelPlacement>
              <PointPlacement>
                <AnchorPoint>
                  <AnchorPointX>0.5</AnchorPointX>
                  <AnchorPointY>0.8</AnchorPointY>
                </AnchorPoint>
              </PointPlacement>
            </LabelPlacement>
            <Stroke>
              <CssParameter name="stroke">#ffffff</CssParameter>
            </Stroke>
            <Halo>
               <Radius>1.5</Radius>
               <Fill>
                 <CssParameter name="fill">#000000</CssParameter>
               </Fill>
            </Halo>
             <Fill>
               <CssParameter name="fill">#ffffff</CssParameter>
             </Fill>
          </TextSymbolizer>   
         </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

i-Ciencias.com

I-Ciencias es una comunidad de estudiantes y amantes de la ciencia en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros usuarios, hacer tus propias preguntas o resolver las de los demás.

Powered by:

X