Skip to end of metadata
Go to start of metadata

Starting with GeoServer 2.3.4 it is possible to add white space around symbols used inside graphic fills, effectively allowing to control the density of the symbols in the map, or even to combine multiple graphics into one fill.

See http://docs.geoserver.org/stable/en/user/styling/sld-extensions/margins.html

A simple way to do this is to add:

<VendorOption
name="graphic-margin">10</VendorOption>

(NOTE: In my testing .png graphics work better, when using .gif graphics the added space was black, not white.)

Compare fill graphics with no space compared to space:

Sample SLD no space:   style name: GISDATA.IWPA_POLY::Fill_Graphics_No_Space_Around

Request:

 http://giswebservices.massgis.state.ma.us/geoserver/wms?LAYERS=massgis:GISDATA.IWPA_POLY&TRANSPARENT=TRUE&STYLES=GISDATA.IWPA_POLY::Fill_Graphics_No_Space_Around&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&SRS=EPSG:26986&BBOX=325832,853279,326683,853848.%20&WIDTH=1038&HEIGHT=693

Response:

 

 

Sample SLD with space (10):   style name: GISDATA.IWPA_POLY::Fill_Graphics_Space_Around_10

 

 

 

Request:

http://giswebservices.massgis.state.ma.us/geoserver/wms?LAYERS=massgis:GISDATA.IWPA_POLY&TRANSPARENT=TRUE&STYLES=GISDATA.IWPA_POLY::Fill_Graphics_Space_Around_10&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&SRS=EPSG:26986&BBOX=325832,853279,326683,853848.%20&WIDTH=1038&HEIGHT=693

Response:

 

 

Sample SLD with space (20):   style name: GISDATA.IWPA_POLY::Fill_Graphics_Space_Around_20


 

Request:

http://giswebservices.massgis.state.ma.us/geoserver/wms?LAYERS=massgis:GISDATA.IWPA_POLY&TRANSPARENT=TRUE&STYLES=GISDATA.IWPA_POLY::Fill_Graphics_Space_Around_20&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&SRS=EPSG:26986&BBOX=325832,853279,326683,853848.%20&WIDTH=1038&HEIGHT=693

Response:

 

Using more than 1 graphic in a fill:

Sample SLD with space:   style name: GISDATA.IWPA_POLY::Fill_Graphics_Space_Around_Composite

 

 

Request:

http://giswebservices.massgis.state.ma.us/geoserver/wms?LAYERS=massgis:GISDATA.IWPA_POLY&TRANSPARENT=TRUE&STYLES=GISDATA.IWPA_POLY::Fill_Graphics_Space_Around_Composite&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&SRS=EPSG:26986&BBOX=325832,853279,326683,853848.%20&WIDTH=1038&HEIGHT=693

 Response: