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've been looking for information on how to get layers names from certain WMS servers, but I didn't find any.

E.g. I have this server: and I want to know what layers can I get from it. Is there any chance to know their names?

Thanks in advance!

share|improve this question
How are you planning to access them? With ArcMap or any other program? Or do you need to create your own program? – kor_ Nov 12 '12 at 11:10
Google Maps at my webpage and to take layers from WMS – GoMati Nov 12 '12 at 14:57
May I humbly offer my :-) – Michal Zimmermann Apr 8 '14 at 19:06
up vote 7 down vote accepted

You should be able to use the GetCapabilities method of the WMS server to list all the data and operations available to you. Something like the following (though I've not got access to test what this returns) should hopefully be what you're looking for:

share|improve this answer
Flawless answer, thank you! :) – GoMati Nov 12 '12 at 11:08

One could use OWSLib, an excellent OGC Web Services utility library in python.

Install with pip (or download sources from repository):

pip install OWSLib

Retrieve some info from the the WMS server:

>>> from owslib.wms import WebMapService
>>> wms = WebMapService("")
>>> wms.identification.title
u'Us\u0142uga przegl\u0105dania (WMS) Pa\u0144stwowego Rejestru Granic dla obsza
ru Polski.'
>>> wms.identification.type
>>> wms.identification.version
>>> list(wms.contents)
['Nazwa_powiatu', 'Nazwa_gminy', 'Nazwa_wojewodztwa', 'Powiaty', 'Wojewodztwa',

Consult the complete documentation for more.

share|improve this answer

Not really sure from your question how exaclty you wish to do this (or if you have a preference). However; to do this in a web app with javascript:

        var formatter = new OpenLayers.Format.WMSCapabilities();
        var endpoint = "path/to/wms/endpoint";
        var layers = [];

        // async call to geoserver (I'm using angular)
        $http.get(endpoint + 'request=GetCapabilities').

        success(function(data, status, headers, config) {

            // use the tool to parse the data
            var response = (;

            // this object contains all the GetCapabilities data
            var capability = response.capability;

            // I want a list of names to use in my queries
            for(var i = 0; i < capability.layers.length; i ++){

        error(function(data, status, headers, config) {
            alert("terrible error logging..");
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.