Search code examples
google-maps-api-3geoserver

One complete row of geoserver produced shapes will not label


I have a web map using the Google Maps API and GeoServer to display 7.5' Quadrangles. They are all the same shape yet a row running from north to south (St Joe to Camden, Arkansas) will not label. Except for the row in question, labels display on mouseover at zoom levels less than 10 and all will display at higher zoom levels. http://www.geology.ar.gov/geologic_maps/quad24k_map.htm

Here is my layer style...

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <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>Quad Poly With Label</Name>
      <UserStyle>
      <Title>Quad Poly With Label</Title>
      <FeatureTypeStyle>
      <Rule>          
      <Name>QuadLabel</Name>          
      <Title>Transparent Quad With Label</Title>
      <Abstract></Abstract>

      <TextSymbolizer>
        <Geometry>
          <ogc:Function name="centroid">
            <ogc:PropertyName>the_geom</ogc:PropertyName>
          </ogc:Function>
        </Geometry>
        <Label>
          <ogc:PropertyName>QUAD_NAME</ogc:PropertyName>
        </Label>                 
        <Font>
          <CssParameter name="font-family">Arial</CssParameter>
          <CssParameter name="font-size">10</CssParameter>
          <CssParameter name="font-style">normal</CssParameter>
          <CssParameter name="font-weight">bold</CssParameter>
        </Font>            
        <LabelPlacement>
          <PointPlacement>
            <AnchorPoint>
              <AnchorPointX>
                <ogc:Literal>0.5</ogc:Literal>
              </AnchorPointX>
              <AnchorPointY>
                <ogc:Literal>0.5</ogc:Literal>
              </AnchorPointY>
            </AnchorPoint>
            <Displacement>
               <DisplacementX>
                  0
               </DisplacementX>
               <DisplacementY>
                   0
               </DisplacementY>
            </Displacement>
            <Rotation>
              <ogc:Literal>0</ogc:Literal>
            </Rotation>
          </PointPlacement>
        </LabelPlacement>
        <Halo>
          <Radius>3</Radius>
          <Fill>
            <CssParameter name="fill">#FFFFFF</CssParameter>
          </Fill>
        </Halo>          
        <Fill>
          <CssParameter name="fill">#000000</CssParameter>
        </Fill>           
        <VendorOption name="conflictResolution">false</VendorOption>
        <VendorOption name="goodnessOfFit">0</VendorOption>
        <VendorOption name="autoWrap">80</VendorOption>
        <VendorOption name="maxDisplacement">25</VendorOption>             
      </TextSymbolizer>          
    </Rule>
  </FeatureTypeStyle>
</UserStyle>


Solution

  • Since you are referring to zoom levels, I guess you are using tiled rendering. Labels that cross tile boundaries are not painted, because there is no guarantee the other half will be painted. If you want to take the risk of cut labels on your map, you can ask GeoServer (since 2.6.x if memory serves me right) to paint them anyways using this vendor option: http://docs.geoserver.org/latest/en/user/styling/sld-reference/labeling.html#partials