Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using GeoServer 2.1.2, and I've got a layer to which I've applied added additional WMS styles. However, I'm having trouble working out how to query the layer and retrieve the list of available styles (for use in my web app).

Any ideas?

I haven't been able to find anything in the GeoServer docs, and I'm still fairly new to the whole WMS/Geoserver thing so I'm not sure what I should be looking for on Google.

share|improve this question
up vote 3 down vote accepted

You need to make a getCapabilities request (http://localhost:8080/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities) then look at the xml response. For each layer you will see a list of the available styles.

<Layer queryable="1">
<Title>Spearfish bug locations</Title>
Sample data from GRASS, bug sites location, Spearfish, South Dakota, USA
<BoundingBox CRS="CRS:84" minx="-103.86796131703647" miny="44.373938816704396" maxx="-103.63773523234195" maxy="44.43418821380063"/>
<BoundingBox CRS="EPSG:26713" minx="590223.4382724703" miny="4914107.882513998" maxx="608462.4604629107" maxy="4920523.89081033"/>
<Title>Capital cities</Title>
<LegendURL width="20" height="20">
<OnlineResource xmlns:xlink="" xlink:type="simple" xlink:href=""/>
<Title>A small red flag</Title>
<Abstract>A sample of how to use an SVG based symbolizer</Abstract>
<LegendURL width="20" height="20">
<OnlineResource xmlns:xlink="" xlink:type="simple" xlink:href=""/>
<Title>Default Point</Title>
<Abstract>A sample style that draws a point</Abstract>
<LegendURL width="20" height="20">
<OnlineResource xmlns:xlink="" xlink:type="simple" xlink:href=""/>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.