RESTAPI允许您在GeoServer中列出、创建、上载、更新和删除层。

备注

阅读 API reference for /layers .

列出所有层

以JSON格式列出服务器上的所有层:

请求

卷曲

curl -u admin:geoserver -XGET http://localhost:8080/geoserver/rest/layers.json

响应

{
  "layers": {
     "layer": [
         {
             "name": "giant_polygon",
             "href": "http://localhost:8080/geoserver/rest/layers/giant_polygon.json"
         },
         {
             "name": "poi",
             "href": "http://localhost:8080/geoserver/rest/layers/poi.json"
         },
         ...
      ]
   }
}

List all layers on the server, in XML format:

请求

卷曲

curl -u admin:geoserver -XGET http://localhost:8080/geoserver/rest/layers.xml

响应

<layers>
  <layer>
    <name>giant_polygon</name>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/layers/giant_polygon.xml" type="application/xml"/>
  </layer>
  <layer>
    <name>poi</name>
    <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://localhost:8080/geoserver/rest/layers/poi.xml" type="application/xml"/>
  </layer>
  ...
</layers>
Previous: 层组
Next: 安全性