To remove a style, click the check box next to the style. Multiple styles can be selected at the same time. Click the Remove selected style(s) link at the top of the page. You will be asked for confirmation:

The Data tab includes basic style information, the ability to generate a style, and legend details.

The Style Data area has mandatory basic style information:

Option

Description

Name

Name of the style

Workspace

Workspace in which the style is contained. Styles can be inside workspaces, but can also be “global” (no workspace).

Format

Format of the style. Options are SLD, CSS, and YSLD, MBStyle depending on availability.

Style Data area

The Style Content area allows you to generate a style, copy an existing style, or upload an existing style:

Option

Description

Generate a default style

Selects a generic style based on geometry. Options are Point, Line, Polygon, Raster, and Generic. Click Generate when selected.

Copy from existing style

Selects an existing style in GeoServer and copy its contents to this style. Any style in GeoServer is available as an option. Not all styles will work with all layers. Click Copy when selected.

Upload a style file

Selects a plain text file on your local system to add as the style. Click Upload when selected.

Style Content area

The Legend area allows you to add, modify, or delete a custom style, and preview the legend for the style. By default GeoServer will generate a legend based on your style file, but this can be customized here:

Option

Description

Add legend

Allows you to use a custom legend

Online Resource

Path to the custom legend graphic to use. Can be a URL or a local path (relative to the style file path). See Structure of the data directory for a description of the styles directory.

Auto-detect image size and type

Populates the Width, Height, and Format options for the Online Resource

Width

Width of the custom legend graphic

Height

Height of the custom legend graphic

Format

Mime type of the custom legend graphic

Discard legend

Will remove the settings for the custom legend graphic and will instead use the default generated legend.

The Publishing tab displays a list of all layers on the server, with the purpose of showing which layers are associated with the current style. Layers can set a single default style and have any number of additional styles. If this style is set to be either of these options for a layer, it will be shown with a check box in the table.

Option

Description

Workspace

Workspace of the layer

Layer

Name of the layer

Default

Shows whether the style being edited is the default for a given layer

Associated

Shows whether the style being edited is an additional style for a given layer

It is very common to have to iterate your styles and test how the visualization changes over time. The Layer Preview tab allows you to make changes to the style and see them without having to navigate away from the page.

The Layer Preview tab shows a single image. GeoServer tries to identify which layer should be shown (for example, a layer for which this style is the default), but if the layer being previewed is not the desired one, click the layer name above the preview box and select a layer.

Most styles utilize the specific values of certain attributes of the associated layer in order to create more detailed and useful styles. (For example: styling all large cities different from small cities based on a particular attribute.)

The Layer Attributes tab will display a list of attributes for the given associated layer. GeoServer tries to identify which layer should be shown (for example, a layer for which this style is the default), but if the layer being previewed is not the desired one, click the layer name above the table and select a layer.

Option

Description

name

Name of the attribute

type

Type of the attribute. Can be a numeric (such as “Long”), a string (“String”), or a geometry (such as “Point”).

sample

Sample value of the attribute taken from the data

min

Minimum value of the attribute in the data set, if applicable

max

Minimum value of the attribute in the data set, if applicable

computeStats

Click Compute to calculate the min and max values for that attribute, if applicable