Commit 7406132b authored by Kris Vanneste's avatar Kris Vanneste
Browse files

Added 'wms_version' property to WMSData.

Added print_info method to WMSData.

git-svn-id: https://svn.seismo.oma.be/svn/seismo/mapping/layeredbasemap/trunk@7658 40b490c5-b4d9-47cb-8714-9bef99b524d5
parent 5370854f
......@@ -41,7 +41,28 @@ class WMSData(BasemapData):
:param url:
str, WMS server URL
"""
def __init__(self, url, layers, verbose=False):
def __init__(self, url, layers, wms_version=None, verbose=False):
self.url = url
self.layers = layers
self.wms_version = wms_version
self.verbose = verbose
def print_info(self):
"""
Print some useful information to test WMS service
"""
from owslib.wms import WebMapService
wms = WebMapService(self.url)
print('id: %s, version: %s' %
(wms.identification.type,wms.identification.version))
print('title: %s, abstract: %s' %
(wms.identification.title,wms.identification.abstract))
print('available layers:')
print(list(wms.contents))
if self.layers:
layer = self.layers[0]
else:
layer = list(wms.contents)[0]
print('projection options:')
print(wms[layer].crsOptions)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment