GeoServer Layers

A layer is a published resource (feature type or coverage).
More information: https://geoserver.org/comm/
Contact Info: geoserver-users@osgeo.org
Version: 1.0.0
BasePath:/geoserver/rest
All rights reserved
http://apache.org/licenses/LICENSE-2.0.html

Access

Methods

[ Jump to Models ]

Table of Contents

Layers

Layers

Up
delete /layers
(layersDelete)
Invalid.

Responses

405

Method not allowed.

Up
get /layers
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

Layers

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 Accept request header; the media type will be conveyed by the Content-Type response header.

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

Layer

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 Accept request header; the media type will be conveyed by the Content-Type response header.

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 Content-Type request header:

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

Layer

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 Accept request header; the media type will be conveyed by the Content-Type response header.

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 Content-Type request header:

Request body

layerBody Layer (required)
Body Parameter — The updated layer definition.

Responses

200

The layer was successfully updated.

Up
post /layers
(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.

Up
put /layers
(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

Layers

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 Accept request header; the media type will be conveyed by the Content-Type response header.

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.

Models

[ Jump to Methods ]

Table of Contents

  1. AuthorityURL -
  2. Identifier -
  3. Layer - layer
  4. LayerReference - layers
  5. Layer_attribution -
  6. Layer_resource -
  7. Layer_styles -
  8. Layers - layers
  9. MetadataEntry - entry
  10. StyleReference - style

AuthorityURL - Up

name (optional)
String Authory name, describing the industry, national or international origanization responsible for data product standard.
href (optional)
String URL to authority organization

Identifier - Up

authority (optional)
String Authority cited, for details see authorityURLs
identifier (optional)
String Work citied, often a data standard provided by

Layer - layer Up

name (optional)
String Name of the layer
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.
Enum:
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)

LayerReference - layers Up

name (optional)
String Name of layer
link (optional)
String URL to layer definition

Layer_attribution - Up

WMS attribution information to be drawn on each map
title (optional)
String Human-readable text describing the data provider
href (optional)
String URL to data provider
logoURL (optional)
String Data provider logo
logoWidth (optional)
Integer Data provider logo width
logoHeight (optional)
Integer Data provider logo height
logoType (optional)
String Format of data provider logo, example "image/png"

Layer_resource - Up

Resource supplying information for layer publication
@class (optional)
String required value featureType
Enum:
featureType
name (optional)
String Name of resource
link (optional)
String URL to the resource definition

Layer_styles - Up

Avaialble styles for layer publication
@class (optional)
String required value linked-hash-set.
Enum:
linked-hash-set
style (optional)

Layers - layers Up

layers (optional)

MetadataEntry - entry Up

@key (optional)
String Key used for metadata entry, additional keys are added over time
Enum:
buffer
$ (optional)
String Text value for provided key Valid text depends on key used. Example {'@key'='buffer','$'='5'}") or 5

StyleReference - style Up

Reference to style definition
name (optional)
String Name of style
link (optional)
String URL to the style definition