GeoServer Layers
A layer is a published resource (feature type or coverage).
Version: 1.0.0
BasePath:/geoserver/rest
All rights reserved
http://apache.org/licenses/LICENSE-2.0.html
Access
[ Jump to Models ]
Table of Contents
(layersDelete)
Invalid.
Responses
405
Method not allowed.
Get a list of layers (layersGet)
Displays a list of all layers on the server. You must use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers.xml" for XML)
Return type
Example data
Content-Type: application/xml
"\n \n tiger:giant_polygon\n \n \n \n sf:bugsites\n \n \n \n"
Example data
Content-Type: application/json
"{\n \"layers\": {\n \"layer\": [\n {\n \"name\": \"tiger:giant_polygon\",\n \"href\": \"http:\\/\\/localhost:8080\\/geoserver\\/rest\\/layers\\/tiger%3Agiant_polygon.json\"\n },\n {\n \"name\": \"sf:bugsites\",\n \"href\": \"http:\\/\\/localhost:8080\\/geoserver\\/rest\\/layers\\/sf%3Abugsites.json\"\n },\n ]\n }\n}\n"
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
text/html
application/xml
application/json
Responses
200
OK
Layers
Example data
Content-Type: application/xml
tiger:giant_polygon
sf:bugsites
Example data
Content-Type: application/json
{
"layers": {
"layer": [
{
"name": "tiger:giant_polygon",
"href": "http:\/\/localhost:8080\/geoserver\/rest\/layers\/tiger%3Agiant_polygon.json"
},
{
"name": "sf:bugsites",
"href": "http:\/\/localhost:8080\/geoserver\/rest\/layers\/sf%3Abugsites.json"
},
]
}
}
Up
delete /layers/{layerName}
Delete layer (layersNameDelete)
Deletes a layer from the server.
Path parameters
layerName (required)
Path Parameter — The name of the layer to delete.
Query parameters
recurse (optional)
Query Parameter — Recursively removes the layer from all layer groups which reference it. If this results in an empty layer group, also delete the layer group. Allowed values for this parameter are true or false. The default value is false. A request with 'recurse=false' will fail if any layer groups reference the layer. default: false
Responses
200
OK
Up
get /layers/{layerName}
Retrieve a layer (layersNameGet)
Retrieves a single layer definition. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers/{layer}.xml" for XML).
Path parameters
layerName (required)
Path Parameter — The name of the layer to retrieve.
Return type
Example data
Content-Type: application/xml
"\n poi\n /\n VECTOR\n \n poi\n \n \n \n \n \n \n \n poi\n \n \n \n 0\n 0\n \n\n"
Example data
Content-Type: application/json
"{\n\n \"layer\": {\n \"name\": \"poi\",\n \"path\": \"/\",\n \"type\": \"VECTOR\",\n \"defaultStyle\": {\n \"name\": \"poi\",\n \"href\": \"http://localhost:8080/geoserver/rest/styles/poi.json\"\n },\n \"styles\": {\n \"@class\": \"linked-hash-set\",\n \"style\": [\n {\n \"name\": \"burg\",\n \"href\": \"http://localhost:8080/geoserver/rest/styles/burg.json\"\n },\n {\n \"name\": \"point\",\n \"href\": \"http://localhost:8080/geoserver/rest/styles/point.json\"\n }\n ]\n },\n \"resource\": {\n \"@class\": \"featureType\",\n \"name\": \"poi\",\n \"href\": \"http://localhost:8080/geoserver/rest/workspaces/tiger/datastores/nyc/featuretypes/poi.json\"\n },\n \"attribution\": {\n \"logoWidth\": 0,\n \"logoHeight\": 0\n }\n }\n\n}\n"
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
application/xml
application/json
text/html
Responses
200
OK
Layer
Example data
Content-Type: application/xml
poi
/
VECTOR
poi
poi
0
0
Example data
Content-Type: application/json
{
"layer": {
"name": "poi",
"path": "/",
"type": "VECTOR",
"defaultStyle": {
"name": "poi",
"href": "http://localhost:8080/geoserver/rest/styles/poi.json"
},
"styles": {
"@class": "linked-hash-set",
"style": [
{
"name": "burg",
"href": "http://localhost:8080/geoserver/rest/styles/burg.json"
},
{
"name": "point",
"href": "http://localhost:8080/geoserver/rest/styles/point.json"
}
]
},
"resource": {
"@class": "featureType",
"name": "poi",
"href": "http://localhost:8080/geoserver/rest/workspaces/tiger/datastores/nyc/featuretypes/poi.json"
},
"attribution": {
"logoWidth": 0,
"logoHeight": 0
}
}
}
Up
post /layers/{layerName}
(layersNamePost)
Invalid. To create a new layer, instead POST to one of /workspaces/{workspaceName}/coveragestores/{coveragestoreName}/coverages
, /workspaces/{workspaceName}/datastores/{datastoreName}/featuretypes
, /workspaces/{workspaceName}/wmsstores/{wmsstoreName}/wmslayers
, or /workspaces/{workspaceName}/wmtsstores/{wmststoreName}/wmtslayers
Responses
405
Method not allowed.
Up
put /layers/{layerName}
Modify a layer. (layersNamePut)
Modifies an existing layer on the server. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers/{layer}.xml" for XML).
Path parameters
layerName (required)
Path Parameter — The name of the layer to modify.
Consumes
This API call consumes the following media types via the request header:
application/xml
application/json
Request body
layerBody
Layer (required)
Body Parameter — The updated layer definition.
Responses
200
The layer was successfully updated.
Up
delete /workspaces/{workspaceName}/layers/{layerName}
Delete layer (layersNameWorkspaceDelete)
Deletes a layer from the server.
Path parameters
workspaceName (required)
Path Parameter — The name of the workspace the layer is in.
layerName (required)
Path Parameter — The name of the layer to delete.
Query parameters
recurse (optional)
Query Parameter — Recursively removes the layer from all layer groups which reference it. If this results in an empty layer group, also delete the layer group. Allowed values for this parameter are true or false. The default value is false. A request with 'recurse=false' will fail if any layer groups reference the layer. default: false
Responses
200
OK
Up
get /workspaces/{workspaceName}/layers/{layerName}
Retrieve a layer (layersNameWorkspaceGet)
Retrieves a single layer definition. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers/{layer}.xml" for XML).
Path parameters
workspaceName (required)
Path Parameter — The name of the workspace the layer is in.
layerName (required)
Path Parameter — The name of the layer to retrieve.
Return type
Example data
Content-Type: application/xml
"\n poi\n /\n VECTOR\n \n poi\n \n \n \n \n \n \n \n poi\n \n \n \n 0\n 0\n \n\n"
Example data
Content-Type: application/json
"{\n\n \"layer\": {\n \"name\": \"poi\",\n \"path\": \"/\",\n \"type\": \"VECTOR\",\n \"defaultStyle\": {\n \"name\": \"poi\",\n \"href\": \"http://localhost:8080/geoserver/rest/styles/poi.json\"\n },\n \"styles\": {\n \"@class\": \"linked-hash-set\",\n \"style\": [\n {\n \"name\": \"burg\",\n \"href\": \"http://localhost:8080/geoserver/rest/styles/burg.json\"\n },\n {\n \"name\": \"point\",\n \"href\": \"http://localhost:8080/geoserver/rest/styles/point.json\"\n }\n ]\n },\n \"resource\": {\n \"@class\": \"featureType\",\n \"name\": \"poi\",\n \"href\": \"http://localhost:8080/geoserver/rest/workspaces/tiger/datastores/nyc/featuretypes/poi.json\"\n },\n \"attribution\": {\n \"logoWidth\": 0,\n \"logoHeight\": 0\n }\n }\n\n}\n"
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
application/xml
application/json
text/html
Responses
200
OK
Layer
Example data
Content-Type: application/xml
poi
/
VECTOR
poi
poi
0
0
Example data
Content-Type: application/json
{
"layer": {
"name": "poi",
"path": "/",
"type": "VECTOR",
"defaultStyle": {
"name": "poi",
"href": "http://localhost:8080/geoserver/rest/styles/poi.json"
},
"styles": {
"@class": "linked-hash-set",
"style": [
{
"name": "burg",
"href": "http://localhost:8080/geoserver/rest/styles/burg.json"
},
{
"name": "point",
"href": "http://localhost:8080/geoserver/rest/styles/point.json"
}
]
},
"resource": {
"@class": "featureType",
"name": "poi",
"href": "http://localhost:8080/geoserver/rest/workspaces/tiger/datastores/nyc/featuretypes/poi.json"
},
"attribution": {
"logoWidth": 0,
"logoHeight": 0
}
}
}
Up
post /workspaces/{workspaceName}/layers/{layerName}
(layersNameWorkspacePost)
Invalid. To create a new layer, instead POST to one of /workspaces/{workspaceName}/coveragestores/{coveragestoreName}/coverages
, /workspaces/{workspaceName}/datastores/{datastoreName}/featuretypes
, /workspaces/{workspaceName}/wmsstores/{wmsstoreName}/wmslayers
, or /workspaces/{workspaceName}/wmtsstores/{wmststoreName}/wmtslayers
Responses
405
Method not allowed.
Up
put /workspaces/{workspaceName}/layers/{layerName}
Modify a layer. (layersNameWorkspacePut)
Modifies an existing layer on the server. Use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers/{layer}.xml" for XML).
Path parameters
workspaceName (required)
Path Parameter — The name of the workspace the layer is in.
layerName (required)
Path Parameter — The name of the layer to modify.
Consumes
This API call consumes the following media types via the request header:
application/xml
application/json
Request body
layerBody
Layer (required)
Body Parameter — The updated layer definition.
Responses
200
The layer was successfully updated.
(layersPost)
Invalid. To create a new layer, instead POST to one of /workspaces/{workspaceName}/coveragestores/{coveragestoreName}/coverages
, /workspaces/{workspaceName}/datastores/{datastoreName}/featuretypes
, /workspaces/{workspaceName}/wmsstores/{wmsstoreName}/wmslayers
, or /workspaces/{workspaceName}/wmtsstores/{wmststoreName}/wmtslayers
Responses
405
Method not allowed.
(layersPut)
Invalid. To edit a layer, use PUT on an individual layer instead.
Responses
405
Method not allowed.
Up
delete /workspaces/{workspaceName}/layers
(layersWorkspaceDelete)
Invalid.
Responses
405
Method not allowed.
Up
get /workspaces/{workspaceName}/layers
Get a list of layers in a workspace. (layersWorkspaceGet)
Displays a list of all layers in the provided workspace. You must use the "Accept:" header to specify format or append an extension to the endpoint (example "/layers.xml" for XML)
Path parameters
workspaceName (required)
Path Parameter — The name of the workspace to list layers in
Return type
Example data
Content-Type: application/xml
"\n \n bugsites\n \n \n\n"
Example data
Content-Type: application/json
"{\n \"layers\": {\n \"layer\": [\n {\n \"name\": \"bugsites\",\n \"href\": \"http:\\/\\/localhost:8080\\/geoserver\\/rest\\/workspaces\\/sf\\/layers\\/bugsites.json\"\n },\n ]\n }\n}\n"
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
text/html
application/xml
application/json
Responses
200
OK
Layers
Example data
Content-Type: application/xml
bugsites
Example data
Content-Type: application/json
{
"layers": {
"layer": [
{
"name": "bugsites",
"href": "http:\/\/localhost:8080\/geoserver\/rest\/workspaces\/sf\/layers\/bugsites.json"
},
]
}
}
Up
post /workspaces/{workspaceName}/layers
(layersWorkspacePost)
Invalid. To create a new layer, instead POST to one of /workspaces/{workspaceName}/coveragestores/{coveragestoreName}/coverages
, /workspaces/{workspaceName}/datastores/{datastoreName}/featuretypes
, /workspaces/{workspaceName}/wmsstores/{wmsstoreName}/wmslayers
, or /workspaces/{workspaceName}/wmtsstores/{wmststoreName}/wmtslayers
Responses
405
Method not allowed.
Up
put /workspaces/{workspaceName}/layers
(layersWorkspacePut)
Invalid. To edit a layer, use PUT on an individual layer instead.
Responses
405
Method not allowed.
[ Jump to Methods ]
Table of Contents
AuthorityURL
-
Identifier
-
Layer
- layer
LayerReference
- layers
Layer_attribution
-
Layer_resource
-
Layer_styles
-
Layers
- layers
MetadataEntry
- entry
StyleReference
- style
name (optional)
String Authory name, describing the industry, national or international origanization responsible for data product standard.
href (optional)
String URL to authority organization
authority (optional)
String Authority cited, for details see authorityURLs
identifier (optional)
String Work citied, often a data standard provided by
name (optional)
path (optional)
String Location of the layer in the WMS capabilities layer tree
type (optional)
String Type of published layer. Can be VECTOR, RASTER, REMOTE, WMS or GROUP. Must be consistent with resource definition.
VECTOR
RASTER
REMOTE
WMS
GROUP
defaultStyle (optional)
styles (optional)
resource (optional)
opaque (optional)
Boolean Controls layer transparency (whether the layer is opaque or transparent).
metadata (optional)
attribution (optional)
authorityURLs (optional)
identifiers (optional)
name (optional)
link (optional)
String URL to layer definition
WMS attribution information to be drawn on each map
title (optional)
String Human-readable text describing the data provider
href (optional)
logoURL (optional)
logoWidth (optional)
logoHeight (optional)
logoType (optional)
String Format of data provider logo, example "image/png"
Resource supplying information for layer publication
@class (optional)
String required value featureType
featureType
name (optional)
link (optional)
String URL to the resource definition
Avaialble styles for layer publication
@class (optional)
String required value linked-hash-set.
linked-hash-set
style (optional)
@key (optional)
String Key used for metadata entry, additional keys are added over time
buffer
$ (optional)
String Text value for provided key Valid text depends on key used. Example {'@key'='buffer','$'='5'}") or
5
Reference to style definition
name (optional)
link (optional)
String URL to the style definition