Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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: http://sdi.geoportal.gov.pl/wms_prg/wmservice.aspx 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 http://wms.zimmi.cz/? :-) –  zimmi Apr 8 at 19:06
add comment

2 Answers 2

up vote 4 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:

http://sdi.geoportal.gov.pl/wms_prg/wmservice.aspx?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities

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

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("http://sdi.geoportal.gov.pl/wms_prg/wmservice.aspx")
>>> wms.identification.title
u'Us\u0142uga przegl\u0105dania (WMS) Pa\u0144stwowego Rejestru Granic dla obsza
ru Polski.'
>>> wms.identification.type
'OGC:WMS'
>>> wms.identification.version
'1.1.1'
>>> list(wms.contents)
['Nazwa_powiatu', 'Nazwa_gminy', 'Nazwa_wojewodztwa', 'Powiaty', 'Wojewodztwa',
'Gminy']

Consult the complete documentation for more.

share|improve this answer
add comment

Your Answer

 
discard

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.