A single polygon symbolizer can only do a uniform fill, but two
superimposed with different offsets can achieve what you want (small border
stroke added
cause I wanted to see where the polygon borders were):

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
                       xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/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>checkers</Name>
    <UserStyle>
      <Title>A red polygon style</Title>
      <FeatureTypeStyle>
        <Rule>
          <Title>red polygon</Title>
          <PolygonSymbolizer>
            <Fill>
              <GraphicFill>
                <Graphic>
                  <Mark>
                    <WellKnownName>ttf://DejaVu Sans#U+004B</WellKnownName>
                    <Fill>
                      <CssParameter  name="fill">#000000</CssParameter>
                    </Fill>
                  </Mark>
                  <Size>5.0</Size>
                </Graphic>
              </GraphicFill>
            </Fill>
            <Stroke>
              <CssParameter name="stroke">#AAAAAA</CssParameter>
              <CssParameter name="stroke-width">0.1</CssParameter>
            </Stroke>
            <VendorOption name="graphic-margin">0 0 30 30</VendorOption>
          </PolygonSymbolizer>
          <PolygonSymbolizer>
            <Fill>
              <GraphicFill>
                <Graphic>
                  <Mark>
                    <WellKnownName>ttf://DejaVu Sans#U+004B</WellKnownName>
                    <Fill>
                      <CssParameter  name="fill">#000000</CssParameter>
                    </Fill>
                  </Mark>
                  <Size>5.0</Size>
                </Graphic>
              </GraphicFill>
            </Fill>
            <VendorOption name="graphic-margin">17 17 13 13</VendorOption>
          </PolygonSymbolizer>
        </Rule>

      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>


[image: image.png]

Cheers
Andrea

On Tue, Oct 13, 2020 at 2:15 PM yaras_phoenix via Geoserver-users <
[email protected]> wrote:

> Hello there!
>
> I'm trying to create a ttf-based uniform fill like a checkboard using
> graphic-margin option.
> Here's an example of what I try to achieve.
>
> <http://osgeo-org.1560.x6.nabble.com/file/t385725/checkboard_style_1.png>
>
> My sld:
>
> <sld:PolygonSymbolizer>
>           <sld:Fill>
>               <sld:GraphicFill>
>                 <sld:Graphic>
>                   <sld:Mark>
>                     <sld:WellKnownName>ttf://DejaVu
> Sans#U+004B</sld:WellKnownName>
>                     <sld:Fill>
>                       <sld:CssParameter
> name="fill">#000000</sld:CssParameter>
>                     </sld:Fill>
>                   </sld:Mark>
>                   <sld:Size>5.0</sld:Size>
>                   </sld:Graphic>
>               </sld:GraphicFill>
>             </sld:Fill>
>             <VendorOption name="graphic-margin">30 30 0 0</VendorOption>
>           </sld:PolygonSymbolizer>
>
> Using this I get the following:
>
> <http://osgeo-org.1560.x6.nabble.com/file/t385725/checkboard_style_2.png>
>
> Geoserver docs' example only helped with creating uniform fill by placing
> two symbolizers near each other but when I try different ways of placing
> them myself I never get a uniform fill, it looks close to this:
>
> <http://osgeo-org.1560.x6.nabble.com/file/t385725/checkboard_style_3.png>
>
> Does anyone have a clue on how to control symbolizers with graphic-margin
> resulting in a uniform fill?
>
>
>
> --
> Sent from:
> http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html
>
>
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>


-- 

Regards, Andrea Aime

== GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf
Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa
(LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549
http://www.geo-solutions.it http://twitter.com/geosolutions_it
------------------------------------------------------- *Con riferimento
alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 -
Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto, gli eventuali
allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i
destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per
errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le
sarei comunque grato se potesse darmene notizia. This email is intended
only for the person or entity to which it is addressed and may contain
information that is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European Regulation 2016/679
“GDPR” - copying, dissemination or use of this e-mail or the information
herein by anyone other than the intended recipient is prohibited. If you
have received this email by mistake, please notify us immediately by
telephone or e-mail.*
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to