[Geoserver-users] SLD Offset

This is my Custom SLD I am having trouble setting the label offset i want to set a text offset for my ADDR field the ADDR and square icon are together i would like to have a few pixels of space to seperate them can some one please help with the schema.

Thanks,
Chris

<?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&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:xlink="http://www.w3.org/1999/xlink&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
<NamedLayer>
    <Name>Buildings</Name>
    <UserStyle>
      <Name>Buildings_style</Name>
      <Title>geoserver style</Title>
      <Abstract>Generated by GeoServer</Abstract>
      <FeatureTypeStyle>
      <Rule>
        <PointSymbolizer>
          <Graphic>
  <Mark>
    <WellKnownName>square</WellKnownName>
          <Fill>
            <CssParameter name="fill">#FF0000</CssParameter>
            <CssParameter name="fill-opacity">1</CssParameter>
          </Fill>
  </Mark>
  <Opacity>1</Opacity>
  <Size>6</Size>
</Graphic>

        </PointSymbolizer>
        <TextSymbolizer>
          <Label>
            <ogc:PropertyName>ADDR</ogc:PropertyName>
          </Label>
            <Font>
              <CssParameter name="font-family">Times New Roman</CssParameter>
              <CssParameter name="font-style">Normal</CssParameter>
              <CssParameter name="font-size">12</CssParameter>
            </Font>
          <Fill>
            <CssParameter name="fill">#000033</CssParameter>
            <CssParameter name="fill-opacity">1</CssParameter>
          </Fill>
        </TextSymbolizer>
      </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>

Chris @ Powerhouse Technology Group ha scritto:

This is my Custom SLD I am having trouble setting the label offset i want to set a text offset for my ADDR field the ADDR and square icon are together i would like to have a few pixels of space to seperate them can some one please help with the schema.

You can use the label displacement, as with this example:

<TextSymbolizer>
   <Label>
     <ogc:PropertyName>CITY_NAME</ogc:PropertyName>
   </Label>
     <Font>
       <CssParameter name="font-family">Arial</CssParameter>
       <CssParameter name="font-style">Normal</CssParameter>
       <CssParameter name="font-size">16</CssParameter>
     </Font>
   <LabelPlacement>
     <PointPlacement>
       <Displacement>
         <DisplacementX>10</DisplacementX>
         <DisplacementY>0</DisplacementY>
       </Displacement>
     </PointPlacement>
   </LabelPlacement>
   <Fill>
     <CssParameter name="fill">#000000</CssParameter>
     <CssParameter name="fill-opacity">1</CssParameter>
   </Fill>
</TextSymbolizer>

For more information, see the SLD 1.0 spec at:
http://portal.opengeospatial.org/files/?artifact_id=1188
and the SLD 1.0 xml schemas at:
http://schemas.opengis.net/sld/1.0.0/

Cheers
Andrea