I am trying to fill polygons with a random patterns of dots or circles but nothing is working. I followed the example given in the link below but my GeoServer (version 2.20.2) gives me an error when validating the SLD and complains about the location of VendorOptions.

Here is the validation error that I get for the lower example in the link below: Invalid content was found starting with element '{"http://www.opengis.net/sld":VendorOption}'. One of '{"http://www.opengis.net/sld":Stroke}' is expected. If I add in <Stroke/> I get this error: Invalid content was found starting with element 'sld:VendorOption'. No child element is expected at this point. https://docs.geoserver.org/stable/en/user/styling/sld/extensions/randomized.html

Can it be that this is a bug?

Here is one version of what I tried, I don´t get any validation errors with this, but it seems GeoServer is not reading the vendor options.

    <?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0" 
    xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" 
                                    <CssParameter name="fill">#000000</CssParameter>
         <VendorOption name="random">grid</VendorOption>
         <VendorOption name="random-tile-size">100</VendorOption>
         <VendorOption name="random-symbol-count">50</VendorOption>

1 Answer 1


A quick check of the manual shows that the VendorOptions go between the end of the Fill and the PolygonSymbolizer end.

            <sld:CssParameter name="stroke">#0000ff</sld:CssParameter>
            <sld:CssParameter name="stroke-linecap">round</sld:CssParameter>
            <sld:CssParameter name="stroke-width">4</sld:CssParameter>
  <sld:VendorOption name="random-seed">5</sld:VendorOption>
  <sld:VendorOption name="random">grid</sld:VendorOption>
  <sld:VendorOption name="random-tile-size">100</sld:VendorOption>
  <sld:VendorOption name="random-rotation">free</sld:VendorOption>
  <sld:VendorOption name="random-symbol-count">50</sld:VendorOption>
  • Putting 'VendorOptions' between 'Fill' and 'PolygonSymbolizer' gives me a validation error. Can this be a bug?
    – user28386
    Nov 18, 2022 at 12:59
  • No it just means that those vendorOptions are not part of the standard and no one has updated our schema to reflect their existence. Feel free to submit a patch to update it if this is important to you.
    – Ian Turton
    Nov 18, 2022 at 18:17
  • Thank you, I will do that :)
    – user28386
    Nov 21, 2022 at 10:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.