How can I get a list of all layers deployed in Geoserver separated by Vector/Raster?
Similar to how Geoserver itself does this when one uses the WPS Request Builder (it then shows a complete list of all available Vector or Raster layers – depending on the service one wants to use).
I can only get a list of all layers when I know the workspace (the name of the WMS) they are running in by calling the capabilities of the WMS. I want to be able to recieve the workspave and the name of the layers.
Edit: I just found out one can use the rest API. Thats a nice thing. I can get all layer names by calling http://localhost:8080/geoserver/rest/layers.json but how can I than seperate those by Vector/Raster?
Best Answer
So this is my final code using ajax and the REST api. Works good so far.
rasList
andvecList
are defined in html of course. This is only the js file to be included in the html.