delete /rest/layers/{layer}/stylesdelete /styles/{style}delete /stylesdelete /rest/workspaces/{workspace}/styles/{style}delete /workspaces/{workspace}/stylesget /rest/layers/{layer}/stylesget /styles/{style}get /stylesget /rest/workspaces/{workspace}/styles/{style}get /workspaces/{workspace}/stylespost /rest/layers/{layer}/stylespost /styles/{style}post /stylespost /rest/workspaces/{workspace}/styles/{style}post /workspaces/{workspace}/stylesput /rest/layers/{layer}/stylesput /styles/{style}put /stylesput /rest/workspaces/{workspace}/styles/{style}put /workspaces/{workspace}/stylesdelete /rest/layers/{layer}/stylesdelete /styles/{style}delete /stylesdelete /rest/workspaces/{workspace}/styles/{style}delete /workspaces/{workspace}/stylesget /rest/layers/{layer}/styles"\n \n \n \n"
"{\n \"styles\": {\n \"style\": [\n {\n \"name\": \"pophatch\",\n \"href\": \"http://localhost:8080/geoserver/rest/layers/topp:states/styles/pophatch.json\"\n },\n {\n \"name\": \"polygon\",\n \"href\": \"http://localhost:8080/geoserver/rest/layers/topp:states/styles/polygon.json\"\n }\n ]\n }\n}\n"
application/xmlapplication/jsontext/html
{
"styles": {
"style": [
{
"name": "pophatch",
"href": "http://localhost:8080/geoserver/rest/layers/topp:states/styles/pophatch.json"
},
{
"name": "polygon",
"href": "http://localhost:8080/geoserver/rest/layers/topp:states/styles/polygon.json"
}
]
}
}
get /styles/{style}Retrieves a single style. Used to both request the style info and the style definition body, depending on the media type requested. The media type can be specified either by using the "Accept:" header or by appending an extension to the endpoint. For example, a style info can be requested in XML format using "/styles/{style}.xml" or "Accept: application/xml". (Also available: "{style}.json", "Accept: application/json" "{style}.html", and "Accept: text/html").
The style definition body can be requested by either appending the file extension of the style file (e.g., "{style}.sld" or "{style}.css") or by specifying the correct media type for the style definition in the "Accept" header. Be aware that by default, if extension is specified, it will override media type. For example if you use SLD 1.1.0 style and specify .sld extension (which provides SLD 1.0.0 result), but use application/vnd.ogc.se+xml media type (which provides SLD 1.1.0 result), response still will be presented in sld version 1.0.0 Below are common style formats and the corresponding media types that can be used in the Accept header to request the style definition body.
"\n"
"{\"style\":\n {\"name\":\"rain\", \"format\":\"sld\",\n \"languageVersion\": {\"version\":\"1.0.0\"},\n \"filename\":\"rain.sld\"}\n}\n"
"\n\n \n rain \n \n rain \n Rain distribution \n \n \n \n 1.0 \n \n \n \n \n \n \n \n \n \n \n \n \n"
application/xmlapplication/jsonapplication/vnd.ogc.sld+xmlapplication/vnd.ogc.se+xmltext/html
{"style":
{"name":"rain", "format":"sld",
"languageVersion": {"version":"1.0.0"},
"filename":"rain.sld"}
}
rain
rain
Rain distribution
1.0
get /styles"\n \n \n \n"
"{\"styles\":\n {\"style\":\n [ {\"href\":\"http://localhost:8080/geoserver/rest/styles/burg.json\", \"name\":\"burg\"},\n {\"href\":\"http://localhost:8080/geoserver/rest/styles/capitals.json\", \"name\":\"capitals\"}]}}\n"
application/xmlapplication/jsontext/html
{"styles":
{"style":
[ {"href":"http://localhost:8080/geoserver/rest/styles/burg.json", "name":"burg"},
{"href":"http://localhost:8080/geoserver/rest/styles/capitals.json", "name":"capitals"}]}}
get /rest/workspaces/{workspace}/styles/{style}Retrieves a single style. Used to both request the style info and the style definition body, depending on the media type requested. The media type can be specified either by using the "Accept:" header or by appending an extension to the endpoint. For example, a style info can be requested in XML format using "/styles/{style}.xml" or "Accept: application/xml". (Also available: "{style}.json", "Accept: application/json" "{style}.html", and "Accept: text/html").
The style definition body can be requested by either appending the file extension of the style file (e.g., "{style}.sld" or "{style}.css") or by specifying the correct media type for the style definition in the "Accept" header. Be aware that by default, if extension is specified, it will override media type. For example if you use SLD 1.1.0 style and specify .sld extension (which provides SLD 1.0.0 result), but use application/vnd.ogc.se+xml media type (which provides SLD 1.1.0 result), response still will be presented in sld version 1.0.0 Below are common style formats and the corresponding media types that can be used in the Accept header to request the style definition body.
"\n"
"{\"style\": \n {\"name\":\"burg\", \n \"workspace\": {\"name\":\"sf\"},\n \"format\":\"sld\",\n \"languageVersion\":{\"version\":\"1.0.0\"},\n \"filename\":\"burg.sld\"}}\n"
"\n \n redflag \n \n burg \n A small red flag \n A sample of how to use an SVG based symbolizer \n\n \n \n Red flag \n \n \n \n \n image/svg+xml \n \n \n 20 \n \n
\n \n \n\n \n \n \n \n"
application/xmlapplication/jsonapplication/vnd.ogc.sld+xmlapplication/vnd.ogc.se+xmltext/html
{"style":
{"name":"burg",
"workspace": {"name":"sf"},
"format":"sld",
"languageVersion":{"version":"1.0.0"},
"filename":"burg.sld"}}
redflag
burg
A small red flag
A sample of how to use an SVG based symbolizer
Red flag
image/svg+xml
20
get /workspaces/{workspace}/styles"\n \n \n \n"
"{\n \"styles\": {\n \"style\": [\n {\n \"name\": \"burg\",\n \"href\": \"http://localhost:8080/geoserver/rest/workspaces/sf/styles/burg.json\"\n },\n {\n \"name\": \"dem\",\n \"href\": \"http://localhost:8080/geoserver/rest/workspaces/sf/styles/dem.json\"\n }\n ]\n }\n}\n"
application/xmlapplication/jsontext/html
{
"styles": {
"style": [
{
"name": "burg",
"href": "http://localhost:8080/geoserver/rest/workspaces/sf/styles/burg.json"
},
{
"name": "dem",
"href": "http://localhost:8080/geoserver/rest/workspaces/sf/styles/dem.json"
}
]
}
}
post /rest/layers/{layer}/stylesapplication/xmlapplication/jsonpost /styles/{style}post /stylesAdds a new style entry to the server.
Using POST with the application/xml or application/json content only adds the style info to the catalog and does not upload style content. PUT to /styles/{style} to upload the style in this case.
Use POST with a style file (application/vnd.ogc.sld+xml or application/vnd.ogc.se+xml for SLD; additional style types are added by extensions) to generate a style info and upload the style all at once. Then separately PUT the style info at /styles/{style} to make any desired changes to the generated catalog entry.
You can also use POST with a ZIP file to upload a SLD 1.0 (application/vnd.ogc.sld+xml) file and any associated icon files, and then separately PUT the style info at /styles/{style}. POST with a ZIP file does not support any other style types.
application/xmlapplication/jsonapplication/ziptext/xmltext/jsonapplication/vnd.ogc.sld+xmlapplication/vnd.ogc.se+xmlapplication/vnd.geoserver.geocss+cssapplication/vnd.geoserver.ysld+yamlapplication/vnd.geoserver.mbstyle+jsonThe style body of a request JSON or XML style uploads follow the schema. For example:
application/xml:
<style>
<name>roads_style</name>
<filename>roads.sld</filename>
</style>
application/json:
{
"style": {
"name": "roads_style",
"filename": "roads.sld"
}
}
Otherwise, the style body is an actual style:
application/zip:
<ZIP file containing SLD and icons>
application/vnd.ogc.sld+xml:
<?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"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- a Named Layer is the basic building block of an SLD document -->
<NamedLayer>
<Name>default_line</Name>
<UserStyle>
<!-- Styles can have names, titles and abstracts -->
<Title>Default Line</Title>
<Abstract>A sample style that draws a line</Abstract>
<!-- FeatureTypeStyles describe how to render different features -->
<!-- A FeatureTypeStyle for rendering lines -->
<FeatureTypeStyle>
<Rule>
<Name>rule1</Name>
<Title>Blue Line</Title>
<Abstract>A solid blue line with a 1 pixel width</Abstract>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#0000FF</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
text/plainpost /rest/workspaces/{workspace}/styles/{style}post /workspaces/{workspace}/stylesAdds a new style entry to the server.
Using POST with the application/xml or application/json content only adds the style info to the catalog and does not upload style content. PUT to /workspaces/{workspace}/styles/{style} to upload the style in this case.
Use POST with a style file (application/vnd.ogc.sld+xml or application/vnd.ogc.sld+xml for SLD; additional style types are added by extensions) to generate a style info and upload the style all at once. Then separately PUT the style info at /workspaces/{workspace}/styles/{style} to make any desired changes to the generated catalog entry.
You can also use POST with a ZIP file to upload a SLD 1.0 (application/vnd.ogc.sld+xml) file and any associated icon files, and then separately PUT the style info at /workspaces/{workspace}/styles/{style}. POST with a ZIP file does not support any other style types.
application/xmlapplication/jsonapplication/ziptext/htmltext/jsonapplication/vnd.ogc.sld+xmlapplication/vnd.ogc.se+xmlapplication/vnd.geoserver.geocss+cssapplication/vnd.geoserver.ysld+yamlapplication/vnd.geoserver.mbstyle+jsonThe style body of a request JSON or XML style uploads follow the schema. For example:
application/xml:
<style>
<name>roads_style</name>
<filename>roads.sld</filename>
</style>
application/json:
{
"style": {
"name": "roads_style",
"filename": "roads.sld"
}
}
Otherwise, the style body is an actual style:
application/zip:
<ZIP file containing SLD and icons>
application/vnd.ogc.sld+xml:
<?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"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- a Named Layer is the basic building block of an SLD document -->
<NamedLayer>
<Name>default_line</Name>
<UserStyle>
<!-- Styles can have names, titles and abstracts -->
<Title>Default Line</Title>
<Abstract>A sample style that draws a line</Abstract>
<!-- FeatureTypeStyles describe how to render different features -->
<!-- A FeatureTypeStyle for rendering lines -->
<FeatureTypeStyle>
<Rule>
<Name>rule1</Name>
<Title>Blue Line</Title>
<Abstract>A solid blue line with a 1 pixel width</Abstract>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#0000FF</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
text/plainput /rest/layers/{layer}/stylesput /styles/{style}Modifies a single style.
Use the "Accept:" header to specify format or append an extension to the endpoint (example /styles/{style}.xml for XML).
Using PUT with the application/xml or application/json content modifies the style info in the catalog and does not alter the style content.
Using PUT with any other format will modify the content of the style. You can also use PUT with a ZIP file to upload a SLD 1.0 (application/vnd.ogc.sld+xml) file and any associated icon files
application/jsonapplication/ziptext/xmlapplication/xmltext/jsonapplication/vnd.ogc.sld+xmlapplication/vnd.ogc.se+xmlapplication/vnd.geoserver.geocss+cssapplication/vnd.geoserver.mbstyle+jsonapplication/vnd.geoserver.ysld+yamlThe style body of a request. For a PUT, only values which should be changed need to be included. JSON or XML style uploads follow the schema, and alter the style configuration. For example:
application/xml:
<style>
<name>roads_style</name>
<languageVersion>
<version>1.0.0</version>
</languageVersion>
<filename>roads.sld</filename>
<legend>
<width>32</width>
<height>32</height>
<format>image/png; charset=UTF-8</format>
<onlineResource>legend.png</onlineResource>
</legend>
</style>
application/json:
{
"style": {
"name": "roads_style",
"languageVersion": {
"version": "1.0.0"
},
"filename": "roads.sld",
"legend": {
"format": "image/png; charset=UTF-8",
"height": 32,
"width": 32,
"onlineResource": "grass_fill.png"
}
}
}
Otherwise, the style body is an actual style:
application/zip:
<ZIP file containing SLD and icons>
application/vnd.ogc.sld+xml:
<?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"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- a Named Layer is the basic building block of an SLD document -->
<NamedLayer>
<Name>default_line</Name>
<UserStyle>
<!-- Styles can have names, titles and abstracts -->
<Title>Default Line</Title>
<Abstract>A sample style that draws a line</Abstract>
<!-- FeatureTypeStyles describe how to render different features -->
<!-- A FeatureTypeStyle for rendering lines -->
<FeatureTypeStyle>
<Rule>
<Name>rule1</Name>
<Title>Blue Line</Title>
<Abstract>A solid blue line with a 1 pixel width</Abstract>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#0000FF</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
put /stylesput /rest/workspaces/{workspace}/styles/{style}Modifies a single style in a given workspace.
Use the "Accept:" header to specify format or append an extension to the endpoint (example /workspaces/{workspace}/styles/{style}.xml for XML).
Using PUT with the application/xml or application/json content modifies the style info in the catalog and does not alter the style content.
Using PUT with any other format will modify the content of the style. You can also use PUT with a ZIP file to upload a SLD 1.0 (application/vnd.ogc.sld+xml) file and any associated icon files
application/jsonapplication/ziptext/xmlapplication/xmltext/jsonapplication/vnd.ogc.sld+xmlapplication/vnd.ogc.se+xmlapplication/vnd.geoserver.geocss+cssapplication/vnd.geoserver.ysld+yamlapplication/vnd.geoserver.mbstyle+jsonThe style body of a request. For a PUT, only values which should be changed need to be included. JSON or XML style uploads follow the schema, and alter the style configuration. For example:
application/xml:
<style>
<name>roads_style</name>
<languageVersion>
<version>1.0.0</version>
</languageVersion>
<filename>roads.sld</filename>
<legend>
<width>32</width>
<height>32</height>
<format>image/png; charset=UTF-8</format>
<onlineResource>legend.png</onlineResource>
</legend>
</style>
application/json:
{
"style": {
"name": "roads_style",
"languageVersion": {
"version": "1.0.0"
},
"filename": "roads.sld",
"legend": {
"format": "image/png; charset=UTF-8",
"height": 32,
"width": 32,
"onlineResource": "grass_fill.png"
}
}
}
Otherwise, the style body is an actual style:
application/zip:
<ZIP file containing SLD and icons>
application/vnd.ogc.sld+xml:
<?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"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- a Named Layer is the basic building block of an SLD document -->
<NamedLayer>
<Name>default_line</Name>
<UserStyle>
<!-- Styles can have names, titles and abstracts -->
<Title>Default Line</Title>
<Abstract>A sample style that draws a line</Abstract>
<!-- FeatureTypeStyles describe how to render different features -->
<!-- A FeatureTypeStyle for rendering lines -->
<FeatureTypeStyle>
<Rule>
<Name>rule1</Name>
<Title>Blue Line</Title>
<Abstract>A solid blue line with a 1 pixel width</Abstract>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#0000FF</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
put /workspaces/{workspace}/stylesStyle - styleStyleInfoPost - styleStyleLayer - styleStyleLayer_layer - StyleList - stylesStyleListItem - styleStyleWorkspace - styleStyleWorkspace_workspace - Style_languageVersion - Style - style UpStyleLayer - style UpStyleLayer_layer - UpStyleWorkspace - style UpStyleWorkspace_workspace - UpStyle_languageVersion - Up